From dec9742df461f02561c619e24a00fd32707650e4 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Sep 2015 07:02:10 -0600 Subject: [PATCH 01/33] SAMV7 Cut'n'paste Errors; CONFIG_SAMV7_XDMAC, not CONFIG_SAMV7_DMAC0/1 --- arch/arm/src/samv7/sam_spi.c | 4 ++-- arch/arm/src/samv7/sam_ssc.c | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/arm/src/samv7/sam_spi.c b/arch/arm/src/samv7/sam_spi.c index ef1e53fbca..ec2b53c345 100644 --- a/arch/arm/src/samv7/sam_spi.c +++ b/arch/arm/src/samv7/sam_spi.c @@ -87,13 +87,13 @@ #ifdef CONFIG_SAMV7_SPI_DMA -# if defined(CONFIG_SAMV7_SPI0_MASTER) && defined(CONFIG_SAMV7_DMAC0) +# if defined(CONFIG_SAMV7_SPI0_MASTER) && defined(CONFIG_SAMV7_XDMAC) # define SAMV7_SPI0_DMA true # else # define SAMV7_SPI0_DMA false # endif -# if defined(CONFIG_SAMV7_SPI1_MASTER) && defined(CONFIG_SAMV7_DMAC1) +# if defined(CONFIG_SAMV7_SPI1_MASTER) && defined(CONFIG_SAMV7_XDMAC) # define SAMV7_SPI1_DMA true # else # define SAMV7_SPI1_DMA false diff --git a/arch/arm/src/samv7/sam_ssc.c b/arch/arm/src/samv7/sam_ssc.c index 17f42e578f..f3381b007a 100644 --- a/arch/arm/src/samv7/sam_ssc.c +++ b/arch/arm/src/samv7/sam_ssc.c @@ -2982,17 +2982,14 @@ static int ssc_dma_allocate(struct sam_ssc_s *priv) return ret; } - /* Allocate DMA channels. These allocations exploit that fact that - * SSC0 is managed by DMAC0 and SSC1 is managed by DMAC1. Hence, - * the SSC number (sscno) is the same as the DMAC number. - */ + /* Allocate DMA channels. */ #ifdef SSC_HAVE_RX if (priv->rxenab) { /* Allocate an RX DMA channel */ - priv->rx.dma = sam_dmachannel(priv->sscno, dmaflags); + priv->rx.dma = sam_dmachannel(0, dmaflags); if (!priv->rx.dma) { i2sdbg("ERROR: Failed to allocate the RX DMA channel\n"); @@ -3015,7 +3012,7 @@ static int ssc_dma_allocate(struct sam_ssc_s *priv) { /* Allocate a TX DMA channel */ - priv->tx.dma = sam_dmachannel(priv->sscno, dmaflags); + priv->tx.dma = sam_dmachannel(0, dmaflags); if (!priv->tx.dma) { i2sdbg("ERROR: Failed to allocate the TX DMA channel\n"); From 7d72d1defca3a05beb1c306de39ed60e97ff259b Mon Sep 17 00:00:00 2001 From: Lederhilger Martin Date: Wed, 30 Sep 2015 07:20:19 -0600 Subject: [PATCH 02/33] STM32 ADC: Fix some cut'n'paste typos in ADC header file --- arch/arm/src/stm32/stm32_adc.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/src/stm32/stm32_adc.h b/arch/arm/src/stm32/stm32_adc.h index 6e6caa40b7..5a4534b275 100644 --- a/arch/arm/src/stm32/stm32_adc.h +++ b/arch/arm/src/stm32/stm32_adc.h @@ -326,9 +326,9 @@ # define ADC2_TIMER_BASE STM32_TIM5_BASE # define ADC2_TIMER_PCLK_FREQUENCY STM32_APB1_TIM5_CLKIN #elif defined(CONFIG_STM32_TIM8_ADC2) -# define ADC1_HAVE_TIMER 1 -# define ADC1_TIMER_BASE STM32_TIM8_BASE -# define ADC1_TIMER_PCLK_FREQUENCY STM32_APB2_TIM8_CLKIN +# define ADC2_HAVE_TIMER 1 +# define ADC2_TIMER_BASE STM32_TIM8_BASE +# define ADC2_TIMER_PCLK_FREQUENCY STM32_APB2_TIM8_CLKIN #else # undef ADC2_HAVE_TIMER #endif @@ -364,9 +364,9 @@ # define ADC3_TIMER_BASE STM32_TIM5_BASE # define ADC3_TIMER_PCLK_FREQUENCY STM32_APB1_TIM5_CLKIN #elif defined(CONFIG_STM32_TIM8_ADC3) -# define ADC1_HAVE_TIMER 1 -# define ADC1_TIMER_BASE STM32_TIM8_BASE -# define ADC1_TIMER_PCLK_FREQUENCY STM32_APB2_TIM8_CLKIN +# define ADC3_HAVE_TIMER 1 +# define ADC3_TIMER_BASE STM32_TIM8_BASE +# define ADC3_TIMER_PCLK_FREQUENCY STM32_APB2_TIM8_CLKIN #else # undef ADC3_HAVE_TIMER #endif From 08baf2fcc35d79f0ff4232af636ce595255c8a58 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Sep 2015 11:00:33 -0600 Subject: [PATCH 03/33] ARMv7-M: Fix logic that determines if there is a pending signal action before scheduling the next signal action. Both the test and the scheduling action need to be atomic --- arch/arm/src/armv7-m/up_schedulesigaction.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/arch/arm/src/armv7-m/up_schedulesigaction.c b/arch/arm/src/armv7-m/up_schedulesigaction.c index d61420a73d..1b5cc41db7 100644 --- a/arch/arm/src/armv7-m/up_schedulesigaction.c +++ b/arch/arm/src/armv7-m/up_schedulesigaction.c @@ -104,18 +104,19 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + DEBUGASSERT(tcb != NULL && sigdeliver != NULL); - if (!tcb->xcp.sigdeliver) + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + + if (tcb->xcp.sigdeliver == NULL) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is being delivered * to the currently executing task. */ @@ -222,9 +223,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_LR] = EXC_RETURN_PRIVTHR; #endif } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ From 26347891ac56cf90630f48ce83ab991fbff67ec3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Sep 2015 11:21:04 -0600 Subject: [PATCH 04/33] Apply same fix for ARMv7-M to other architectures --- arch/arm/src/arm/up_schedulesigaction.c | 20 +++++----- arch/arm/src/armv6-m/up_schedulesigaction.c | 20 +++++----- arch/arm/src/armv7-a/arm_schedulesigaction.c | 20 +++++----- arch/avr/src/avr/up_schedulesigaction.c | 20 +++++----- arch/avr/src/avr32/up_schedulesigaction.c | 20 +++++----- arch/mips/src/mips32/up_schedulesigaction.c | 21 +++++----- arch/sh/src/m16c/m16c_schedulesigaction.c | 20 +++++----- arch/sh/src/sh1/sh1_schedulesigaction.c | 20 +++++----- arch/x86/src/i486/up_schedulesigaction.c | 40 ++++++++++---------- arch/z16/src/common/up_schedulesigaction.c | 20 +++++----- arch/z80/src/ez80/ez80_schedulesigaction.c | 18 ++++----- arch/z80/src/z180/z180_schedulesigaction.c | 18 ++++----- arch/z80/src/z8/z8_schedulesigaction.c | 18 ++++----- arch/z80/src/z80/z80_schedulesigaction.c | 19 +++++----- 14 files changed, 146 insertions(+), 148 deletions(-) diff --git a/arch/arm/src/arm/up_schedulesigaction.c b/arch/arm/src/arm/up_schedulesigaction.c index f14263c6a3..a943c0abde 100644 --- a/arch/arm/src/arm/up_schedulesigaction.c +++ b/arch/arm/src/arm/up_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/arm/up_schedulesigaction.c * - * Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -103,18 +103,18 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is * being delivered to the currently executing task. */ @@ -196,9 +196,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver; tcb->xcp.regs[REG_CPSR] = SVC_MODE | PSR_I_BIT | PSR_F_BIT; } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/arm/src/armv6-m/up_schedulesigaction.c b/arch/arm/src/armv6-m/up_schedulesigaction.c index e538674b47..ada505f3a3 100644 --- a/arch/arm/src/armv6-m/up_schedulesigaction.c +++ b/arch/arm/src/armv6-m/up_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv6-m/up_schedulesigaction.c * - * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -104,18 +104,18 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is being delivered * to the currently executing task. */ @@ -206,9 +206,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_LR] = EXC_RETURN_PRIVTHR; #endif } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/arm/src/armv7-a/arm_schedulesigaction.c b/arch/arm/src/armv7-a/arm_schedulesigaction.c index dfdf5235f3..866ebb36a5 100644 --- a/arch/arm/src/armv7-a/arm_schedulesigaction.c +++ b/arch/arm/src/armv7-a/arm_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-a/arm_schedulesigaction.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -103,18 +103,18 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is being delivered * to the currently executing task. */ @@ -195,9 +195,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver; tcb->xcp.regs[REG_CPSR] = (PSR_MODE_SVC | PSR_I_BIT | PSR_F_BIT); } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/avr/src/avr/up_schedulesigaction.c b/arch/avr/src/avr/up_schedulesigaction.c index ebd40eba56..54f5601df7 100644 --- a/arch/avr/src/avr/up_schedulesigaction.c +++ b/arch/avr/src/avr/up_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/avr/src/avr/up_schedulesigaction.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -103,18 +103,18 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is * being delivered to the currently executing task. */ @@ -200,9 +200,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_PCH] = (uint16_t)up_sigdeliver >> 8; tcb->xcp.regs[REG_SREG] &= ~(1 << SREG_I); } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/avr/src/avr32/up_schedulesigaction.c b/arch/avr/src/avr32/up_schedulesigaction.c index c877ba2442..d1166f79c8 100644 --- a/arch/avr/src/avr32/up_schedulesigaction.c +++ b/arch/avr/src/avr32/up_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/avr/src/avr32/up_schedulesigaction.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -103,18 +103,18 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is * being delivered to the currently executing task. */ @@ -196,9 +196,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver; tcb->xcp.regs[REG_SR] |= AVR32_SR_GM_MASK; } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/mips/src/mips32/up_schedulesigaction.c b/arch/mips/src/mips32/up_schedulesigaction.c index 1173bf2c40..f3e58a5f49 100644 --- a/arch/mips/src/mips32/up_schedulesigaction.c +++ b/arch/mips/src/mips32/up_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/mips/src/mips32/up_schedulesigaction.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -103,20 +103,19 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { + irqstate_t flags; uint32_t status; - /* Refuse to handle nested signal actions */ - sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is * being delivered to the currently executing task. */ @@ -212,9 +211,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.saved_epc, tcb->xcp.saved_status, tcb->xcp.regs[REG_EPC], tcb->xcp.regs[REG_STATUS]); } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/sh/src/m16c/m16c_schedulesigaction.c b/arch/sh/src/m16c/m16c_schedulesigaction.c index adce23d373..c278d2f93b 100644 --- a/arch/sh/src/m16c/m16c_schedulesigaction.c +++ b/arch/sh/src/m16c/m16c_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/m16c/m16c_schedulesigaction.c * - * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -102,18 +102,18 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is * being delivered to the currently executing task. */ @@ -193,9 +193,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_PC+1] = (uint32_t)up_sigdeliver; tcb->xcp.regs[REG_FLG] &= ~M16C_FLG_I; } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/sh/src/sh1/sh1_schedulesigaction.c b/arch/sh/src/sh1/sh1_schedulesigaction.c index 38fe1e361b..8fff1572e7 100644 --- a/arch/sh/src/sh1/sh1_schedulesigaction.c +++ b/arch/sh/src/sh1/sh1_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/sh1/sh1_schedulesigaction.c * - * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -102,18 +102,18 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is * being delivered to the currently executing task. */ @@ -189,9 +189,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver; tcb->xcp.regs[REG_SR] |= 0x000000f0 ; } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/x86/src/i486/up_schedulesigaction.c b/arch/x86/src/i486/up_schedulesigaction.c index 150324eceb..8d6b03213f 100644 --- a/arch/x86/src/i486/up_schedulesigaction.c +++ b/arch/x86/src/i486/up_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/x86/src/i486/up_schedulesigaction.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -98,20 +98,20 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is being delivered - * to the currently executing task. + * to the currently executing task. */ sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs); @@ -119,7 +119,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) if (tcb == (struct tcb_s*)g_readytorun.head) { /* CASE 1: We are not in an interrupt handler and a task is - * signalling itself for some reason. + * signalling itself for some reason. */ if (!current_regs) @@ -130,21 +130,21 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) } /* CASE 2: We are in an interrupt handler AND the interrupted task - * is the same as the one that must receive the signal, then we will - * have to modify the return state as well as the state in the TCB. + * is the same as the one that must receive the signal, then we will + * have to modify the return state as well as the state in the TCB. * * Hmmm... there looks like a latent bug here: The following logic - * would fail in the strange case where we are in an interrupt - * handler, the thread is signalling itself, but a context switch to - * another task has occurred so that current_regs does not refer to - * the thread at g_readytorun.head! + * would fail in the strange case where we are in an interrupt + * handler, the thread is signalling itself, but a context switch to + * another task has occurred so that current_regs does not refer to + * the thread at g_readytorun.head! */ else { /* Save the return lr and cpsr and one scratch register. These - * will be restored by the signal trampoline after the signals - * have been delivered. + * will be restored by the signal trampoline after the signals + * have been delivered. */ tcb->xcp.sigdeliver = sigdeliver; @@ -190,9 +190,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_EIP] = (uint32_t)up_sigdeliver; tcb->xcp.regs[REG_EFLAGS] = 0; } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/z16/src/common/up_schedulesigaction.c b/arch/z16/src/common/up_schedulesigaction.c index 1a2ccae48b..f71d6be7eb 100644 --- a/arch/z16/src/common/up_schedulesigaction.c +++ b/arch/z16/src/common/up_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * common/up_schedulesigaction.c * - * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -102,18 +102,18 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; dbg("tcb=0x%p sigdeliver=0x%06x\n", tcb, (uint32_t)sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is * being delivered to the currently executing task. */ @@ -192,9 +192,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) *saved_pc = (uint32_t)up_sigdeliver; tcb->xcp.regs[REG_FLAGS] = 0; } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* CONFIG_DISABLE_SIGNALS */ diff --git a/arch/z80/src/ez80/ez80_schedulesigaction.c b/arch/z80/src/ez80/ez80_schedulesigaction.c index 987c1dd647..b98e61701f 100644 --- a/arch/z80/src/ez80/ez80_schedulesigaction.c +++ b/arch/z80/src/ez80/ez80_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/ez80/ez80_schedulesigaction.c * - * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -123,18 +123,18 @@ static void ez80_sigsetup(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver, FAR c void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) { + irqstate_t flags; + sdbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + /* Refuse to handle nested signal actions */ if (tcb->xcp.sigdeliver == NULL) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is being delivered * to the currently executing task. */ @@ -183,9 +183,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) ez80_sigsetup(tcb, sigdeliver, tcb->xcp.regs); } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* CONFIG_DISABLE_SIGNALS */ diff --git a/arch/z80/src/z180/z180_schedulesigaction.c b/arch/z80/src/z180/z180_schedulesigaction.c index f3025b6e99..e212bf0ff8 100644 --- a/arch/z80/src/z180/z180_schedulesigaction.c +++ b/arch/z80/src/z180/z180_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/z180/z180_schedulesigaction.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -123,18 +123,18 @@ static void z180_sigsetup(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver, FAR c void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) { + irqstate_t flags; + dbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + /* Refuse to handle nested signal actions */ if (tcb->xcp.sigdeliver == NULL) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is being delivered * to the currently executing task. */ @@ -183,9 +183,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) z180_sigsetup(tcb, sigdeliver, tcb->xcp.regs); } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* CONFIG_DISABLE_SIGNALS */ diff --git a/arch/z80/src/z8/z8_schedulesigaction.c b/arch/z80/src/z8/z8_schedulesigaction.c index 2a6c7495a0..8d876a52c5 100644 --- a/arch/z80/src/z8/z8_schedulesigaction.c +++ b/arch/z80/src/z8/z8_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/z8/z8_schedulesigaction.c * - * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -123,18 +123,18 @@ static void z8_sigsetup(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver, FAR chi void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) { + irqstate_t flags; + dbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + /* Refuse to handle nested signal actions */ if (tcb->xcp.sigdeliver == NULL) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is being delivered * to the currently executing task. */ @@ -183,9 +183,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) z8_sigsetup(tcb, sigdeliver, tcb->xcp.regs); } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* CONFIG_DISABLE_SIGNALS */ diff --git a/arch/z80/src/z80/z80_schedulesigaction.c b/arch/z80/src/z80/z80_schedulesigaction.c index 66ca29b851..f4581314db 100644 --- a/arch/z80/src/z80/z80_schedulesigaction.c +++ b/arch/z80/src/z80/z80_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/z80/z80_schedulesigaction.c * - * Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -123,18 +123,18 @@ static void z80_sigsetup(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver, FAR ch void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) { + irqstate_t flags; + dbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + /* Refuse to handle nested signal actions */ if (tcb->xcp.sigdeliver == NULL) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is being delivered * to the currently executing task. */ @@ -183,10 +183,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) z80_sigsetup(tcb, sigdeliver, tcb->xcp.regs); } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* CONFIG_DISABLE_SIGNALS */ - From 3acc09c0569877ab94e826343895f2041faa6f9d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 1 Oct 2015 07:18:07 -0600 Subject: [PATCH 05/33] LPC43xx: Remove unused .c file picked up in a recent merge --- arch/arm/src/lpc43xx/chip/lpc43_i2c.c | 573 -------------------------- 1 file changed, 573 deletions(-) delete mode 100644 arch/arm/src/lpc43xx/chip/lpc43_i2c.c diff --git a/arch/arm/src/lpc43xx/chip/lpc43_i2c.c b/arch/arm/src/lpc43xx/chip/lpc43_i2c.c deleted file mode 100644 index 3cd0619545..0000000000 --- a/arch/arm/src/lpc43xx/chip/lpc43_i2c.c +++ /dev/null @@ -1,573 +0,0 @@ -/******************************************************************************* - * arch/arm/src/lpc43xx/lpc43_i2c.c - * - * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Ported from from the LPC17 version: - * - * Copyright (C) 2011 Li Zhuoyi. All rights reserved. - * Author: Li Zhuoyi - * History: 0.1 2011-08-20 initial version - * - * Derived from arch/arm/src/lpc31xx/lpc31_i2c.c - * - * Author: David Hewson - * - * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - *******************************************************************************/ - -/******************************************************************************* - * Included Files - *******************************************************************************/ - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "up_arch.h" -#include "up_internal.h" - -#include "lpc43_i2c.h" -#include "lpc43_scu.h" -#include "lpc43_ccu.h" - -#if defined(CONFIG_LPC43_I2C0) || defined(CONFIG_LPC43_I2C1) - -#ifndef PINCONF_I2C1_SCL -# define PINCONF_I2C1_SCL PINCONF_I2C1_SCL_1 -# define PINCONF_I2C1_SDA PINCONF_I2C1_SDA_1 -#endif - -#ifndef CONFIG_I2C0_FREQ -# define CONFIG_I2C0_FREQ 100000 -#endif - -#ifndef CONFIG_I2C1_FREQ -# define CONFIG_I2C1_FREQ 100000 -#endif - -#ifndef CONFIG_I2C2_FREQ -# define CONFIG_I2C2_FREQ 100000 -#endif - -/******************************************************************************* - * Pre-processor Definitions - *******************************************************************************/ - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define I2C_TIMEOUT ((20 * CLK_TCK) / 1000) /* 20 mS */ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -struct lpc43_i2cdev_s -{ - struct i2c_dev_s dev; /* Generic I2C device */ - struct i2c_msg_s msg; /* a single message for legacy read/write */ - unsigned int base; /* Base address of registers */ - uint16_t irqid; /* IRQ for this device */ - - sem_t mutex; /* Only one thread can access at a time */ - sem_t wait; /* Place to wait for state machine completion */ - volatile uint8_t state; /* State of state machine */ - WDOG_ID timeout; /* watchdog to timeout when bus hung */ - - uint16_t wrcnt; /* number of bytes sent to tx fifo */ - uint16_t rdcnt; /* number of bytes read from rx fifo */ -}; - -#ifdef CONFIG_LPC43_I2C0 -static struct lpc43_i2cdev_s g_i2c0dev; -#endif -#ifdef CONFIG_LPC43_I2C1 -static struct lpc43_i2cdev_s g_i2c1dev; -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -static int i2c_start(struct lpc43_i2cdev_s *priv); -static void i2c_stop(struct lpc43_i2cdev_s *priv); -static int i2c_interrupt(int irq, FAR void *context); -static void i2c_timeout(int argc, uint32_t arg, ...); - -/**************************************************************************** - * I2C device operations - ****************************************************************************/ - -static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, - uint32_t frequency); -static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, - int nbits); -static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, - int buflen); -static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, - int buflen); -static int i2c_transfer(FAR struct i2c_dev_s *dev, - FAR struct i2c_msg_s *msgs, int count); - -struct i2c_ops_s lpc43_i2c_ops = -{ - .setfrequency = i2c_setfrequency, - .setaddress = i2c_setaddress, - .write = i2c_write, - .read = i2c_read, -#ifdef CONFIG_I2C_TRANSFER - .transfer = i2c_transfer -#endif -}; - -/******************************************************************************* - * Name: lpc43_i2c_setfrequency - * - * Description: - * Set the frequence for the next transfer - * - *******************************************************************************/ - -static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) -{ - struct lpc43_i2cdev_s *priv = (struct lpc43_i2cdev_s *) dev; - - if (frequency > 100000) - { - /* asymetric per 400Khz I2C spec */ - - putreg32(LPC43_CCLK / (83 + 47) * 47 / frequency, priv->base + LPC43_I2C_SCLH_OFFSET); - putreg32(LPC43_CCLK / (83 + 47) * 83 / frequency, priv->base + LPC43_I2C_SCLL_OFFSET); - } - else - { - /* 50/50 mark space ratio */ - - putreg32(LPC43_CCLK / 100 * 50 / frequency, priv->base + LPC43_I2C_SCLH_OFFSET); - putreg32(LPC43_CCLK / 100 * 50 / frequency, priv->base + LPC43_I2C_SCLL_OFFSET); - } - - /* FIXME: This function should return the actual selected frequency */ - - return (frequency); -} - -/******************************************************************************* - * Name: lpc43_i2c_setaddress - * - * Description: - * Set the I2C slave address for a subsequent read/write - * - *******************************************************************************/ - -static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) -{ - struct lpc43_i2cdev_s *priv = (struct lpc43_i2cdev_s *)dev; - - DEBUGASSERT(dev != NULL); - DEBUGASSERT(nbits == 7); - - priv->msg.addr = addr << 1; - priv->msg.flags = 0 ; - - return (0); -} - -/******************************************************************************* - * Name: lpc43_i2c_write - * - * Description: - * Send a block of data on I2C using the previously selected I2C - * frequency and slave address. - * - *******************************************************************************/ - -static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, - int buflen) -{ - struct lpc43_i2cdev_s *priv = (struct lpc43_i2cdev_s *)dev; - int ret; - - DEBUGASSERT(dev != NULL); - - priv->wrcnt = 0; - priv->rdcnt = 0; - priv->msg.addr &= ~0x01; - priv->msg.buffer = (uint8_t*)buffer; - priv->msg.length = buflen; - - ret = i2c_start(priv); - - return (ret > 0 ? 0 : -ETIMEDOUT); -} - -/******************************************************************************* - * Name: lpc43_i2c_read - * - * Description: - * Receive a block of data on I2C using the previously selected I2C - * frequency and slave address. - * - *******************************************************************************/ - -static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen) -{ - struct lpc43_i2cdev_s *priv = (struct lpc43_i2cdev_s *)dev; - int ret; - - DEBUGASSERT(dev != NULL); - - priv->wrcnt=0; - priv->rdcnt=0; - priv->msg.addr |= 0x01; - priv->msg.buffer = buffer; - priv->msg.length = buflen; - - ret = i2c_start(priv); - - return (ret >0 ? 0 : -ETIMEDOUT); -} - -/******************************************************************************* - * Name: i2c_start - * - * Description: - * Perform a I2C transfer start - * - *******************************************************************************/ - -static int i2c_start(struct lpc43_i2cdev_s *priv) -{ - int ret = -1; - - sem_wait(&priv->mutex); - - putreg32(I2C_CONCLR_STAC|I2C_CONCLR_SIC,priv->base+LPC43_I2C_CONCLR_OFFSET); - putreg32(I2C_CONSET_STA,priv->base+LPC43_I2C_CONSET_OFFSET); - - wd_start(priv->timeout, I2C_TIMEOUT, i2c_timeout, 1, (uint32_t)priv); - sem_wait(&priv->wait); - wd_cancel(priv->timeout); - sem_post(&priv->mutex); - - if (priv-> state == 0x18 || priv->state == 0x28) - { - ret = priv->wrcnt; - } - else if (priv-> state == 0x50 || priv->state == 0x58) - { - ret = priv->rdcnt; - } - - return (ret); -} - -/******************************************************************************* - * Name: i2c_stop - * - * Description: - * Perform a I2C transfer stop - * - *******************************************************************************/ - -static void i2c_stop(struct lpc43_i2cdev_s *priv) -{ - if (priv->state != 0x38) - { - putreg32(I2C_CONSET_STO|I2C_CONSET_AA,priv->base+LPC43_I2C_CONSET_OFFSET); - } - - sem_post(&priv->wait); -} - -/******************************************************************************* - * Name: i2c_timeout - * - * Description: - * Watchdog timer for timeout of I2C operation - * - *******************************************************************************/ - -static void i2c_timeout(int argc, uint32_t arg, ...) -{ - struct lpc43_i2cdev_s *priv = (struct lpc43_i2cdev_s *)arg; - - irqstate_t flags = irqsave(); - priv->state = 0xff; - sem_post(&priv->wait); - irqrestore(flags); -} - -/******************************************************************************* - * Name: i2c_interrupt - * - * Description: - * The I2C Interrupt Handler - * - *******************************************************************************/ - -static int i2c_interrupt(int irq, FAR void *context) -{ - struct lpc43_i2cdev_s *priv; - uint32_t state; - -#ifdef CONFIG_LPC43_I2C0 - if (irq == LPC43M0_IRQ_I2C0) - { - priv = &g_i2c0dev; - } - else -#endif -#ifdef CONFIG_LPC43_I2C1 - if (irq == LPC43_IRQ_I2C1) - { - priv = &g_i2c1dev; - } - else -#endif - { - PANIC(); - } - - /* Reference UM10360 19.10.5 */ - - state = getreg32(priv->base+LPC43_I2C_STAT_OFFSET); - putreg32(I2C_CONCLR_SIC, priv->base + LPC43_I2C_CONCLR_OFFSET); - - priv->state = state; - state &= 0xf8; - switch (state) - { - case 0x00: /* Bus Error */ - case 0x20: - case 0x30: - case 0x38: - case 0x48: - i2c_stop(priv); - break; - - case 0x08: /* START */ - case 0x10: /* Repeated START */ - putreg32(priv->msg.addr, priv->base + LPC43_I2C_DAT_OFFSET); - putreg32(I2C_CONCLR_STAC, priv->base + LPC43_I2C_CONCLR_OFFSET); - break; - - case 0x18: - priv->wrcnt=0; - putreg32(priv->msg.buffer[0], priv->base + LPC43_I2C_DAT_OFFSET); - break; - - case 0x28: - priv->wrcnt++; - if (priv->wrcnt < priv->msg.length) - { - putreg32(priv->msg.buffer[priv->wrcnt],priv->base+LPC43_I2C_DAT_OFFSET); - } - else - { - i2c_stop(priv); - } - break; - - case 0x40: - priv->rdcnt = -1; - putreg32(I2C_CONSET_AA, priv->base + LPC43_I2C_CONSET_OFFSET); - break; - - case 0x50: - priv->rdcnt++; - if (priv->rdcnt < priv->msg.length) - { - priv->msg.buffer[priv->rdcnt]=getreg32(priv->base+LPC43_I2C_BUFR_OFFSET); - } - - if (priv->rdcnt >= priv->msg.length - 1) - { - putreg32(I2C_CONCLR_AAC|I2C_CONCLR_SIC,priv->base+LPC43_I2C_CONCLR_OFFSET); - } - break; - - case 0x58: - i2c_stop(priv); - break; - - default: - i2c_stop(priv); - break; - } - - return (0); -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/******************************************************************************* - * Name: up_i2cinitialize - * - * Description: - * Initialise an I2C device - * - *******************************************************************************/ - -struct i2c_dev_s *up_i2cinitialize(int port) -{ - struct lpc43_i2cdev_s *priv; - - if (port>2) - { - dbg("lpc I2C Only support 0,1,2\n"); - return NULL; - } - - irqstate_t flags; - uint32_t regval; - - flags = irqsave(); - -#ifdef CONFIG_LPC43_I2C0 - if (port == 0) - { - priv = &g_i2c0dev; - priv->base = LPC43_I2C0_BASE; - priv->irqid = LPC43M0_IRQ_I2C0; - - //enable - regval = getreg32(LPC43_SCU_SFSI2C0 ); - regval |= SCU_SFSI2C0_SCL_EZI | SCU_SFSI2C0_SDA_EZI; - if ( CONFIG_I2C0_FREQ == 1000000 ) { //super fast mode - regval |= SCU_SFSI2C0_SCL_EHD | SCU_SFSI2C0_SDA_EHD; - } - putreg32(regval, LPC43_SCU_SFSI2C0); - - //enable clock - regval = getreg32(LPC43_CCU1_APB1_I2C0_CFG); - regval |= CCU_CLK_CFG_RUN; - putreg32(regval, LPC43_CCU1_APB1_I2C0_CFG); - - // - putreg32(LPC43_CCLK/CONFIG_I2C0_FREQ/2, priv->base + LPC43_I2C_SCLH_OFFSET); - putreg32(LPC43_CCLK/CONFIG_I2C0_FREQ/2, priv->base + LPC43_I2C_SCLL_OFFSET); - - //no pins configuration needed - } - else -#endif -#ifdef CONFIG_LPC43_I2C1 - if (port == 1) - { - priv = &g_i2c1dev; - priv->base = LPC43_I2C1_BASE; - priv->irqid = LPC43_IRQ_I2C1; - - regval = getreg32(LPC43_SCU_SFSI2C0); - regval |= SYSCON_PCONP_PCI2C1; - putreg32(regval, LPC43_SCU_SFSI2C0); - - regval = getreg32(LPC43_SYSCON_PCLKSEL1); - regval &= ~SYSCON_PCLKSEL1_I2C1_MASK; - regval |= (SYSCON_PCLKSEL_CCLK << SYSCON_PCLKSEL1_I2C1_SHIFT); - putreg32(regval, LPC43_SYSCON_PCLKSEL1); - - lpc43_pin_config(PINCONF_I2C1_SCL); - lpc43_pin_config(PINCONF_I2C1_SDA); - - putreg32(LPC43_CCLK/CONFIG_I2C1_FREQ/2, priv->base + LPC43_I2C_SCLH_OFFSET); - putreg32(LPC43_CCLK/CONFIG_I2C1_FREQ/2, priv->base + LPC43_I2C_SCLL_OFFSET); - } - else -#endif - { - return NULL; - } - - putreg32(I2C_CONSET_I2EN,priv->base+LPC43_I2C_CONSET_OFFSET); - - sem_init(&priv->mutex, 0, 1); - sem_init(&priv->wait, 0, 0); - - /* Allocate a watchdog timer */ - - priv->timeout = wd_create(); - DEBUGASSERT(priv->timeout != 0); - - /* Attach Interrupt Handler */ - - irq_attach(priv->irqid, i2c_interrupt); - - /* Enable Interrupt Handler */ - - up_enable_irq(priv->irqid); - - /* Install our operations */ - - priv->dev.ops = &lpc43_i2c_ops; - return (&priv->dev); -} - -/******************************************************************************* - * Name: up_i2cuninitalize - * - * Description: - * Uninitialise an I2C device - * - *******************************************************************************/ - -int up_i2cuninitialize(FAR struct i2c_dev_s * dev) -{ - struct lpc43_i2cdev_s *priv = (struct lpc43_i2cdev_s *) dev; - - putreg32(I2C_CONCLRT_I2ENC,priv->base+LPC43_I2C_CONCLR_OFFSET); - up_disable_irq(priv->irqid); - irq_detach(priv->irqid); - return (0); -} - -#endif From 166d307add79661728cbac881d35e3820dcff5c2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 1 Oct 2015 08:39:21 -0600 Subject: [PATCH 06/33] STM32: Fix conditional compilation of TIM SYSLOG initialization --- arch/arm/src/stm32/stm32f40xxx_rcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/src/stm32/stm32f40xxx_rcc.c b/arch/arm/src/stm32/stm32f40xxx_rcc.c index b2530bc0bb..f0e16f4079 100644 --- a/arch/arm/src/stm32/stm32f40xxx_rcc.c +++ b/arch/arm/src/stm32/stm32f40xxx_rcc.c @@ -801,7 +801,7 @@ static void stm32_stdclockconfig(void) * ****************************************************************************/ -#if defined(CONFIG_SYSLOG) || defined(CONFIG_ARMV7M_ITMSYSLOG) +#if defined(CONFIG_SYSLOG) && defined(CONFIG_ARMV7M_ITMSYSLOG) static inline void rcc_itm_syslog(void) { /* Enable SWO output */ From 3a07b09b9a5ae99759896dfe337df953468fa513 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 1 Oct 2015 10:00:25 -0600 Subject: [PATCH 07/33] LPC43xx: Tweaks to pkolesnikov's LPC4370 changes to get a clean compilation --- arch/arm/include/lpc43xx/chip.h | 136 +++++++++++++++++++++++-------- arch/arm/src/lpc43xx/Kconfig | 5 ++ arch/arm/src/lpc43xx/lpc43_i2c.c | 24 ++++-- 3 files changed, 123 insertions(+), 42 deletions(-) diff --git a/arch/arm/include/lpc43xx/chip.h b/arch/arm/include/lpc43xx/chip.h index 390f96bd6c..7272f06790 100644 --- a/arch/arm/include/lpc43xx/chip.h +++ b/arch/arm/include/lpc43xx/chip.h @@ -134,8 +134,9 @@ # define LPC43_NI2S (2) /* Two I2S controllers */ # define LPC43_NCAN (2) /* Two CAN controllers */ # define LPC43_NDAC (1) /* One 10-bit DAC */ -# define LPC43_NADC (2) /* Two 10-bit ADC controllers */ -# define LPC43_NADC_CHANNELS (8) /* Eight ADC channels */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (8) /* Eight ADC channels */ +# undef LPC43_NADC12 /* No 12-bit ADC controllers */ #elif defined(CONFIG_ARCH_CHIP_LPC4310FET100) # define LPC43_FLASH_BANKA_SIZE (0) /* Flashless */ # define LPC43_FLASH_BANKB_SIZE (0) @@ -159,8 +160,9 @@ # define LPC43_NI2S (2) /* Two I2S controllers */ # define LPC43_NCAN (2) /* Two CAN controllers */ # define LPC43_NDAC (1) /* One 10-bit DAC */ -# define LPC43_NADC (2) /* Two 10-bit ADC controllers */ -# define LPC43_NADC_CHANNELS (4) /* Four ADC channels */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (4) /* Four ADC channels */ +# undef LPC43_NADC12 /* No 12-bit ADC controllers */ #elif defined(CONFIG_ARCH_CHIP_LPC4320FBD144) # warning "Data sheet and user manual are consistement for the LPC4320" # define LPC43_FLASH_BANKA_SIZE (0) /* Flashless */ @@ -185,8 +187,9 @@ # define LPC43_NI2S (2) /* Two I2S controllers */ # define LPC43_NCAN (2) /* Two CAN controllers */ # define LPC43_NDAC (1) /* One 10-bit DAC */ -# define LPC43_NADC (2) /* Two 10-bit ADC controllers */ -# define LPC43_NADC_CHANNELS (8) /* Eight ADC channels */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (8) /* Eight ADC channels */ +# undef LPC43_NADC12 /* No 12-bit ADC controllers */ #elif defined(CONFIG_ARCH_CHIP_LPC4320FET100) # warning "Data sheet and user manual are consistement for the LPC4320" # define LPC43_FLASH_BANKA_SIZE (0) /* Flashless */ @@ -211,8 +214,9 @@ # define LPC43_NI2S (2) /* Two I2S controllers */ # define LPC43_NCAN (2) /* Two CAN controllers */ # define LPC43_NDAC (1) /* One 10-bit DAC */ -# define LPC43_NADC (2) /* Two 10-bit ADC controllers */ -# define LPC43_NADC_CHANNELS (4) /* Four ADC channels */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (4) /* Four ADC channels */ +# undef LPC43_NADC12 /* No 12-bit ADC controllers */ #elif defined(CONFIG_ARCH_CHIP_LPC4330FBD144) # define LPC43_FLASH_BANKA_SIZE (0) /* Flashless */ # define LPC43_FLASH_BANKB_SIZE (0) @@ -236,8 +240,9 @@ # define LPC43_NI2S (2) /* Two I2S controllers */ # define LPC43_NCAN (2) /* Two CAN controllers */ # define LPC43_NDAC (1) /* One 10-bit DAC */ -# define LPC43_NADC (2) /* Two 10-bit ADC controllers */ -# define LPC43_NADC_CHANNELS (8) /* Eight ADC channels */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (8) /* Eight ADC channels */ +# undef LPC43_NADC12 /* No 12-bit ADC controllers */ #elif defined(CONFIG_ARCH_CHIP_LPC4330FET100) # define LPC43_FLASH_BANKA_SIZE (0) /* Flashless */ # define LPC43_FLASH_BANKB_SIZE (0) @@ -261,8 +266,9 @@ # define LPC43_NI2S (2) /* Two I2S controllers */ # define LPC43_NCAN (2) /* Two CAN controllers */ # define LPC43_NDAC (1) /* One 10-bit DAC */ -# define LPC43_NADC (2) /* Two 10-bit ADC controllers */ -# define LPC43_NADC_CHANNELS (4) /* Four ADC channels */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (4) /* Four ADC channels */ +# undef LPC43_NADC12 /* No 12-bit ADC controllers */ #elif defined(CONFIG_ARCH_CHIP_LPC4330FET180) # define LPC43_FLASH_BANKA_SIZE (0) /* Flashless */ # define LPC43_FLASH_BANKB_SIZE (0) @@ -286,8 +292,9 @@ # define LPC43_NI2S (2) /* Two I2S controllers */ # define LPC43_NCAN (2) /* Two CAN controllers */ # define LPC43_NDAC (1) /* One 10-bit DAC */ -# define LPC43_NADC (2) /* Two 10-bit ADC controllers */ -# define LPC43_NADC_CHANNELS (8) /* Eight ADC channels */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (8) /* Eight ADC channels */ +# undef LPC43_NADC12 /* No 12-bit ADC controllers */ #elif defined(CONFIG_ARCH_CHIP_LPC4330FET256) # define LPC43_FLASH_BANKA_SIZE (0) /* Flashless */ # define LPC43_FLASH_BANKB_SIZE (0) @@ -311,8 +318,9 @@ # define LPC43_NI2S (2) /* Two I2S controllers */ # define LPC43_NCAN (2) /* Two CAN controllers */ # define LPC43_NDAC (1) /* One 10-bit DAC */ -# define LPC43_NADC (2) /* Two 10-bit ADC controllers */ -# define LPC43_NADC_CHANNELS (8) /* Eight ADC channels */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (8) /* Eight ADC channels */ +# undef LPC43_NADC12 /* No 12-bit ADC controllers */ #elif defined(CONFIG_ARCH_CHIP_LPC4350FBD208) # define LPC43_FLASH_BANKA_SIZE (0) /* Flashless */ # define LPC43_FLASH_BANKB_SIZE (0) @@ -336,8 +344,9 @@ # define LPC43_NI2S (2) /* Two I2S controllers */ # define LPC43_NCAN (2) /* Two CAN controllers */ # define LPC43_NDAC (1) /* One 10-bit DAC */ -# define LPC43_NADC (2) /* Two 10-bit ADC controllers */ -# define LPC43_NADC_CHANNELS (8) /* Eight ADC channels */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (8) /* Eight ADC channels */ +# undef LPC43_NADC12 /* No 12-bit ADC controllers */ #elif defined(CONFIG_ARCH_CHIP_LPC4350FET180) # define LPC43_FLASH_BANKA_SIZE (0) /* Flashless */ # define LPC43_FLASH_BANKB_SIZE (0) @@ -361,8 +370,9 @@ # define LPC43_NI2S (2) /* Two I2S controllers */ # define LPC43_NCAN (2) /* Two CAN controllers */ # define LPC43_NDAC (1) /* One 10-bit DAC */ -# define LPC43_NADC (2) /* Two 10-bit ADC controllers */ -# define LPC43_NADC_CHANNELS (8) /* Eight ADC channels */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (8) /* Eight ADC channels */ +# undef LPC43_NADC12 /* No 12-bit ADC controllers */ #elif defined(CONFIG_ARCH_CHIP_LPC4350FET256) # define LPC43_FLASH_BANKA_SIZE (0) /* Flashless */ # define LPC43_FLASH_BANKB_SIZE (0) @@ -386,8 +396,9 @@ # define LPC43_NI2S (2) /* Two I2S controllers */ # define LPC43_NCAN (2) /* Two CAN controllers */ # define LPC43_NDAC (1) /* One 10-bit DAC */ -# define LPC43_NADC (2) /* Two 10-bit ADC controllers */ -# define LPC43_NADC_CHANNELS (8) /* Eight ADC channels */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (8) /* Eight ADC channels */ +# undef LPC43_NADC12 /* No 12-bit ADC controllers */ #elif defined(CONFIG_ARCH_CHIP_LPC4353FBD208) # define LPC43_FLASH_BANKA_SIZE (256*1025) /* 512Kb FLASH */ # define LPC43_FLASH_BANKB_SIZE (256*1025) @@ -411,8 +422,9 @@ # define LPC43_NI2S (2) /* Two I2S controllers */ # define LPC43_NCAN (2) /* Two CAN controllers */ # define LPC43_NDAC (1) /* One 10-bit DAC */ -# define LPC43_NADC (2) /* Two 10-bit ADC controllers */ -# define LPC43_NADC_CHANNELS (8) /* Eight ADC channels */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (8) /* Eight ADC channels */ +# undef LPC43_NADC12 /* No 12-bit ADC controllers */ #elif defined(CONFIG_ARCH_CHIP_LPC4353FET180) # define LPC43_FLASH_BANKA_SIZE (256*1025) /* 512Kb FLASH */ # define LPC43_FLASH_BANKB_SIZE (256*1025) @@ -436,8 +448,9 @@ # define LPC43_NI2S (2) /* Two I2S controllers */ # define LPC43_NCAN (2) /* Two CAN controllers */ # define LPC43_NDAC (1) /* One 10-bit DAC */ -# define LPC43_NADC (2) /* Two 10-bit ADC controllers */ -# define LPC43_NADC_CHANNELS (8) /* Eight ADC channels */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (8) /* Eight ADC channels */ +# undef LPC43_NADC12 /* No 12-bit ADC controllers */ #elif defined(CONFIG_ARCH_CHIP_LPC4353FET256) # define LPC43_FLASH_BANKA_SIZE (256*1025) /* 512Kb FLASH */ # define LPC43_FLASH_BANKB_SIZE (256*1025) @@ -461,8 +474,9 @@ # define LPC43_NI2S (2) /* Two I2S controllers */ # define LPC43_NCAN (2) /* Two CAN controllers */ # define LPC43_NDAC (1) /* One 10-bit DAC */ -# define LPC43_NADC (2) /* Two 10-bit ADC controllers */ -# define LPC43_NADC_CHANNELS (8) /* Eight ADC channels */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (8) /* Eight ADC channels */ +# undef LPC43_NADC12 /* No 12-bit ADC controllers */ #elif defined(CONFIG_ARCH_CHIP_LPC4357FET180) # define LPC43_FLASH_BANKA_SIZE (512*1025) /* 1024Kb FLASH */ # define LPC43_FLASH_BANKB_SIZE (512*1025) @@ -486,8 +500,9 @@ # define LPC43_NI2S (2) /* Two I2S controllers */ # define LPC43_NCAN (2) /* Two CAN controllers */ # define LPC43_NDAC (1) /* One 10-bit DAC */ -# define LPC43_NADC (2) /* Two 10-bit ADC controllers */ -# define LPC43_NADC_CHANNELS (8) /* Eight ADC channels */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (8) /* Eight ADC channels */ +# undef LPC43_NADC12 /* No 12-bit ADC controllers */ #elif defined(CONFIG_ARCH_CHIP_LPC4357FBD208) # define LPC43_FLASH_BANKA_SIZE (512*1025) /* 1024Kb FLASH */ # define LPC43_FLASH_BANKB_SIZE (512*1025) @@ -511,8 +526,9 @@ # define LPC43_NI2S (2) /* Two I2S controllers */ # define LPC43_NCAN (2) /* Two CAN controllers */ # define LPC43_NDAC (1) /* One 10-bit DAC */ -# define LPC43_NADC (2) /* Two 10-bit ADC controllers */ -# define LPC43_NADC_CHANNELS (8) /* Eight ADC channels */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (8) /* Eight ADC channels */ +# undef LPC43_NADC12 /* No 12-bit ADC controllers */ #elif defined(CONFIG_ARCH_CHIP_LPC4357FET256) # define LPC43_FLASH_BANKA_SIZE (512*1025) /* 1024Kb FLASH */ # define LPC43_FLASH_BANKB_SIZE (512*1025) @@ -536,8 +552,60 @@ # define LPC43_NI2S (2) /* Two I2S controllers */ # define LPC43_NCAN (2) /* Two CAN controllers */ # define LPC43_NDAC (1) /* One 10-bit DAC */ -# define LPC43_NADC (2) /* Two 10-bit ADC controllers */ -# define LPC43_NADC_CHANNELS (8) /* Eight ADC channels */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (8) /* Eight ADC channels */ +# undef LPC43_NADC12 /* No 12-bit ADC controllers */ +#elif defined(CONFIG_ARCH_CHIP_LPC4370FET100) +# define LPC43_FLASH_BANKA_SIZE (0) /* Flashless */ +# define LPC43_FLASH_BANKB_SIZE (0) +# define LPC43_LOCSRAM_BANK0_SIZE (128*1024) /* 200Kb Local SRAM (plus 18Kb for Cortex-M0)*/ +# define LPC43_LOCSRAM_BANK1_SIZE (72*1024) +# define LPC43_AHBSRAM_BANK0_SIZE (32*1024) /* 64Kb AHB SRAM */ +# define LPC43_AHBSRAM_BANK1_SIZE (16*1024) +# define LPC43_AHBSRAM_BANK2_SIZE (16*1024) +# define LPC43_EEPROM_SIZE (0) /* No EEPROM */ +# undef LPC43_NLCD /* No LCD controller */ +# define LPC43_ETHERNET (1) /* One Ethernet controller */ +# define LPC43_USB0 (1) /* Have USB0 (Host, Device, OTG) */ +# define LPC43_USB1 (1) /* Have USB1 (Host, Device) */ +# undef LPC43_USB1_ULPI /* No USB1 (Host, Device) with ULPI I/F */ +# undef LPC43_MCPWM /* No PWM capability */ +# undef LPC43_QEI /* No Quadrature Encoder capability */ +# define LPC43_NUSARTS (4) /* Three USARTs + 1 UART */ +# define LPC43_NSSP (2) /* Two SSP controllers */ +# define LPC43_NTIMERS (4) /* Four Timers */ +# define LPC43_NI2C (2) /* Two I2C controllers */ +# define LPC43_NI2S (2) /* Two I2S controllers */ +# define LPC43_NCAN (2) /* Two C-CAN controllers */ +# define LPC43_NDAC (1) /* One 10-bit DAC */ +# define LPC43_NADC10 (2) /* Two 10-bit ADC controllers */ +# define LPC43_NADC10_CHANNELS (8) /* Eight ADC channels (per ADC)*/ +# define LPC43_NADC12 (1) /* ONne 12-bit ADC controllers (ADCHS)*/ +#elif defined(CONFIG_ARCH_CHIP_LPC4370FET256) +# define LPC43_FLASH_BANKA_SIZE (0) /* Flashless */ +# define LPC43_FLASH_BANKB_SIZE (0) +# define LPC43_LOCSRAM_BANK0_SIZE (128*1024) /* 200Kb Local SRAM (plus 18Kb for Cortex-M0)*/ +# define LPC43_LOCSRAM_BANK1_SIZE (72*1024) +# define LPC43_AHBSRAM_BANK0_SIZE (32*1024) /* 64Kb AHB SRAM */ +# define LPC43_AHBSRAM_BANK1_SIZE (16*1024) +# define LPC43_AHBSRAM_BANK2_SIZE (16*1024) +# define LPC43_EEPROM_SIZE (0) /* No EEPROM */ +# define LPC43_NLCD (1) /* One LCD controller */ +# define LPC43_ETHERNET (1) /* One Ethernet controller */ +# define LPC43_USB0 (1) /* Have USB0 (Host, Device, OTG) */ +# define LPC43_USB1 (1) /* Have USB1 (Host, Device) */ +# define LPC43_USB1_ULPI (1) /* Have USB1 (Host, Device) with ULPI I/F */ +# define LPC43_MCPWM (1) /* One PWM interface */ +# define LPC43_QEI (1) /* One Quadrature Encoder interface */ +# define LPC43_NUSARTS (4) /* Three USARTs + 1 UART */ +# define LPC43_NSSP (2) /* Two SSP controllers */ +# define LPC43_NTIMERS (4) /* Four Timers */ +# define LPC43_NI2C (2) /* Two I2C controllers */ +# define LPC43_NI2S (2) /* Two I2S controllers */ +# define LPC43_NCAN (2) /* Two C-CAN controllers */ +# define LPC43_NDAC (1) /* One 10-bit DAC */ +# define LPC43_NADC10_CHANNELS (8) /* Eight ADC channels (per ADC)*/ +# define LPC43_NADC12 (1) /* ONne 12-bit ADC controllers (ADCHS)*/ #else # error "Unsupported LPC43xx chip" #endif diff --git a/arch/arm/src/lpc43xx/Kconfig b/arch/arm/src/lpc43xx/Kconfig index ce7cf821a2..8df9946f07 100644 --- a/arch/arm/src/lpc43xx/Kconfig +++ b/arch/arm/src/lpc43xx/Kconfig @@ -328,6 +328,11 @@ config LPC43_I2C0 bool "I2C0" default n +config LPC43_I2C0_SUPERFAST + bool "I2C0 super fast mode" + default n + depends on LPC43_I2C0 + config LPC43_I2C1 bool "I2C1" default n diff --git a/arch/arm/src/lpc43xx/lpc43_i2c.c b/arch/arm/src/lpc43xx/lpc43_i2c.c index cdb02002be..90652f08ee 100644 --- a/arch/arm/src/lpc43xx/lpc43_i2c.c +++ b/arch/arm/src/lpc43xx/lpc43_i2c.c @@ -84,6 +84,14 @@ #define I2C_TIMEOUT (20*1000/CONFIG_USEC_PER_TICK) /* 20 mS */ +#ifdef CONFIG_LPC43_I2C0_SUPERFAST +# define I2C0_DEFAULT_FREQUENCY 1000000 +#else +# define I2C0_DEFAULT_FREQUENCY 400000 +#endif + +#define I2C1_DEFAULT_FREQUENCY 400000 + /**************************************************************************** * Private Data ****************************************************************************/ @@ -507,7 +515,7 @@ struct i2c_dev_s *up_i2cinitialize(int port) #ifdef CONFIG_LPC43_I2C0 if (port == 0) { - priv = &g_i2c0dev; + priv = &g_i2c0dev; priv->base = LPC43_I2C0_BASE; priv->irqid = LPC43M0_IRQ_I2C0; priv->baseFreq = BOARD_ABP1_FREQUENCY; @@ -516,12 +524,12 @@ struct i2c_dev_s *up_i2cinitialize(int port) regval = getreg32(LPC43_SCU_SFSI2C0); regval |= SCU_SFSI2C0_SCL_EZI | SCU_SFSI2C0_SDA_EZI; - if (CONFIG_I2C0_FREQ == 1000000) - { - /* Super fast mode */ - regval |= SCU_SFSI2C0_SCL_EHD | SCU_SFSI2C0_SDA_EHD; - } +#ifdef CONFIG_LPC43_I2C0_SUPERFAST + /* Enable super fast mode */ + + regval |= SCU_SFSI2C0_SCL_EHD | SCU_SFSI2C0_SDA_EHD; +#endif putreg32(regval, LPC43_SCU_SFSI2C0); @@ -531,7 +539,7 @@ struct i2c_dev_s *up_i2cinitialize(int port) regval |= CCU_CLK_CFG_RUN; putreg32(regval, LPC43_CCU1_APB1_I2C0_CFG); - i2c_setfrequency((struct i2c_dev_s *)priv,CONFIG_I2C0_FREQ); + i2c_setfrequency((struct i2c_dev_s *)priv, I2C0_DEFAULT_FREQUENCY); /* No pin configuration needed */ } @@ -558,7 +566,7 @@ struct i2c_dev_s *up_i2cinitialize(int port) lpc43_pin_config(PINCONF_I2C1_SCL); lpc43_pin_config(PINCONF_I2C1_SDA); - i2c_setfrequency(priv,CONFIG_I2C1_FREQ); + i2c_setfrequency(priv, I2C1_DEFAULT_FREQUENCY); } else From ddf936c913520a236876eedf5237d48df9e1c89b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 1 Oct 2015 11:09:39 -0600 Subject: [PATCH 08/33] Various fixes for compilation issues found by tools/testbuild.sh --- arch/arm/src/efm32/chip/efm32_timer.h | 2 +- arch/arm/src/lpc11xx/lpc11_lowgetc.c | 2 +- arch/arm/src/lpc11xx/lpc11_lowgetc.h | 1 + arch/arm/src/lpc11xx/lpc11_lowputc.c | 10 +++++----- arch/arm/src/lpc11xx/lpc11_serial.c | 8 ++++---- arch/arm/src/lpc11xx/lpc11_serial.h | 4 ++-- arch/arm/src/stm32/stm32_rtcc.c | 1 + 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/arch/arm/src/efm32/chip/efm32_timer.h b/arch/arm/src/efm32/chip/efm32_timer.h index d312dd4ea7..86b9aaa51a 100644 --- a/arch/arm/src/efm32/chip/efm32_timer.h +++ b/arch/arm/src/efm32/chip/efm32_timer.h @@ -69,7 +69,7 @@ #include "chip/efm32_memorymap.h" #if !defined(CONFIG_EFM32_EFM32GG) -# warning This is the EFM32GG header file; Review/modification needed for this archtecture +# warning This is the EFM32GG header file; Review/modification needed for this architecture #endif /******************************************************************************************************************************* diff --git a/arch/arm/src/lpc11xx/lpc11_lowgetc.c b/arch/arm/src/lpc11xx/lpc11_lowgetc.c index 43c47fd904..909036de06 100644 --- a/arch/arm/src/lpc11xx/lpc11_lowgetc.c +++ b/arch/arm/src/lpc11xx/lpc11_lowgetc.c @@ -115,7 +115,7 @@ int lpc11_lowgetc(void) { uint8_t ch = 0; -#if defined HAVE_UART && defined HAVE_CONSOLE +#if defined HAVE_UART && defined HAVE_SERIAL_CONSOLE /* Wait while the Receiver Data Ready (RDR) is indicating a "empty" FIFO to * assure that we have data in the buffer to read. */ diff --git a/arch/arm/src/lpc11xx/lpc11_lowgetc.h b/arch/arm/src/lpc11xx/lpc11_lowgetc.h index 4a26ebef42..4c94f39b78 100644 --- a/arch/arm/src/lpc11xx/lpc11_lowgetc.h +++ b/arch/arm/src/lpc11xx/lpc11_lowgetc.h @@ -41,6 +41,7 @@ ************************************************************************************/ #include +#include "lpc11_serial.h" /************************************************************************************ * Pre-processor Definitions diff --git a/arch/arm/src/lpc11xx/lpc11_lowputc.c b/arch/arm/src/lpc11xx/lpc11_lowputc.c index d68fa147d7..af1b34bd59 100644 --- a/arch/arm/src/lpc11xx/lpc11_lowputc.c +++ b/arch/arm/src/lpc11xx/lpc11_lowputc.c @@ -66,7 +66,7 @@ # define CONSOLE_BITS CONFIG_UART0_BITS # define CONSOLE_PARITY CONFIG_UART0_PARITY # define CONSOLE_2STOP CONFIG_UART0_2STOP -#elif defined(HAVE_CONSOLE) +#elif defined(HAVE_SERIAL_CONSOLE) # error "No CONFIG_UART0_SERIAL_CONSOLE Setting" #endif @@ -80,7 +80,7 @@ # define CONSOLE_LCR_WLS UART_LCR_WLS_7BIT #elif CONSOLE_BITS == 8 # define CONSOLE_LCR_WLS UART_LCR_WLS_8BIT -#elif defined(HAVE_CONSOLE) +#elif defined(HAVE_SERIAL_CONSOLE) # error "Invalid CONFIG_UARTn_BITS setting for console " #endif @@ -96,7 +96,7 @@ # define CONSOLE_LCR_PAR (UART_LCR_PE|UART_LCR_PS_STICK1) #elif CONSOLE_PARITY == 4 # define CONSOLE_LCR_PAR (UART_LCR_PE|UART_LCR_PS_STICK0) -#elif defined(HAVE_CONSOLE) +#elif defined(HAVE_SERIAL_CONSOLE) # error "Invalid CONFIG_UARTn_PARITY setting for CONSOLE" #endif @@ -157,7 +157,7 @@ void up_lowputc(char ch) { -#if defined HAVE_UART && defined HAVE_CONSOLE +#if defined HAVE_UART && defined HAVE_SERIAL_CONSOLE /* Wait for the transmitter to be available */ while ((getreg32(CONSOLE_BASE+LPC11_UART_LSR_OFFSET) & UART_LSR_THRE) == 0); @@ -231,7 +231,7 @@ void lpc11_lowsetup(void) /* Configure the console (only) */ -#if defined(HAVE_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) +#if defined(HAVE_SERIAL_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) /* Clear fifos */ diff --git a/arch/arm/src/lpc11xx/lpc11_serial.c b/arch/arm/src/lpc11xx/lpc11_serial.c index 2db88cf11a..3a9809588c 100644 --- a/arch/arm/src/lpc11xx/lpc11_serial.c +++ b/arch/arm/src/lpc11xx/lpc11_serial.c @@ -177,14 +177,14 @@ static uart_dev_t g_uart0port = /* Which UART with be tty0/console and which tty1? tty2? tty3? */ -#ifdef HAVE_CONSOLE +#ifdef HAVE_SERIAL_CONSOLE # if defined(CONFIG_UART0_SERIAL_CONSOLE) # define CONSOLE_DEV g_uart0port /* UART0=console */ # define TTYS0_DEV g_uart0port /* UART0=ttyS0 */ # endif #else /* No console */ # define TTYS0_DEV g_uart0port /* UART0=ttyS0 */ -#endif /*HAVE_CONSOLE*/ +#endif /* HAVE_SERIAL_CONSOLE */ /**************************************************************************** * Inline Functions @@ -990,7 +990,7 @@ void up_serialinit(void) int up_putc(int ch) { -#ifdef HAVE_CONSOLE +#ifdef HAVE_SERIAL_CONSOLE struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; uint32_t ier; up_disableuartint(priv, &ier); @@ -1006,7 +1006,7 @@ int up_putc(int ch) } up_lowputc(ch); -#ifdef HAVE_CONSOLE +#ifdef HAVE_SERIAL_CONSOLE up_restoreuartint(priv, ier); #endif diff --git a/arch/arm/src/lpc11xx/lpc11_serial.h b/arch/arm/src/lpc11xx/lpc11_serial.h index 11b4fd1989..59e6cc36f0 100644 --- a/arch/arm/src/lpc11xx/lpc11_serial.h +++ b/arch/arm/src/lpc11xx/lpc11_serial.h @@ -66,10 +66,10 @@ */ #if defined(CONFIG_UART0_SERIAL_CONSOLE) && defined(CONFIG_LPC11_UART0) -# define HAVE_CONSOLE 1 +# define HAVE_SERIAL_CONSOLE 1 #else # undef CONFIG_UART0_SERIAL_CONSOLE -# undef HAVE_CONSOLE +# undef HAVE_SERIAL_CONSOLE #endif /* We cannot allow the DLM/DLL divisor to become to small or will will lose too diff --git a/arch/arm/src/stm32/stm32_rtcc.c b/arch/arm/src/stm32/stm32_rtcc.c index c9146e62bb..6f2294238c 100644 --- a/arch/arm/src/stm32/stm32_rtcc.c +++ b/arch/arm/src/stm32/stm32_rtcc.c @@ -53,6 +53,7 @@ #include "stm32_rcc.h" #include "stm32_pwr.h" +#include "stm32_exti.h" #include "stm32_rtc.h" #ifdef CONFIG_RTC From 16ecf905c043767ba96e49427847c5323ffb76a0 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 2 Oct 2015 14:13:57 -0600 Subject: [PATCH 09/33] Standardize nameing of the pre-processor definitiongs group header --- arch/arm/src/lpc11xx/chip/lpc111x_pinconfig.h | 2 +- arch/arm/src/lpc11xx/chip/lpc11_memorymap.h | 2 +- arch/arm/src/lpc11xx/chip/lpc11_pinconfig.h | 2 +- arch/arm/src/lpc11xx/lpc11_irq.c | 2 +- arch/arm/src/lpc11xx/lpc11_ssp.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/src/lpc11xx/chip/lpc111x_pinconfig.h b/arch/arm/src/lpc11xx/chip/lpc111x_pinconfig.h index da9b120320..e839aaef29 100644 --- a/arch/arm/src/lpc11xx/chip/lpc111x_pinconfig.h +++ b/arch/arm/src/lpc11xx/chip/lpc111x_pinconfig.h @@ -43,7 +43,7 @@ #include /************************************************************************************ - * Definitions + * Pre-processor Definitions ************************************************************************************/ /* GPIO pin definitions *************************************************************/ /* NOTE that functions have a alternate pins that can be selected. These alternates diff --git a/arch/arm/src/lpc11xx/chip/lpc11_memorymap.h b/arch/arm/src/lpc11xx/chip/lpc11_memorymap.h index 00dd64d7e7..c01a346c26 100644 --- a/arch/arm/src/lpc11xx/chip/lpc11_memorymap.h +++ b/arch/arm/src/lpc11xx/chip/lpc11_memorymap.h @@ -55,7 +55,7 @@ #endif /************************************************************************************ - * Definitions + * Pre-processor Definitions ************************************************************************************/ /************************************************************************************ diff --git a/arch/arm/src/lpc11xx/chip/lpc11_pinconfig.h b/arch/arm/src/lpc11xx/chip/lpc11_pinconfig.h index 48fd69edd3..c53b6b3d37 100644 --- a/arch/arm/src/lpc11xx/chip/lpc11_pinconfig.h +++ b/arch/arm/src/lpc11xx/chip/lpc11_pinconfig.h @@ -55,7 +55,7 @@ #endif /************************************************************************************ - * Definitions + * Pre-processor Definitions ************************************************************************************/ /************************************************************************************ diff --git a/arch/arm/src/lpc11xx/lpc11_irq.c b/arch/arm/src/lpc11xx/lpc11_irq.c index edd22842a9..8fcef88650 100644 --- a/arch/arm/src/lpc11xx/lpc11_irq.c +++ b/arch/arm/src/lpc11xx/lpc11_irq.c @@ -53,7 +53,7 @@ //#include "lpc11_irq.h" /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /* Get a 32-bit version of the default priority */ diff --git a/arch/arm/src/lpc11xx/lpc11_ssp.c b/arch/arm/src/lpc11xx/lpc11_ssp.c index cae1db6630..b41bf8c69a 100644 --- a/arch/arm/src/lpc11xx/lpc11_ssp.c +++ b/arch/arm/src/lpc11xx/lpc11_ssp.c @@ -62,7 +62,7 @@ defined(CONFIG_LPC11_SSP2) /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /* Configuration ************************************************************/ /* This driver does not support the SPI exchange method. */ From 36726b1bc40a952e8b131420e27cb3c8934fd36a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 2 Oct 2015 17:42:29 -0600 Subject: [PATCH 10/33] Standardize the width of all comment boxes in header files --- arch/arm/include/a1x/a10_irq.h | 2 +- arch/arm/include/arch.h | 2 +- arch/arm/include/arm/irq.h | 2 +- arch/arm/include/arm/syscall.h | 2 +- arch/arm/include/armv6-m/irq.h | 2 +- arch/arm/include/armv6-m/syscall.h | 2 +- arch/arm/include/armv7-a/irq.h | 2 +- arch/arm/include/armv7-a/syscall.h | 2 +- arch/arm/include/armv7-m/irq.h | 2 +- arch/arm/include/armv7-m/irq_cmnvector.h | 2 +- arch/arm/include/armv7-m/irq_lazyfpu.h | 2 +- arch/arm/include/armv7-m/syscall.h | 2 +- arch/arm/include/c5471/irq.h | 2 +- arch/arm/include/dm320/irq.h | 2 +- arch/arm/include/imx/irq.h | 2 +- arch/arm/include/irq.h | 2 +- arch/arm/include/lpc11xx/irq.h | 2 +- arch/arm/include/lpc17xx/irq.h | 2 +- arch/arm/include/lpc17xx/lpc176x_irq.h | 2 +- arch/arm/include/lpc17xx/lpc178x_irq.h | 2 +- arch/arm/include/lpc214x/irq.h | 2 +- arch/arm/include/lpc2378/irq.h | 2 +- arch/arm/include/lpc31xx/irq.h | 2 +- arch/arm/include/lpc43xx/irq.h | 2 +- arch/arm/include/moxart/irq.h | 2 +- arch/arm/include/sam34/sam3u_irq.h | 2 +- arch/arm/include/sam34/sam3x_irq.h | 2 +- arch/arm/include/sam34/sam4cm_irq.h | 2 +- arch/arm/include/sam34/sam4e_irq.h | 2 +- arch/arm/include/sam34/sam4l_irq.h | 2 +- arch/arm/include/sam34/sam4s_irq.h | 2 +- arch/arm/include/sama5/sama5d2_irq.h | 2 +- arch/arm/include/sama5/sama5d3_irq.h | 2 +- arch/arm/include/sama5/sama5d4_irq.h | 2 +- arch/arm/include/samdl/samd20_irq.h | 2 +- arch/arm/include/samv7/samv71_irq.h | 2 +- arch/arm/include/syscall.h | 2 +- arch/arm/include/types.h | 2 +- arch/arm/src/a1x/a1x_boot.c | 2 +- arch/arm/src/a1x/a1x_lowputc.c | 46 ++++++------ arch/arm/src/a1x/a1x_pio.c | 2 +- arch/arm/src/a1x/a1x_timerisr.c | 2 +- arch/arm/src/arm/arm.h | 2 +- arch/arm/src/arm/up_fullcontextrestore.S | 2 +- arch/arm/src/arm/up_saveusercontext.S | 2 +- arch/arm/src/arm/up_vectoraddrexcptn.S | 2 +- arch/arm/src/arm/up_vectors.S | 2 +- arch/arm/src/arm/up_vectortab.S | 2 +- arch/arm/src/arm/vfork.S | 2 +- arch/arm/src/armv6-m/up_exception.S | 2 +- arch/arm/src/armv6-m/up_fullcontextrestore.S | 2 +- arch/arm/src/armv6-m/up_saveusercontext.S | 2 +- arch/arm/src/armv6-m/up_switchcontext.S | 2 +- arch/arm/src/armv6-m/vfork.S | 2 +- arch/arm/src/armv7-a/addrenv.h | 2 +- arch/arm/src/armv7-a/arm.h | 2 +- arch/arm/src/armv7-a/arm_l2cc_pl310.c | 56 +++++++------- arch/arm/src/armv7-a/arm_memcpy.S | 2 +- arch/arm/src/armv7-a/arm_restorefpu.S | 2 +- arch/arm/src/armv7-a/arm_savefpu.S | 2 +- arch/arm/src/armv7-a/arm_vectortab.S | 2 +- arch/arm/src/armv7-a/cache.h | 2 +- arch/arm/src/armv7-a/cp15_cacheops.h | 2 +- arch/arm/src/armv7-a/fpu.h | 2 +- arch/arm/src/armv7-a/l2cc.h | 2 +- arch/arm/src/armv7-a/mmu.h | 2 +- arch/arm/src/armv7-a/sctlr.h | 2 +- arch/arm/src/armv7-m/cache.h | 2 +- arch/arm/src/armv7-m/mpu.h | 2 +- arch/arm/src/armv7-m/up_exception.S | 2 +- arch/arm/src/armv7-m/up_fpu.S | 2 +- arch/arm/src/armv7-m/up_fullcontextrestore.S | 2 +- arch/arm/src/armv7-m/up_lazyexception.S | 2 +- arch/arm/src/armv7-m/up_memcpy.S | 2 +- arch/arm/src/armv7-m/up_ramvec_attach.c | 2 +- arch/arm/src/armv7-m/up_ramvec_initialize.c | 2 +- arch/arm/src/armv7-m/up_saveusercontext.S | 2 +- arch/arm/src/armv7-m/up_switchcontext.S | 2 +- arch/arm/src/armv7-m/vfork.S | 2 +- arch/arm/src/c5471/c5471_lowputc.S | 2 +- arch/arm/src/c5471/c5471_timerisr.c | 34 ++++----- arch/arm/src/c5471/c5471_vectors.S | 2 +- arch/arm/src/c5471/c5471_watchdog.c | 72 +++++++++--------- arch/arm/src/calypso/calypso_irq.c | 2 +- arch/arm/src/calypso/calypso_lowputc.S | 2 +- arch/arm/src/calypso/calypso_timer.c | 20 ++--- arch/arm/src/calypso/calypso_uwire.c | 2 +- arch/arm/src/calypso/clock.c | 2 +- arch/arm/src/common/up_checkstack.c | 2 +- arch/arm/src/common/up_createstack.c | 2 +- arch/arm/src/common/up_internal.h | 2 +- arch/arm/src/common/up_interruptcontext.c | 2 +- arch/arm/src/common/up_releasestack.c | 2 +- arch/arm/src/common/up_stackframe.c | 2 +- arch/arm/src/common/up_usestack.c | 2 +- arch/arm/src/dm320/dm320_allocateheap.c | 28 +++---- arch/arm/src/dm320/dm320_boot.c | 2 +- arch/arm/src/dm320/dm320_framebuffer.c | 6 +- arch/arm/src/dm320/dm320_irq.c | 44 +++++------ arch/arm/src/dm320/dm320_lowputc.S | 2 +- arch/arm/src/dm320/dm320_timerisr.c | 2 +- arch/arm/src/efm32/efm32_adc.c | 2 +- arch/arm/src/efm32/efm32_spi.c | 4 +- arch/arm/src/efm32/efm32_timerisr.c | 2 +- arch/arm/src/efm32/efm32_vectors.S | 2 +- arch/arm/src/imx/imx_boot.c | 2 +- arch/arm/src/imx/imx_lowputc.S | 2 +- arch/arm/src/imx/imx_spi.c | 2 +- arch/arm/src/imx/imx_timerisr.c | 2 +- arch/arm/src/kinetis/kinetis_lowputc.c | 46 ++++++------ arch/arm/src/kinetis/kinetis_timerisr.c | 2 +- arch/arm/src/kinetis/kinetis_vectors.S | 2 +- arch/arm/src/kl/kl_lowgetc.c | 42 +++++------ arch/arm/src/kl/kl_lowputc.c | 46 ++++++------ arch/arm/src/kl/kl_spi.c | 2 +- arch/arm/src/kl/kl_timerisr.c | 2 +- arch/arm/src/lpc11xx/lpc11_gpio.c | 2 +- arch/arm/src/lpc11xx/lpc11_gpiodbg.c | 2 +- arch/arm/src/lpc11xx/lpc11_gpioint.c | 2 +- arch/arm/src/lpc11xx/lpc11_lowgetc.c | 42 +++++------ arch/arm/src/lpc11xx/lpc11_lowputc.c | 50 ++++++------- arch/arm/src/lpc11xx/lpc11_spi.c | 2 +- arch/arm/src/lpc11xx/lpc11_ssp.c | 4 +- arch/arm/src/lpc11xx/lpc11_timerisr.c | 2 +- arch/arm/src/lpc17xx/lpc176x_gpio.c | 2 +- arch/arm/src/lpc17xx/lpc178x_gpio.c | 2 +- arch/arm/src/lpc17xx/lpc17_allocateheap.c | 4 +- arch/arm/src/lpc17xx/lpc17_gpio.c | 2 +- arch/arm/src/lpc17xx/lpc17_gpiodbg.c | 2 +- arch/arm/src/lpc17xx/lpc17_gpioint.c | 2 +- arch/arm/src/lpc17xx/lpc17_lcd.c | 2 +- arch/arm/src/lpc17xx/lpc17_lowputc.c | 46 ++++++------ arch/arm/src/lpc17xx/lpc17_spi.c | 2 +- arch/arm/src/lpc17xx/lpc17_ssp.c | 4 +- arch/arm/src/lpc17xx/lpc17_timerisr.c | 2 +- arch/arm/src/lpc17xx/lpc17_vectors.S | 2 +- arch/arm/src/lpc214x/chip.h | 2 +- arch/arm/src/lpc214x/lpc214x_lowputc.S | 2 +- arch/arm/src/lpc214x/lpc214x_pll.h | 2 +- arch/arm/src/lpc214x/lpc214x_timerisr.c | 2 +- arch/arm/src/lpc214x/lpc214x_uart.h | 2 +- arch/arm/src/lpc2378/chip.h | 2 +- arch/arm/src/lpc2378/internal.h | 2 +- arch/arm/src/lpc2378/lpc23xx_io.c | 14 ++-- arch/arm/src/lpc2378/lpc23xx_irq.c | 16 ++-- arch/arm/src/lpc2378/lpc23xx_lowputc.S | 2 +- arch/arm/src/lpc2378/lpc23xx_pllsetup.c | 8 +- arch/arm/src/lpc2378/lpc23xx_scb.h | 2 +- arch/arm/src/lpc2378/lpc23xx_spi.c | 2 +- arch/arm/src/lpc2378/lpc23xx_timerisr.c | 2 +- arch/arm/src/lpc2378/lpc23xx_uart.h | 2 +- arch/arm/src/lpc31xx/lpc31_allocateheap.c | 32 ++++---- arch/arm/src/lpc31xx/lpc31_bcrndx.c | 28 +++---- arch/arm/src/lpc31xx/lpc31_boot.c | 2 +- arch/arm/src/lpc31xx/lpc31_clkdomain.c | 28 +++---- arch/arm/src/lpc31xx/lpc31_clkfreq.c | 28 +++---- arch/arm/src/lpc31xx/lpc31_ehci.c | 2 +- arch/arm/src/lpc31xx/lpc31_esrndx.c | 28 +++---- arch/arm/src/lpc31xx/lpc31_fdcndx.c | 28 +++---- arch/arm/src/lpc31xx/lpc31_pllconfig.c | 8 +- arch/arm/src/lpc31xx/lpc31_softreset.c | 28 +++---- arch/arm/src/lpc31xx/lpc31_spi.c | 4 +- arch/arm/src/lpc31xx/lpc31_timerisr.c | 2 +- arch/arm/src/lpc43xx/lpc43_allocateheap.c | 4 +- arch/arm/src/lpc43xx/lpc43_ehci.c | 2 +- arch/arm/src/lpc43xx/lpc43_spi.c | 2 +- arch/arm/src/lpc43xx/lpc43_ssp.c | 4 +- arch/arm/src/lpc43xx/lpc43_timerisr.c | 2 +- arch/arm/src/lpc43xx/lpc43_uart.c | 46 ++++++------ arch/arm/src/moxart/moxart_irq.c | 6 +- arch/arm/src/moxart/moxart_lowputc.S | 2 +- arch/arm/src/nuc1xx/nuc_timerisr.c | 2 +- arch/arm/src/sam34/sam4cm_supc.c | 2 +- arch/arm/src/sam34/sam4l_clockconfig.c | 2 +- arch/arm/src/sam34/sam4l_gpio.c | 2 +- arch/arm/src/sam34/sam4l_periphclks.c | 2 +- arch/arm/src/sam34/sam_aes.c | 0 arch/arm/src/sam34/sam_allocateheap.c | 4 +- arch/arm/src/sam34/sam_gpio.c | 2 +- arch/arm/src/sam34/sam_lowputc.c | 46 ++++++------ arch/arm/src/sam34/sam_spi.c | 2 +- arch/arm/src/sam34/sam_timerisr.c | 2 +- arch/arm/src/sam34/sam_vectors.S | 2 +- arch/arm/src/sama5/sam_ehci.c | 2 +- arch/arm/src/sama5/sam_lcd.c | 2 +- arch/arm/src/sama5/sam_lowputc.c | 24 +++--- arch/arm/src/sama5/sam_spi.c | 2 +- arch/arm/src/sama5/sam_timerisr.c | 2 +- arch/arm/src/sama5/sam_usbhost.c | 2 +- arch/arm/src/sama5/sama5d2x_pio.c | 2 +- arch/arm/src/sama5/sama5d3x4x_pio.c | 2 +- arch/arm/src/samdl/sam_spi.c | 2 +- arch/arm/src/samdl/sam_timerisr.c | 2 +- arch/arm/src/samv7/sam_allocateheap.c | 4 +- arch/arm/src/samv7/sam_gpio.c | 2 +- arch/arm/src/samv7/sam_lowputc.c | 46 ++++++------ arch/arm/src/samv7/sam_mcan.c | 2 +- arch/arm/src/samv7/sam_spi.c | 2 +- arch/arm/src/samv7/sam_timerisr.c | 2 +- arch/arm/src/stm32/stm32_bbsram.c | 2 +- arch/arm/src/stm32/stm32_lowputc.c | 46 ++++++------ arch/arm/src/stm32/stm32_procfs_ccm.c | 2 +- arch/arm/src/stm32/stm32_spi.c | 4 +- arch/arm/src/stm32/stm32_timerisr.c | 2 +- arch/arm/src/stm32/stm32_usbhost.c | 2 +- arch/arm/src/stm32/stm32_vectors.S | 2 +- arch/arm/src/stm32f7/stm32_lowputc.c | 46 ++++++------ arch/arm/src/stm32f7/stm32_procfs_dtcm.c | 2 +- arch/arm/src/stm32f7/stm32_timerisr.c | 2 +- arch/arm/src/str71x/str71x_lowputc.c | 46 ++++++------ arch/arm/src/str71x/str71x_timerisr.c | 2 +- arch/arm/src/tiva/tiva_dumpgpio.c | 2 +- arch/arm/src/tiva/tiva_lowputc.c | 46 ++++++------ arch/arm/src/tiva/tiva_ssi.c | 2 +- arch/arm/src/tiva/tiva_timerisr.c | 2 +- arch/arm/src/tiva/tiva_vectors.S | 2 +- arch/avr/include/arch.h | 2 +- arch/avr/include/at32uc3/irq.h | 2 +- arch/avr/include/at90usb/irq.h | 2 +- arch/avr/include/atmega/irq.h | 2 +- arch/avr/include/avr/irq.h | 2 +- arch/avr/include/avr/syscall.h | 2 +- arch/avr/include/avr32/irq.h | 2 +- arch/avr/include/avr32/syscall.h | 2 +- arch/avr/include/irq.h | 2 +- arch/avr/include/syscall.h | 2 +- arch/avr/include/xmega/chip.h | 2 +- arch/avr/include/xmega/irq.h | 2 +- arch/avr/include/xmega/xmegac_irq.h | 2 +- arch/avr/src/at32uc3/at32uc3_clkinit.c | 78 ++++++++++---------- arch/avr/src/at32uc3/at32uc3_gpio.c | 38 +++++----- arch/avr/src/at32uc3/at32uc3_lowconsole.c | 2 +- arch/avr/src/at32uc3/at32uc3_lowinit.c | 42 +++++------ arch/avr/src/at32uc3/at32uc3_timerisr.c | 2 +- arch/avr/src/at90usb/at90usb_lowconsole.c | 2 +- arch/avr/src/at90usb/at90usb_lowinit.c | 46 ++++++------ arch/avr/src/at90usb/at90usb_timerisr.c | 2 +- arch/avr/src/atmega/atmega_lowconsole.c | 2 +- arch/avr/src/atmega/atmega_lowinit.c | 46 ++++++------ arch/avr/src/atmega/atmega_timerisr.c | 2 +- arch/avr/src/avr/avr_internal.h | 2 +- arch/avr/src/avr/excptmacros.h | 2 +- arch/avr/src/avr/up_createstack.c | 2 +- arch/avr/src/avr/up_spi.c | 2 +- arch/avr/src/avr/up_stackframe.c | 2 +- arch/avr/src/avr/up_switchcontext.S | 2 +- arch/avr/src/avr/up_usestack.c | 2 +- arch/avr/src/avr32/avr32_internal.h | 2 +- arch/avr/src/avr32/up_createstack.c | 2 +- arch/avr/src/avr32/up_stackframe.c | 2 +- arch/avr/src/avr32/up_switchcontext.S | 2 +- arch/avr/src/avr32/up_syscall6.S | 2 +- arch/avr/src/avr32/up_usestack.c | 2 +- arch/avr/src/common/up_internal.h | 2 +- arch/avr/src/common/up_interruptcontext.c | 2 +- arch/avr/src/common/up_releasestack.c | 2 +- arch/hc/include/arch.h | 2 +- arch/hc/include/hc12/types.h | 2 +- arch/hc/include/hcs12/types.h | 2 +- arch/hc/include/irq.h | 2 +- arch/hc/include/syscall.h | 2 +- arch/hc/include/types.h | 2 +- arch/hc/src/common/up_createstack.c | 2 +- arch/hc/src/common/up_internal.h | 2 +- arch/hc/src/common/up_interruptcontext.c | 2 +- arch/hc/src/common/up_releasestack.c | 2 +- arch/hc/src/common/up_stackframe.c | 2 +- arch/hc/src/common/up_usestack.c | 2 +- arch/hc/src/m9s12/m9s12_lowputc.S | 2 +- arch/hc/src/m9s12/m9s12_saveusercontext.S | 2 +- arch/hc/src/m9s12/m9s12_start.S | 2 +- arch/hc/src/m9s12/m9s12_timerisr.c | 2 +- arch/hc/src/m9s12/m9s12_vectors.S | 2 +- arch/mips/include/arch.h | 2 +- arch/mips/include/irq.h | 2 +- arch/mips/include/mips32/irq.h | 2 +- arch/mips/include/mips32/registers.h | 2 +- arch/mips/include/mips32/syscall.h | 2 +- arch/mips/include/pic32mx/irq.h | 2 +- arch/mips/include/pic32mx/irq_1xx2xx.h | 2 +- arch/mips/include/pic32mx/irq_3xx4xx.h | 2 +- arch/mips/include/pic32mx/irq_5xx6xx7xx.h | 2 +- arch/mips/include/pic32mz/irq.h | 2 +- arch/mips/include/pic32mz/irq_pic32mzxxxec.h | 2 +- arch/mips/include/syscall.h | 2 +- arch/mips/src/common/up_createstack.c | 2 +- arch/mips/src/common/up_internal.h | 2 +- arch/mips/src/common/up_interruptcontext.c | 2 +- arch/mips/src/common/up_releasestack.c | 2 +- arch/mips/src/common/up_stackframe.c | 2 +- arch/mips/src/common/up_usestack.c | 2 +- arch/mips/src/mips32/up_syscall0.S | 2 +- arch/mips/src/mips32/vfork.S | 2 +- arch/mips/src/pic32mx/excptmacros.h | 2 +- arch/mips/src/pic32mx/pic32mx-head.S | 4 +- arch/mips/src/pic32mx/pic32mx-lowconsole.c | 2 +- arch/mips/src/pic32mx/pic32mx-lowinit.c | 2 +- arch/mips/src/pic32mx/pic32mx-spi.c | 2 +- arch/mips/src/pic32mx/pic32mx-timerisr.c | 2 +- arch/mips/src/pic32mz/pic32mz-excptmacros.h | 2 +- arch/mips/src/pic32mz/pic32mz-head.S | 4 +- arch/mips/src/pic32mz/pic32mz-lowconsole.c | 2 +- arch/mips/src/pic32mz/pic32mz-lowinit.c | 2 +- arch/mips/src/pic32mz/pic32mz-spi.c | 2 +- arch/mips/src/pic32mz/pic32mz-timerisr.c | 2 +- arch/rgmp/include/types.h | 2 +- arch/sh/include/arch.h | 2 +- arch/sh/include/irq.h | 2 +- arch/sh/include/m16c/types.h | 2 +- arch/sh/include/sh1/types.h | 2 +- arch/sh/include/syscall.h | 2 +- arch/sh/include/types.h | 2 +- arch/sh/src/common/up_createstack.c | 2 +- arch/sh/src/common/up_internal.h | 2 +- arch/sh/src/common/up_interruptcontext.c | 2 +- arch/sh/src/common/up_releasestack.c | 2 +- arch/sh/src/common/up_stackframe.c | 2 +- arch/sh/src/common/up_usestack.c | 2 +- arch/sh/src/m16c/chip.h | 2 +- arch/sh/src/m16c/m16c_lowputc.c | 54 +++++++------- arch/sh/src/m16c/m16c_timer.h | 2 +- arch/sh/src/m16c/m16c_timerisr.c | 2 +- arch/sh/src/m16c/m16c_uart.h | 2 +- arch/sh/src/sh1/sh1_lowputc.c | 50 ++++++------- arch/sh/src/sh1/sh1_saveusercontext.S | 2 +- arch/sh/src/sh1/sh1_timerisr.c | 2 +- arch/sim/include/arch.h | 2 +- arch/sim/include/irq.h | 2 +- arch/sim/include/syscall.h | 2 +- arch/sim/include/types.h | 2 +- arch/sim/src/up_appinit.c | 8 +- arch/sim/src/up_framebuffer.c | 2 +- arch/sim/src/up_head.c | 2 +- arch/sim/src/up_setjmp32.S | 2 +- arch/sim/src/up_setjmp64.S | 2 +- arch/sim/src/up_stackframe.c | 2 +- arch/sim/src/up_x11eventloop.c | 12 +-- arch/sim/src/up_x11framebuffer.c | 26 +++---- arch/x86/include/arch.h | 2 +- arch/x86/include/i486/arch.h | 2 +- arch/x86/include/i486/io.h | 2 +- arch/x86/include/i486/irq.h | 2 +- arch/x86/include/i486/syscall.h | 2 +- arch/x86/include/i486/types.h | 2 +- arch/x86/include/io.h | 2 +- arch/x86/include/irq.h | 2 +- arch/x86/include/qemu/arch.h | 2 +- arch/x86/include/qemu/irq.h | 2 +- arch/x86/include/syscall.h | 2 +- arch/x86/include/types.h | 2 +- arch/x86/src/common/up_internal.h | 2 +- arch/x86/src/common/up_interruptcontext.c | 2 +- arch/x86/src/i486/i486_utils.S | 2 +- arch/x86/src/i486/up_createstack.c | 2 +- arch/x86/src/i486/up_releasestack.c | 2 +- arch/x86/src/i486/up_stackframe.c | 2 +- arch/x86/src/i486/up_syscall6.S | 2 +- arch/x86/src/i486/up_usestack.c | 2 +- arch/x86/src/qemu/qemu_fullcontextrestore.S | 2 +- arch/x86/src/qemu/qemu_head.S | 2 +- arch/x86/src/qemu/qemu_lowputc.c | 4 +- arch/x86/src/qemu/qemu_timerisr.c | 2 +- arch/x86/src/qemu/qemu_vectors.S | 2 +- arch/z16/include/arch.h | 2 +- arch/z16/include/irq.h | 2 +- arch/z16/include/syscall.h | 2 +- arch/z16/include/types.h | 2 +- arch/z16/include/z16f/arch.h | 2 +- arch/z16/include/z16f/chip.h | 2 +- arch/z16/include/z16f/irq.h | 2 +- arch/z16/src/common/up_createstack.c | 2 +- arch/z16/src/common/up_internal.h | 2 +- arch/z16/src/common/up_interruptcontext.c | 2 +- arch/z16/src/common/up_releasestack.c | 2 +- arch/z16/src/common/up_stackframe.c | 2 +- arch/z16/src/common/up_usestack.c | 2 +- arch/z16/src/z16f/z16f_clkinit.c | 32 ++++---- arch/z16/src/z16f/z16f_espi.c | 2 +- arch/z16/src/z16f/z16f_sysexec.c | 30 ++++---- arch/z16/src/z16f/z16f_timerisr.c | 34 ++++----- arch/z80/include/arch.h | 2 +- arch/z80/include/ez80/arch.h | 2 +- arch/z80/include/ez80/io.h | 2 +- arch/z80/include/ez80/irq.h | 2 +- arch/z80/include/ez80/types.h | 2 +- arch/z80/include/io.h | 2 +- arch/z80/include/irq.h | 2 +- arch/z80/include/syscall.h | 2 +- arch/z80/include/types.h | 2 +- arch/z80/include/z180/arch.h | 2 +- arch/z80/include/z180/chip.h | 2 +- arch/z80/include/z180/io.h | 2 +- arch/z80/include/z180/irq.h | 2 +- arch/z80/include/z180/types.h | 2 +- arch/z80/include/z8/arch.h | 2 +- arch/z80/include/z8/irq.h | 2 +- arch/z80/include/z8/types.h | 2 +- arch/z80/include/z80/arch.h | 2 +- arch/z80/include/z80/io.h | 2 +- arch/z80/include/z80/irq.h | 2 +- arch/z80/include/z80/types.h | 2 +- arch/z80/src/common/up_createstack.c | 2 +- arch/z80/src/common/up_internal.h | 2 +- arch/z80/src/common/up_interruptcontext.c | 2 +- arch/z80/src/common/up_releasestack.c | 2 +- arch/z80/src/common/up_stackframe.c | 2 +- arch/z80/src/common/up_usestack.c | 2 +- arch/z80/src/ez80/ez80_spi.c | 2 +- arch/z80/src/ez80/ez80_timerisr.c | 32 ++++---- arch/z80/src/ez80/switch.h | 2 +- arch/z80/src/z180/switch.h | 2 +- arch/z80/src/z180/z180_timerisr.c | 2 +- arch/z80/src/z8/switch.h | 2 +- arch/z80/src/z8/z8_timerisr.c | 32 ++++---- arch/z80/src/z80/switch.h | 2 +- 415 files changed, 1246 insertions(+), 1246 deletions(-) mode change 100755 => 100644 arch/arm/src/sam34/sam_aes.c mode change 100755 => 100644 arch/arm/src/samv7/sam_mcan.c diff --git a/arch/arm/include/a1x/a10_irq.h b/arch/arm/include/a1x/a10_irq.h index a5777d2faf..82a4092743 100644 --- a/arch/arm/include/a1x/a10_irq.h +++ b/arch/arm/include/a1x/a10_irq.h @@ -197,7 +197,7 @@ ****************************************************************************************/ /**************************************************************************************** - * Public Variables + * Public Data ****************************************************************************************/ /**************************************************************************************** diff --git a/arch/arm/include/arch.h b/arch/arm/include/arch.h index f4cae2e5b3..186b7cb653 100644 --- a/arch/arm/include/arch.h +++ b/arch/arm/include/arch.h @@ -187,7 +187,7 @@ typedef struct save_addrenv_s save_addrenv_t; #endif /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/arm/irq.h b/arch/arm/include/arm/irq.h index 6edae979e7..e4501accb1 100644 --- a/arch/arm/include/arm/irq.h +++ b/arch/arm/include/arm/irq.h @@ -206,7 +206,7 @@ static inline void irqrestore(irqstate_t flags) #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/arm/syscall.h b/arch/arm/include/arm/syscall.h index 604f90ec9e..18aa53f84e 100644 --- a/arch/arm/include/arm/syscall.h +++ b/arch/arm/include/arm/syscall.h @@ -219,7 +219,7 @@ static inline uintptr_t sys_call6(unsigned int nbr, uintptr_t parm1, } /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/armv6-m/irq.h b/arch/arm/include/armv6-m/irq.h index 185e45d4b5..ca494afb91 100644 --- a/arch/arm/include/armv6-m/irq.h +++ b/arch/arm/include/armv6-m/irq.h @@ -341,7 +341,7 @@ static inline void setcontrol(uint32_t control) #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/armv6-m/syscall.h b/arch/arm/include/armv6-m/syscall.h index 6126ee96fc..de7c2a754b 100644 --- a/arch/arm/include/armv6-m/syscall.h +++ b/arch/arm/include/armv6-m/syscall.h @@ -242,7 +242,7 @@ static inline uintptr_t sys_call6(unsigned int nbr, uintptr_t parm1, } /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/armv7-a/irq.h b/arch/arm/include/armv7-a/irq.h index 5688593ff3..e582ebd008 100644 --- a/arch/arm/include/armv7-a/irq.h +++ b/arch/arm/include/armv7-a/irq.h @@ -387,7 +387,7 @@ static inline void irqrestore(irqstate_t flags) #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/arm/include/armv7-a/syscall.h b/arch/arm/include/armv7-a/syscall.h index 887d271dd8..e3a0ab90eb 100644 --- a/arch/arm/include/armv7-a/syscall.h +++ b/arch/arm/include/armv7-a/syscall.h @@ -219,7 +219,7 @@ static inline uintptr_t sys_call6(unsigned int nbr, uintptr_t parm1, } /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/armv7-m/irq.h b/arch/arm/include/armv7-m/irq.h index e6a1d67e5b..385d24ce63 100644 --- a/arch/arm/include/armv7-m/irq.h +++ b/arch/arm/include/armv7-m/irq.h @@ -357,7 +357,7 @@ static inline void setcontrol(uint32_t control) #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/armv7-m/irq_cmnvector.h b/arch/arm/include/armv7-m/irq_cmnvector.h index 8a577d4919..c07af9e632 100644 --- a/arch/arm/include/armv7-m/irq_cmnvector.h +++ b/arch/arm/include/armv7-m/irq_cmnvector.h @@ -157,7 +157,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/armv7-m/irq_lazyfpu.h b/arch/arm/include/armv7-m/irq_lazyfpu.h index 7d9a792ff6..895d32befb 100644 --- a/arch/arm/include/armv7-m/irq_lazyfpu.h +++ b/arch/arm/include/armv7-m/irq_lazyfpu.h @@ -175,7 +175,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/armv7-m/syscall.h b/arch/arm/include/armv7-m/syscall.h index 4babf663a3..dfef3ec391 100644 --- a/arch/arm/include/armv7-m/syscall.h +++ b/arch/arm/include/armv7-m/syscall.h @@ -242,7 +242,7 @@ static inline uintptr_t sys_call6(unsigned int nbr, uintptr_t parm1, } /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/c5471/irq.h b/arch/arm/include/c5471/irq.h index e147422ad9..f2a79ef0b1 100644 --- a/arch/arm/include/c5471/irq.h +++ b/arch/arm/include/c5471/irq.h @@ -80,7 +80,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/dm320/irq.h b/arch/arm/include/dm320/irq.h index e2c7510754..c48e58d1b7 100644 --- a/arch/arm/include/dm320/irq.h +++ b/arch/arm/include/dm320/irq.h @@ -109,7 +109,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/imx/irq.h b/arch/arm/include/imx/irq.h index 05f4b2443c..15131d4e50 100644 --- a/arch/arm/include/imx/irq.h +++ b/arch/arm/include/imx/irq.h @@ -139,7 +139,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/irq.h b/arch/arm/include/irq.h index 137327f2cd..5f3389bfa2 100644 --- a/arch/arm/include/irq.h +++ b/arch/arm/include/irq.h @@ -80,7 +80,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/lpc11xx/irq.h b/arch/arm/include/lpc11xx/irq.h index 20c4def1d3..22cbf7c048 100644 --- a/arch/arm/include/lpc11xx/irq.h +++ b/arch/arm/include/lpc11xx/irq.h @@ -124,7 +124,7 @@ typedef void (*vic_vector_t)(uint32_t *regs); ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/lpc17xx/irq.h b/arch/arm/include/lpc17xx/irq.h index b78a005bee..6af683225c 100644 --- a/arch/arm/include/lpc17xx/irq.h +++ b/arch/arm/include/lpc17xx/irq.h @@ -99,7 +99,7 @@ typedef void (*vic_vector_t)(uint32_t *regs); ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/lpc17xx/lpc176x_irq.h b/arch/arm/include/lpc17xx/lpc176x_irq.h index 96b7d141a5..248c5c47d6 100644 --- a/arch/arm/include/lpc17xx/lpc176x_irq.h +++ b/arch/arm/include/lpc17xx/lpc176x_irq.h @@ -235,7 +235,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/lpc17xx/lpc178x_irq.h b/arch/arm/include/lpc17xx/lpc178x_irq.h index d8f0459ca9..76c7490452 100644 --- a/arch/arm/include/lpc17xx/lpc178x_irq.h +++ b/arch/arm/include/lpc17xx/lpc178x_irq.h @@ -281,7 +281,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/lpc214x/irq.h b/arch/arm/include/lpc214x/irq.h index eba2a16a2b..a4737c38d4 100644 --- a/arch/arm/include/lpc214x/irq.h +++ b/arch/arm/include/lpc214x/irq.h @@ -100,7 +100,7 @@ typedef void (*vic_vector_t)(uint32_t *regs); ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/lpc2378/irq.h b/arch/arm/include/lpc2378/irq.h index ae15257a9b..18ef58604b 100644 --- a/arch/arm/include/lpc2378/irq.h +++ b/arch/arm/include/lpc2378/irq.h @@ -122,7 +122,7 @@ typedef void (*vic_vector_t)(uint32_t *regs); ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/lpc31xx/irq.h b/arch/arm/include/lpc31xx/irq.h index 20a1c0aad8..c67c5b1274 100644 --- a/arch/arm/include/lpc31xx/irq.h +++ b/arch/arm/include/lpc31xx/irq.h @@ -93,7 +93,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/lpc43xx/irq.h b/arch/arm/include/lpc43xx/irq.h index b544bb6952..9b103e9718 100644 --- a/arch/arm/include/lpc43xx/irq.h +++ b/arch/arm/include/lpc43xx/irq.h @@ -201,7 +201,7 @@ typedef void (*vic_vector_t)(uint32_t *regs); ********************************************************************************************/ /******************************************************************************************** - * Public Variables + * Public Data ********************************************************************************************/ /******************************************************************************************** diff --git a/arch/arm/include/moxart/irq.h b/arch/arm/include/moxart/irq.h index 238d47761e..f9165cbaaa 100644 --- a/arch/arm/include/moxart/irq.h +++ b/arch/arm/include/moxart/irq.h @@ -57,7 +57,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/sam34/sam3u_irq.h b/arch/arm/include/sam34/sam3u_irq.h index 25993c8d2a..8165519c01 100644 --- a/arch/arm/include/sam34/sam3u_irq.h +++ b/arch/arm/include/sam34/sam3u_irq.h @@ -251,7 +251,7 @@ ****************************************************************************************/ /**************************************************************************************** - * Public Variables + * Public Data ****************************************************************************************/ /**************************************************************************************** diff --git a/arch/arm/include/sam34/sam3x_irq.h b/arch/arm/include/sam34/sam3x_irq.h index d23830102d..f9de5513be 100644 --- a/arch/arm/include/sam34/sam3x_irq.h +++ b/arch/arm/include/sam34/sam3x_irq.h @@ -406,7 +406,7 @@ ****************************************************************************************/ /**************************************************************************************** - * Public Variables + * Public Data ****************************************************************************************/ /**************************************************************************************** diff --git a/arch/arm/include/sam34/sam4cm_irq.h b/arch/arm/include/sam34/sam4cm_irq.h index 0498d49d0c..096d735705 100644 --- a/arch/arm/include/sam34/sam4cm_irq.h +++ b/arch/arm/include/sam34/sam4cm_irq.h @@ -280,7 +280,7 @@ ****************************************************************************************/ /**************************************************************************************** - * Public Variables + * Public Data ****************************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/arm/include/sam34/sam4e_irq.h b/arch/arm/include/sam34/sam4e_irq.h index 2a03b2217b..fd86889983 100644 --- a/arch/arm/include/sam34/sam4e_irq.h +++ b/arch/arm/include/sam34/sam4e_irq.h @@ -314,7 +314,7 @@ ****************************************************************************************/ /**************************************************************************************** - * Public Variables + * Public Data ****************************************************************************************/ /**************************************************************************************** diff --git a/arch/arm/include/sam34/sam4l_irq.h b/arch/arm/include/sam34/sam4l_irq.h index 95d9777301..98441ab9da 100644 --- a/arch/arm/include/sam34/sam4l_irq.h +++ b/arch/arm/include/sam34/sam4l_irq.h @@ -312,7 +312,7 @@ ****************************************************************************************/ /**************************************************************************************** - * Public Variables + * Public Data ****************************************************************************************/ /**************************************************************************************** diff --git a/arch/arm/include/sam34/sam4s_irq.h b/arch/arm/include/sam34/sam4s_irq.h index 79c447a925..f46781d0d2 100644 --- a/arch/arm/include/sam34/sam4s_irq.h +++ b/arch/arm/include/sam34/sam4s_irq.h @@ -262,7 +262,7 @@ ****************************************************************************************/ /**************************************************************************************** - * Public Variables + * Public Data ****************************************************************************************/ /**************************************************************************************** diff --git a/arch/arm/include/sama5/sama5d2_irq.h b/arch/arm/include/sama5/sama5d2_irq.h index a50944567d..0776ae0ce3 100644 --- a/arch/arm/include/sama5/sama5d2_irq.h +++ b/arch/arm/include/sama5/sama5d2_irq.h @@ -399,7 +399,7 @@ ****************************************************************************************/ /**************************************************************************************** - * Public Variables + * Public Data ****************************************************************************************/ /**************************************************************************************** diff --git a/arch/arm/include/sama5/sama5d3_irq.h b/arch/arm/include/sama5/sama5d3_irq.h index c198b79ebd..21d3ef573c 100644 --- a/arch/arm/include/sama5/sama5d3_irq.h +++ b/arch/arm/include/sama5/sama5d3_irq.h @@ -371,7 +371,7 @@ ****************************************************************************************/ /**************************************************************************************** - * Public Variables + * Public Data ****************************************************************************************/ /**************************************************************************************** diff --git a/arch/arm/include/sama5/sama5d4_irq.h b/arch/arm/include/sama5/sama5d4_irq.h index c49c7d9333..b27df9afa8 100644 --- a/arch/arm/include/sama5/sama5d4_irq.h +++ b/arch/arm/include/sama5/sama5d4_irq.h @@ -414,7 +414,7 @@ ****************************************************************************************/ /**************************************************************************************** - * Public Variables + * Public Data ****************************************************************************************/ /**************************************************************************************** diff --git a/arch/arm/include/samdl/samd20_irq.h b/arch/arm/include/samdl/samd20_irq.h index 5042655d26..01361e8e00 100644 --- a/arch/arm/include/samdl/samd20_irq.h +++ b/arch/arm/include/samdl/samd20_irq.h @@ -117,7 +117,7 @@ ****************************************************************************************/ /**************************************************************************************** - * Public Variables + * Public Data ****************************************************************************************/ /**************************************************************************************** diff --git a/arch/arm/include/samv7/samv71_irq.h b/arch/arm/include/samv7/samv71_irq.h index 2637da9f0e..67843998cb 100644 --- a/arch/arm/include/samv7/samv71_irq.h +++ b/arch/arm/include/samv7/samv71_irq.h @@ -413,7 +413,7 @@ ****************************************************************************************/ /**************************************************************************************** - * Public Variables + * Public Data ****************************************************************************************/ /**************************************************************************************** diff --git a/arch/arm/include/syscall.h b/arch/arm/include/syscall.h index 4c7ba24889..c8aa0fe43c 100644 --- a/arch/arm/include/syscall.h +++ b/arch/arm/include/syscall.h @@ -70,7 +70,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/include/types.h b/arch/arm/include/types.h index 0cc8a53120..e0fc7c1c1d 100644 --- a/arch/arm/include/types.h +++ b/arch/arm/include/types.h @@ -101,7 +101,7 @@ typedef unsigned int irqstate_t; #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************/ #endif /* __ARCH_ARM_INCLUDE_TYPES_H */ diff --git a/arch/arm/src/a1x/a1x_boot.c b/arch/arm/src/a1x/a1x_boot.c index 9750bf90d9..1105301ab6 100644 --- a/arch/arm/src/a1x/a1x_boot.c +++ b/arch/arm/src/a1x/a1x_boot.c @@ -81,7 +81,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ extern uint32_t _vector_start; /* Beginning of vector block */ diff --git a/arch/arm/src/a1x/a1x_lowputc.c b/arch/arm/src/a1x/a1x_lowputc.c index 743a77bfd0..402204c721 100644 --- a/arch/arm/src/a1x/a1x_lowputc.c +++ b/arch/arm/src/a1x/a1x_lowputc.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/arm/src/a1x/a1x_lowputc.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -51,9 +51,9 @@ #include "chip/a1x_uart.h" #include "a1x_pio.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* Select UART parameters for the selected console */ @@ -166,37 +166,37 @@ #define CONSOLE_DL (A1X_SCLK / (CONSOLE_BAUD << 4)) -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - **************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { @@ -211,7 +211,7 @@ void up_lowputc(char ch) #endif } -/************************************************************************** +/**************************************************************************** * Name: a1x_lowsetup * * Description: @@ -219,7 +219,7 @@ void up_lowputc(char ch) * console. Its purpose is to get the console output available as soon * as possible. * - **************************************************************************/ + ****************************************************************************/ void a1x_lowsetup(void) { diff --git a/arch/arm/src/a1x/a1x_pio.c b/arch/arm/src/a1x/a1x_pio.c index ca454f7bbc..afec6abcb9 100644 --- a/arch/arm/src/a1x/a1x_pio.c +++ b/arch/arm/src/a1x/a1x_pio.c @@ -173,7 +173,7 @@ static int a1x_pio_interrupt(int irq, void *context) #endif /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/a1x/a1x_timerisr.c b/arch/arm/src/a1x/a1x_timerisr.c index a1b123da6e..d4e827b13d 100644 --- a/arch/arm/src/a1x/a1x_timerisr.c +++ b/arch/arm/src/a1x/a1x_timerisr.c @@ -78,7 +78,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/arm/arm.h b/arch/arm/src/arm/arm.h index 4f097f0b62..81fe724be3 100644 --- a/arch/arm/src/arm/arm.h +++ b/arch/arm/src/arm/arm.h @@ -427,7 +427,7 @@ static inline void tlb_data_invalidate_single(unsigned int mva) #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/arm/up_fullcontextrestore.S b/arch/arm/src/arm/up_fullcontextrestore.S index cf23a96b96..b1cdf581af 100644 --- a/arch/arm/src/arm/up_fullcontextrestore.S +++ b/arch/arm/src/arm/up_fullcontextrestore.S @@ -53,7 +53,7 @@ **************************************************************************/ /************************************************************************** - * Global Variables + * Public Data **************************************************************************/ /************************************************************************** diff --git a/arch/arm/src/arm/up_saveusercontext.S b/arch/arm/src/arm/up_saveusercontext.S index 848964aa33..49577d31e3 100644 --- a/arch/arm/src/arm/up_saveusercontext.S +++ b/arch/arm/src/arm/up_saveusercontext.S @@ -53,7 +53,7 @@ **************************************************************************/ /************************************************************************** - * Global Variables + * Public Data **************************************************************************/ /************************************************************************** diff --git a/arch/arm/src/arm/up_vectoraddrexcptn.S b/arch/arm/src/arm/up_vectoraddrexcptn.S index b644b7968d..6348cd626d 100644 --- a/arch/arm/src/arm/up_vectoraddrexcptn.S +++ b/arch/arm/src/arm/up_vectoraddrexcptn.S @@ -46,7 +46,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Data + * Public Data ************************************************************************************/ /************************************************************************************ diff --git a/arch/arm/src/arm/up_vectors.S b/arch/arm/src/arm/up_vectors.S index f099db8a7f..ff3bb56e5c 100644 --- a/arch/arm/src/arm/up_vectors.S +++ b/arch/arm/src/arm/up_vectors.S @@ -48,7 +48,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Data + * Public Data ************************************************************************************/ .data diff --git a/arch/arm/src/arm/up_vectortab.S b/arch/arm/src/arm/up_vectortab.S index 4090608f5a..026180e1d8 100644 --- a/arch/arm/src/arm/up_vectortab.S +++ b/arch/arm/src/arm/up_vectortab.S @@ -44,7 +44,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Data + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/arm/vfork.S b/arch/arm/src/arm/vfork.S index 2f0edac820..161315466f 100644 --- a/arch/arm/src/arm/vfork.S +++ b/arch/arm/src/arm/vfork.S @@ -46,7 +46,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .file "vfork.S" diff --git a/arch/arm/src/armv6-m/up_exception.S b/arch/arm/src/armv6-m/up_exception.S index f4e24cdce7..5a9d5d8a68 100644 --- a/arch/arm/src/armv6-m/up_exception.S +++ b/arch/arm/src/armv6-m/up_exception.S @@ -49,7 +49,7 @@ #include "chip.h" /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .globl exception_common diff --git a/arch/arm/src/armv6-m/up_fullcontextrestore.S b/arch/arm/src/armv6-m/up_fullcontextrestore.S index d7bd704851..048c468749 100644 --- a/arch/arm/src/armv6-m/up_fullcontextrestore.S +++ b/arch/arm/src/armv6-m/up_fullcontextrestore.S @@ -48,7 +48,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .cpu cortex-m0 diff --git a/arch/arm/src/armv6-m/up_saveusercontext.S b/arch/arm/src/armv6-m/up_saveusercontext.S index 7bc14e4c49..bfc9a70ea8 100644 --- a/arch/arm/src/armv6-m/up_saveusercontext.S +++ b/arch/arm/src/armv6-m/up_saveusercontext.S @@ -48,7 +48,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .cpu cortex-m0 diff --git a/arch/arm/src/armv6-m/up_switchcontext.S b/arch/arm/src/armv6-m/up_switchcontext.S index d76f3a80cc..c24f501fc2 100644 --- a/arch/arm/src/armv6-m/up_switchcontext.S +++ b/arch/arm/src/armv6-m/up_switchcontext.S @@ -48,7 +48,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .cpu cortex-m0 diff --git a/arch/arm/src/armv6-m/vfork.S b/arch/arm/src/armv6-m/vfork.S index 5bee4c5e10..20c003d3ea 100644 --- a/arch/arm/src/armv6-m/vfork.S +++ b/arch/arm/src/armv6-m/vfork.S @@ -46,7 +46,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .cpu cortex-m0 diff --git a/arch/arm/src/armv7-a/addrenv.h b/arch/arm/src/armv7-a/addrenv.h index 6112cdae6c..653be5e269 100644 --- a/arch/arm/src/armv7-a/addrenv.h +++ b/arch/arm/src/armv7-a/addrenv.h @@ -72,7 +72,7 @@ #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/arm/src/armv7-a/arm.h b/arch/arm/src/armv7-a/arm.h index dbdb65e0ea..75c683be55 100644 --- a/arch/arm/src/armv7-a/arm.h +++ b/arch/arm/src/armv7-a/arm.h @@ -96,7 +96,7 @@ #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/armv7-a/arm_l2cc_pl310.c b/arch/arm/src/armv7-a/arm_l2cc_pl310.c index 94dfe574cf..960a49ac0e 100644 --- a/arch/arm/src/armv7-a/arm_l2cc_pl310.c +++ b/arch/arm/src/armv7-a/arm_l2cc_pl310.c @@ -38,9 +38,9 @@ * ************************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Included Files - ***************************************************************************/ + ****************************************************************************/ #include @@ -56,9 +56,9 @@ #ifdef CONFIG_ARMV7A_L2CC_PL310 -/*************************************************************************** +/**************************************************************************** * Pre-processor Definitions - ***************************************************************************/ + ****************************************************************************/ /* Configuration ***********************************************************/ /* Number of ways depends on ARM configuration */ @@ -251,11 +251,11 @@ #define dsb(a) __asm__ __volatile__ ("dsb " #a : : : "memory") -/*************************************************************************** +/**************************************************************************** * Private Functions - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Name: pl310_flush_all * * Description: @@ -267,7 +267,7 @@ * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ static void pl310_flush_all(void) { @@ -292,7 +292,7 @@ static void pl310_flush_all(void) * Public Functions ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Name: up_l2ccinitialize * * Description: @@ -306,7 +306,7 @@ static void pl310_flush_all(void) * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void up_l2ccinitialize(void) { @@ -415,7 +415,7 @@ void up_l2ccinitialize(void) PL310_NWAYS, PL310_WAYSIZE, PL310_CACHE_SIZE); } -/*************************************************************************** +/**************************************************************************** * Name: l2cc_enable * * Description: @@ -428,7 +428,7 @@ void up_l2ccinitialize(void) * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_enable(void) { @@ -442,7 +442,7 @@ void l2cc_enable(void) irqrestore(flags); } -/*************************************************************************** +/**************************************************************************** * Name: l2cc_disable * * Description: @@ -454,7 +454,7 @@ void l2cc_enable(void) * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_disable(void) { @@ -472,7 +472,7 @@ void l2cc_disable(void) irqrestore(flags); } -/*************************************************************************** +/**************************************************************************** * Name: l2cc_sync * * Description: @@ -485,7 +485,7 @@ void l2cc_disable(void) * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_sync(void) { @@ -500,7 +500,7 @@ void l2cc_sync(void) irqrestore(flags); } -/*************************************************************************** +/**************************************************************************** * Name: l2cc_invalidate_all * * Description: @@ -512,7 +512,7 @@ void l2cc_sync(void) * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_invalidate_all(void) { @@ -550,7 +550,7 @@ void l2cc_invalidate_all(void) irqrestore(flags); } -/*************************************************************************** +/**************************************************************************** * Name: l2cc_invalidate * * Description: @@ -564,7 +564,7 @@ void l2cc_invalidate_all(void) * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_invalidate(uintptr_t startaddr, uintptr_t endaddr) { @@ -647,7 +647,7 @@ void l2cc_invalidate(uintptr_t startaddr, uintptr_t endaddr) irqrestore(flags); } -/*************************************************************************** +/**************************************************************************** * Name: l2cc_clean_all * * Description: @@ -659,7 +659,7 @@ void l2cc_invalidate(uintptr_t startaddr, uintptr_t endaddr) * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_clean_all(void) { @@ -684,7 +684,7 @@ void l2cc_clean_all(void) irqrestore(flags); } -/*************************************************************************** +/**************************************************************************** * Name: l2cc_clean * * Description: @@ -698,7 +698,7 @@ void l2cc_clean_all(void) * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_clean(uintptr_t startaddr, uintptr_t endaddr) { @@ -765,7 +765,7 @@ void l2cc_clean(uintptr_t startaddr, uintptr_t endaddr) irqrestore(flags); } -/*************************************************************************** +/**************************************************************************** * Name: l2cc_flush_all * * Description: @@ -777,7 +777,7 @@ void l2cc_clean(uintptr_t startaddr, uintptr_t endaddr) * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_flush_all(void) { @@ -790,7 +790,7 @@ void l2cc_flush_all(void) irqrestore(flags); } -/*************************************************************************** +/**************************************************************************** * Name: l2cc_flush * * Description: @@ -804,7 +804,7 @@ void l2cc_flush_all(void) * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_flush(uint32_t startaddr, uint32_t endaddr) { diff --git a/arch/arm/src/armv7-a/arm_memcpy.S b/arch/arm/src/armv7-a/arm_memcpy.S index 713359d09e..f66307a603 100644 --- a/arch/arm/src/armv7-a/arm_memcpy.S +++ b/arch/arm/src/armv7-a/arm_memcpy.S @@ -54,7 +54,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .global memcpy diff --git a/arch/arm/src/armv7-a/arm_restorefpu.S b/arch/arm/src/armv7-a/arm_restorefpu.S index f40b3d4203..6633e6dc51 100644 --- a/arch/arm/src/armv7-a/arm_restorefpu.S +++ b/arch/arm/src/armv7-a/arm_restorefpu.S @@ -50,7 +50,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .globl up_restorefpu diff --git a/arch/arm/src/armv7-a/arm_savefpu.S b/arch/arm/src/armv7-a/arm_savefpu.S index 1ad3bcb034..b753046d9f 100644 --- a/arch/arm/src/armv7-a/arm_savefpu.S +++ b/arch/arm/src/armv7-a/arm_savefpu.S @@ -50,7 +50,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .globl up_savefpu diff --git a/arch/arm/src/armv7-a/arm_vectortab.S b/arch/arm/src/armv7-a/arm_vectortab.S index d7d2c2f87d..5f3c54754b 100644 --- a/arch/arm/src/armv7-a/arm_vectortab.S +++ b/arch/arm/src/armv7-a/arm_vectortab.S @@ -46,7 +46,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Symbols + * Public Symbols ****************************************************************************/ .globl _vector_start diff --git a/arch/arm/src/armv7-a/cache.h b/arch/arm/src/armv7-a/cache.h index 3a122d437c..4f64f9d274 100644 --- a/arch/arm/src/armv7-a/cache.h +++ b/arch/arm/src/armv7-a/cache.h @@ -183,7 +183,7 @@ static inline void arch_flush_dcache(uintptr_t start, uintptr_t end) } /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifdef __cplusplus diff --git a/arch/arm/src/armv7-a/cp15_cacheops.h b/arch/arm/src/armv7-a/cp15_cacheops.h index 9aa1bbbc93..ce38540793 100644 --- a/arch/arm/src/armv7-a/cp15_cacheops.h +++ b/arch/arm/src/armv7-a/cp15_cacheops.h @@ -875,7 +875,7 @@ static inline void cp15_cleaninvalidate_dcacheline(unsigned int setway) #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/arm/src/armv7-a/fpu.h b/arch/arm/src/armv7-a/fpu.h index 354af29f10..075ade1cff 100644 --- a/arch/arm/src/armv7-a/fpu.h +++ b/arch/arm/src/armv7-a/fpu.h @@ -56,7 +56,7 @@ #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/arm/src/armv7-a/l2cc.h b/arch/arm/src/armv7-a/l2cc.h index 1ddb913f66..7dab637653 100644 --- a/arch/arm/src/armv7-a/l2cc.h +++ b/arch/arm/src/armv7-a/l2cc.h @@ -50,7 +50,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/arm/src/armv7-a/mmu.h b/arch/arm/src/armv7-a/mmu.h index 6b7fbfb779..869299c861 100644 --- a/arch/arm/src/armv7-a/mmu.h +++ b/arch/arm/src/armv7-a/mmu.h @@ -1355,7 +1355,7 @@ static inline uint32_t mmu_l2_getentry(uint32_t l2vaddr, uint32_t vaddr) #endif /* __ASSEMBLY__ */ /************************************************************************************ - * Public Variables + * Public Data ************************************************************************************/ /************************************************************************************ diff --git a/arch/arm/src/armv7-a/sctlr.h b/arch/arm/src/armv7-a/sctlr.h index 21441ef050..41c4700678 100644 --- a/arch/arm/src/armv7-a/sctlr.h +++ b/arch/arm/src/armv7-a/sctlr.h @@ -344,7 +344,7 @@ static inline void cp15_wrvbar(unsigned int sctlr) #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/armv7-m/cache.h b/arch/arm/src/armv7-m/cache.h index 16fc0bdf2a..7dd1059f79 100644 --- a/arch/arm/src/armv7-m/cache.h +++ b/arch/arm/src/armv7-m/cache.h @@ -237,7 +237,7 @@ static inline void arch_dcache_writethrough(void) #endif /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifdef __cplusplus diff --git a/arch/arm/src/armv7-m/mpu.h b/arch/arm/src/armv7-m/mpu.h index 747e62eaf0..3726ee5764 100644 --- a/arch/arm/src/armv7-m/mpu.h +++ b/arch/arm/src/armv7-m/mpu.h @@ -129,7 +129,7 @@ # define MPU_RASR_XN (1 << 28) /* Bit 28: Instruction access disable */ /************************************************************************************ - * Global Function Prototypes + * Public Function Prototypes ************************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/arm/src/armv7-m/up_exception.S b/arch/arm/src/armv7-m/up_exception.S index 07eca63b64..1682e70e17 100644 --- a/arch/arm/src/armv7-m/up_exception.S +++ b/arch/arm/src/armv7-m/up_exception.S @@ -80,7 +80,7 @@ #endif /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .globl exception_common diff --git a/arch/arm/src/armv7-m/up_fpu.S b/arch/arm/src/armv7-m/up_fpu.S index e2bb424cc2..c75b27c3b6 100644 --- a/arch/arm/src/armv7-m/up_fpu.S +++ b/arch/arm/src/armv7-m/up_fpu.S @@ -53,7 +53,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .globl up_savefpu diff --git a/arch/arm/src/armv7-m/up_fullcontextrestore.S b/arch/arm/src/armv7-m/up_fullcontextrestore.S index 01f8f68482..46d482248d 100644 --- a/arch/arm/src/armv7-m/up_fullcontextrestore.S +++ b/arch/arm/src/armv7-m/up_fullcontextrestore.S @@ -48,7 +48,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .syntax unified diff --git a/arch/arm/src/armv7-m/up_lazyexception.S b/arch/arm/src/armv7-m/up_lazyexception.S index 0832062832..c6c837356a 100644 --- a/arch/arm/src/armv7-m/up_lazyexception.S +++ b/arch/arm/src/armv7-m/up_lazyexception.S @@ -77,7 +77,7 @@ #endif /************************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************************/ .globl exception_common diff --git a/arch/arm/src/armv7-m/up_memcpy.S b/arch/arm/src/armv7-m/up_memcpy.S index 84877b0400..4144455081 100644 --- a/arch/arm/src/armv7-m/up_memcpy.S +++ b/arch/arm/src/armv7-m/up_memcpy.S @@ -53,7 +53,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .global memcpy diff --git a/arch/arm/src/armv7-m/up_ramvec_attach.c b/arch/arm/src/armv7-m/up_ramvec_attach.c index 13db264929..44ca535692 100644 --- a/arch/arm/src/armv7-m/up_ramvec_attach.c +++ b/arch/arm/src/armv7-m/up_ramvec_attach.c @@ -71,7 +71,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/armv7-m/up_ramvec_initialize.c b/arch/arm/src/armv7-m/up_ramvec_initialize.c index 3733277685..56989441ee 100644 --- a/arch/arm/src/armv7-m/up_ramvec_initialize.c +++ b/arch/arm/src/armv7-m/up_ramvec_initialize.c @@ -90,7 +90,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Variables + * Public Data ****************************************************************************/ /* If CONFIG_ARCH_RAMVECTORS is defined, then the ARM logic must provide diff --git a/arch/arm/src/armv7-m/up_saveusercontext.S b/arch/arm/src/armv7-m/up_saveusercontext.S index d3136d507f..72f1526ea1 100644 --- a/arch/arm/src/armv7-m/up_saveusercontext.S +++ b/arch/arm/src/armv7-m/up_saveusercontext.S @@ -48,7 +48,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .syntax unified diff --git a/arch/arm/src/armv7-m/up_switchcontext.S b/arch/arm/src/armv7-m/up_switchcontext.S index cd01ca05e4..9e51652356 100644 --- a/arch/arm/src/armv7-m/up_switchcontext.S +++ b/arch/arm/src/armv7-m/up_switchcontext.S @@ -48,7 +48,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .syntax unified diff --git a/arch/arm/src/armv7-m/vfork.S b/arch/arm/src/armv7-m/vfork.S index c6a0f2401b..a0d0c15502 100644 --- a/arch/arm/src/armv7-m/vfork.S +++ b/arch/arm/src/armv7-m/vfork.S @@ -46,7 +46,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .syntax unified diff --git a/arch/arm/src/c5471/c5471_lowputc.S b/arch/arm/src/c5471/c5471_lowputc.S index d792606c4b..0c2af49e16 100644 --- a/arch/arm/src/c5471/c5471_lowputc.S +++ b/arch/arm/src/c5471/c5471_lowputc.S @@ -56,7 +56,7 @@ **************************************************************************/ /************************************************************************** - * Global Variables + * Public Data **************************************************************************/ /************************************************************************** diff --git a/arch/arm/src/c5471/c5471_timerisr.c b/arch/arm/src/c5471/c5471_timerisr.c index d253ee1436..065a15728b 100644 --- a/arch/arm/src/c5471/c5471_timerisr.c +++ b/arch/arm/src/c5471/c5471_timerisr.c @@ -1,4 +1,4 @@ -/************************************************************ +/**************************************************************************** * c5471/c5471_timerisr.c * * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Included Files - ************************************************************/ + ****************************************************************************/ #include @@ -48,9 +48,9 @@ #include "clock/clock.h" #include "up_internal.h" -/************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************/ + ****************************************************************************/ /* We want the general purpose timer running at the rate * USEC_PER_TICK. The C5471 clock is 47.5MHz and we're using @@ -69,26 +69,26 @@ #define ST 0x00000008 #define PTV 0x00000003 -/************************************************************ +/**************************************************************************** * Private Types - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Private Function Prototypes - ************************************************************/ + ****************************************************************************/ -/************************************************************ - * Global Functions - ************************************************************/ +/**************************************************************************** + * Public Functions + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Function: up_timerisr * * Description: * The timer ISR will perform a variety of services for * various portions of the systems. * - ************************************************************/ + ****************************************************************************/ int up_timerisr(int irq, uint32_t *regs) { @@ -98,14 +98,14 @@ int up_timerisr(int irq, uint32_t *regs) return 0; } -/************************************************************ +/**************************************************************************** * Function: up_timer_initialize * * Description: * This function is called during start-up to initialize * the timer interrupt. * - ************************************************************/ + ****************************************************************************/ void up_timer_initialize(void) { diff --git a/arch/arm/src/c5471/c5471_vectors.S b/arch/arm/src/c5471/c5471_vectors.S index 8fe398caa4..443e12cad7 100644 --- a/arch/arm/src/c5471/c5471_vectors.S +++ b/arch/arm/src/c5471/c5471_vectors.S @@ -49,7 +49,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Data + * Public Data ************************************************************************************/ .data diff --git a/arch/arm/src/c5471/c5471_watchdog.c b/arch/arm/src/c5471/c5471_watchdog.c index 979fc55529..c76a0dd4a9 100644 --- a/arch/arm/src/c5471/c5471_watchdog.c +++ b/arch/arm/src/c5471/c5471_watchdog.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/arm/src/c5471/c5471_watchdog.c * * Copyright (C) 2007, 2009, 2012-2014 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -54,9 +54,9 @@ #include "chip.h" #include "up_arch.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ #undef CONFIG_SOFTWARE_TEST #undef CONFIG_SOFTWARE_REBOOT @@ -82,13 +82,13 @@ #define c5471_wdt_cntl (*(volatile uint32_t*)C5471_TIMER0_CTRL) #define c5471_wdt_count (*(volatile uint32_t*)C5471_TIMER0_CNT) -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ /* Local implementation of timer interface */ @@ -103,9 +103,9 @@ static ssize_t wdt_read(struct file *filep, char *buffer, size_t buflen); static ssize_t wdt_write(struct file *filep, const char *buffer, size_t buflen); static int wdt_ioctl(FAR struct file *filep, int cmd, unsigned long arg); -/************************************************************************** +/**************************************************************************** * Private Data - **************************************************************************/ + ****************************************************************************/ static bool g_wdtopen; @@ -118,13 +118,13 @@ static const struct file_operations g_wdtops = .ioctl = wdt_ioctl, }; -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: wdt_prescaletoptv - **************************************************************************/ + ****************************************************************************/ static inline unsigned int wdt_prescaletoptv(unsigned int prescale) { @@ -159,9 +159,9 @@ static inline unsigned int wdt_prescaletoptv(unsigned int prescale) return ptv; } -/************************************************************************** +/**************************************************************************** * Name: wdt_setusec - **************************************************************************/ + ****************************************************************************/ static int wdt_setusec(uint32_t usec) { @@ -224,13 +224,13 @@ static int wdt_setusec(uint32_t usec) return 0; } -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: wdt_interrupt - **************************************************************************/ + ****************************************************************************/ static int wdt_interrupt(int irq, void *context) { @@ -249,9 +249,9 @@ static int wdt_interrupt(int irq, void *context) return OK; } -/************************************************************************** +/**************************************************************************** * Name: wdt_read - **************************************************************************/ + ****************************************************************************/ static ssize_t wdt_read(struct file *filep, char *buffer, size_t buflen) { @@ -268,9 +268,9 @@ static ssize_t wdt_read(struct file *filep, char *buffer, size_t buflen) return 0; } -/************************************************************************** +/**************************************************************************** * Name: wdt_write - **************************************************************************/ + ****************************************************************************/ static ssize_t wdt_write(struct file *filep, const char *buffer, size_t buflen) { @@ -286,9 +286,9 @@ static ssize_t wdt_write(struct file *filep, const char *buffer, size_t buflen) return 0; } -/************************************************************************** +/**************************************************************************** * Name: wdt_ioctl - **************************************************************************/ + ****************************************************************************/ static int wdt_ioctl(FAR struct file *filep, int cmd, unsigned long arg) { @@ -309,9 +309,9 @@ static int wdt_ioctl(FAR struct file *filep, int cmd, unsigned long arg) return OK; } -/************************************************************************** +/**************************************************************************** * Name: wdt_open - **************************************************************************/ + ****************************************************************************/ static int wdt_open(struct file *filep) { @@ -333,9 +333,9 @@ static int wdt_open(struct file *filep) return OK; } -/************************************************************************** +/**************************************************************************** * Name: wdt_close - **************************************************************************/ + ****************************************************************************/ static int wdt_close(struct file *filep) { @@ -355,13 +355,13 @@ static int wdt_close(struct file *filep) return 0; } -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_wdtinit - **************************************************************************/ + ****************************************************************************/ int up_wdtinit(void) { diff --git a/arch/arm/src/calypso/calypso_irq.c b/arch/arm/src/calypso/calypso_irq.c index 6b1af5623d..2dd811f3a9 100644 --- a/arch/arm/src/calypso/calypso_irq.c +++ b/arch/arm/src/calypso/calypso_irq.c @@ -35,7 +35,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Included Files diff --git a/arch/arm/src/calypso/calypso_lowputc.S b/arch/arm/src/calypso/calypso_lowputc.S index 77bbafd994..1a6e5e8391 100644 --- a/arch/arm/src/calypso/calypso_lowputc.S +++ b/arch/arm/src/calypso/calypso_lowputc.S @@ -60,7 +60,7 @@ **************************************************************************/ /************************************************************************** - * Global Variables + * Public Data **************************************************************************/ /************************************************************************** diff --git a/arch/arm/src/calypso/calypso_timer.c b/arch/arm/src/calypso/calypso_timer.c index e1a2fcdf46..86c98b8aa6 100644 --- a/arch/arm/src/calypso/calypso_timer.c +++ b/arch/arm/src/calypso/calypso_timer.c @@ -35,7 +35,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ #include #include @@ -109,9 +109,9 @@ uint16_t hwtimer_read(int num) return getreg16(TIMER_REG(num, READ_TIMER)); } -/************************************************************ +/**************************************************************************** * Watchdog Timer - ************************************************************/ + ****************************************************************************/ #define BASE_ADDR_WDOG 0xfffff800 #define WDOG_REG(m) (BASE_ADDR_WDOG + m) @@ -161,18 +161,18 @@ void wdog_reset(void) putreg16(0x0000, WDOG_REG(WD_LOAD_TIMER)); } -/************************************************************ - * Global Functions - ************************************************************/ +/**************************************************************************** + * Public Functions + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Function: up_timerisr * * Description: * The timer ISR will perform a variety of services for * various portions of the systems. * - ************************************************************/ + ****************************************************************************/ int up_timerisr(int irq, uint32_t *regs) { @@ -182,7 +182,7 @@ int up_timerisr(int irq, uint32_t *regs) return 0; } -/************************************************************ +/**************************************************************************** * Function: up_timer_initialize * * Description: @@ -191,7 +191,7 @@ int up_timerisr(int irq, uint32_t *regs) * This function is called during start-up to initialize * the timer interrupt. * - ************************************************************/ + ****************************************************************************/ void up_timer_initialize(void) { diff --git a/arch/arm/src/calypso/calypso_uwire.c b/arch/arm/src/calypso/calypso_uwire.c index 234cd07e22..eaf62db986 100644 --- a/arch/arm/src/calypso/calypso_uwire.c +++ b/arch/arm/src/calypso/calypso_uwire.c @@ -34,7 +34,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Included Files diff --git a/arch/arm/src/calypso/clock.c b/arch/arm/src/calypso/clock.c index 3c753cd863..497300e287 100644 --- a/arch/arm/src/calypso/clock.c +++ b/arch/arm/src/calypso/clock.c @@ -34,7 +34,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ #include diff --git a/arch/arm/src/common/up_checkstack.c b/arch/arm/src/common/up_checkstack.c index 97a5695e2f..03cea836d3 100644 --- a/arch/arm/src/common/up_checkstack.c +++ b/arch/arm/src/common/up_checkstack.c @@ -149,7 +149,7 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size) } /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/common/up_createstack.c b/arch/arm/src/common/up_createstack.c index 460e1b235d..0903269f8d 100644 --- a/arch/arm/src/common/up_createstack.c +++ b/arch/arm/src/common/up_createstack.c @@ -95,7 +95,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/common/up_internal.h b/arch/arm/src/common/up_internal.h index 6523f57d30..1be4793247 100644 --- a/arch/arm/src/common/up_internal.h +++ b/arch/arm/src/common/up_internal.h @@ -189,7 +189,7 @@ typedef void (*up_vector_t)(void); #endif /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/arm/src/common/up_interruptcontext.c b/arch/arm/src/common/up_interruptcontext.c index 0039692bcd..c7c7b20490 100644 --- a/arch/arm/src/common/up_interruptcontext.c +++ b/arch/arm/src/common/up_interruptcontext.c @@ -54,7 +54,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/common/up_releasestack.c b/arch/arm/src/common/up_releasestack.c index d7abec71ac..052f404dcc 100644 --- a/arch/arm/src/common/up_releasestack.c +++ b/arch/arm/src/common/up_releasestack.c @@ -67,7 +67,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/common/up_stackframe.c b/arch/arm/src/common/up_stackframe.c index 086d6cadc0..b5712b2a29 100644 --- a/arch/arm/src/common/up_stackframe.c +++ b/arch/arm/src/common/up_stackframe.c @@ -85,7 +85,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/common/up_usestack.c b/arch/arm/src/common/up_usestack.c index a45ec99b57..fe0b483919 100644 --- a/arch/arm/src/common/up_usestack.c +++ b/arch/arm/src/common/up_usestack.c @@ -85,7 +85,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/dm320/dm320_allocateheap.c b/arch/arm/src/dm320/dm320_allocateheap.c index 346e99ca7c..dc33b76e56 100644 --- a/arch/arm/src/dm320/dm320_allocateheap.c +++ b/arch/arm/src/dm320/dm320_allocateheap.c @@ -1,4 +1,4 @@ -/************************************************************ +/**************************************************************************** * dm320/dm320_allocateheap.c * * Copyright (C) 2007, 2013, 2015 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Included Files - ************************************************************/ + ****************************************************************************/ #include #include @@ -49,23 +49,23 @@ #include "up_arch.h" #include "up_internal.h" -/************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Private Data - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Private Functions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Public Functions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Name: up_allocate_heap * * Description: @@ -81,7 +81,7 @@ * heap must be allocated (and protected) by an analogous * up_allocate_kheap(). * - ************************************************************/ + ****************************************************************************/ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) { diff --git a/arch/arm/src/dm320/dm320_boot.c b/arch/arm/src/dm320/dm320_boot.c index 2d6db7d0cb..8e676fa88b 100644 --- a/arch/arm/src/dm320/dm320_boot.c +++ b/arch/arm/src/dm320/dm320_boot.c @@ -60,7 +60,7 @@ struct section_mapping_s }; /************************************************************************************ - * Public Variables + * Public Data ************************************************************************************/ extern uint32_t _vector_start; /* Beginning of vector block */ diff --git a/arch/arm/src/dm320/dm320_framebuffer.c b/arch/arm/src/dm320/dm320_framebuffer.c index 3fb6a6271e..9e8c9dc752 100644 --- a/arch/arm/src/dm320/dm320_framebuffer.c +++ b/arch/arm/src/dm320/dm320_framebuffer.c @@ -53,9 +53,9 @@ #include "dm320_memorymap.h" #include "dm320_osd.h" -/************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************/ + ****************************************************************************/ /* Configuration ********************************************************/ @@ -1393,7 +1393,7 @@ int up_fbinitialize(void) * Returned value: * Reference to the framebuffer object (NULL on failure) * - ***************************************************************************/ + ****************************************************************************/ FAR struct fb_vtable_s *up_fbgetvplane(int vplane) { diff --git a/arch/arm/src/dm320/dm320_irq.c b/arch/arm/src/dm320/dm320_irq.c index 2c92a697ea..e1ce9c420c 100644 --- a/arch/arm/src/dm320/dm320_irq.c +++ b/arch/arm/src/dm320/dm320_irq.c @@ -1,4 +1,4 @@ -/************************************************************************ +/**************************************************************************** * arch/arm/src/dm320/dm320_irq.c * * Copyright (C) 2007, 2009, 2012 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************/ + ****************************************************************************/ #include @@ -48,19 +48,19 @@ #include "up_arch.h" #include "up_internal.h" -/************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************/ + ****************************************************************************/ volatile uint32_t *current_regs; -/************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************/ + ****************************************************************************/ /* The value of _svectors is defined in ld.script. It could be hard- * coded because we know that correct IRAM area is 0xffc00000. @@ -68,17 +68,17 @@ volatile uint32_t *current_regs; extern int _svectors; /* Type does not matter */ -/************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Name: up_irqinitialize - ************************************************************************/ + ****************************************************************************/ void up_irqinitialize(void) { @@ -120,13 +120,13 @@ void up_irqinitialize(void) #endif } -/************************************************************************ +/**************************************************************************** * Name: up_disable_irq * * Description: * Disable the IRQ specified by 'irq' * - ************************************************************************/ + ****************************************************************************/ void up_disable_irq(int irq) { @@ -160,13 +160,13 @@ void up_disable_irq(int irq) } } -/************************************************************************ +/**************************************************************************** * Name: up_enable_irq * * Description: * Enable the IRQ specified by 'irq' * - ************************************************************************/ + ****************************************************************************/ void up_enable_irq(int irq) { @@ -200,13 +200,13 @@ void up_enable_irq(int irq) } } -/************************************************************************ +/**************************************************************************** * Name: up_ack_irq * * Description: * Acknowledge the interrupt * - ************************************************************************/ + ****************************************************************************/ void up_ack_irq(int irq) { diff --git a/arch/arm/src/dm320/dm320_lowputc.S b/arch/arm/src/dm320/dm320_lowputc.S index 3e71359ba2..83abf7fab8 100644 --- a/arch/arm/src/dm320/dm320_lowputc.S +++ b/arch/arm/src/dm320/dm320_lowputc.S @@ -57,7 +57,7 @@ **************************************************************************/ /************************************************************************** - * Global Variables + * Public Data **************************************************************************/ /************************************************************************** diff --git a/arch/arm/src/dm320/dm320_timerisr.c b/arch/arm/src/dm320/dm320_timerisr.c index 193138a2b0..aaa365387b 100644 --- a/arch/arm/src/dm320/dm320_timerisr.c +++ b/arch/arm/src/dm320/dm320_timerisr.c @@ -105,7 +105,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/efm32/efm32_adc.c b/arch/arm/src/efm32/efm32_adc.c index d8bbb6f164..5d3a73290f 100644 --- a/arch/arm/src/efm32/efm32_adc.c +++ b/arch/arm/src/efm32/efm32_adc.c @@ -382,7 +382,7 @@ static void ADC_CalibrateLoadSingle(ADC_TypeDef *adc, ADC_Ref_TypeDef ref) } /******************************************************************************* - * Global Functions + * Public Functions ******************************************************************************/ /***************************************************************************//** diff --git a/arch/arm/src/efm32/efm32_spi.c b/arch/arm/src/efm32/efm32_spi.c index c67dc3ad6e..8d0a05e288 100644 --- a/arch/arm/src/efm32/efm32_spi.c +++ b/arch/arm/src/efm32/efm32_spi.c @@ -1396,7 +1396,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, DEBUGASSERT(unsent == 0); } -/************************************************************************* +/**************************************************************************** * Name: spi_exchange (with DMA capability) * * Description: @@ -1481,7 +1481,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, } #endif /* CONFIG_EFM32_SPI_DMA */ -/************************************************************************* +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/arm/src/efm32/efm32_timerisr.c b/arch/arm/src/efm32/efm32_timerisr.c index 6a373b76d6..0bc7bb82b6 100644 --- a/arch/arm/src/efm32/efm32_timerisr.c +++ b/arch/arm/src/efm32/efm32_timerisr.c @@ -82,7 +82,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/efm32/efm32_vectors.S b/arch/arm/src/efm32/efm32_vectors.S index cf4101b615..488c8581e0 100644 --- a/arch/arm/src/efm32/efm32_vectors.S +++ b/arch/arm/src/efm32/efm32_vectors.S @@ -82,7 +82,7 @@ #define HEAP_BASE (_ebss+CONFIG_IDLETHREAD_STACKSIZE) /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .syntax unified diff --git a/arch/arm/src/imx/imx_boot.c b/arch/arm/src/imx/imx_boot.c index 25a3205f60..4a26434637 100644 --- a/arch/arm/src/imx/imx_boot.c +++ b/arch/arm/src/imx/imx_boot.c @@ -63,7 +63,7 @@ struct section_mapping_s }; /************************************************************************************ - * Public Variables + * Public Data ************************************************************************************/ extern uint32_t _vector_start; /* Beginning of vector block */ diff --git a/arch/arm/src/imx/imx_lowputc.S b/arch/arm/src/imx/imx_lowputc.S index 0e71742048..09aa4562fa 100644 --- a/arch/arm/src/imx/imx_lowputc.S +++ b/arch/arm/src/imx/imx_lowputc.S @@ -57,7 +57,7 @@ **************************************************************************/ /************************************************************************** - * Global Variables + * Public Data **************************************************************************/ /************************************************************************** diff --git a/arch/arm/src/imx/imx_spi.c b/arch/arm/src/imx/imx_spi.c index f51bfd734c..934763827e 100644 --- a/arch/arm/src/imx/imx_spi.c +++ b/arch/arm/src/imx/imx_spi.c @@ -931,7 +931,7 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, } #endif -/************************************************************************* +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/arm/src/imx/imx_timerisr.c b/arch/arm/src/imx/imx_timerisr.c index eab5f24e44..840dcf0a97 100644 --- a/arch/arm/src/imx/imx_timerisr.c +++ b/arch/arm/src/imx/imx_timerisr.c @@ -64,7 +64,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/kinetis/kinetis_lowputc.c b/arch/arm/src/kinetis/kinetis_lowputc.c index 9985cfc772..86c83327f0 100644 --- a/arch/arm/src/kinetis/kinetis_lowputc.c +++ b/arch/arm/src/kinetis/kinetis_lowputc.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/arm/src/kinetis/kinetis_lowputc.c * * Copyright (C) 2011 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -53,9 +53,9 @@ #include "kinetis_sim.h" #include "kinetis_pinmux.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* Select UART parameters for the selected console */ @@ -99,21 +99,21 @@ # error "No CONFIG_UARTn_SERIAL_CONSOLE Setting" #endif -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ /* This array maps an encoded FIFO depth (index) to the actual size of the * FIFO (indexed value). NOTE: That there is no 8th value. @@ -123,21 +123,21 @@ static uint8_t g_sizemap[8] = {1, 4, 8, 16, 32, 64, 128, 0}; #endif -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - **************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { @@ -175,7 +175,7 @@ void up_lowputc(char ch) #endif } -/************************************************************************** +/**************************************************************************** * Name: kinetis_lowsetup * * Description: @@ -183,7 +183,7 @@ void up_lowputc(char ch) * console. Its purpose is to get the console output availabe as soon * as possible. * - **************************************************************************/ + ****************************************************************************/ void kinetis_lowsetup(void) { diff --git a/arch/arm/src/kinetis/kinetis_timerisr.c b/arch/arm/src/kinetis/kinetis_timerisr.c index 427070b9a8..c3818cb8e8 100644 --- a/arch/arm/src/kinetis/kinetis_timerisr.c +++ b/arch/arm/src/kinetis/kinetis_timerisr.c @@ -86,7 +86,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/kinetis/kinetis_vectors.S b/arch/arm/src/kinetis/kinetis_vectors.S index 3213fc2df4..1fca02d399 100644 --- a/arch/arm/src/kinetis/kinetis_vectors.S +++ b/arch/arm/src/kinetis/kinetis_vectors.S @@ -92,7 +92,7 @@ #define HEAP_BASE (_ebss+CONFIG_IDLETHREAD_STACKSIZE) /************************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************************/ .syntax unified diff --git a/arch/arm/src/kl/kl_lowgetc.c b/arch/arm/src/kl/kl_lowgetc.c index 8343c4ea48..d0714b6753 100644 --- a/arch/arm/src/kl/kl_lowgetc.c +++ b/arch/arm/src/kl/kl_lowgetc.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/arm/src/kl/kl_lowgetc.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -52,9 +52,9 @@ #include "chip/kl_uart.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* Select UART parameters for the selected console */ #if defined(CONFIG_UART0_SERIAL_CONSOLE) @@ -77,37 +77,37 @@ # define CONSOLE_PARITY CONFIG_UART2_PARITY #endif -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowgetc * * Description: * Input one byte from the serial console * - **************************************************************************/ + ****************************************************************************/ int kl_lowgetc(void) { diff --git a/arch/arm/src/kl/kl_lowputc.c b/arch/arm/src/kl/kl_lowputc.c index 7ea89b5b0a..aee40a0663 100644 --- a/arch/arm/src/kl/kl_lowputc.c +++ b/arch/arm/src/kl/kl_lowputc.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/arm/src/kl/kl_lowputc.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -57,9 +57,9 @@ #include "chip/kl_uart.h" #include "chip/kl_pinmux.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* Select UART parameters for the selected console */ #if defined(CONFIG_UART0_SERIAL_CONSOLE) @@ -84,37 +84,37 @@ #define OVER_SAMPLE 16 -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - **************************************************************************/ + ****************************************************************************/ void kl_lowputc(uint32_t ch) { @@ -143,7 +143,7 @@ void kl_lowputc(uint32_t ch) #endif } -/************************************************************************** +/**************************************************************************** * Name: kl_lowsetup * * Description: @@ -151,7 +151,7 @@ void kl_lowputc(uint32_t ch) * console. Its purpose is to get the console output availabe as soon * as possible. * - **************************************************************************/ + ****************************************************************************/ void kl_lowsetup(void) { uint32_t regval; diff --git a/arch/arm/src/kl/kl_spi.c b/arch/arm/src/kl/kl_spi.c index 3d50af8594..899acb2c6c 100644 --- a/arch/arm/src/kl/kl_spi.c +++ b/arch/arm/src/kl/kl_spi.c @@ -577,7 +577,7 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, } } -/************************************************************************* +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/arm/src/kl/kl_timerisr.c b/arch/arm/src/kl/kl_timerisr.c index 31dc2ba5de..005c3d17f3 100644 --- a/arch/arm/src/kl/kl_timerisr.c +++ b/arch/arm/src/kl/kl_timerisr.c @@ -101,7 +101,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/lpc11xx/lpc11_gpio.c b/arch/arm/src/lpc11xx/lpc11_gpio.c index 932740af88..ef984351db 100644 --- a/arch/arm/src/lpc11xx/lpc11_gpio.c +++ b/arch/arm/src/lpc11xx/lpc11_gpio.c @@ -76,5 +76,5 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ diff --git a/arch/arm/src/lpc11xx/lpc11_gpiodbg.c b/arch/arm/src/lpc11xx/lpc11_gpiodbg.c index 45e7d311f6..e6eb8dda2c 100644 --- a/arch/arm/src/lpc11xx/lpc11_gpiodbg.c +++ b/arch/arm/src/lpc11xx/lpc11_gpiodbg.c @@ -118,7 +118,7 @@ static uint32_t lpc11_pinmode(unsigned int port, unsigned int pin) #endif /* LPC176x */ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/lpc11xx/lpc11_gpioint.c b/arch/arm/src/lpc11xx/lpc11_gpioint.c index 82e22d564f..b5b8fdc067 100644 --- a/arch/arm/src/lpc11xx/lpc11_gpioint.c +++ b/arch/arm/src/lpc11xx/lpc11_gpioint.c @@ -440,7 +440,7 @@ static int lpc11_gpiointerrupt(int irq, void *context) } /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/lpc11xx/lpc11_lowgetc.c b/arch/arm/src/lpc11xx/lpc11_lowgetc.c index 909036de06..5bfe75fbd1 100644 --- a/arch/arm/src/lpc11xx/lpc11_lowgetc.c +++ b/arch/arm/src/lpc11xx/lpc11_lowgetc.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/arm/src/lpc11/lpc11_lowgetc.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -54,9 +54,9 @@ #include "lpc11_lowgetc.h" #include "lpc11_serial.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* Select UART parameters for the selected console */ #if defined(CONFIG_UART0_SERIAL_CONSOLE) @@ -79,37 +79,37 @@ # define CONSOLE_PARITY CONFIG_UART2_PARITY #endif -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowgetc * * Description: * Input one byte from the serial console * - **************************************************************************/ + ****************************************************************************/ int lpc11_lowgetc(void) { diff --git a/arch/arm/src/lpc11xx/lpc11_lowputc.c b/arch/arm/src/lpc11xx/lpc11_lowputc.c index af1b34bd59..c7a0168177 100644 --- a/arch/arm/src/lpc11xx/lpc11_lowputc.c +++ b/arch/arm/src/lpc11xx/lpc11_lowputc.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/arm/src/lpc11xx/lpc11_lowputc.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -54,9 +54,9 @@ #include "lpc11_lowputc.h" #include "lpc11_serial.h" -/************************************************************************** +/**************************************************************************** * Private Definitions - **************************************************************************/ + ****************************************************************************/ /* Select UART parameters for the selected console */ @@ -114,46 +114,46 @@ #define CONSOLE_FCR_VALUE (UART_FCR_RXTRIGGER_8 | UART_FCR_TXRST |\ UART_FCR_RXRST | UART_FCR_FIFOEN) -/************************************************************************** +/**************************************************************************** * This Baud Rate configuration is based on idea suggested at LPCWare: * www.lpcware.com/content/blog/lpc17xx-uart-simpler-way-calculate-baudrate-timming * * The original code is for LPC17xx but with few modifications it worked * fine in the LPC11xx as well. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - **************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { @@ -168,7 +168,7 @@ void up_lowputc(char ch) #endif } -/************************************************************************** +/**************************************************************************** * Name: lpc11_lowsetup * * Description: @@ -186,7 +186,7 @@ void up_lowputc(char ch) * 3. Peripheral clock: Enable the UART peripheral clock by writing to the * UARTCLKDIV register. * - **************************************************************************/ + ****************************************************************************/ void lpc11_lowsetup(void) { diff --git a/arch/arm/src/lpc11xx/lpc11_spi.c b/arch/arm/src/lpc11xx/lpc11_spi.c index f9ef42812e..db0eb55729 100644 --- a/arch/arm/src/lpc11xx/lpc11_spi.c +++ b/arch/arm/src/lpc11xx/lpc11_spi.c @@ -444,7 +444,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) return (uint16_t)getreg32(LPC11_SPI_DR); } -/************************************************************************* +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/arm/src/lpc11xx/lpc11_ssp.c b/arch/arm/src/lpc11xx/lpc11_ssp.c index b41bf8c69a..d7a3f2acd0 100644 --- a/arch/arm/src/lpc11xx/lpc11_ssp.c +++ b/arch/arm/src/lpc11xx/lpc11_ssp.c @@ -328,7 +328,7 @@ static inline uint32_t ssp_getreg(FAR struct lpc11_sspdev_s *priv, * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ static inline void ssp_putreg(FAR struct lpc11_sspdev_s *priv, uint8_t offset, uint32_t value) @@ -635,7 +635,7 @@ static uint16_t ssp_send(FAR struct spi_dev_s *dev, uint16_t wd) return (uint16_t)regval; } -/************************************************************************* +/**************************************************************************** * Name: ssp_sndblock * * Description: diff --git a/arch/arm/src/lpc11xx/lpc11_timerisr.c b/arch/arm/src/lpc11xx/lpc11_timerisr.c index 38790f4480..8248052d19 100644 --- a/arch/arm/src/lpc11xx/lpc11_timerisr.c +++ b/arch/arm/src/lpc11xx/lpc11_timerisr.c @@ -101,7 +101,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/lpc17xx/lpc176x_gpio.c b/arch/arm/src/lpc17xx/lpc176x_gpio.c index f3231691d6..7de2fd04bc 100644 --- a/arch/arm/src/lpc17xx/lpc176x_gpio.c +++ b/arch/arm/src/lpc17xx/lpc176x_gpio.c @@ -549,7 +549,7 @@ static int lpc17_configalternate(lpc17_pinset_t cfgset, unsigned int port, } /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/lpc17xx/lpc178x_gpio.c b/arch/arm/src/lpc17xx/lpc178x_gpio.c index aed67f8ce8..4a27945c15 100644 --- a/arch/arm/src/lpc17xx/lpc178x_gpio.c +++ b/arch/arm/src/lpc17xx/lpc178x_gpio.c @@ -786,7 +786,7 @@ static int lpc17_configalternate(lpc17_pinset_t cfgset, unsigned int port, } /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/lpc17xx/lpc17_allocateheap.c b/arch/arm/src/lpc17xx/lpc17_allocateheap.c index 491a3445af..b9b524d1eb 100644 --- a/arch/arm/src/lpc17xx/lpc17_allocateheap.c +++ b/arch/arm/src/lpc17xx/lpc17_allocateheap.c @@ -310,14 +310,14 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size) } #endif -/************************************************************************ +/**************************************************************************** * Name: up_addregion * * Description: * Memory may be added in non-contiguous chunks. Additional chunks are * added by calling this function. * - ************************************************************************/ + ****************************************************************************/ #if CONFIG_MM_REGIONS > 1 void up_addregion(void) diff --git a/arch/arm/src/lpc17xx/lpc17_gpio.c b/arch/arm/src/lpc17xx/lpc17_gpio.c index 96c89f0e74..34f0aefcd6 100644 --- a/arch/arm/src/lpc17xx/lpc17_gpio.c +++ b/arch/arm/src/lpc17xx/lpc17_gpio.c @@ -77,5 +77,5 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ diff --git a/arch/arm/src/lpc17xx/lpc17_gpiodbg.c b/arch/arm/src/lpc17xx/lpc17_gpiodbg.c index 7876da0acb..16d3a3fd86 100644 --- a/arch/arm/src/lpc17xx/lpc17_gpiodbg.c +++ b/arch/arm/src/lpc17xx/lpc17_gpiodbg.c @@ -118,7 +118,7 @@ static uint32_t lpc17_pinmode(unsigned int port, unsigned int pin) #endif /* LPC176x */ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/lpc17xx/lpc17_gpioint.c b/arch/arm/src/lpc17xx/lpc17_gpioint.c index 7cb51ed078..132ab14be3 100644 --- a/arch/arm/src/lpc17xx/lpc17_gpioint.c +++ b/arch/arm/src/lpc17xx/lpc17_gpioint.c @@ -440,7 +440,7 @@ static int lpc17_gpiointerrupt(int irq, void *context) } /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/lpc17xx/lpc17_lcd.c b/arch/arm/src/lpc17xx/lpc17_lcd.c index 001364a386..2d2ca6b5c0 100644 --- a/arch/arm/src/lpc17xx/lpc17_lcd.c +++ b/arch/arm/src/lpc17xx/lpc17_lcd.c @@ -711,7 +711,7 @@ int up_fbinitialize(void) * Returned value: * Reference to the framebuffer object (NULL on failure) * - ***************************************************************************/ + ****************************************************************************/ FAR struct fb_vtable_s *up_fbgetvplane(int vplane) { diff --git a/arch/arm/src/lpc17xx/lpc17_lowputc.c b/arch/arm/src/lpc17xx/lpc17_lowputc.c index 1378e7642c..05bc2c2c2d 100644 --- a/arch/arm/src/lpc17xx/lpc17_lowputc.c +++ b/arch/arm/src/lpc17xx/lpc17_lowputc.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/arm/src/lpc17xx/lpc17_lowputc.c * * Copyright (C) 2010-2013 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -54,9 +54,9 @@ #include "lpc17_lowputc.h" #include "lpc17_serial.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* Select UART parameters for the selected console */ @@ -229,37 +229,37 @@ #define CONSOLE_DL (CONSOLE_NUMERATOR / (CONSOLE_BAUD << 4)) -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - **************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { @@ -274,7 +274,7 @@ void up_lowputc(char ch) #endif } -/************************************************************************** +/**************************************************************************** * Name: lpc17_lowsetup * * Description: @@ -302,7 +302,7 @@ void up_lowputc(char ch) * 7. DMA: UART transmit and receive functions can operate with the * GPDMA controller. * - **************************************************************************/ + ****************************************************************************/ void lpc17_lowsetup(void) { diff --git a/arch/arm/src/lpc17xx/lpc17_spi.c b/arch/arm/src/lpc17xx/lpc17_spi.c index 9c97be815f..e595496c44 100644 --- a/arch/arm/src/lpc17xx/lpc17_spi.c +++ b/arch/arm/src/lpc17xx/lpc17_spi.c @@ -437,7 +437,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) return (uint16_t)getreg32(LPC17_SPI_DR); } -/************************************************************************* +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/arm/src/lpc17xx/lpc17_ssp.c b/arch/arm/src/lpc17xx/lpc17_ssp.c index b24e9b879b..dc44e95a25 100644 --- a/arch/arm/src/lpc17xx/lpc17_ssp.c +++ b/arch/arm/src/lpc17xx/lpc17_ssp.c @@ -325,7 +325,7 @@ static inline uint32_t ssp_getreg(FAR struct lpc17_sspdev_s *priv, uint8_t offse * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ static inline void ssp_putreg(FAR struct lpc17_sspdev_s *priv, uint8_t offset, uint32_t value) { @@ -631,7 +631,7 @@ static uint16_t ssp_send(FAR struct spi_dev_s *dev, uint16_t wd) return (uint16_t)regval; } -/************************************************************************* +/**************************************************************************** * Name: ssp_sndblock * * Description: diff --git a/arch/arm/src/lpc17xx/lpc17_timerisr.c b/arch/arm/src/lpc17xx/lpc17_timerisr.c index 593d9142b9..1b4a6a3794 100644 --- a/arch/arm/src/lpc17xx/lpc17_timerisr.c +++ b/arch/arm/src/lpc17xx/lpc17_timerisr.c @@ -87,7 +87,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/lpc17xx/lpc17_vectors.S b/arch/arm/src/lpc17xx/lpc17_vectors.S index b1dda9df25..6cee7d9731 100644 --- a/arch/arm/src/lpc17xx/lpc17_vectors.S +++ b/arch/arm/src/lpc17xx/lpc17_vectors.S @@ -93,7 +93,7 @@ #define HEAP_BASE (_ebss+CONFIG_IDLETHREAD_STACKSIZE) /************************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************************/ .syntax unified diff --git a/arch/arm/src/lpc214x/chip.h b/arch/arm/src/lpc214x/chip.h index 15b2f9903a..c0af01c447 100644 --- a/arch/arm/src/lpc214x/chip.h +++ b/arch/arm/src/lpc214x/chip.h @@ -343,7 +343,7 @@ ****************************************************************************************************/ /**************************************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************************************/ #endif /* __LPC214X_CHIP_H */ diff --git a/arch/arm/src/lpc214x/lpc214x_lowputc.S b/arch/arm/src/lpc214x/lpc214x_lowputc.S index acfd36a1aa..320be8ef56 100644 --- a/arch/arm/src/lpc214x/lpc214x_lowputc.S +++ b/arch/arm/src/lpc214x/lpc214x_lowputc.S @@ -115,7 +115,7 @@ **************************************************************************/ /************************************************************************** - * Global Variables + * Public Data **************************************************************************/ /************************************************************************** diff --git a/arch/arm/src/lpc214x/lpc214x_pll.h b/arch/arm/src/lpc214x/lpc214x_pll.h index 4b875cbd70..4e19bcdc11 100644 --- a/arch/arm/src/lpc214x/lpc214x_pll.h +++ b/arch/arm/src/lpc214x/lpc214x_pll.h @@ -99,7 +99,7 @@ ****************************************************************************************************/ /**************************************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************************************/ #endif /* _ARCH_ARM_SRC_LPC214X_PLL_H */ diff --git a/arch/arm/src/lpc214x/lpc214x_timerisr.c b/arch/arm/src/lpc214x/lpc214x_timerisr.c index f5001ee663..ecb280f24f 100644 --- a/arch/arm/src/lpc214x/lpc214x_timerisr.c +++ b/arch/arm/src/lpc214x/lpc214x_timerisr.c @@ -80,7 +80,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/lpc214x/lpc214x_uart.h b/arch/arm/src/lpc214x/lpc214x_uart.h index c45f94cbc6..c4c90c1669 100644 --- a/arch/arm/src/lpc214x/lpc214x_uart.h +++ b/arch/arm/src/lpc214x/lpc214x_uart.h @@ -136,7 +136,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Function Prototypes + * Public Function Prototypes ************************************************************************************/ #endif /* __LPC214X_UART_H */ diff --git a/arch/arm/src/lpc2378/chip.h b/arch/arm/src/lpc2378/chip.h index 1389f450d7..b8b8b70c85 100644 --- a/arch/arm/src/lpc2378/chip.h +++ b/arch/arm/src/lpc2378/chip.h @@ -1000,7 +1000,7 @@ are for LPC24xx only. */ ****************************************************************************************************/ /**************************************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************************************/ #endif /* _ARCH_ARM_SRC_LPC2378_CHIP_H */ diff --git a/arch/arm/src/lpc2378/internal.h b/arch/arm/src/lpc2378/internal.h index 12f2632fa8..0c7fccede9 100644 --- a/arch/arm/src/lpc2378/internal.h +++ b/arch/arm/src/lpc2378/internal.h @@ -55,7 +55,7 @@ //~ #define CONFIG_VECTORED_INTERRUPTS /**************************************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/arm/src/lpc2378/lpc23xx_io.c b/arch/arm/src/lpc2378/lpc23xx_io.c index 9db909bceb..1634d80ea7 100644 --- a/arch/arm/src/lpc2378/lpc23xx_io.c +++ b/arch/arm/src/lpc2378/lpc23xx_io.c @@ -1,4 +1,4 @@ -/*********************************************************************** +/**************************************************************************** * arch/arm/src/arm/lpc2378/lpc23xx_head.S * * Copyright (C) 2010 Rommel Marcelo. All rights reserved. @@ -35,11 +35,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ***********************************************************************/ + ****************************************************************************/ -/*********************************************************************** +/**************************************************************************** * Included files - ***********************************************************************/ + ****************************************************************************/ #include "up_arch.h" #include @@ -48,11 +48,11 @@ #include "lpc23xx_uart.h" #include "lpc23xx_gpio.h" -/*********************************************************************** +/**************************************************************************** * Pre-processor Definitions - ***********************************************************************/ + ****************************************************************************/ -/*********************************************************************** +/**************************************************************************** * Name: IO_Init() * * Descriptions: Initialize the target board before running the main() diff --git a/arch/arm/src/lpc2378/lpc23xx_irq.c b/arch/arm/src/lpc2378/lpc23xx_irq.c index 0be33877eb..5151384854 100644 --- a/arch/arm/src/lpc2378/lpc23xx_irq.c +++ b/arch/arm/src/lpc2378/lpc23xx_irq.c @@ -115,10 +115,10 @@ void up_irqinitialize(void) #endif } -/*********************************************************************** +/**************************************************************************** * Name: up_enable_irq_protect * VIC registers can be accessed in User or privileged mode - ***********************************************************************/ + ****************************************************************************/ #if 0 /* Not used */ static void up_enable_irq_protect(void) @@ -127,10 +127,10 @@ static void up_enable_irq_protect(void) } #endif -/*********************************************************************** +/**************************************************************************** * Name: up_disable_irq_protect * VIC registers can only be accessed in privileged mode - ***********************************************************************/ + ****************************************************************************/ #if 0 /* Not used */ static void up_disable_irq_protect(void) @@ -139,13 +139,13 @@ static void up_disable_irq_protect(void) } #endif -/*********************************************************************** +/**************************************************************************** * Name: up_disable_irq * * Description: * Disable the IRQ specified by 'irq' * - ***********************************************************************/ + ****************************************************************************/ void up_disable_irq(int irq) { @@ -161,13 +161,13 @@ void up_disable_irq(int irq) } } -/*********************************************************************** +/**************************************************************************** * Name: up_enable_irq * * Description: * Enable the IRQ specified by 'irq' * - ***********************************************************************/ + ****************************************************************************/ void up_enable_irq(int irq) { diff --git a/arch/arm/src/lpc2378/lpc23xx_lowputc.S b/arch/arm/src/lpc2378/lpc23xx_lowputc.S index 96da5e4376..9f5aec15af 100755 --- a/arch/arm/src/lpc2378/lpc23xx_lowputc.S +++ b/arch/arm/src/lpc2378/lpc23xx_lowputc.S @@ -151,7 +151,7 @@ **************************************************************************/ /************************************************************************** - * Global Variables + * Public Data **************************************************************************/ /************************************************************************** diff --git a/arch/arm/src/lpc2378/lpc23xx_pllsetup.c b/arch/arm/src/lpc2378/lpc23xx_pllsetup.c index 98286160c5..853da420a9 100644 --- a/arch/arm/src/lpc2378/lpc23xx_pllsetup.c +++ b/arch/arm/src/lpc2378/lpc23xx_pllsetup.c @@ -56,9 +56,9 @@ * corresponding to the selected mode. */ -/*********************************************************************** +/**************************************************************************** * Included Files - **********************************************************************/ + ****************************************************************************/ #include #include @@ -72,9 +72,9 @@ void IO_Init(void); -/*********************************************************************** +/**************************************************************************** * Pre-processor Definitions - **********************************************************************/ + ****************************************************************************/ #if ((FOSC < 32000) || (FOSC > 50000000)) # error Fosc out of range (32KHz-50MHz) diff --git a/arch/arm/src/lpc2378/lpc23xx_scb.h b/arch/arm/src/lpc2378/lpc23xx_scb.h index f5e964bf5c..09004f3f26 100644 --- a/arch/arm/src/lpc2378/lpc23xx_scb.h +++ b/arch/arm/src/lpc2378/lpc23xx_scb.h @@ -128,7 +128,7 @@ ****************************************************************************************************/ /**************************************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************************************/ #endif /* __ARCH_ARM_SRC_LPC2378_LPC23XX_SCB_H */ diff --git a/arch/arm/src/lpc2378/lpc23xx_spi.c b/arch/arm/src/lpc2378/lpc23xx_spi.c index 3392e6478e..0ce06502bb 100644 --- a/arch/arm/src/lpc2378/lpc23xx_spi.c +++ b/arch/arm/src/lpc2378/lpc23xx_spi.c @@ -451,7 +451,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) return (uint16_t)getreg32(SPI_DR); } -/************************************************************************* +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/arm/src/lpc2378/lpc23xx_timerisr.c b/arch/arm/src/lpc2378/lpc23xx_timerisr.c index 054710954a..8bd6cd9841 100644 --- a/arch/arm/src/lpc2378/lpc23xx_timerisr.c +++ b/arch/arm/src/lpc2378/lpc23xx_timerisr.c @@ -89,7 +89,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/lpc2378/lpc23xx_uart.h b/arch/arm/src/lpc2378/lpc23xx_uart.h index acce7b6ff5..ccdd26f9e6 100644 --- a/arch/arm/src/lpc2378/lpc23xx_uart.h +++ b/arch/arm/src/lpc2378/lpc23xx_uart.h @@ -225,7 +225,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Function Prototypes + * Public Function Prototypes ************************************************************************************/ #endif /* __ARCH_ARM_SRC_LPC2378_LPC23XX_UART_H */ diff --git a/arch/arm/src/lpc31xx/lpc31_allocateheap.c b/arch/arm/src/lpc31xx/lpc31_allocateheap.c index 4ab7b0076e..f46f3466d6 100644 --- a/arch/arm/src/lpc31xx/lpc31_allocateheap.c +++ b/arch/arm/src/lpc31xx/lpc31_allocateheap.c @@ -1,4 +1,4 @@ -/************************************************************************ +/**************************************************************************** * arch/arm/src/lpc31xx/lpc31_allocateheap.c * * Copyright (C) 2009-2010, 2013, 2015 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************/ + ****************************************************************************/ #include @@ -58,9 +58,9 @@ # include "pg_macros.h" #endif -/************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************/ + ****************************************************************************/ /* Configuration ********************************************************/ @@ -142,19 +142,19 @@ # endif #endif -/************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Name: up_allocate_heap * * Description: @@ -176,7 +176,7 @@ * NOTE: Ignore the erroneous nomenclature DRAM and SDRAM. That names * date back to an earlier platform that had SDRAM. * - ************************************************************************/ + ****************************************************************************/ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) { @@ -185,14 +185,14 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) *heap_size = LPC31_HEAP_VEND - g_idle_topstack; } -/************************************************************************ +/**************************************************************************** * Name: up_addregion * * Description: * Memory may be added in non-contiguous chunks. Additional chunks are * added by calling this function. * - ************************************************************************/ + ****************************************************************************/ #if CONFIG_MM_REGIONS > 1 void up_addregion(void) diff --git a/arch/arm/src/lpc31xx/lpc31_bcrndx.c b/arch/arm/src/lpc31xx/lpc31_bcrndx.c index f2bcf7276e..078f2c99f9 100644 --- a/arch/arm/src/lpc31xx/lpc31_bcrndx.c +++ b/arch/arm/src/lpc31xx/lpc31_bcrndx.c @@ -1,4 +1,4 @@ -/************************************************************************ +/**************************************************************************** * arch/arm/src/lpc31xx/lpc31_bcrndx.c * * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. @@ -35,11 +35,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************/ + ****************************************************************************/ #include #include @@ -47,23 +47,23 @@ #include "up_arch.h" #include "lpc31_cgudrvr.h" -/************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Name: lpc31_bcrndx * * Description: @@ -71,7 +71,7 @@ * function returns the index to the associated BCR register (if any) * or BCRNDX_INVALID otherwise. * - ************************************************************************/ + ****************************************************************************/ int lpc31_bcrndx(enum lpc31_domainid_e dmnid) { diff --git a/arch/arm/src/lpc31xx/lpc31_boot.c b/arch/arm/src/lpc31xx/lpc31_boot.c index 3e8b1949de..cbf7a1e571 100644 --- a/arch/arm/src/lpc31xx/lpc31_boot.c +++ b/arch/arm/src/lpc31xx/lpc31_boot.c @@ -73,7 +73,7 @@ struct section_mapping_s }; /************************************************************************************ - * Public Variables + * Public Data ************************************************************************************/ extern uint32_t _vector_start; /* Beginning of vector block */ diff --git a/arch/arm/src/lpc31xx/lpc31_clkdomain.c b/arch/arm/src/lpc31xx/lpc31_clkdomain.c index e07f86e52e..cdb2fc9ca7 100644 --- a/arch/arm/src/lpc31xx/lpc31_clkdomain.c +++ b/arch/arm/src/lpc31xx/lpc31_clkdomain.c @@ -1,4 +1,4 @@ -/************************************************************************ +/**************************************************************************** * arch/arm/src/lpc31xx/lpc31_clkdomain.c * * Copyright (C) 2009 Gregory Nutt. All rights reserved. @@ -35,11 +35,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************/ + ****************************************************************************/ #include #include @@ -47,30 +47,30 @@ #include "up_arch.h" #include "lpc31_cgudrvr.h" -/************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Name: lpc31_clkdomain * * Description: * Given a clock ID, return the ID of the domain in which the clock * resides. * - ************************************************************************/ + ****************************************************************************/ enum lpc31_domainid_e lpc31_clkdomain(enum lpc31_clockid_e clkid) { diff --git a/arch/arm/src/lpc31xx/lpc31_clkfreq.c b/arch/arm/src/lpc31xx/lpc31_clkfreq.c index e78b95086c..aba8384bce 100644 --- a/arch/arm/src/lpc31xx/lpc31_clkfreq.c +++ b/arch/arm/src/lpc31xx/lpc31_clkfreq.c @@ -1,4 +1,4 @@ -/************************************************************************ +/**************************************************************************** * arch/arm/src/lpc31xx/lpc31_clkfreq.c * * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. @@ -35,11 +35,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************/ + ****************************************************************************/ #include #include @@ -47,30 +47,30 @@ #include "up_arch.h" #include "lpc31_cgudrvr.h" -/************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Name: lpc31_fdcndx * * Description: * Given a clock ID and its domain ID, return the frequency of the * clock. * - ************************************************************************/ + ****************************************************************************/ uint32_t lpc31_clkfreq(enum lpc31_clockid_e clkid, enum lpc31_domainid_e dmnid) diff --git a/arch/arm/src/lpc31xx/lpc31_ehci.c b/arch/arm/src/lpc31xx/lpc31_ehci.c index 97b73fd96b..9250679b38 100644 --- a/arch/arm/src/lpc31xx/lpc31_ehci.c +++ b/arch/arm/src/lpc31xx/lpc31_ehci.c @@ -4856,7 +4856,7 @@ static int lpc31_reset(void) } /******************************************************************************* - * Global Functions + * Public Functions *******************************************************************************/ /******************************************************************************* * Name: lpc31_ehci_initialize diff --git a/arch/arm/src/lpc31xx/lpc31_esrndx.c b/arch/arm/src/lpc31xx/lpc31_esrndx.c index a868dc57a2..55ffd0d4db 100644 --- a/arch/arm/src/lpc31xx/lpc31_esrndx.c +++ b/arch/arm/src/lpc31xx/lpc31_esrndx.c @@ -1,4 +1,4 @@ -/************************************************************************ +/**************************************************************************** * arch/arm/src/lpc31xx/lpc31_esrndx.c * * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. @@ -35,11 +35,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************/ + ****************************************************************************/ #include #include @@ -47,23 +47,23 @@ #include "up_arch.h" #include "lpc31_cgudrvr.h" -/************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Name: lpc31_esrndx * * Description: @@ -81,7 +81,7 @@ * * CLKID_SYSCLKO Clock ID 91: SYSCLK_O * - ************************************************************************/ + ****************************************************************************/ int lpc31_esrndx(enum lpc31_clockid_e clkid) { diff --git a/arch/arm/src/lpc31xx/lpc31_fdcndx.c b/arch/arm/src/lpc31xx/lpc31_fdcndx.c index 7d678b3702..6297d65fb2 100644 --- a/arch/arm/src/lpc31xx/lpc31_fdcndx.c +++ b/arch/arm/src/lpc31xx/lpc31_fdcndx.c @@ -1,4 +1,4 @@ -/************************************************************************ +/**************************************************************************** * arch/arm/src/lpc31xx/lpc31_fdcndx.c * * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. @@ -35,11 +35,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************/ + ****************************************************************************/ #include #include @@ -47,9 +47,9 @@ #include "up_arch.h" #include "lpc31_cgudrvr.h" -/************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************/ + ****************************************************************************/ /* The select register in the ESR registers vary in width from 1-3 bits. * Below is a macro to select the widest case (which is OK because the @@ -59,9 +59,9 @@ #define CGU_ESRSEL(n) (((n)>>1)&7) -/************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************/ + ****************************************************************************/ static const uint8_t g_fdcbase[CGU_NDOMAINS] = { @@ -79,15 +79,15 @@ static const uint8_t g_fdcbase[CGU_NDOMAINS] = 0, /* Domain 11: SYSCLKO_BASE (no ESR register) */ }; -/************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Name: lpc31_fdcndx * * Description: @@ -95,7 +95,7 @@ static const uint8_t g_fdcbase[CGU_NDOMAINS] = * corresponding fractional divider register (or FDCNDX_INVALID if * there is no fractional divider associated with this clock). * - ************************************************************************/ + ****************************************************************************/ int lpc31_fdcndx(enum lpc31_clockid_e clkid, enum lpc31_domainid_e dmnid) { diff --git a/arch/arm/src/lpc31xx/lpc31_pllconfig.c b/arch/arm/src/lpc31xx/lpc31_pllconfig.c index 427606b02e..a39d21d138 100644 --- a/arch/arm/src/lpc31xx/lpc31_pllconfig.c +++ b/arch/arm/src/lpc31xx/lpc31_pllconfig.c @@ -211,13 +211,13 @@ void lpc31_pllconfig(const struct lpc31_pllconfig_s * const cfg) lpc31_restoredomains(cfg, dmnset); } -/************************************************************************ +/**************************************************************************** * Name: lpc31_hp0pllconfig * * Description: * Configure the HP0 PLL according to the board.h selections. * - ************************************************************************/ + ****************************************************************************/ void lpc31_hp0pllconfig(void) { @@ -238,13 +238,13 @@ void lpc31_hp0pllconfig(void) lpc31_pllconfig(&cfg); } -/************************************************************************ +/**************************************************************************** * Name: lpc31_hp1pllconfig * * Description: * Configure the HP1 PLL according to the board.h selections. * - ************************************************************************/ + ****************************************************************************/ void lpc31_hp1pllconfig(void) { diff --git a/arch/arm/src/lpc31xx/lpc31_softreset.c b/arch/arm/src/lpc31xx/lpc31_softreset.c index 7deb33a24e..386cb3710d 100644 --- a/arch/arm/src/lpc31xx/lpc31_softreset.c +++ b/arch/arm/src/lpc31xx/lpc31_softreset.c @@ -1,4 +1,4 @@ -/************************************************************************ +/**************************************************************************** * arch/arm/src/lpc31xx/lpc31_softreset.c * * Copyright (C) 2009 Gregory Nutt. All rights reserved. @@ -35,11 +35,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************/ + ****************************************************************************/ #include #include @@ -47,29 +47,29 @@ #include "up_arch.h" #include "lpc31_cgudrvr.h" -/************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Name: lpc31_softreset * * Description: * Perform a soft reset on the specified module. * - ************************************************************************/ + ****************************************************************************/ void lpc31_softreset(enum lpc31_resetid_e resetid) { diff --git a/arch/arm/src/lpc31xx/lpc31_spi.c b/arch/arm/src/lpc31xx/lpc31_spi.c index 9699bdcedd..5d0524f718 100644 --- a/arch/arm/src/lpc31xx/lpc31_spi.c +++ b/arch/arm/src/lpc31xx/lpc31_spi.c @@ -720,7 +720,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t word) return spi_readword(priv); } -/************************************************************************* +/**************************************************************************** * Name: spi_exchange * * Description: @@ -833,7 +833,7 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, } } -/************************************************************************* +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/arm/src/lpc31xx/lpc31_timerisr.c b/arch/arm/src/lpc31xx/lpc31_timerisr.c index 0494b16f9a..e9a6bc2715 100644 --- a/arch/arm/src/lpc31xx/lpc31_timerisr.c +++ b/arch/arm/src/lpc31xx/lpc31_timerisr.c @@ -66,7 +66,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/lpc43xx/lpc43_allocateheap.c b/arch/arm/src/lpc43xx/lpc43_allocateheap.c index 40d05afc9b..22ba4a9a3f 100644 --- a/arch/arm/src/lpc43xx/lpc43_allocateheap.c +++ b/arch/arm/src/lpc43xx/lpc43_allocateheap.c @@ -253,14 +253,14 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) *heap_size = CONFIG_RAM_END - g_idle_topstack; } -/************************************************************************ +/**************************************************************************** * Name: up_addregion * * Description: * Memory may be added in non-contiguous chunks. Additional chunks are * added by calling this function. * - ************************************************************************/ + ****************************************************************************/ #if CONFIG_MM_REGIONS > 1 void up_addregion(void) diff --git a/arch/arm/src/lpc43xx/lpc43_ehci.c b/arch/arm/src/lpc43xx/lpc43_ehci.c index 983f09e40e..09c144ebbb 100644 --- a/arch/arm/src/lpc43xx/lpc43_ehci.c +++ b/arch/arm/src/lpc43xx/lpc43_ehci.c @@ -4680,7 +4680,7 @@ static int lpc43_reset(void) } /******************************************************************************* - * Global Functions + * Public Functions *******************************************************************************/ /******************************************************************************* * Name: lpc43_ehci_initialize diff --git a/arch/arm/src/lpc43xx/lpc43_spi.c b/arch/arm/src/lpc43xx/lpc43_spi.c index c613bd1435..92918bbdea 100644 --- a/arch/arm/src/lpc43xx/lpc43_spi.c +++ b/arch/arm/src/lpc43xx/lpc43_spi.c @@ -426,7 +426,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) return (uint16_t)getreg32(LPC43_SPI_DR); } -/************************************************************************* +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/arm/src/lpc43xx/lpc43_ssp.c b/arch/arm/src/lpc43xx/lpc43_ssp.c index 5ee4fb5978..49a4673a7d 100644 --- a/arch/arm/src/lpc43xx/lpc43_ssp.c +++ b/arch/arm/src/lpc43xx/lpc43_ssp.c @@ -259,7 +259,7 @@ static inline uint32_t ssp_getreg(FAR struct lpc43_sspdev_s *priv, uint8_t offse * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ static inline void ssp_putreg(FAR struct lpc43_sspdev_s *priv, uint8_t offset, uint32_t value) { @@ -526,7 +526,7 @@ static uint16_t ssp_send(FAR struct spi_dev_s *dev, uint16_t wd) return (uint16_t)regval; } -/************************************************************************* +/**************************************************************************** * Name: ssp_sndblock * * Description: diff --git a/arch/arm/src/lpc43xx/lpc43_timerisr.c b/arch/arm/src/lpc43xx/lpc43_timerisr.c index bc7a933023..12f3be8388 100644 --- a/arch/arm/src/lpc43xx/lpc43_timerisr.c +++ b/arch/arm/src/lpc43xx/lpc43_timerisr.c @@ -86,7 +86,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/lpc43xx/lpc43_uart.c b/arch/arm/src/lpc43xx/lpc43_uart.c index c304fef12c..948cac54b6 100644 --- a/arch/arm/src/lpc43xx/lpc43_uart.c +++ b/arch/arm/src/lpc43xx/lpc43_uart.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/arm/src/lpc43xx/lpc43_uart.c * * Copyright (C) 2012 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -56,9 +56,9 @@ #include "lpc43_uart.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* Select UART parameters for the selected console */ @@ -139,37 +139,37 @@ #define CONSOLE_FCR_VALUE (UART_FCR_RXTRIGGER_8 | UART_FCR_TXRST |\ UART_FCR_RXRST | UART_FCR_FIFOEN) -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - **************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { @@ -184,7 +184,7 @@ void up_lowputc(char ch) #endif } -/************************************************************************** +/**************************************************************************** * Name: lpc43_lowsetup * * Description: @@ -207,7 +207,7 @@ void up_lowputc(char ch) * 5. DMA: UART transmit and receive functions can operate with the * GPDMA controller. * - **************************************************************************/ + ****************************************************************************/ void lpc43_lowsetup(void) { diff --git a/arch/arm/src/moxart/moxart_irq.c b/arch/arm/src/moxart/moxart_irq.c index 4e8747b45c..b0475495ca 100644 --- a/arch/arm/src/moxart/moxart_irq.c +++ b/arch/arm/src/moxart/moxart_irq.c @@ -32,7 +32,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Included Files @@ -274,13 +274,13 @@ static int ffs(uint32_t word) return r; } -/************************************************************************ +/**************************************************************************** * Name: up_ack_irq * * Description: * Acknowledge the interrupt * - ************************************************************************/ + ****************************************************************************/ void up_ack_irq(int irq) { diff --git a/arch/arm/src/moxart/moxart_lowputc.S b/arch/arm/src/moxart/moxart_lowputc.S index d57328a17e..750f915e86 100644 --- a/arch/arm/src/moxart/moxart_lowputc.S +++ b/arch/arm/src/moxart/moxart_lowputc.S @@ -56,7 +56,7 @@ **************************************************************************/ /************************************************************************** - * Global Variables + * Public Data **************************************************************************/ /************************************************************************** diff --git a/arch/arm/src/nuc1xx/nuc_timerisr.c b/arch/arm/src/nuc1xx/nuc_timerisr.c index 3840a13c1d..fa64efdfa8 100644 --- a/arch/arm/src/nuc1xx/nuc_timerisr.c +++ b/arch/arm/src/nuc1xx/nuc_timerisr.c @@ -152,7 +152,7 @@ static inline void nuc_lock(void) #endif /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/sam34/sam4cm_supc.c b/arch/arm/src/sam34/sam4cm_supc.c index 5334efcf58..73058cda4d 100644 --- a/arch/arm/src/sam34/sam4cm_supc.c +++ b/arch/arm/src/sam34/sam4cm_supc.c @@ -68,7 +68,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ uint32_t supc_get_slcd_power_mode(void) diff --git a/arch/arm/src/sam34/sam4l_clockconfig.c b/arch/arm/src/sam34/sam4l_clockconfig.c index bbb51f806e..17e04acda0 100644 --- a/arch/arm/src/sam34/sam4l_clockconfig.c +++ b/arch/arm/src/sam34/sam4l_clockconfig.c @@ -446,7 +446,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/sam34/sam4l_gpio.c b/arch/arm/src/sam34/sam4l_gpio.c index d94870a647..f26b6dc0e5 100644 --- a/arch/arm/src/sam34/sam4l_gpio.c +++ b/arch/arm/src/sam34/sam4l_gpio.c @@ -428,7 +428,7 @@ static inline int sam_configperiph(uintptr_t base, uint32_t pin, } /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/sam34/sam4l_periphclks.c b/arch/arm/src/sam34/sam4l_periphclks.c index 2747ac6cbe..0deaa097cd 100644 --- a/arch/arm/src/sam34/sam4l_periphclks.c +++ b/arch/arm/src/sam34/sam4l_periphclks.c @@ -79,7 +79,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/sam34/sam_aes.c b/arch/arm/src/sam34/sam_aes.c old mode 100755 new mode 100644 diff --git a/arch/arm/src/sam34/sam_allocateheap.c b/arch/arm/src/sam34/sam_allocateheap.c index cef06d9e19..16a2a3d477 100644 --- a/arch/arm/src/sam34/sam_allocateheap.c +++ b/arch/arm/src/sam34/sam_allocateheap.c @@ -291,14 +291,14 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size) } #endif -/************************************************************************ +/**************************************************************************** * Name: up_addregion * * Description: * Memory may be added in non-contiguous chunks. Additional chunks are * added by calling this function. * - ************************************************************************/ + ****************************************************************************/ #if CONFIG_MM_REGIONS > 1 void up_addregion(void) diff --git a/arch/arm/src/sam34/sam_gpio.c b/arch/arm/src/sam34/sam_gpio.c index c3f534a757..1dcb4a9811 100644 --- a/arch/arm/src/sam34/sam_gpio.c +++ b/arch/arm/src/sam34/sam_gpio.c @@ -362,7 +362,7 @@ static inline int sam_configperiph(uintptr_t base, uint32_t pin, } /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/sam34/sam_lowputc.c b/arch/arm/src/sam34/sam_lowputc.c index 9cb9a0eecb..54cda81b40 100644 --- a/arch/arm/src/sam34/sam_lowputc.c +++ b/arch/arm/src/sam34/sam_lowputc.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/arm/src/sam34/sam_lowputc.c * * Copyright (C) 2010, 2013-2014 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -65,9 +65,9 @@ #include "chip/sam_pinmap.h" #include -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* Configuration **********************************************************/ @@ -246,37 +246,37 @@ #endif /* HAVE_CONSOLE */ -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - **************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { @@ -336,7 +336,7 @@ int up_putc(int ch) return ch; } -/************************************************************************** +/**************************************************************************** * Name: sam_lowsetup * * Description: @@ -344,7 +344,7 @@ int up_putc(int ch) * console. Its purpose is to get the console output availabe as soon * as possible. * - **************************************************************************/ + ****************************************************************************/ void sam_lowsetup(void) { diff --git a/arch/arm/src/sam34/sam_spi.c b/arch/arm/src/sam34/sam_spi.c index fb1ab49585..81956f3d51 100644 --- a/arch/arm/src/sam34/sam_spi.c +++ b/arch/arm/src/sam34/sam_spi.c @@ -1672,7 +1672,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, } #endif /* CONFIG_SAM34_SPI_DMA */ -/*************************************************************************** +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/arm/src/sam34/sam_timerisr.c b/arch/arm/src/sam34/sam_timerisr.c index a1ebf3421d..29d3f5613f 100644 --- a/arch/arm/src/sam34/sam_timerisr.c +++ b/arch/arm/src/sam34/sam_timerisr.c @@ -108,7 +108,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/sam34/sam_vectors.S b/arch/arm/src/sam34/sam_vectors.S index ad7862e175..9765f61474 100644 --- a/arch/arm/src/sam34/sam_vectors.S +++ b/arch/arm/src/sam34/sam_vectors.S @@ -93,7 +93,7 @@ #define HEAP_BASE (_ebss+CONFIG_IDLETHREAD_STACKSIZE) /************************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************************/ .syntax unified diff --git a/arch/arm/src/sama5/sam_ehci.c b/arch/arm/src/sama5/sam_ehci.c index 603b5c4c05..6fbc135769 100644 --- a/arch/arm/src/sama5/sam_ehci.c +++ b/arch/arm/src/sama5/sam_ehci.c @@ -4667,7 +4667,7 @@ static int sam_reset(void) } /******************************************************************************* - * Global Functions + * Public Functions *******************************************************************************/ /******************************************************************************* * Name: sam_ehci_initialize diff --git a/arch/arm/src/sama5/sam_lcd.c b/arch/arm/src/sama5/sam_lcd.c index 5b10587301..72b2271622 100644 --- a/arch/arm/src/sama5/sam_lcd.c +++ b/arch/arm/src/sama5/sam_lcd.c @@ -2996,7 +2996,7 @@ int up_fbinitialize(void) * Returned value: * Reference to the framebuffer object (NULL on failure) * - ***************************************************************************/ + ****************************************************************************/ struct fb_vtable_s *up_fbgetvplane(int vplane) { diff --git a/arch/arm/src/sama5/sam_lowputc.c b/arch/arm/src/sama5/sam_lowputc.c index 98505d263e..e169ce59e1 100644 --- a/arch/arm/src/sama5/sam_lowputc.c +++ b/arch/arm/src/sama5/sam_lowputc.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/arm/src/sama5/sam_lowputc.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -59,9 +59,9 @@ #include -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* The UART/USART modules are driven by the peripheral clock (MCK or MCK2). */ @@ -224,17 +224,17 @@ UART_MR_CHMODE_NORMAL) #endif -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - **************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { @@ -348,7 +348,7 @@ int up_putc(int ch) return ch; } -/************************************************************************** +/**************************************************************************** * Name: sam_lowsetup * * Description: @@ -356,7 +356,7 @@ int up_putc(int ch) * console. Its purpose is to get the console output availabe as soon * as possible. * - **************************************************************************/ + ****************************************************************************/ void sam_lowsetup(void) { diff --git a/arch/arm/src/sama5/sam_spi.c b/arch/arm/src/sama5/sam_spi.c index a774c08ac0..a5e2819a93 100644 --- a/arch/arm/src/sama5/sam_spi.c +++ b/arch/arm/src/sama5/sam_spi.c @@ -1606,7 +1606,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, } #endif /* CONFIG_SAMA5_SPI_DMA */ -/*************************************************************************** +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/arm/src/sama5/sam_timerisr.c b/arch/arm/src/sama5/sam_timerisr.c index 9f61a40115..4814bf445e 100644 --- a/arch/arm/src/sama5/sam_timerisr.c +++ b/arch/arm/src/sama5/sam_timerisr.c @@ -84,7 +84,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/sama5/sam_usbhost.c b/arch/arm/src/sama5/sam_usbhost.c index ce508baffb..7d8e46d55b 100644 --- a/arch/arm/src/sama5/sam_usbhost.c +++ b/arch/arm/src/sama5/sam_usbhost.c @@ -214,7 +214,7 @@ static const struct sam_usbhost_trace_s g_trace2[TRACE2_NSTRINGS] = ********************************************************************************************/ /******************************************************************************************** - * Global Functions + * Public Functions ********************************************************************************************/ /******************************************************************************************** diff --git a/arch/arm/src/sama5/sama5d2x_pio.c b/arch/arm/src/sama5/sama5d2x_pio.c index 3ea9279c5d..7c54fece09 100644 --- a/arch/arm/src/sama5/sama5d2x_pio.c +++ b/arch/arm/src/sama5/sama5d2x_pio.c @@ -401,7 +401,7 @@ static inline int sam_configperiph(uintptr_t base, uint32_t pin, } /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/sama5/sama5d3x4x_pio.c b/arch/arm/src/sama5/sama5d3x4x_pio.c index c152fe26ed..5192aac267 100644 --- a/arch/arm/src/sama5/sama5d3x4x_pio.c +++ b/arch/arm/src/sama5/sama5d3x4x_pio.c @@ -639,7 +639,7 @@ static inline int sam_configperiph(uintptr_t base, uint32_t pin, } /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/samdl/sam_spi.c b/arch/arm/src/samdl/sam_spi.c index bbbfb55101..e90d5782b5 100644 --- a/arch/arm/src/samdl/sam_spi.c +++ b/arch/arm/src/samdl/sam_spi.c @@ -1342,7 +1342,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, } } -/*************************************************************************** +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/arm/src/samdl/sam_timerisr.c b/arch/arm/src/samdl/sam_timerisr.c index 30ef6370e7..7350694572 100644 --- a/arch/arm/src/samdl/sam_timerisr.c +++ b/arch/arm/src/samdl/sam_timerisr.c @@ -91,7 +91,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/samv7/sam_allocateheap.c b/arch/arm/src/samv7/sam_allocateheap.c index 91f4575943..35a335f9ee 100644 --- a/arch/arm/src/samv7/sam_allocateheap.c +++ b/arch/arm/src/samv7/sam_allocateheap.c @@ -298,14 +298,14 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size) } #endif -/************************************************************************ +/**************************************************************************** * Name: up_addregion * * Description: * Memory may be added in non-contiguous chunks. Additional chunks are * added by calling this function. * - ************************************************************************/ + ****************************************************************************/ #if CONFIG_MM_REGIONS > 1 void up_addregion(void) diff --git a/arch/arm/src/samv7/sam_gpio.c b/arch/arm/src/samv7/sam_gpio.c index 99f8946171..f5b6ed8776 100644 --- a/arch/arm/src/samv7/sam_gpio.c +++ b/arch/arm/src/samv7/sam_gpio.c @@ -398,7 +398,7 @@ static inline int sam_configperiph(uintptr_t base, uint32_t pin, } /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/samv7/sam_lowputc.c b/arch/arm/src/samv7/sam_lowputc.c index b4b2d44a91..52d167cd0f 100644 --- a/arch/arm/src/samv7/sam_lowputc.c +++ b/arch/arm/src/samv7/sam_lowputc.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/arm/src/samv7/sam_lowputc.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -55,9 +55,9 @@ #include "chip/sam_uart.h" #include "chip/sam_pinmap.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* Configuration **********************************************************/ @@ -171,37 +171,37 @@ #endif /* HAVE_SERIAL_CONSOLE */ -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - **************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { @@ -260,7 +260,7 @@ int up_putc(int ch) return ch; } -/************************************************************************** +/**************************************************************************** * Name: sam_lowsetup * * Description: @@ -268,7 +268,7 @@ int up_putc(int ch) * console. Its purpose is to get the console output availabe as soon * as possible. * - **************************************************************************/ + ****************************************************************************/ void sam_lowsetup(void) { diff --git a/arch/arm/src/samv7/sam_mcan.c b/arch/arm/src/samv7/sam_mcan.c old mode 100755 new mode 100644 index 45acfe4972..c64921301c --- a/arch/arm/src/samv7/sam_mcan.c +++ b/arch/arm/src/samv7/sam_mcan.c @@ -2882,7 +2882,7 @@ static bool mcan_txempty(FAR struct can_dev_s *dev) * Returned Value: * True: Data is available * - ***************************************************************************/ + ****************************************************************************/ #if 0 /* Not Used */ bool mcan_dedicated_rxbuffer_available(FAR struct sam_mcan_s *priv, int bufndx) diff --git a/arch/arm/src/samv7/sam_spi.c b/arch/arm/src/samv7/sam_spi.c index ec2b53c345..204e009e26 100644 --- a/arch/arm/src/samv7/sam_spi.c +++ b/arch/arm/src/samv7/sam_spi.c @@ -1653,7 +1653,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, } #endif /* CONFIG_SAMV7_SPI_DMA */ -/*************************************************************************** +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/arm/src/samv7/sam_timerisr.c b/arch/arm/src/samv7/sam_timerisr.c index 825be35e32..925292fdc0 100644 --- a/arch/arm/src/samv7/sam_timerisr.c +++ b/arch/arm/src/samv7/sam_timerisr.c @@ -94,7 +94,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/stm32/stm32_bbsram.c b/arch/arm/src/stm32/stm32_bbsram.c index 5fdbc5bbfa..80fc2c8eac 100644 --- a/arch/arm/src/stm32/stm32_bbsram.c +++ b/arch/arm/src/stm32/stm32_bbsram.c @@ -67,7 +67,7 @@ /**************************************************************************** * Pre-processor Definitions - ***************************************************************************/ + ****************************************************************************/ #if !defined(CONFIG_STM32_BKPSRAM) #error Driver Requires CONFIG_STM32_BKPSRAM to be enabled diff --git a/arch/arm/src/stm32/stm32_lowputc.c b/arch/arm/src/stm32/stm32_lowputc.c index 545bc2cc53..33520b5bc6 100644 --- a/arch/arm/src/stm32/stm32_lowputc.c +++ b/arch/arm/src/stm32/stm32_lowputc.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/arm/src/stm32/stm32_lowputc.c * * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -53,9 +53,9 @@ #include "stm32_gpio.h" #include "stm32_uart.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* Select USART parameters for the selected console */ @@ -368,37 +368,37 @@ # endif /* CONFIG_STM32_STM32F30XX */ #endif /* HAVE_CONSOLE */ -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - **************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { @@ -422,7 +422,7 @@ void up_lowputc(char ch) #endif /* HAVE_CONSOLE */ } -/************************************************************************** +/**************************************************************************** * Name: stm32_lowsetup * * Description: @@ -430,7 +430,7 @@ void up_lowputc(char ch) * console. Its purpose is to get the console output availabe as soon * as possible. * - **************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_STM32_STM32F10XX) diff --git a/arch/arm/src/stm32/stm32_procfs_ccm.c b/arch/arm/src/stm32/stm32_procfs_ccm.c index 49b3a7351b..a74c4c7686 100644 --- a/arch/arm/src/stm32/stm32_procfs_ccm.c +++ b/arch/arm/src/stm32/stm32_procfs_ccm.c @@ -106,7 +106,7 @@ static int ccm_stat(FAR const char *relpath, FAR struct stat *buf); ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /* See include/nutts/fs/procfs.h diff --git a/arch/arm/src/stm32/stm32_spi.c b/arch/arm/src/stm32/stm32_spi.c index 6fdb028b88..278e9c8871 100644 --- a/arch/arm/src/stm32/stm32_spi.c +++ b/arch/arm/src/stm32/stm32_spi.c @@ -1360,7 +1360,7 @@ static void spi_exchange_nodma(FAR struct spi_dev_s *dev, FAR const void *txbuff } #endif /* !CONFIG_STM32_SPI_DMA || CONFIG_STM32_DMACAPABLE */ -/************************************************************************* +/**************************************************************************** * Name: spi_exchange (with DMA capability) * * Description: @@ -1421,7 +1421,7 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, } #endif /* CONFIG_STM32_SPI_DMA */ -/************************************************************************* +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/arm/src/stm32/stm32_timerisr.c b/arch/arm/src/stm32/stm32_timerisr.c index d7f3eafd2b..e4919c3847 100644 --- a/arch/arm/src/stm32/stm32_timerisr.c +++ b/arch/arm/src/stm32/stm32_timerisr.c @@ -94,7 +94,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/stm32/stm32_usbhost.c b/arch/arm/src/stm32/stm32_usbhost.c index 8f887697dd..0c3ff5a37f 100644 --- a/arch/arm/src/stm32/stm32_usbhost.c +++ b/arch/arm/src/stm32/stm32_usbhost.c @@ -214,7 +214,7 @@ static const struct stm32_usbhost_trace_s g_trace2[TRACE2_NSTRINGS] = ********************************************************************************************/ /******************************************************************************************** - * Global Functions + * Public Functions ********************************************************************************************/ /******************************************************************************************** diff --git a/arch/arm/src/stm32/stm32_vectors.S b/arch/arm/src/stm32/stm32_vectors.S index 8b8c297bad..ae04b7d501 100644 --- a/arch/arm/src/stm32/stm32_vectors.S +++ b/arch/arm/src/stm32/stm32_vectors.S @@ -99,7 +99,7 @@ #define HEAP_BASE (_ebss+CONFIG_IDLETHREAD_STACKSIZE) /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .syntax unified diff --git a/arch/arm/src/stm32f7/stm32_lowputc.c b/arch/arm/src/stm32f7/stm32_lowputc.c index a1c346cee2..286178096e 100644 --- a/arch/arm/src/stm32f7/stm32_lowputc.c +++ b/arch/arm/src/stm32f7/stm32_lowputc.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/arm/src/stm32f7/stm32_lowputc.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -53,9 +53,9 @@ #include -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* Select USART parameters for the selected console */ @@ -300,37 +300,37 @@ # endif #endif /* HAVE_CONSOLE */ -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - **************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { @@ -354,7 +354,7 @@ void up_lowputc(char ch) #endif /* HAVE_CONSOLE */ } -/************************************************************************** +/**************************************************************************** * Name: stm32_lowsetup * * Description: @@ -362,7 +362,7 @@ void up_lowputc(char ch) * console. Its purpose is to get the console output availabe as soon * as possible. * - **************************************************************************/ + ****************************************************************************/ void stm32_lowsetup(void) { diff --git a/arch/arm/src/stm32f7/stm32_procfs_dtcm.c b/arch/arm/src/stm32f7/stm32_procfs_dtcm.c index 19e0485307..2ca6687783 100644 --- a/arch/arm/src/stm32f7/stm32_procfs_dtcm.c +++ b/arch/arm/src/stm32f7/stm32_procfs_dtcm.c @@ -112,7 +112,7 @@ static int dtcm_stat(FAR const char *relpath, FAR struct stat *buf); ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /* See include/nutts/fs/procfs.h diff --git a/arch/arm/src/stm32f7/stm32_timerisr.c b/arch/arm/src/stm32f7/stm32_timerisr.c index ee89a08bce..db9c685cdf 100644 --- a/arch/arm/src/stm32f7/stm32_timerisr.c +++ b/arch/arm/src/stm32f7/stm32_timerisr.c @@ -100,7 +100,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/str71x/str71x_lowputc.c b/arch/arm/src/str71x/str71x_lowputc.c index bf70f4730b..5262894e2d 100644 --- a/arch/arm/src/str71x/str71x_lowputc.c +++ b/arch/arm/src/str71x/str71x_lowputc.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/arm/src/str71x/str71x_lowputc.c * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include #include @@ -46,9 +46,9 @@ #include "str71x_internal.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* Configuration **********************************************************/ @@ -218,37 +218,37 @@ #define UART_BAUDDIVISOR (16 * STR71X_UART_BAUD) #define UART_BAUDRATE ((STR71X_PCLK1 + (UART_BAUDDIVISOR/2)) / UART_BAUDDIVISOR) -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - **************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { @@ -263,7 +263,7 @@ void up_lowputc(char ch) #endif } -/************************************************************************** +/**************************************************************************** * Name: up_lowsetup * * Description: @@ -271,7 +271,7 @@ void up_lowputc(char ch) * console. Its purpose is to get the console output availabe as soon * as possible. * - **************************************************************************/ + ****************************************************************************/ void up_lowsetup(void) { diff --git a/arch/arm/src/str71x/str71x_timerisr.c b/arch/arm/src/str71x/str71x_timerisr.c index b93e43c770..a255389774 100644 --- a/arch/arm/src/str71x/str71x_timerisr.c +++ b/arch/arm/src/str71x/str71x_timerisr.c @@ -120,7 +120,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/tiva/tiva_dumpgpio.c b/arch/arm/src/tiva/tiva_dumpgpio.c index 689f4ee587..f51f53d432 100644 --- a/arch/arm/src/tiva/tiva_dumpgpio.c +++ b/arch/arm/src/tiva/tiva_dumpgpio.c @@ -126,7 +126,7 @@ static inline uint8_t tiva_gpioport(int port) } /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/tiva/tiva_lowputc.c b/arch/arm/src/tiva/tiva_lowputc.c index 4bc46c805f..192869c6eb 100644 --- a/arch/arm/src/tiva/tiva_lowputc.c +++ b/arch/arm/src/tiva/tiva_lowputc.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/arm/src/tiva/tiva_lowputc.c * * Copyright (C) 2009-2010, 2014 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include #include @@ -54,9 +54,9 @@ #include "tiva_lowputc.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* Configuration **********************************************************/ /* Select UART parameters for the selected console */ @@ -200,37 +200,37 @@ * Which should yied BAUD = 50,000,000 / (16 * (27 + 8/64)) = 115207.37 */ -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - **************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { @@ -245,7 +245,7 @@ void up_lowputc(char ch) #endif } -/************************************************************************** +/**************************************************************************** * Name: up_lowsetup * * Description: @@ -253,7 +253,7 @@ void up_lowputc(char ch) * console. Its purpose is to get the console output availabe as soon * as possible. * - **************************************************************************/ + ****************************************************************************/ void up_lowsetup(void) { diff --git a/arch/arm/src/tiva/tiva_ssi.c b/arch/arm/src/tiva/tiva_ssi.c index 094b8c8212..6ee628226b 100644 --- a/arch/arm/src/tiva/tiva_ssi.c +++ b/arch/arm/src/tiva/tiva_ssi.c @@ -1437,7 +1437,7 @@ static void ssi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, } #endif -/************************************************************************* +/**************************************************************************** * Name: ssi_sndblock * * Description: diff --git a/arch/arm/src/tiva/tiva_timerisr.c b/arch/arm/src/tiva/tiva_timerisr.c index 70cfacc821..235b7abdf8 100644 --- a/arch/arm/src/tiva/tiva_timerisr.c +++ b/arch/arm/src/tiva/tiva_timerisr.c @@ -84,7 +84,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/arm/src/tiva/tiva_vectors.S b/arch/arm/src/tiva/tiva_vectors.S index 13b154e152..4f56269ba4 100644 --- a/arch/arm/src/tiva/tiva_vectors.S +++ b/arch/arm/src/tiva/tiva_vectors.S @@ -98,7 +98,7 @@ #define HEAP_BASE (_ebss+CONFIG_IDLETHREAD_STACKSIZE) /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .syntax unified diff --git a/arch/avr/include/arch.h b/arch/avr/include/arch.h index 4e753a0f11..ecf79ea276 100644 --- a/arch/avr/include/arch.h +++ b/arch/avr/include/arch.h @@ -59,7 +59,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/include/at32uc3/irq.h b/arch/avr/include/at32uc3/irq.h index 5873579f25..b5395b1b7b 100644 --- a/arch/avr/include/at32uc3/irq.h +++ b/arch/avr/include/at32uc3/irq.h @@ -610,7 +610,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/include/at90usb/irq.h b/arch/avr/include/at90usb/irq.h index 7980526d7b..4c62130990 100644 --- a/arch/avr/include/at90usb/irq.h +++ b/arch/avr/include/at90usb/irq.h @@ -107,7 +107,7 @@ #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/include/atmega/irq.h b/arch/avr/include/atmega/irq.h index 0640db80c9..037a8d2542 100644 --- a/arch/avr/include/atmega/irq.h +++ b/arch/avr/include/atmega/irq.h @@ -143,7 +143,7 @@ #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/include/avr/irq.h b/arch/avr/include/avr/irq.h index afca2e588d..954d1e6d34 100644 --- a/arch/avr/include/avr/irq.h +++ b/arch/avr/include/avr/irq.h @@ -182,7 +182,7 @@ static inline void irqrestore(irqstate_t flags) #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/include/avr/syscall.h b/arch/avr/include/avr/syscall.h index a7bb2cf1fb..0f758fba45 100644 --- a/arch/avr/include/avr/syscall.h +++ b/arch/avr/include/avr/syscall.h @@ -58,7 +58,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/include/avr32/irq.h b/arch/avr/include/avr32/irq.h index 2ef80d2652..d44c91a64f 100644 --- a/arch/avr/include/avr32/irq.h +++ b/arch/avr/include/avr32/irq.h @@ -192,7 +192,7 @@ static inline void irqrestore(irqstate_t flags) #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/include/avr32/syscall.h b/arch/avr/include/avr32/syscall.h index 7e47929e53..cab4e8af46 100644 --- a/arch/avr/include/avr32/syscall.h +++ b/arch/avr/include/avr32/syscall.h @@ -58,7 +58,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/include/irq.h b/arch/avr/include/irq.h index 1d90e5637e..6fdfcb0124 100644 --- a/arch/avr/include/irq.h +++ b/arch/avr/include/irq.h @@ -75,7 +75,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/include/syscall.h b/arch/avr/include/syscall.h index 2f5db66a6c..c1f5b85a59 100644 --- a/arch/avr/include/syscall.h +++ b/arch/avr/include/syscall.h @@ -65,7 +65,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/include/xmega/chip.h b/arch/avr/include/xmega/chip.h index 167c496c34..819ce13b78 100644 --- a/arch/avr/include/xmega/chip.h +++ b/arch/avr/include/xmega/chip.h @@ -61,7 +61,7 @@ #ifndef __ASSEMBLY__ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifdef __cplusplus diff --git a/arch/avr/include/xmega/irq.h b/arch/avr/include/xmega/irq.h index d87fbade1a..221c43b1ea 100644 --- a/arch/avr/include/xmega/irq.h +++ b/arch/avr/include/xmega/irq.h @@ -64,7 +64,7 @@ #ifndef __ASSEMBLY__ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifdef __cplusplus diff --git a/arch/avr/include/xmega/xmegac_irq.h b/arch/avr/include/xmega/xmegac_irq.h index acc5bd86e8..150826319e 100644 --- a/arch/avr/include/xmega/xmegac_irq.h +++ b/arch/avr/include/xmega/xmegac_irq.h @@ -99,7 +99,7 @@ #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/src/at32uc3/at32uc3_clkinit.c b/arch/avr/src/at32uc3/at32uc3_clkinit.c index 38ffebd333..53eb5ad04d 100644 --- a/arch/avr/src/at32uc3/at32uc3_clkinit.c +++ b/arch/avr/src/at32uc3/at32uc3_clkinit.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/avr/src/at32uc3/at32uc3_clkinit.c * * Copyright (C) 2010 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -49,9 +49,9 @@ #include "at32uc3_pm.h" #include "at32uc3_flashc.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ #if defined(AVR32_CLOCK_OSC0) || \ (defined (AVR32_CLOCK_PLL0) && defined(AVR32_CLOCK_PLL0_OSC0)) || \ @@ -65,34 +65,34 @@ # define NEED_OSC1 #endif -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_enableosc32 * * Description: * Initialiaze the 32KHz oscillaor. This oscillaor is used by the RTC * logic to provide the sysem timer. * - **************************************************************************/ + ****************************************************************************/ #ifdef AVR32_CLOCK_OSC32 static inline void up_enableosc32(void) @@ -115,13 +115,13 @@ static inline void up_enableosc32(void) } #endif -/************************************************************************** +/**************************************************************************** * Name: up_enableosc0 * * Description: * Initialiaze OSC0 settings per the definitions in the board.h file. * - **************************************************************************/ + ****************************************************************************/ #ifdef NEED_OSC0 static inline void up_enableosc0(void) @@ -164,13 +164,13 @@ static inline void up_enableosc0(void) } #endif -/************************************************************************** +/**************************************************************************** * Name: up_enableosc1 * * Description: * Initialiaze OSC0 settings per the definitions in the board.h file. * - **************************************************************************/ + ****************************************************************************/ #ifdef NEED_OSC1 static inline void up_enableosc1(void) @@ -213,13 +213,13 @@ static inline void up_enableosc1(void) } #endif -/************************************************************************** +/**************************************************************************** * Name: up_enablepll0 * * Description: * Initialiaze PLL0 settings per the definitions in the board.h file. * - **************************************************************************/ + ****************************************************************************/ #ifdef AVR32_CLOCK_PLL0 static inline void up_enablepll0(void) @@ -263,13 +263,13 @@ static inline void up_enablepll0(void) } #endif -/************************************************************************** +/**************************************************************************** * Name: up_enablepll1 * * Description: * Initialiaze PLL1 settings per the definitions in the board.h file. * - **************************************************************************/ + ****************************************************************************/ #ifdef AVR32_CLOCK_PLL1 static inline void up_enablepll1(void) @@ -313,13 +313,13 @@ static inline void up_enablepll1(void) } #endif -/************************************************************************** +/**************************************************************************** * Name: up_clksel * * Description: * Configure derived clocks. * - **************************************************************************/ + ****************************************************************************/ static inline void up_clksel(void) { @@ -352,13 +352,13 @@ static inline void up_clksel(void) while ((getreg32(AVR32_PM_POSCSR) & PM_POSCSR_CKRDY) == 0); } -/************************************************************************** +/**************************************************************************** * Name: up_fws * * Description: * Setup FLASH wait states. * - **************************************************************************/ + ****************************************************************************/ static void up_fws(uint32_t cpuclock) { @@ -376,13 +376,13 @@ static void up_fws(uint32_t cpuclock) putreg32(regval, AVR32_FLASHC_FCR); } -/************************************************************************** +/**************************************************************************** * Name: up_mainclk * * Description: * Select the main clock. * - **************************************************************************/ + ****************************************************************************/ static inline void up_mainclk(uint32_t mcsel) { @@ -394,13 +394,13 @@ static inline void up_mainclk(uint32_t mcsel) putreg32(regval, AVR32_PM_MCCTRL); } -/************************************************************************** +/**************************************************************************** * Name: up_usbclock * * Description: * Setup the USBB GCLK. * - **************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV static inline void up_usbclock(void) @@ -429,18 +429,18 @@ static inline void up_usbclock(void) } #endif -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_clkinit * * Description: * Initialiaze clock/PLL settings per the definitions in the board.h * file. * - **************************************************************************/ + ****************************************************************************/ void up_clkinitialize(void) { diff --git a/arch/avr/src/at32uc3/at32uc3_gpio.c b/arch/avr/src/at32uc3/at32uc3_gpio.c index ae883bd319..0ad8125da8 100644 --- a/arch/avr/src/at32uc3/at32uc3_gpio.c +++ b/arch/avr/src/at32uc3/at32uc3_gpio.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/avr/src/at32uc3/at32uc3_gpio.c * * Copyright (C) 2010 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -50,9 +50,9 @@ #include "chip.h" #include "at32uc3_gpio.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* How many GPIO ports are supported? There are 32-pins per port and we * know he number of GPIO pins supported by the architecture: @@ -60,21 +60,21 @@ #define AVR32_NGPIO_PORTS ((AVR32_NGPIO+31) >> 5) -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ static uint32_t g_portmap[AVR32_NGPIO_PORTS] = { @@ -95,13 +95,13 @@ static uint32_t g_portmap[AVR32_NGPIO_PORTS] = #endif }; -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ /************************************************************************************ * Name: at32uc3_configgpio diff --git a/arch/avr/src/at32uc3/at32uc3_lowconsole.c b/arch/avr/src/at32uc3/at32uc3_lowconsole.c index 654e467e9f..86e66143b4 100644 --- a/arch/avr/src/at32uc3/at32uc3_lowconsole.c +++ b/arch/avr/src/at32uc3/at32uc3_lowconsole.c @@ -90,7 +90,7 @@ ******************************************************************************/ /****************************************************************************** - * Global Variables + * Public Data ******************************************************************************/ /****************************************************************************** diff --git a/arch/avr/src/at32uc3/at32uc3_lowinit.c b/arch/avr/src/at32uc3/at32uc3_lowinit.c index 8b1279abca..0ab2bc2c44 100644 --- a/arch/avr/src/at32uc3/at32uc3_lowinit.c +++ b/arch/avr/src/at32uc3/at32uc3_lowinit.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/avr/src/at32uc3/at32uc3_lowinit.c * * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -43,35 +43,35 @@ #include "up_internal.h" #include "at32uc3_internal.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowinit * * Description: @@ -79,7 +79,7 @@ * console. Its purpose is to get the console output availabe as soon * as possible. * - **************************************************************************/ + ****************************************************************************/ void up_lowinit(void) { diff --git a/arch/avr/src/at32uc3/at32uc3_timerisr.c b/arch/avr/src/at32uc3/at32uc3_timerisr.c index fca9b580d1..acb508cab0 100644 --- a/arch/avr/src/at32uc3/at32uc3_timerisr.c +++ b/arch/avr/src/at32uc3/at32uc3_timerisr.c @@ -153,7 +153,7 @@ static void rtc_waitnotbusy(void) } /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/src/at90usb/at90usb_lowconsole.c b/arch/avr/src/at90usb/at90usb_lowconsole.c index c4aa274e10..637793b771 100644 --- a/arch/avr/src/at90usb/at90usb_lowconsole.c +++ b/arch/avr/src/at90usb/at90usb_lowconsole.c @@ -125,7 +125,7 @@ ******************************************************************************/ /****************************************************************************** - * Global Variables + * Public Data ******************************************************************************/ /****************************************************************************** diff --git a/arch/avr/src/at90usb/at90usb_lowinit.c b/arch/avr/src/at90usb/at90usb_lowinit.c index 8c01cd4d5e..2d49736f5f 100644 --- a/arch/avr/src/at90usb/at90usb_lowinit.c +++ b/arch/avr/src/at90usb/at90usb_lowinit.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/avr/src/at90usb/at90usb_lowinit.c * * Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include #include @@ -45,9 +45,9 @@ #include "up_internal.h" #include "at90usb_internal.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_WDTO_15MS) # define WDTO_VALUE WDTO_15MS @@ -71,33 +71,33 @@ # define WDTO_VALUE WDTO_8S #endif -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_wdtinit * * Description: * Initialize the watchdog per the NuttX configuration. * - **************************************************************************/ + ****************************************************************************/ static inline void up_wdtinit(void) { @@ -106,11 +106,11 @@ static inline void up_wdtinit(void) #endif } -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowinit * * Description: @@ -118,7 +118,7 @@ static inline void up_wdtinit(void) * console. Its purpose is to get the console output availabe as soon * as possible. * - **************************************************************************/ + ****************************************************************************/ void up_lowinit(void) { diff --git a/arch/avr/src/at90usb/at90usb_timerisr.c b/arch/avr/src/at90usb/at90usb_timerisr.c index 4d8e565fc4..7aa9e66493 100644 --- a/arch/avr/src/at90usb/at90usb_timerisr.c +++ b/arch/avr/src/at90usb/at90usb_timerisr.c @@ -111,7 +111,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/src/atmega/atmega_lowconsole.c b/arch/avr/src/atmega/atmega_lowconsole.c index cd4dc347e9..a5ed1fc345 100644 --- a/arch/avr/src/atmega/atmega_lowconsole.c +++ b/arch/avr/src/atmega/atmega_lowconsole.c @@ -184,7 +184,7 @@ ******************************************************************************/ /****************************************************************************** - * Global Variables + * Public Data ******************************************************************************/ /****************************************************************************** diff --git a/arch/avr/src/atmega/atmega_lowinit.c b/arch/avr/src/atmega/atmega_lowinit.c index e56480adc2..dacb520d92 100644 --- a/arch/avr/src/atmega/atmega_lowinit.c +++ b/arch/avr/src/atmega/atmega_lowinit.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/avr/src/atmega/atmega_lowinit.c * * Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include #include @@ -45,9 +45,9 @@ #include "up_internal.h" #include "atmega_internal.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_WDTO_15MS) # define WDTO_VALUE WDTO_15MS @@ -71,33 +71,33 @@ # define WDTO_VALUE WDTO_8S #endif -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_wdtinit * * Description: * Initialize the watchdog per the NuttX configuration. * - **************************************************************************/ + ****************************************************************************/ static inline void up_wdtinit(void) { @@ -106,11 +106,11 @@ static inline void up_wdtinit(void) #endif } -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowinit * * Description: @@ -118,7 +118,7 @@ static inline void up_wdtinit(void) * console. Its purpose is to get the console output availabe as soon * as possible. * - **************************************************************************/ + ****************************************************************************/ void up_lowinit(void) { diff --git a/arch/avr/src/atmega/atmega_timerisr.c b/arch/avr/src/atmega/atmega_timerisr.c index 1e470264bd..2b30a2b7d6 100644 --- a/arch/avr/src/atmega/atmega_timerisr.c +++ b/arch/avr/src/atmega/atmega_timerisr.c @@ -111,7 +111,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/src/avr/avr_internal.h b/arch/avr/src/avr/avr_internal.h index b0b8dba96f..a7d000ec1a 100644 --- a/arch/avr/src/avr/avr_internal.h +++ b/arch/avr/src/avr/avr_internal.h @@ -66,7 +66,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/avr/src/avr/excptmacros.h b/arch/avr/src/avr/excptmacros.h index 97b17b41b7..be19551c7f 100644 --- a/arch/avr/src/avr/excptmacros.h +++ b/arch/avr/src/avr/excptmacros.h @@ -58,7 +58,7 @@ ********************************************************************************************/ /******************************************************************************************** - * Global Symbols + * Public Symbols ********************************************************************************************/ #if CONFIG_ARCH_INTERRUPTSTACK > 3 diff --git a/arch/avr/src/avr/up_createstack.c b/arch/avr/src/avr/up_createstack.c index 0b5e4ab939..860f0471eb 100644 --- a/arch/avr/src/avr/up_createstack.c +++ b/arch/avr/src/avr/up_createstack.c @@ -63,7 +63,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/src/avr/up_spi.c b/arch/avr/src/avr/up_spi.c index e467d3e434..75ebe41da9 100644 --- a/arch/avr/src/avr/up_spi.c +++ b/arch/avr/src/avr/up_spi.c @@ -400,7 +400,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) return (uint16_t)SPDR; } -/************************************************************************* +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/avr/src/avr/up_stackframe.c b/arch/avr/src/avr/up_stackframe.c index 1dfa238a28..0f7d3a8746 100644 --- a/arch/avr/src/avr/up_stackframe.c +++ b/arch/avr/src/avr/up_stackframe.c @@ -62,7 +62,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/src/avr/up_switchcontext.S b/arch/avr/src/avr/up_switchcontext.S index 62532081f1..645d5e17a9 100755 --- a/arch/avr/src/avr/up_switchcontext.S +++ b/arch/avr/src/avr/up_switchcontext.S @@ -46,7 +46,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .file "up_switchcontext.S" diff --git a/arch/avr/src/avr/up_usestack.c b/arch/avr/src/avr/up_usestack.c index 84817e356a..0546d8c770 100644 --- a/arch/avr/src/avr/up_usestack.c +++ b/arch/avr/src/avr/up_usestack.c @@ -59,7 +59,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/src/avr32/avr32_internal.h b/arch/avr/src/avr32/avr32_internal.h index 14d9c85210..f6078e881a 100644 --- a/arch/avr/src/avr32/avr32_internal.h +++ b/arch/avr/src/avr32/avr32_internal.h @@ -64,7 +64,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/avr/src/avr32/up_createstack.c b/arch/avr/src/avr32/up_createstack.c index 6ad3a52bbc..d6d5b01789 100644 --- a/arch/avr/src/avr32/up_createstack.c +++ b/arch/avr/src/avr32/up_createstack.c @@ -63,7 +63,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/src/avr32/up_stackframe.c b/arch/avr/src/avr32/up_stackframe.c index 576f832850..acd10d9216 100644 --- a/arch/avr/src/avr32/up_stackframe.c +++ b/arch/avr/src/avr32/up_stackframe.c @@ -74,7 +74,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/src/avr32/up_switchcontext.S b/arch/avr/src/avr32/up_switchcontext.S index 91b6a98bae..8820427e69 100755 --- a/arch/avr/src/avr32/up_switchcontext.S +++ b/arch/avr/src/avr32/up_switchcontext.S @@ -46,7 +46,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .file "up_switchcontext.S" diff --git a/arch/avr/src/avr32/up_syscall6.S b/arch/avr/src/avr32/up_syscall6.S index 78e518dd75..a0fdf0c163 100755 --- a/arch/avr/src/avr32/up_syscall6.S +++ b/arch/avr/src/avr32/up_syscall6.S @@ -49,7 +49,7 @@ ****************************************************************************/ /**************************************************************************** - * Globals + * Public Symbols ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/src/avr32/up_usestack.c b/arch/avr/src/avr32/up_usestack.c index 8e7f398c06..533c82a16c 100644 --- a/arch/avr/src/avr32/up_usestack.c +++ b/arch/avr/src/avr32/up_usestack.c @@ -58,7 +58,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/src/common/up_internal.h b/arch/avr/src/common/up_internal.h index 98936cb59f..c2beb82671 100644 --- a/arch/avr/src/common/up_internal.h +++ b/arch/avr/src/common/up_internal.h @@ -90,7 +90,7 @@ typedef void (*up_vector_t)(void); #endif /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/avr/src/common/up_interruptcontext.c b/arch/avr/src/common/up_interruptcontext.c index 4930e56eac..ac9525c5cf 100644 --- a/arch/avr/src/common/up_interruptcontext.c +++ b/arch/avr/src/common/up_interruptcontext.c @@ -54,7 +54,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/avr/src/common/up_releasestack.c b/arch/avr/src/common/up_releasestack.c index 7595f1e0af..9cda128cab 100644 --- a/arch/avr/src/common/up_releasestack.c +++ b/arch/avr/src/common/up_releasestack.c @@ -56,7 +56,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/hc/include/arch.h b/arch/hc/include/arch.h index d4b470fdd3..8c1db80697 100644 --- a/arch/hc/include/arch.h +++ b/arch/hc/include/arch.h @@ -59,7 +59,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/hc/include/hc12/types.h b/arch/hc/include/hc12/types.h index 751247150b..3f2dc7c48f 100644 --- a/arch/hc/include/hc12/types.h +++ b/arch/hc/include/hc12/types.h @@ -97,7 +97,7 @@ typedef unsigned int irqstate_t; #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************/ #endif /* __ARCH_HC_INCLUDE_HC12_TYPES_H */ diff --git a/arch/hc/include/hcs12/types.h b/arch/hc/include/hcs12/types.h index 7c84a69e30..fbe5d737de 100644 --- a/arch/hc/include/hcs12/types.h +++ b/arch/hc/include/hcs12/types.h @@ -98,7 +98,7 @@ typedef unsigned char irqstate_t; #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************/ #endif /* __ARCH_HC_INCLUDE_HCS12_TYPES_H */ diff --git a/arch/hc/include/irq.h b/arch/hc/include/irq.h index 160f41a9fc..da1f69d72f 100644 --- a/arch/hc/include/irq.h +++ b/arch/hc/include/irq.h @@ -75,7 +75,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/hc/include/syscall.h b/arch/hc/include/syscall.h index efb94f4ef9..a9d1b5ce83 100644 --- a/arch/hc/include/syscall.h +++ b/arch/hc/include/syscall.h @@ -57,7 +57,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/hc/include/types.h b/arch/hc/include/types.h index e6def4b405..e7b133b964 100644 --- a/arch/hc/include/types.h +++ b/arch/hc/include/types.h @@ -61,7 +61,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************/ #endif /* __ARCH_HC_INCLUDE_TYPES_H */ diff --git a/arch/hc/src/common/up_createstack.c b/arch/hc/src/common/up_createstack.c index f1ec61333d..278a643f7b 100644 --- a/arch/hc/src/common/up_createstack.c +++ b/arch/hc/src/common/up_createstack.c @@ -60,7 +60,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/hc/src/common/up_internal.h b/arch/hc/src/common/up_internal.h index e076c5e36e..61c116c2d1 100644 --- a/arch/hc/src/common/up_internal.h +++ b/arch/hc/src/common/up_internal.h @@ -126,7 +126,7 @@ typedef void (*up_vector_t)(void); #endif /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/hc/src/common/up_interruptcontext.c b/arch/hc/src/common/up_interruptcontext.c index 87c5053287..31628790bb 100644 --- a/arch/hc/src/common/up_interruptcontext.c +++ b/arch/hc/src/common/up_interruptcontext.c @@ -54,7 +54,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/hc/src/common/up_releasestack.c b/arch/hc/src/common/up_releasestack.c index 86819d3894..03d50098e1 100644 --- a/arch/hc/src/common/up_releasestack.c +++ b/arch/hc/src/common/up_releasestack.c @@ -56,7 +56,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/hc/src/common/up_stackframe.c b/arch/hc/src/common/up_stackframe.c index 72777893da..d712bb7d3b 100644 --- a/arch/hc/src/common/up_stackframe.c +++ b/arch/hc/src/common/up_stackframe.c @@ -74,7 +74,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/hc/src/common/up_usestack.c b/arch/hc/src/common/up_usestack.c index 047ba2e9a5..6160e92b5e 100644 --- a/arch/hc/src/common/up_usestack.c +++ b/arch/hc/src/common/up_usestack.c @@ -57,7 +57,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/hc/src/m9s12/m9s12_lowputc.S b/arch/hc/src/m9s12/m9s12_lowputc.S index f8cfe89325..55500e17e1 100755 --- a/arch/hc/src/m9s12/m9s12_lowputc.S +++ b/arch/hc/src/m9s12/m9s12_lowputc.S @@ -117,7 +117,7 @@ **************************************************************************/ /************************************************************************** - * Global Variables + * Public Data **************************************************************************/ /************************************************************************** diff --git a/arch/hc/src/m9s12/m9s12_saveusercontext.S b/arch/hc/src/m9s12/m9s12_saveusercontext.S index 2f12346d3c..aef92b1350 100755 --- a/arch/hc/src/m9s12/m9s12_saveusercontext.S +++ b/arch/hc/src/m9s12/m9s12_saveusercontext.S @@ -65,7 +65,7 @@ **************************************************************************/ /************************************************************************** - * Global Variables + * Public Data **************************************************************************/ /************************************************************************** diff --git a/arch/hc/src/m9s12/m9s12_start.S b/arch/hc/src/m9s12/m9s12_start.S index ef01e906cc..f72880fe76 100755 --- a/arch/hc/src/m9s12/m9s12_start.S +++ b/arch/hc/src/m9s12/m9s12_start.S @@ -64,7 +64,7 @@ #define INITEE_EE (MMC_INITEE_EE(HCS12_EEPROM_BASE)|MMC_INITEE_EEON) /**************************************************************************** - * Global Symbols + * Public Symbols ****************************************************************************/ .file "m9s12_start.S" diff --git a/arch/hc/src/m9s12/m9s12_timerisr.c b/arch/hc/src/m9s12/m9s12_timerisr.c index da31020bdd..ee93435f48 100644 --- a/arch/hc/src/m9s12/m9s12_timerisr.c +++ b/arch/hc/src/m9s12/m9s12_timerisr.c @@ -127,7 +127,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/hc/src/m9s12/m9s12_vectors.S b/arch/hc/src/m9s12/m9s12_vectors.S index d7d929b65a..fbe4d69f0a 100755 --- a/arch/hc/src/m9s12/m9s12_vectors.S +++ b/arch/hc/src/m9s12/m9s12_vectors.S @@ -54,7 +54,7 @@ #endif /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .globl __start diff --git a/arch/mips/include/arch.h b/arch/mips/include/arch.h index 9fffb8a89e..04eb2a9d74 100644 --- a/arch/mips/include/arch.h +++ b/arch/mips/include/arch.h @@ -59,7 +59,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/include/irq.h b/arch/mips/include/irq.h index d9cfd956de..58826d4bd7 100644 --- a/arch/mips/include/irq.h +++ b/arch/mips/include/irq.h @@ -75,7 +75,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/include/mips32/irq.h b/arch/mips/include/mips32/irq.h index e9c94cbf3c..3ca53adf1b 100644 --- a/arch/mips/include/mips32/irq.h +++ b/arch/mips/include/mips32/irq.h @@ -497,7 +497,7 @@ static inline void cp0_putcause(uint32_t cause) } /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/include/mips32/registers.h b/arch/mips/include/mips32/registers.h index 00696dce44..016d1278ba 100644 --- a/arch/mips/include/mips32/registers.h +++ b/arch/mips/include/mips32/registers.h @@ -121,7 +121,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/include/mips32/syscall.h b/arch/mips/include/mips32/syscall.h index 44e719d11a..4661145d46 100644 --- a/arch/mips/include/mips32/syscall.h +++ b/arch/mips/include/mips32/syscall.h @@ -193,7 +193,7 @@ #ifndef __ASSEMBLY__ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/include/pic32mx/irq.h b/arch/mips/include/pic32mx/irq.h index 96896cf8f2..25d4c6f5cd 100644 --- a/arch/mips/include/pic32mx/irq.h +++ b/arch/mips/include/pic32mx/irq.h @@ -190,7 +190,7 @@ static inline void cp0_putebase(uint32_t ebase) } /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/include/pic32mx/irq_1xx2xx.h b/arch/mips/include/pic32mx/irq_1xx2xx.h index 6fe7c25770..0bd739c44a 100644 --- a/arch/mips/include/pic32mx/irq_1xx2xx.h +++ b/arch/mips/include/pic32mx/irq_1xx2xx.h @@ -191,7 +191,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/include/pic32mx/irq_3xx4xx.h b/arch/mips/include/pic32mx/irq_3xx4xx.h index 0d263c71ae..3b404db33f 100644 --- a/arch/mips/include/pic32mx/irq_3xx4xx.h +++ b/arch/mips/include/pic32mx/irq_3xx4xx.h @@ -180,7 +180,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/include/pic32mx/irq_5xx6xx7xx.h b/arch/mips/include/pic32mx/irq_5xx6xx7xx.h index e1f18b6d4d..f9f9802792 100644 --- a/arch/mips/include/pic32mx/irq_5xx6xx7xx.h +++ b/arch/mips/include/pic32mx/irq_5xx6xx7xx.h @@ -249,7 +249,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/include/pic32mz/irq.h b/arch/mips/include/pic32mz/irq.h index 9872a4ea7b..f00dc0beba 100644 --- a/arch/mips/include/pic32mz/irq.h +++ b/arch/mips/include/pic32mz/irq.h @@ -188,7 +188,7 @@ static inline void cp0_putebase(uint32_t ebase) } /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/include/pic32mz/irq_pic32mzxxxec.h b/arch/mips/include/pic32mz/irq_pic32mzxxxec.h index 9e86af467d..64c0727c4d 100644 --- a/arch/mips/include/pic32mz/irq_pic32mzxxxec.h +++ b/arch/mips/include/pic32mz/irq_pic32mzxxxec.h @@ -258,7 +258,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/include/syscall.h b/arch/mips/include/syscall.h index 67ac42bea5..b4f9a7b95a 100644 --- a/arch/mips/include/syscall.h +++ b/arch/mips/include/syscall.h @@ -63,7 +63,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/src/common/up_createstack.c b/arch/mips/src/common/up_createstack.c index ba314e71b2..12f1da65a7 100644 --- a/arch/mips/src/common/up_createstack.c +++ b/arch/mips/src/common/up_createstack.c @@ -81,7 +81,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/src/common/up_internal.h b/arch/mips/src/common/up_internal.h index c8b9a32e73..ec61d75944 100644 --- a/arch/mips/src/common/up_internal.h +++ b/arch/mips/src/common/up_internal.h @@ -123,7 +123,7 @@ typedef void (*up_vector_t)(void); #endif /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/mips/src/common/up_interruptcontext.c b/arch/mips/src/common/up_interruptcontext.c index 526e86f87e..9eee52c3d6 100644 --- a/arch/mips/src/common/up_interruptcontext.c +++ b/arch/mips/src/common/up_interruptcontext.c @@ -54,7 +54,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/src/common/up_releasestack.c b/arch/mips/src/common/up_releasestack.c index a023342fa4..a322f4c24c 100644 --- a/arch/mips/src/common/up_releasestack.c +++ b/arch/mips/src/common/up_releasestack.c @@ -56,7 +56,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/src/common/up_stackframe.c b/arch/mips/src/common/up_stackframe.c index 1c4776af53..6c631f3e1f 100644 --- a/arch/mips/src/common/up_stackframe.c +++ b/arch/mips/src/common/up_stackframe.c @@ -76,7 +76,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/src/common/up_usestack.c b/arch/mips/src/common/up_usestack.c index 89cff7ff9e..72721a3185 100644 --- a/arch/mips/src/common/up_usestack.c +++ b/arch/mips/src/common/up_usestack.c @@ -78,7 +78,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/src/mips32/up_syscall0.S b/arch/mips/src/mips32/up_syscall0.S index cd5338156c..35fa3639a4 100644 --- a/arch/mips/src/mips32/up_syscall0.S +++ b/arch/mips/src/mips32/up_syscall0.S @@ -43,7 +43,7 @@ #include /**************************************************************************** - * Global Symbols + * Public Symbols ****************************************************************************/ .file "up_syscall0.S" diff --git a/arch/mips/src/mips32/vfork.S b/arch/mips/src/mips32/vfork.S index b373a6a936..7012b45a41 100644 --- a/arch/mips/src/mips32/vfork.S +++ b/arch/mips/src/mips32/vfork.S @@ -46,7 +46,7 @@ ************************************************************************************/ /************************************************************************************ - * Global Symbols + * Public Symbols ************************************************************************************/ .file "vfork.S" diff --git a/arch/mips/src/pic32mx/excptmacros.h b/arch/mips/src/pic32mx/excptmacros.h index 3596851912..f759e4e9e1 100644 --- a/arch/mips/src/pic32mx/excptmacros.h +++ b/arch/mips/src/pic32mx/excptmacros.h @@ -52,7 +52,7 @@ ********************************************************************************************/ /******************************************************************************************** - * Global Symbols + * Public Symbols ********************************************************************************************/ #if CONFIG_ARCH_INTERRUPTSTACK > 3 diff --git a/arch/mips/src/pic32mx/pic32mx-head.S b/arch/mips/src/pic32mx/pic32mx-head.S index 085edb42b3..2a6f43230a 100644 --- a/arch/mips/src/pic32mx/pic32mx-head.S +++ b/arch/mips/src/pic32mx/pic32mx-head.S @@ -105,7 +105,7 @@ #endif /**************************************************************************** - * Global Symbols + * Public Symbols ****************************************************************************/ .file "pic32mx-head.S" @@ -669,7 +669,7 @@ devconfig0: .size devconfig, .-devconfig /**************************************************************************** - * Global Data + * Public Data ****************************************************************************/ /* Interrupt stack variables */ diff --git a/arch/mips/src/pic32mx/pic32mx-lowconsole.c b/arch/mips/src/pic32mx/pic32mx-lowconsole.c index f2c6a96994..c613ab3828 100644 --- a/arch/mips/src/pic32mx/pic32mx-lowconsole.c +++ b/arch/mips/src/pic32mx/pic32mx-lowconsole.c @@ -108,7 +108,7 @@ ******************************************************************************/ /****************************************************************************** - * Global Variables + * Public Data ******************************************************************************/ /****************************************************************************** diff --git a/arch/mips/src/pic32mx/pic32mx-lowinit.c b/arch/mips/src/pic32mx/pic32mx-lowinit.c index 0eb34d0c9a..251c52a87d 100644 --- a/arch/mips/src/pic32mx/pic32mx-lowinit.c +++ b/arch/mips/src/pic32mx/pic32mx-lowinit.c @@ -86,7 +86,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/src/pic32mx/pic32mx-spi.c b/arch/mips/src/pic32mx/pic32mx-spi.c index 2a13e5e878..5ae76f2d8b 100644 --- a/arch/mips/src/pic32mx/pic32mx-spi.c +++ b/arch/mips/src/pic32mx/pic32mx-spi.c @@ -760,7 +760,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) return (uint16_t)spi_getreg(priv, PIC32MX_SPI_BUF_OFFSET); } -/************************************************************************* +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/mips/src/pic32mx/pic32mx-timerisr.c b/arch/mips/src/pic32mx/pic32mx-timerisr.c index 149b1de926..527f7463ff 100644 --- a/arch/mips/src/pic32mx/pic32mx-timerisr.c +++ b/arch/mips/src/pic32mx/pic32mx-timerisr.c @@ -133,7 +133,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/src/pic32mz/pic32mz-excptmacros.h b/arch/mips/src/pic32mz/pic32mz-excptmacros.h index e74befa413..d52b1be162 100644 --- a/arch/mips/src/pic32mz/pic32mz-excptmacros.h +++ b/arch/mips/src/pic32mz/pic32mz-excptmacros.h @@ -52,7 +52,7 @@ ********************************************************************************************/ /******************************************************************************************** - * Global Symbols + * Public Symbols ********************************************************************************************/ #if CONFIG_ARCH_INTERRUPTSTACK > 3 diff --git a/arch/mips/src/pic32mz/pic32mz-head.S b/arch/mips/src/pic32mz/pic32mz-head.S index 091f1a8bc2..fae8eb73e6 100644 --- a/arch/mips/src/pic32mz/pic32mz-head.S +++ b/arch/mips/src/pic32mz/pic32mz-head.S @@ -105,7 +105,7 @@ #endif /**************************************************************************** - * Global Symbols + * Public Symbols ****************************************************************************/ .file "pic32mz-head.S" @@ -761,7 +761,7 @@ adevcfg0: .size adevcfg, .-adevcfg /**************************************************************************** - * Global Data + * Public Data ****************************************************************************/ /* Interrupt stack variables */ diff --git a/arch/mips/src/pic32mz/pic32mz-lowconsole.c b/arch/mips/src/pic32mz/pic32mz-lowconsole.c index 3cfddafe6d..f21b3b0554 100644 --- a/arch/mips/src/pic32mz/pic32mz-lowconsole.c +++ b/arch/mips/src/pic32mz/pic32mz-lowconsole.c @@ -110,7 +110,7 @@ ******************************************************************************/ /****************************************************************************** - * Global Variables + * Public Data ******************************************************************************/ /****************************************************************************** diff --git a/arch/mips/src/pic32mz/pic32mz-lowinit.c b/arch/mips/src/pic32mz/pic32mz-lowinit.c index 14aeee64e6..18f146216b 100644 --- a/arch/mips/src/pic32mz/pic32mz-lowinit.c +++ b/arch/mips/src/pic32mz/pic32mz-lowinit.c @@ -173,7 +173,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/mips/src/pic32mz/pic32mz-spi.c b/arch/mips/src/pic32mz/pic32mz-spi.c index 7cafb6195d..26e70ea051 100644 --- a/arch/mips/src/pic32mz/pic32mz-spi.c +++ b/arch/mips/src/pic32mz/pic32mz-spi.c @@ -1168,7 +1168,7 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, } } -/************************************************************************* +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/mips/src/pic32mz/pic32mz-timerisr.c b/arch/mips/src/pic32mz/pic32mz-timerisr.c index 3cd4504786..675e69543e 100644 --- a/arch/mips/src/pic32mz/pic32mz-timerisr.c +++ b/arch/mips/src/pic32mz/pic32mz-timerisr.c @@ -132,7 +132,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/rgmp/include/types.h b/arch/rgmp/include/types.h index 254cab6e40..482ae0dbd6 100644 --- a/arch/rgmp/include/types.h +++ b/arch/rgmp/include/types.h @@ -90,7 +90,7 @@ typedef unsigned int irqstate_t; #endif /* __ASSEMBLY__ */ /************************************************************************ - * Global Function Prototypes + * Public Function Prototypes ************************************************************************/ #endif /* __ARCH_RGMP_INCLUDE_TYPES_H */ diff --git a/arch/sh/include/arch.h b/arch/sh/include/arch.h index 2ee75e5939..4b4c7e934d 100644 --- a/arch/sh/include/arch.h +++ b/arch/sh/include/arch.h @@ -57,7 +57,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/sh/include/irq.h b/arch/sh/include/irq.h index 1f0c25d35e..78617accce 100644 --- a/arch/sh/include/irq.h +++ b/arch/sh/include/irq.h @@ -60,7 +60,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/sh/include/m16c/types.h b/arch/sh/include/m16c/types.h index 4cd229d5f9..7a1a96d2b0 100644 --- a/arch/sh/include/m16c/types.h +++ b/arch/sh/include/m16c/types.h @@ -92,7 +92,7 @@ typedef _uint16_t irqstate_t; #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************/ #endif /* __ARCH_SH_INCLUDE_M16C_TYPES_H */ diff --git a/arch/sh/include/sh1/types.h b/arch/sh/include/sh1/types.h index c5fa256711..dab1b43d1d 100644 --- a/arch/sh/include/sh1/types.h +++ b/arch/sh/include/sh1/types.h @@ -90,7 +90,7 @@ typedef unsigned long irqstate_t; #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************/ #endif /* __ARCH_SH_INCLUDE_SH1_TYPES_H */ diff --git a/arch/sh/include/syscall.h b/arch/sh/include/syscall.h index 38fb6e2aa9..b26dffcd39 100644 --- a/arch/sh/include/syscall.h +++ b/arch/sh/include/syscall.h @@ -57,7 +57,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/sh/include/types.h b/arch/sh/include/types.h index 51c4f235a5..db6c6178ad 100644 --- a/arch/sh/include/types.h +++ b/arch/sh/include/types.h @@ -55,7 +55,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************/ #endif /* __ARCH_SH_INCLUDE_TYPES_H */ diff --git a/arch/sh/src/common/up_createstack.c b/arch/sh/src/common/up_createstack.c index 3927c8086b..825efb8cf3 100644 --- a/arch/sh/src/common/up_createstack.c +++ b/arch/sh/src/common/up_createstack.c @@ -60,7 +60,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/sh/src/common/up_internal.h b/arch/sh/src/common/up_internal.h index f035687011..37c187efb2 100644 --- a/arch/sh/src/common/up_internal.h +++ b/arch/sh/src/common/up_internal.h @@ -123,7 +123,7 @@ typedef void (*up_vector_t)(void); #endif /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/sh/src/common/up_interruptcontext.c b/arch/sh/src/common/up_interruptcontext.c index 19a7997b10..21bbedae54 100644 --- a/arch/sh/src/common/up_interruptcontext.c +++ b/arch/sh/src/common/up_interruptcontext.c @@ -54,7 +54,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/sh/src/common/up_releasestack.c b/arch/sh/src/common/up_releasestack.c index c6f04be760..8e01456fdb 100644 --- a/arch/sh/src/common/up_releasestack.c +++ b/arch/sh/src/common/up_releasestack.c @@ -56,7 +56,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/sh/src/common/up_stackframe.c b/arch/sh/src/common/up_stackframe.c index 727cbb7830..06d2c218a3 100644 --- a/arch/sh/src/common/up_stackframe.c +++ b/arch/sh/src/common/up_stackframe.c @@ -72,7 +72,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/sh/src/common/up_usestack.c b/arch/sh/src/common/up_usestack.c index b489762b6b..2da654391c 100644 --- a/arch/sh/src/common/up_usestack.c +++ b/arch/sh/src/common/up_usestack.c @@ -58,7 +58,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/sh/src/m16c/chip.h b/arch/sh/src/m16c/chip.h index cf0e196ab0..695814d432 100644 --- a/arch/sh/src/m16c/chip.h +++ b/arch/sh/src/m16c/chip.h @@ -248,7 +248,7 @@ #define M16C_PCR 0x003ff /* Port control */ /************************************************************************************ - * Global Data + * Public Data ************************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/sh/src/m16c/m16c_lowputc.c b/arch/sh/src/m16c/m16c_lowputc.c index b064bec29d..830a25427c 100644 --- a/arch/sh/src/m16c/m16c_lowputc.c +++ b/arch/sh/src/m16c/m16c_lowputc.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/sh/src/m16c/m16c_lowputc.c * * Copyright (C) 2009 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -49,9 +49,9 @@ #include "up_internal.h" #include "m16c_uart.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* Configuration **********************************************************/ @@ -171,33 +171,33 @@ #endif /* HAVE_SERIALCONSOLE */ -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_txready * * Description: * Return TRUE of the Transmit Data Register is empty * - **************************************************************************/ + ****************************************************************************/ #ifdef HAVE_SERIALCONSOLE static inline int up_txready(void) @@ -208,7 +208,7 @@ static inline int up_txready(void) } #endif /* HAVE_SERIALCONSOLE */ -/************************************************************************** +/**************************************************************************** * Name: up_lowserialsetup * * Description: @@ -216,7 +216,7 @@ static inline int up_txready(void) * console. Its purpose is to get the console output availabe as soon * as possible. * - **************************************************************************/ + ****************************************************************************/ #if defined(HAVE_SERIALCONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) static inline void up_lowserialsetup(void) @@ -286,17 +286,17 @@ static inline void up_lowserialsetup(void) } #endif /* HAVE_SERIALCONFIG && !CONFIG_SUPPRESS_UART_CONFIG */ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console. * - **************************************************************************/ + ****************************************************************************/ #if defined(HAVE_SERIAL) && !defined(CONFIG_LCD_CONSOLE) void up_lowputc(char ch) @@ -313,7 +313,7 @@ void up_lowputc(char ch) } #endif -/************************************************************************** +/**************************************************************************** * Name: up_lowsetup * * Description: @@ -321,7 +321,7 @@ void up_lowputc(char ch) * console. Its purpose is to get the console output availabe as soon * as possible. * - **************************************************************************/ + ****************************************************************************/ void up_lowsetup(void) { diff --git a/arch/sh/src/m16c/m16c_timer.h b/arch/sh/src/m16c/m16c_timer.h index 9bfab51cfe..ff54216322 100644 --- a/arch/sh/src/m16c/m16c_timer.h +++ b/arch/sh/src/m16c/m16c_timer.h @@ -216,7 +216,7 @@ #define TBnMR_TCK_PMFC32 0xc0 /* 11: fc32 */ /************************************************************************************ - * Global Data + * Public Data ************************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/sh/src/m16c/m16c_timerisr.c b/arch/sh/src/m16c/m16c_timerisr.c index 5667042acd..d26ff845e5 100644 --- a/arch/sh/src/m16c/m16c_timerisr.c +++ b/arch/sh/src/m16c/m16c_timerisr.c @@ -115,7 +115,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/sh/src/m16c/m16c_uart.h b/arch/sh/src/m16c/m16c_uart.h index c1ad1b5db6..382411538d 100644 --- a/arch/sh/src/m16c/m16c_uart.h +++ b/arch/sh/src/m16c/m16c_uart.h @@ -135,7 +135,7 @@ /* UART2 special mode register 4 (to be provided) */ /************************************************************************************ - * Global Data + * Public Data ************************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/sh/src/sh1/sh1_lowputc.c b/arch/sh/src/sh1/sh1_lowputc.c index eee753ed1f..7a6a704c69 100644 --- a/arch/sh/src/sh1/sh1_lowputc.c +++ b/arch/sh/src/sh1/sh1_lowputc.c @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/sh/src/sh1/sh1_lowputc.c * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include @@ -48,9 +48,9 @@ #include "chip.h" #include "up_internal.h" -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* Configuration **********************************************************/ @@ -145,33 +145,33 @@ #define SH1_DIVISOR (32 * SH1_SCI_BAUD) #define SH1_BRR (((SH1_CLOCK + (SH1_DIVISOR/2))/SH1_DIVISOR)-1) -/************************************************************************** +/**************************************************************************** * Private Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Function Prototypes - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** - * Global Variables - **************************************************************************/ +/**************************************************************************** + * Public Data + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Variables - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_txready * * Description: * Return TRUE of the Transmit Data Register is empty * - **************************************************************************/ + ****************************************************************************/ #ifdef HAVE_CONSOLE static inline int up_txready(void) @@ -182,17 +182,17 @@ static inline int up_txready(void) } #endif -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - **************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { @@ -215,7 +215,7 @@ void up_lowputc(char ch) #endif } -/************************************************************************** +/**************************************************************************** * Name: up_lowsetup * * Description: @@ -223,7 +223,7 @@ void up_lowputc(char ch) * console. Its purpose is to get the console output availabe as soon * as possible. * - **************************************************************************/ + ****************************************************************************/ void up_lowsetup(void) { diff --git a/arch/sh/src/sh1/sh1_saveusercontext.S b/arch/sh/src/sh1/sh1_saveusercontext.S index 00cb8a677d..5be7d94d4e 100644 --- a/arch/sh/src/sh1/sh1_saveusercontext.S +++ b/arch/sh/src/sh1/sh1_saveusercontext.S @@ -53,7 +53,7 @@ **************************************************************************/ /************************************************************************** - * Global Variables + * Public Data **************************************************************************/ /************************************************************************** diff --git a/arch/sh/src/sh1/sh1_timerisr.c b/arch/sh/src/sh1/sh1_timerisr.c index cd48c4e92c..08647be112 100644 --- a/arch/sh/src/sh1/sh1_timerisr.c +++ b/arch/sh/src/sh1/sh1_timerisr.c @@ -121,7 +121,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/sim/include/arch.h b/arch/sim/include/arch.h index b2ae4b2649..97cfc77602 100644 --- a/arch/sim/include/arch.h +++ b/arch/sim/include/arch.h @@ -57,7 +57,7 @@ ************************************************************/ /************************************************************ - * Public Variables + * Public Data ************************************************************/ /************************************************************ diff --git a/arch/sim/include/irq.h b/arch/sim/include/irq.h index efe57f6504..c167ae6a6e 100644 --- a/arch/sim/include/irq.h +++ b/arch/sim/include/irq.h @@ -102,7 +102,7 @@ static inline void irqrestore(irqstate_t flags) #endif /************************************************************ - * Public Variables + * Public Data ************************************************************/ /************************************************************ diff --git a/arch/sim/include/syscall.h b/arch/sim/include/syscall.h index 19c57fca2e..1e468e5ef0 100644 --- a/arch/sim/include/syscall.h +++ b/arch/sim/include/syscall.h @@ -57,7 +57,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/sim/include/types.h b/arch/sim/include/types.h index 1322163332..3adf56fabd 100644 --- a/arch/sim/include/types.h +++ b/arch/sim/include/types.h @@ -98,7 +98,7 @@ typedef unsigned int irqstate_t; #endif /* __ASSEMBLY__ */ /************************************************************************ - * Global Function Prototypes + * Public Function Prototypes ************************************************************************/ #endif /* __ARCH_SIM_INCLUDE_TYPES_H */ diff --git a/arch/sim/src/up_appinit.c b/arch/sim/src/up_appinit.c index ddaf088639..e1e9ff9701 100644 --- a/arch/sim/src/up_appinit.c +++ b/arch/sim/src/up_appinit.c @@ -33,9 +33,9 @@ * ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Included Files - ***************************************************************************/ + ****************************************************************************/ #include @@ -43,9 +43,9 @@ #include -/*************************************************************************** +/**************************************************************************** * Public Functions - ***************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Name: board_app_initialize diff --git a/arch/sim/src/up_framebuffer.c b/arch/sim/src/up_framebuffer.c index 0bf9bd14c4..5dfe199389 100644 --- a/arch/sim/src/up_framebuffer.c +++ b/arch/sim/src/up_framebuffer.c @@ -375,7 +375,7 @@ int up_fbinitialize(void) * Returned value: * Reference to the framebuffer object (NULL on failure) * - ***************************************************************************/ + ****************************************************************************/ FAR struct fb_vtable_s *up_fbgetvplane(int vplane) { diff --git a/arch/sim/src/up_head.c b/arch/sim/src/up_head.c index ddc0270974..323370c030 100644 --- a/arch/sim/src/up_head.c +++ b/arch/sim/src/up_head.c @@ -60,7 +60,7 @@ static jmp_buf g_simabort; static int g_exitcode = EXIT_SUCCESS; /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/sim/src/up_setjmp32.S b/arch/sim/src/up_setjmp32.S index 4951b27498..ac5945824e 100644 --- a/arch/sim/src/up_setjmp32.S +++ b/arch/sim/src/up_setjmp32.S @@ -58,7 +58,7 @@ **************************************************************************/ /************************************************************************** - * Public Variables + * Public Data **************************************************************************/ /************************************************************************** diff --git a/arch/sim/src/up_setjmp64.S b/arch/sim/src/up_setjmp64.S index 28ec8f14a8..7f1a43b676 100644 --- a/arch/sim/src/up_setjmp64.S +++ b/arch/sim/src/up_setjmp64.S @@ -93,7 +93,7 @@ **************************************************************************/ /************************************************************************** - * Public Variables + * Public Data **************************************************************************/ /************************************************************************** diff --git a/arch/sim/src/up_stackframe.c b/arch/sim/src/up_stackframe.c index 7634dd842f..de0397160c 100644 --- a/arch/sim/src/up_stackframe.c +++ b/arch/sim/src/up_stackframe.c @@ -74,7 +74,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/sim/src/up_x11eventloop.c b/arch/sim/src/up_x11eventloop.c index a7c29e1eca..f6afbcd4e0 100644 --- a/arch/sim/src/up_x11eventloop.c +++ b/arch/sim/src/up_x11eventloop.c @@ -47,7 +47,7 @@ /**************************************************************************** * Private Type Declarations - ***************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Private Function Prototypes @@ -60,7 +60,7 @@ extern int up_buttonevent(int x, int y, int buttons); /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /* Defined in up_x11framebuffer.c */ @@ -75,11 +75,11 @@ volatile int g_eventloop; /**************************************************************************** * Private Functions - ***************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Name: up_buttonmap - ***************************************************************************/ + ****************************************************************************/ static int up_buttonmap(int state) { @@ -107,7 +107,7 @@ static int up_buttonmap(int state) /**************************************************************************** * Public Functions - ***************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Name: up_x11events @@ -115,7 +115,7 @@ static int up_buttonmap(int state) * Description: * Called periodically from the IDLE loop to check for queued X11 events. * - ***************************************************************************/ + ****************************************************************************/ void up_x11events(void) { diff --git a/arch/sim/src/up_x11framebuffer.c b/arch/sim/src/up_x11framebuffer.c index 12a5c5db99..bf0e3ce150 100644 --- a/arch/sim/src/up_x11framebuffer.c +++ b/arch/sim/src/up_x11framebuffer.c @@ -57,14 +57,14 @@ /**************************************************************************** * Private Type Declarations - ***************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Private Function Prototypes ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /* Also used in up_x11eventloop */ @@ -92,7 +92,7 @@ static int b_useshm; /**************************************************************************** * Name: up_x11createframe - ***************************************************************************/ + ****************************************************************************/ static inline int up_x11createframe(void) { @@ -159,7 +159,7 @@ static inline int up_x11createframe(void) /**************************************************************************** * Name: up_x11errorhandler - ***************************************************************************/ + ****************************************************************************/ #ifndef CONFIG_SIM_X11NOSHM static int up_x11errorhandler(Display *display, XErrorEvent *event) @@ -171,7 +171,7 @@ static int up_x11errorhandler(Display *display, XErrorEvent *event) /**************************************************************************** * Name: up_x11traperrors - ***************************************************************************/ + ****************************************************************************/ #ifndef CONFIG_SIM_X11NOSHM static void up_x11traperrors(void) @@ -183,7 +183,7 @@ static void up_x11traperrors(void) /**************************************************************************** * Name: up_x11untraperrors - ***************************************************************************/ + ****************************************************************************/ #ifndef CONFIG_SIM_X11NOSHM static int up_x11untraperrors(void) @@ -196,7 +196,7 @@ static int up_x11untraperrors(void) /**************************************************************************** * Name: up_x11uninitX - ***************************************************************************/ + ****************************************************************************/ static void up_x11uninitX(void) { @@ -238,7 +238,7 @@ static void up_x11uninitX(void) /**************************************************************************** * Name: up_x11uninitialize - ***************************************************************************/ + ****************************************************************************/ #ifndef CONFIG_SIM_X11NOSHM static void up_x11uninitialize(void) @@ -262,7 +262,7 @@ static void up_x11uninitialize(void) /**************************************************************************** * Name: up_x11mapsharedmem - ***************************************************************************/ + ****************************************************************************/ static inline int up_x11mapsharedmem(int depth, unsigned int fblen) { @@ -356,7 +356,7 @@ shmerror: /**************************************************************************** * Public Functions - ***************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Name: up_x11initialize @@ -364,7 +364,7 @@ shmerror: * Description: * Make an X11 window look like a frame buffer. * - ***************************************************************************/ + ****************************************************************************/ int up_x11initialize(unsigned short width, unsigned short height, void **fbmem, unsigned int *fblen, unsigned char *bpp, @@ -422,7 +422,7 @@ int up_x11initialize(unsigned short width, unsigned short height, /**************************************************************************** * Name: up_x11cmap - ***************************************************************************/ + ****************************************************************************/ int up_x11cmap(unsigned short first, unsigned short len, unsigned char *red, unsigned char *green, @@ -462,7 +462,7 @@ int up_x11cmap(unsigned short first, unsigned short len, /**************************************************************************** * Name: up_x11update - ***************************************************************************/ + ****************************************************************************/ void up_x11update(void) { diff --git a/arch/x86/include/arch.h b/arch/x86/include/arch.h index 76f5fe979a..cdd5f2f630 100644 --- a/arch/x86/include/arch.h +++ b/arch/x86/include/arch.h @@ -69,7 +69,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/x86/include/i486/arch.h b/arch/x86/include/i486/arch.h index bc8dc49cbf..1994e3fda3 100644 --- a/arch/x86/include/i486/arch.h +++ b/arch/x86/include/i486/arch.h @@ -426,7 +426,7 @@ static inline uint32_t up_getss() ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/x86/include/i486/io.h b/arch/x86/include/i486/io.h index bb4aa5c557..56471b5ab5 100644 --- a/arch/x86/include/i486/io.h +++ b/arch/x86/include/i486/io.h @@ -125,7 +125,7 @@ static inline uint32_t inl(uint16_t port) } /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/x86/include/i486/irq.h b/arch/x86/include/i486/irq.h index cc1a9f5eb8..493cf206f9 100644 --- a/arch/x86/include/i486/irq.h +++ b/arch/x86/include/i486/irq.h @@ -263,7 +263,7 @@ static inline void system_call3(unsigned int nbr, uintptr_t parm1, } /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/x86/include/i486/syscall.h b/arch/x86/include/i486/syscall.h index f167b8b8d0..2c84b31e05 100644 --- a/arch/x86/include/i486/syscall.h +++ b/arch/x86/include/i486/syscall.h @@ -58,7 +58,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/x86/include/i486/types.h b/arch/x86/include/i486/types.h index ae46b8e532..c30026a221 100644 --- a/arch/x86/include/i486/types.h +++ b/arch/x86/include/i486/types.h @@ -91,7 +91,7 @@ typedef unsigned int irqstate_t; #endif /* __ASSEMBLY__ */ /************************************************************************ - * Global Function Prototypes + * Public Function Prototypes ************************************************************************/ #endif /* __ARCH_X86_INCLUDE_I486_TYPES_H */ diff --git a/arch/x86/include/io.h b/arch/x86/include/io.h index b8cdde51f4..2fe29be37a 100644 --- a/arch/x86/include/io.h +++ b/arch/x86/include/io.h @@ -61,7 +61,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/x86/include/irq.h b/arch/x86/include/irq.h index 12f12c156e..4c46b5f6e3 100644 --- a/arch/x86/include/irq.h +++ b/arch/x86/include/irq.h @@ -73,7 +73,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/x86/include/qemu/arch.h b/arch/x86/include/qemu/arch.h index 5ebc6dd93d..c64baadb0b 100644 --- a/arch/x86/include/qemu/arch.h +++ b/arch/x86/include/qemu/arch.h @@ -57,7 +57,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/x86/include/qemu/irq.h b/arch/x86/include/qemu/irq.h index 9352077123..601aba73b1 100644 --- a/arch/x86/include/qemu/irq.h +++ b/arch/x86/include/qemu/irq.h @@ -57,7 +57,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/x86/include/syscall.h b/arch/x86/include/syscall.h index 2ecc22734b..88c92d02dc 100644 --- a/arch/x86/include/syscall.h +++ b/arch/x86/include/syscall.h @@ -63,7 +63,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/x86/include/types.h b/arch/x86/include/types.h index 9f5d3577a7..5e7dba28ed 100644 --- a/arch/x86/include/types.h +++ b/arch/x86/include/types.h @@ -59,7 +59,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************/ #endif /* __ARCH_X86_INCLUDE_TYPES_H */ diff --git a/arch/x86/src/common/up_internal.h b/arch/x86/src/common/up_internal.h index d60968ff01..253bb3e1ed 100644 --- a/arch/x86/src/common/up_internal.h +++ b/arch/x86/src/common/up_internal.h @@ -125,7 +125,7 @@ typedef void (*up_vector_t)(void); #endif /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/x86/src/common/up_interruptcontext.c b/arch/x86/src/common/up_interruptcontext.c index 4cf65f4e1e..a1e762edfe 100644 --- a/arch/x86/src/common/up_interruptcontext.c +++ b/arch/x86/src/common/up_interruptcontext.c @@ -54,7 +54,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/x86/src/i486/i486_utils.S b/arch/x86/src/i486/i486_utils.S index db3af06e5b..2f793a460c 100644 --- a/arch/x86/src/i486/i486_utils.S +++ b/arch/x86/src/i486/i486_utils.S @@ -51,7 +51,7 @@ #define KSEG 0x10 /**************************************************************************** - * Globals + * Public Symbols ****************************************************************************/ .globl gdt_flush diff --git a/arch/x86/src/i486/up_createstack.c b/arch/x86/src/i486/up_createstack.c index 4426b132e1..8a7146f32a 100644 --- a/arch/x86/src/i486/up_createstack.c +++ b/arch/x86/src/i486/up_createstack.c @@ -62,7 +62,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/x86/src/i486/up_releasestack.c b/arch/x86/src/i486/up_releasestack.c index 797934f9f6..0f23cd3fb7 100644 --- a/arch/x86/src/i486/up_releasestack.c +++ b/arch/x86/src/i486/up_releasestack.c @@ -56,7 +56,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/x86/src/i486/up_stackframe.c b/arch/x86/src/i486/up_stackframe.c index 4f2ee156ab..fab05bff9c 100644 --- a/arch/x86/src/i486/up_stackframe.c +++ b/arch/x86/src/i486/up_stackframe.c @@ -75,7 +75,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/x86/src/i486/up_syscall6.S b/arch/x86/src/i486/up_syscall6.S index 3bcbad9ba6..437d44d077 100755 --- a/arch/x86/src/i486/up_syscall6.S +++ b/arch/x86/src/i486/up_syscall6.S @@ -49,7 +49,7 @@ ****************************************************************************/ /**************************************************************************** - * Globals + * Public Symbols ****************************************************************************/ /**************************************************************************** diff --git a/arch/x86/src/i486/up_usestack.c b/arch/x86/src/i486/up_usestack.c index b391599315..b2005fe2de 100644 --- a/arch/x86/src/i486/up_usestack.c +++ b/arch/x86/src/i486/up_usestack.c @@ -58,7 +58,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/x86/src/qemu/qemu_fullcontextrestore.S b/arch/x86/src/qemu/qemu_fullcontextrestore.S index 6efbfac83d..97a208ad89 100644 --- a/arch/x86/src/qemu/qemu_fullcontextrestore.S +++ b/arch/x86/src/qemu/qemu_fullcontextrestore.S @@ -48,7 +48,7 @@ **************************************************************************/ /************************************************************************** - * Global Variables + * Public Data **************************************************************************/ /**************************************************************************** diff --git a/arch/x86/src/qemu/qemu_head.S b/arch/x86/src/qemu/qemu_head.S index 8c49b5fcd7..82b8d37a8d 100755 --- a/arch/x86/src/qemu/qemu_head.S +++ b/arch/x86/src/qemu/qemu_head.S @@ -72,7 +72,7 @@ .endm /**************************************************************************** - * Global Symbols + * Public Symbols ****************************************************************************/ .global __start /* Making entry point visible to linker */ diff --git a/arch/x86/src/qemu/qemu_lowputc.c b/arch/x86/src/qemu/qemu_lowputc.c index 9260884a38..d4b01b2010 100644 --- a/arch/x86/src/qemu/qemu_lowputc.c +++ b/arch/x86/src/qemu/qemu_lowputc.c @@ -83,13 +83,13 @@ * Public Functions ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - **************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { diff --git a/arch/x86/src/qemu/qemu_timerisr.c b/arch/x86/src/qemu/qemu_timerisr.c index 111b521269..ee72f66993 100644 --- a/arch/x86/src/qemu/qemu_timerisr.c +++ b/arch/x86/src/qemu/qemu_timerisr.c @@ -110,7 +110,7 @@ static int up_timerisr(int irq, uint32_t *regs) } /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/x86/src/qemu/qemu_vectors.S b/arch/x86/src/qemu/qemu_vectors.S index 8a68e2e095..dbc27a5f8f 100755 --- a/arch/x86/src/qemu/qemu_vectors.S +++ b/arch/x86/src/qemu/qemu_vectors.S @@ -58,7 +58,7 @@ .text /**************************************************************************** - * Globals + * Public Symbols ****************************************************************************/ .globl irq_handler diff --git a/arch/z16/include/arch.h b/arch/z16/include/arch.h index 048bc01142..cb574663df 100644 --- a/arch/z16/include/arch.h +++ b/arch/z16/include/arch.h @@ -57,7 +57,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z16/include/irq.h b/arch/z16/include/irq.h index ce195b1dec..9aab0cc133 100644 --- a/arch/z16/include/irq.h +++ b/arch/z16/include/irq.h @@ -56,7 +56,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z16/include/syscall.h b/arch/z16/include/syscall.h index ceb6222cf3..b686a7cc21 100644 --- a/arch/z16/include/syscall.h +++ b/arch/z16/include/syscall.h @@ -57,7 +57,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z16/include/types.h b/arch/z16/include/types.h index 590a3b65a0..2f77289c5c 100644 --- a/arch/z16/include/types.h +++ b/arch/z16/include/types.h @@ -86,7 +86,7 @@ typedef unsigned short irqstate_t; #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************/ #endif /* __ARCH_Z16_INCLUDE_TYPES_H */ diff --git a/arch/z16/include/z16f/arch.h b/arch/z16/include/z16f/arch.h index c05cb31c1b..cc4819c718 100644 --- a/arch/z16/include/z16f/arch.h +++ b/arch/z16/include/z16f/arch.h @@ -53,7 +53,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z16/include/z16f/chip.h b/arch/z16/include/z16f/chip.h index 2ff4b4174b..e759953dd2 100644 --- a/arch/z16/include/z16f/chip.h +++ b/arch/z16/include/z16f/chip.h @@ -49,7 +49,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z16/include/z16f/irq.h b/arch/z16/include/z16f/irq.h index 95d84042fe..5dfd08470c 100644 --- a/arch/z16/include/z16f/irq.h +++ b/arch/z16/include/z16f/irq.h @@ -210,7 +210,7 @@ struct xcptcontext ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z16/src/common/up_createstack.c b/arch/z16/src/common/up_createstack.c index 63b8d5a977..e395bae436 100644 --- a/arch/z16/src/common/up_createstack.c +++ b/arch/z16/src/common/up_createstack.c @@ -61,7 +61,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/z16/src/common/up_internal.h b/arch/z16/src/common/up_internal.h index 5e368b05da..ff9f760677 100644 --- a/arch/z16/src/common/up_internal.h +++ b/arch/z16/src/common/up_internal.h @@ -123,7 +123,7 @@ typedef void (*up_vector_t)(void); #endif /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/z16/src/common/up_interruptcontext.c b/arch/z16/src/common/up_interruptcontext.c index 99cc4abe77..38a2407461 100644 --- a/arch/z16/src/common/up_interruptcontext.c +++ b/arch/z16/src/common/up_interruptcontext.c @@ -55,7 +55,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/z16/src/common/up_releasestack.c b/arch/z16/src/common/up_releasestack.c index c64a5f4087..f1ab953741 100644 --- a/arch/z16/src/common/up_releasestack.c +++ b/arch/z16/src/common/up_releasestack.c @@ -56,7 +56,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/z16/src/common/up_stackframe.c b/arch/z16/src/common/up_stackframe.c index 8823034c45..6a2fe6d347 100644 --- a/arch/z16/src/common/up_stackframe.c +++ b/arch/z16/src/common/up_stackframe.c @@ -73,7 +73,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/z16/src/common/up_usestack.c b/arch/z16/src/common/up_usestack.c index eb725b7fb9..d65609a67d 100644 --- a/arch/z16/src/common/up_usestack.c +++ b/arch/z16/src/common/up_usestack.c @@ -58,7 +58,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/z16/src/z16f/z16f_clkinit.c b/arch/z16/src/z16f/z16f_clkinit.c index ce78fc29a7..15371646bc 100644 --- a/arch/z16/src/z16f/z16f_clkinit.c +++ b/arch/z16/src/z16f/z16f_clkinit.c @@ -1,4 +1,4 @@ -/*************************************************************************** +/**************************************************************************** * z16f/z16f_clkinit.c * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. @@ -33,17 +33,17 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Included Files - ***************************************************************************/ + ****************************************************************************/ #include "chip/chip.h" -/*************************************************************************** +/**************************************************************************** * Pre-processor Definitions - ***************************************************************************/ + ****************************************************************************/ /* System clock source value from ZDS target settings */ @@ -55,12 +55,12 @@ extern _Erom unsigned long SYS_CLK_SRC; extern _Erom unsigned long SYS_CLK_FREQ; #define _DEFCLK ((unsigned long)&SYS_CLK_FREQ) -/*************************************************************************** +/**************************************************************************** * Private Functions - ***************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_DEBUG -/*************************************************************************** +/**************************************************************************** * System clock initialization--DEBUG. Code Using Frequency Input from * ZDS IDE. * @@ -83,7 +83,7 @@ extern _Erom unsigned long SYS_CLK_FREQ; * * Function Not Recommended for Release Code. * - ***************************************************************************/ + ****************************************************************************/ static void z16f_sysclkinit(int clockid, uint32_t frequency) { @@ -207,14 +207,14 @@ static void z16f_sysclkinit(int clockid, uint32_t frequency) } #else /* CONFIG_DEBUG */ -/*************************************************************************** +/**************************************************************************** * System Clock Initialization Recommended for Release Code * * The z16f_sysclkinit function below allows the user to switch from * Internal to External Clock source and should be used for clock frequency * switching to the External Clock. Note the delay to allow the clock to * stabilize. - ***************************************************************************/ + ****************************************************************************/ static void z16f_sysclkinit(int clockid, uint32_t frequency) { @@ -249,13 +249,13 @@ static void z16f_sysclkinit(int clockid, uint32_t frequency) } #endif /* CONFIG_DEBUG */ -/*************************************************************************** +/**************************************************************************** * Public Functions - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Name: z16f_clkinit - ***************************************************************************/ + ****************************************************************************/ void z16f_clkinit(void) { diff --git a/arch/z16/src/z16f/z16f_espi.c b/arch/z16/src/z16f/z16f_espi.c index cc247fd948..3ba9118c6f 100644 --- a/arch/z16/src/z16f/z16f_espi.c +++ b/arch/z16/src/z16f/z16f_espi.c @@ -755,7 +755,7 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, } } -/*************************************************************************** +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/z16/src/z16f/z16f_sysexec.c b/arch/z16/src/z16f/z16f_sysexec.c index b250c2b585..9a8c7da505 100644 --- a/arch/z16/src/z16f/z16f_sysexec.c +++ b/arch/z16/src/z16f/z16f_sysexec.c @@ -1,4 +1,4 @@ -/*************************************************************************** +/**************************************************************************** * z16f/z16f_sysexec.c * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Included Files - ***************************************************************************/ + ****************************************************************************/ #include @@ -47,29 +47,29 @@ #include "chip/chip.h" #include "up_internal.h" -/*************************************************************************** +/**************************************************************************** * Pre-processor Definitions - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Private Types - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Private Functions - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** - * Global Functions - ***************************************************************************/ +/**************************************************************************** + * Public Functions + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Function: z16f_sysexec * * Description: * Handle a Z16F system execption * - ***************************************************************************/ + ****************************************************************************/ void z16f_sysexec(FAR chipreg_t *regs) { diff --git a/arch/z16/src/z16f/z16f_timerisr.c b/arch/z16/src/z16f/z16f_timerisr.c index 79f1dc2eb9..24b12a4695 100644 --- a/arch/z16/src/z16f/z16f_timerisr.c +++ b/arch/z16/src/z16f/z16f_timerisr.c @@ -1,4 +1,4 @@ -/*************************************************************************** +/**************************************************************************** * z16f/z16f_timerisr.c * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Included Files - ***************************************************************************/ + ****************************************************************************/ #include @@ -49,9 +49,9 @@ #include "clock/clock.h" #include "up_internal.h" -/*************************************************************************** +/**************************************************************************** * Pre-processor Definitions - ***************************************************************************/ + ****************************************************************************/ /* The desired timer interrupt frequency is provided by the definition * CLOCKS_PER_SEC (see include/time.h). CLOCKS_PER_SEC defines the desired * number of system clock ticks per second. That value is a user @@ -69,26 +69,26 @@ extern _Erom uint8_t SYS_CLK_FREQ; #define _DEFCLK ((uint32_t)&SYS_CLK_FREQ) -/*************************************************************************** +/**************************************************************************** * Private Types - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Private Function Prototypes - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** - * Global Functions - ***************************************************************************/ +/**************************************************************************** + * Public Functions + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Function: up_timerisr * * Description: * The timer ISR will perform a variety of services for various portions * of the system. * - ***************************************************************************/ + ****************************************************************************/ int up_timerisr(int irq, uint32_t *regs) { @@ -98,14 +98,14 @@ int up_timerisr(int irq, uint32_t *regs) return 0; } -/*************************************************************************** +/**************************************************************************** * Function: up_timer_initialize * * Description: * This function is called during start-up to initialize * the timer interrupt. * - ***************************************************************************/ + ****************************************************************************/ void up_timer_initialize(void) { diff --git a/arch/z80/include/arch.h b/arch/z80/include/arch.h index 0a0673e031..123ea4bada 100644 --- a/arch/z80/include/arch.h +++ b/arch/z80/include/arch.h @@ -59,7 +59,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/include/ez80/arch.h b/arch/z80/include/ez80/arch.h index 2914d5b30a..f210332399 100644 --- a/arch/z80/include/ez80/arch.h +++ b/arch/z80/include/ez80/arch.h @@ -54,7 +54,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/include/ez80/io.h b/arch/z80/include/ez80/io.h index ff85352827..2ae92c8ba5 100644 --- a/arch/z80/include/ez80/io.h +++ b/arch/z80/include/ez80/io.h @@ -60,7 +60,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/include/ez80/irq.h b/arch/z80/include/ez80/irq.h index 5bde20b599..c7ca8ba704 100644 --- a/arch/z80/include/ez80/irq.h +++ b/arch/z80/include/ez80/irq.h @@ -234,7 +234,7 @@ struct xcptcontext ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/include/ez80/types.h b/arch/z80/include/ez80/types.h index f770478b89..56a9c8b825 100644 --- a/arch/z80/include/ez80/types.h +++ b/arch/z80/include/ez80/types.h @@ -109,7 +109,7 @@ typedef _uint24_t irqstate_t; #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************/ #endif /* __ARCH_Z80_INCLUDE_EZ80_TYPES_H */ diff --git a/arch/z80/include/io.h b/arch/z80/include/io.h index e07a071d95..bd97c3792f 100644 --- a/arch/z80/include/io.h +++ b/arch/z80/include/io.h @@ -52,7 +52,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/include/irq.h b/arch/z80/include/irq.h index 7d482df49b..da9131cab8 100644 --- a/arch/z80/include/irq.h +++ b/arch/z80/include/irq.h @@ -56,7 +56,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/include/syscall.h b/arch/z80/include/syscall.h index bc9ebbb11f..20a055f701 100644 --- a/arch/z80/include/syscall.h +++ b/arch/z80/include/syscall.h @@ -57,7 +57,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/include/types.h b/arch/z80/include/types.h index 09f713db01..af06d1fc56 100644 --- a/arch/z80/include/types.h +++ b/arch/z80/include/types.h @@ -55,7 +55,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************/ #endif /* __ARCH_Z80_INCLUDE_TYPES_H */ diff --git a/arch/z80/include/z180/arch.h b/arch/z80/include/z180/arch.h index 4fba27919b..4dc90f629a 100644 --- a/arch/z80/include/z180/arch.h +++ b/arch/z80/include/z180/arch.h @@ -76,7 +76,7 @@ typedef FAR struct z180_cbr_s *group_addrenv_t; #endif /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/include/z180/chip.h b/arch/z80/include/z180/chip.h index 9a1ba8098c..88df7a2b4b 100644 --- a/arch/z80/include/z180/chip.h +++ b/arch/z80/include/z180/chip.h @@ -456,7 +456,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/include/z180/io.h b/arch/z80/include/z180/io.h index d8af9b0914..12bf6219e3 100644 --- a/arch/z80/include/z180/io.h +++ b/arch/z80/include/z180/io.h @@ -58,7 +58,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/include/z180/irq.h b/arch/z80/include/z180/irq.h index 215f9cd456..bfd3639377 100644 --- a/arch/z80/include/z180/irq.h +++ b/arch/z80/include/z180/irq.h @@ -207,7 +207,7 @@ struct xcptcontext ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/include/z180/types.h b/arch/z80/include/z180/types.h index 0de51cab19..3c4f593b2a 100644 --- a/arch/z80/include/z180/types.h +++ b/arch/z80/include/z180/types.h @@ -93,7 +93,7 @@ typedef _uint16_t irqstate_t; #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************/ #endif /* __ARC_Z80_INCLUDE_Z180_TYPES_H */ diff --git a/arch/z80/include/z8/arch.h b/arch/z80/include/z8/arch.h index a3bab32a71..8d913a7349 100644 --- a/arch/z80/include/z8/arch.h +++ b/arch/z80/include/z8/arch.h @@ -54,7 +54,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/include/z8/irq.h b/arch/z80/include/z8/irq.h index 64866ee9ef..7bc706d8d5 100644 --- a/arch/z80/include/z8/irq.h +++ b/arch/z80/include/z8/irq.h @@ -340,7 +340,7 @@ struct xcptcontext ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/include/z8/types.h b/arch/z80/include/z8/types.h index b8f3f4a320..7e0577b31c 100644 --- a/arch/z80/include/z8/types.h +++ b/arch/z80/include/z8/types.h @@ -100,7 +100,7 @@ typedef _uint8_t irqstate_t; #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************/ #endif /* __ARCH_Z80_INCLUDE_Z8_IRQ_H */ diff --git a/arch/z80/include/z80/arch.h b/arch/z80/include/z80/arch.h index 23da0a8fd1..d40c84b4d6 100644 --- a/arch/z80/include/z80/arch.h +++ b/arch/z80/include/z80/arch.h @@ -54,7 +54,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/include/z80/io.h b/arch/z80/include/z80/io.h index c0fdb4e737..e8545a719c 100644 --- a/arch/z80/include/z80/io.h +++ b/arch/z80/include/z80/io.h @@ -58,7 +58,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/include/z80/irq.h b/arch/z80/include/z80/irq.h index de5c9b4284..10fd0be62e 100644 --- a/arch/z80/include/z80/irq.h +++ b/arch/z80/include/z80/irq.h @@ -124,7 +124,7 @@ struct xcptcontext ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/include/z80/types.h b/arch/z80/include/z80/types.h index 56301dcac7..d11868e033 100644 --- a/arch/z80/include/z80/types.h +++ b/arch/z80/include/z80/types.h @@ -93,7 +93,7 @@ typedef _uint16_t irqstate_t; #endif /* __ASSEMBLY__ */ /**************************************************************************** - * Global Function Prototypes + * Public Function Prototypes ****************************************************************************/ #endif /* __ARC_Z80_INCLUDE_Z80_TYPES_H */ diff --git a/arch/z80/src/common/up_createstack.c b/arch/z80/src/common/up_createstack.c index 64db8f8b04..e3880a0c61 100644 --- a/arch/z80/src/common/up_createstack.c +++ b/arch/z80/src/common/up_createstack.c @@ -60,7 +60,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/src/common/up_internal.h b/arch/z80/src/common/up_internal.h index 819dd3c4c8..58875d16bb 100644 --- a/arch/z80/src/common/up_internal.h +++ b/arch/z80/src/common/up_internal.h @@ -113,7 +113,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Variables + * Public Data ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/src/common/up_interruptcontext.c b/arch/z80/src/common/up_interruptcontext.c index 31a6364189..fc92512894 100644 --- a/arch/z80/src/common/up_interruptcontext.c +++ b/arch/z80/src/common/up_interruptcontext.c @@ -56,7 +56,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/src/common/up_releasestack.c b/arch/z80/src/common/up_releasestack.c index be978aadd9..63b5572030 100644 --- a/arch/z80/src/common/up_releasestack.c +++ b/arch/z80/src/common/up_releasestack.c @@ -56,7 +56,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/src/common/up_stackframe.c b/arch/z80/src/common/up_stackframe.c index 2c419c723e..9da978a4f7 100644 --- a/arch/z80/src/common/up_stackframe.c +++ b/arch/z80/src/common/up_stackframe.c @@ -72,7 +72,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/src/common/up_usestack.c b/arch/z80/src/common/up_usestack.c index 414040ec2f..dd82424d33 100644 --- a/arch/z80/src/common/up_usestack.c +++ b/arch/z80/src/common/up_usestack.c @@ -57,7 +57,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/src/ez80/ez80_spi.c b/arch/z80/src/ez80/ez80_spi.c index 47957b40c8..e2c15e5bb2 100644 --- a/arch/z80/src/ez80/ez80_spi.c +++ b/arch/z80/src/ez80/ez80_spi.c @@ -335,7 +335,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) return spi_transfer((uint8_t)wd); } -/************************************************************************* +/**************************************************************************** * Name: spi_sndblock * * Description: diff --git a/arch/z80/src/ez80/ez80_timerisr.c b/arch/z80/src/ez80/ez80_timerisr.c index b85e26852d..109fff7913 100644 --- a/arch/z80/src/ez80/ez80_timerisr.c +++ b/arch/z80/src/ez80/ez80_timerisr.c @@ -1,4 +1,4 @@ -/*************************************************************************** +/**************************************************************************** * arch/z80/src/ez80/ez80_timerisr.c * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Included Files - ***************************************************************************/ + ****************************************************************************/ #include @@ -49,30 +49,30 @@ #include "clock/clock.h" #include "up_internal.h" -/*************************************************************************** +/**************************************************************************** * Pre-processor Definitions - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Private Types - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Private Functions - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Public Functions - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Function: up_timerisr * * Description: * The timer ISR will perform a variety of services for various portions * of the system. * - ***************************************************************************/ + ****************************************************************************/ int up_timerisr(int irq, chipreg_t *regs) { @@ -99,14 +99,14 @@ int up_timerisr(int irq, chipreg_t *regs) return 0; } -/*************************************************************************** +/**************************************************************************** * Function: up_timer_initialize * * Description: * This function is called during start-up to initialize the timer * interrupt. * - ***************************************************************************/ + ****************************************************************************/ void up_timer_initialize(void) { diff --git a/arch/z80/src/ez80/switch.h b/arch/z80/src/ez80/switch.h index 72c0176e57..a397e3334a 100644 --- a/arch/z80/src/ez80/switch.h +++ b/arch/z80/src/ez80/switch.h @@ -122,7 +122,7 @@ ************************************************************************************/ /************************************************************************************ - * Public Variables + * Public Data ************************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/z80/src/z180/switch.h b/arch/z80/src/z180/switch.h index d04a41b1b6..4be15aef5f 100644 --- a/arch/z80/src/z180/switch.h +++ b/arch/z80/src/z180/switch.h @@ -180,7 +180,7 @@ ************************************************************************************/ /************************************************************************************ - * Public Variables + * Public Data ************************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/z80/src/z180/z180_timerisr.c b/arch/z80/src/z180/z180_timerisr.c index 253fd43270..11f0bc92ce 100644 --- a/arch/z80/src/z180/z180_timerisr.c +++ b/arch/z80/src/z180/z180_timerisr.c @@ -80,7 +80,7 @@ ****************************************************************************/ /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/arch/z80/src/z8/switch.h b/arch/z80/src/z8/switch.h index f9309ecf72..c141193143 100644 --- a/arch/z80/src/z8/switch.h +++ b/arch/z80/src/z8/switch.h @@ -207,7 +207,7 @@ struct z8_irqstate_s #endif /************************************************************************************ - * Public Variables + * Public Data ************************************************************************************/ #ifndef __ASSEMBLY__ diff --git a/arch/z80/src/z8/z8_timerisr.c b/arch/z80/src/z8/z8_timerisr.c index 64d39acc59..d387c770c6 100644 --- a/arch/z80/src/z8/z8_timerisr.c +++ b/arch/z80/src/z8/z8_timerisr.c @@ -1,4 +1,4 @@ -/*************************************************************************** +/**************************************************************************** * arch/z80/src/z8/z8_timerisr.c * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Included Files - ***************************************************************************/ + ****************************************************************************/ #include @@ -49,34 +49,34 @@ #include "clock/clock.h" #include "up_internal.h" -/*************************************************************************** +/**************************************************************************** * Pre-processor Definitions - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Private Types - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Private Functions - ***************************************************************************/ + ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Public Functions - ***************************************************************************/ + ****************************************************************************/ /* This function is normally prototyped int the ZiLOG header file sio.h */ extern uint32_t get_freq(void); -/*************************************************************************** +/**************************************************************************** * Function: up_timerisr * * Description: * The timer ISR will perform a variety of services for various portions * of the system. * - ***************************************************************************/ + ****************************************************************************/ int up_timerisr(int irq, uint32_t *regs) { @@ -86,14 +86,14 @@ int up_timerisr(int irq, uint32_t *regs) return 0; } -/*************************************************************************** +/**************************************************************************** * Function: up_timer_initialize * * Description: * This function is called during start-up to initialize the timer * interrupt. * - ***************************************************************************/ + ****************************************************************************/ void up_timer_initialize(void) { diff --git a/arch/z80/src/z80/switch.h b/arch/z80/src/z80/switch.h index 0ded0ea559..8d6f525906 100644 --- a/arch/z80/src/z80/switch.h +++ b/arch/z80/src/z80/switch.h @@ -121,7 +121,7 @@ ************************************************************************************/ /************************************************************************************ - * Public Variables + * Public Data ************************************************************************************/ #ifndef __ASSEMBLY__ From cae0c9a2e33034f78fa197ad8b9f989de4e7599a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 2 Oct 2015 17:47:23 -0600 Subject: [PATCH 11/33] Standardize the width of all comment boxes in header files --- arch/arm/include/calypso/irq.h | 2 +- arch/arm/src/a1x/a1x_irq.h | 4 +-- arch/arm/src/armv7-a/l2cc.h | 40 ++++++++++++++-------------- arch/arm/src/lpc31xx/lpc31_cgudrvr.h | 4 +-- arch/arm/src/sama5/sam_config.h | 12 ++++----- arch/arm/src/sama5/sam_irq.h | 4 +-- arch/arm/src/samv7/sam_mcan.h | 8 +++--- arch/rgmp/include/limits.h | 12 ++++----- arch/rgmp/include/types.h | 20 +++++++------- arch/sim/include/arch.h | 28 +++++++++---------- arch/sim/include/irq.h | 28 +++++++++---------- arch/sim/include/limits.h | 12 ++++----- arch/sim/include/types.h | 20 +++++++------- arch/sim/src/up_internal.h | 24 ++++++++--------- arch/x86/include/i486/types.h | 20 +++++++------- arch/z16/include/serial.h | 20 +++++++------- 16 files changed, 129 insertions(+), 129 deletions(-) diff --git a/arch/arm/include/calypso/irq.h b/arch/arm/include/calypso/irq.h index fd579c4d32..baea3de5a3 100644 --- a/arch/arm/include/calypso/irq.h +++ b/arch/arm/include/calypso/irq.h @@ -35,7 +35,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ #ifndef __INCLUDE_NUTTX_IRQ_H #error "This file should never be included directly! Use " diff --git a/arch/arm/src/a1x/a1x_irq.h b/arch/arm/src/a1x/a1x_irq.h index 15d236d0c4..ad0925707c 100644 --- a/arch/arm/src/a1x/a1x_irq.h +++ b/arch/arm/src/a1x/a1x_irq.h @@ -73,9 +73,9 @@ extern "C" #define EXTERN extern #endif -/*************************************************************************** +/**************************************************************************** * Public Function Prototypes - ***************************************************************************/ + ****************************************************************************/ #undef EXTERN #if defined(__cplusplus) diff --git a/arch/arm/src/armv7-a/l2cc.h b/arch/arm/src/armv7-a/l2cc.h index 7dab637653..1c09f81fd6 100644 --- a/arch/arm/src/armv7-a/l2cc.h +++ b/arch/arm/src/armv7-a/l2cc.h @@ -66,7 +66,7 @@ extern "C" * Public Function Prototypes ****************************************************************************/ -/*************************************************************************** +/**************************************************************************** * Name: up_l2ccinitialize * * Description: @@ -80,13 +80,13 @@ extern "C" * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ #if 0 /* Prototyped in up_internal.h */ void up_l2ccinitialize(void); #endif -/*************************************************************************** +/**************************************************************************** * Name: l2cc_enable * * Description: @@ -99,11 +99,11 @@ void up_l2ccinitialize(void); * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_enable(void); -/*************************************************************************** +/**************************************************************************** * Name: l2cc_disable * * Description: @@ -115,11 +115,11 @@ void l2cc_enable(void); * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_disable(void); -/*************************************************************************** +/**************************************************************************** * Name: l2cc_sync * * Description: @@ -131,11 +131,11 @@ void l2cc_disable(void); * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_sync(void); -/*************************************************************************** +/**************************************************************************** * Name: l2cc_invalidate_all * * Description: @@ -147,11 +147,11 @@ void l2cc_sync(void); * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_invalidate_all(void); -/*************************************************************************** +/**************************************************************************** * Name: l2cc_invalidate * * Description: @@ -164,11 +164,11 @@ void l2cc_invalidate_all(void); * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_invalidate(uintptr_t startaddr, uintptr_t endaddr); -/*************************************************************************** +/**************************************************************************** * Name: l2cc_clean_all * * Description: @@ -180,11 +180,11 @@ void l2cc_invalidate(uintptr_t startaddr, uintptr_t endaddr); * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_clean_all(void); -/*************************************************************************** +/**************************************************************************** * Name: l2cc_clean * * Description: @@ -197,11 +197,11 @@ void l2cc_clean_all(void); * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_clean(uintptr_t startaddr, uintptr_t endaddr); -/*************************************************************************** +/**************************************************************************** * Name: l2cc_flush_all * * Description: @@ -213,11 +213,11 @@ void l2cc_clean(uintptr_t startaddr, uintptr_t endaddr); * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_flush_all(void); -/*************************************************************************** +/**************************************************************************** * Name: l2cc_flush * * Description: @@ -230,7 +230,7 @@ void l2cc_flush_all(void); * Returned Value: * None * - ***************************************************************************/ + ****************************************************************************/ void l2cc_flush(uint32_t startaddr, uint32_t endaddr); diff --git a/arch/arm/src/lpc31xx/lpc31_cgudrvr.h b/arch/arm/src/lpc31xx/lpc31_cgudrvr.h index f2c12528d4..47a2e3917f 100644 --- a/arch/arm/src/lpc31xx/lpc31_cgudrvr.h +++ b/arch/arm/src/lpc31xx/lpc31_cgudrvr.h @@ -180,8 +180,8 @@ * divider index */ /********************************************************************************************** - * Public Types********************** - ************************************************************************/ + * Public Types + **********************************************************************************************/ #ifndef __ASSEMBLY__ #ifdef __cplusplus diff --git a/arch/arm/src/sama5/sam_config.h b/arch/arm/src/sama5/sam_config.h index af8ea87667..650d6c1503 100644 --- a/arch/arm/src/sama5/sam_config.h +++ b/arch/arm/src/sama5/sam_config.h @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/arm/src/sama5/sam_config.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. @@ -31,20 +31,20 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_ARM_SRC_SAMA5_SAM_CONFIG_H #define __ARCH_ARM_SRC_SAMA5_SAM_CONFIG_H 1 -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* Configuration **********************************************************/ diff --git a/arch/arm/src/sama5/sam_irq.h b/arch/arm/src/sama5/sam_irq.h index 505aa69034..5f462862d0 100644 --- a/arch/arm/src/sama5/sam_irq.h +++ b/arch/arm/src/sama5/sam_irq.h @@ -83,9 +83,9 @@ extern "C" #define EXTERN extern #endif -/*************************************************************************** +/**************************************************************************** * Public Function Prototypes - ***************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Name: sam_irq_srctype diff --git a/arch/arm/src/samv7/sam_mcan.h b/arch/arm/src/samv7/sam_mcan.h index 741c458a78..540800b37d 100644 --- a/arch/arm/src/samv7/sam_mcan.h +++ b/arch/arm/src/samv7/sam_mcan.h @@ -59,9 +59,9 @@ #define MCAN0 0 #define MCAN1 1 -/*************************************************************************** +/**************************************************************************** * Public Types - ***************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ @@ -78,9 +78,9 @@ extern "C" #define EXTERN extern #endif -/*************************************************************************** +/**************************************************************************** * Public Functions - ***************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Name: sam_mcan_initialize diff --git a/arch/rgmp/include/limits.h b/arch/rgmp/include/limits.h index 0a6a05c1a6..a17af23d99 100644 --- a/arch/rgmp/include/limits.h +++ b/arch/rgmp/include/limits.h @@ -1,4 +1,4 @@ -/************************************************************ +/**************************************************************************** * arch/rgmp/include/limits.h * * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. @@ -31,18 +31,18 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ #ifndef __ARCH_RGMP_INCLUDE_LIMITS_H #define __ARCH_RGMP_INCLUDE_LIMITS_H -/************************************************************ +/**************************************************************************** * Included Files - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************/ + ****************************************************************************/ #define CHAR_BIT 8 #define SCHAR_MIN (-SCHAR_MAX - 1) diff --git a/arch/rgmp/include/types.h b/arch/rgmp/include/types.h index 482ae0dbd6..90865e3e08 100644 --- a/arch/rgmp/include/types.h +++ b/arch/rgmp/include/types.h @@ -1,4 +1,4 @@ -/************************************************************************ +/**************************************************************************** * arch/rgmp/include/types.h * * Copyright (C) 2011 Gregory Nutt. All rights reserved. @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************/ + ****************************************************************************/ /* This file should never be included directed but, rather, * only indirectly through sys/types.h @@ -40,17 +40,17 @@ #ifndef __ARCH_RGMP_INCLUDE_TYPES_H #define __ARCH_RGMP_INCLUDE_TYPES_H -/************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Type Declarations - ************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ @@ -89,8 +89,8 @@ typedef unsigned int irqstate_t; #endif /* __ASSEMBLY__ */ -/************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************/ + ****************************************************************************/ #endif /* __ARCH_RGMP_INCLUDE_TYPES_H */ diff --git a/arch/sim/include/arch.h b/arch/sim/include/arch.h index 97cfc77602..29cf6495fc 100644 --- a/arch/sim/include/arch.h +++ b/arch/sim/include/arch.h @@ -1,4 +1,4 @@ -/************************************************************ +/**************************************************************************** * arch.h * * Copyright (C) 2007 Gregory Nutt. All rights reserved. @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ /* This file should never be included directed but, rather, * only indirectly through nuttx/arch.h @@ -40,29 +40,29 @@ #ifndef __ARCH_ARCH_H #define __ARCH_ARCH_H -/************************************************************ +/**************************************************************************** * Included Files - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Inline functions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Public Types - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Public Data - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************/ + ****************************************************************************/ #ifdef __cplusplus #define EXTERN extern "C" diff --git a/arch/sim/include/irq.h b/arch/sim/include/irq.h index c167ae6a6e..47bcb37826 100644 --- a/arch/sim/include/irq.h +++ b/arch/sim/include/irq.h @@ -1,4 +1,4 @@ -/************************************************************ +/**************************************************************************** * irq.h * * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ /* This file should never be included directed but, rather, * only indirectly through nuttx/irq.h @@ -40,13 +40,13 @@ #ifndef __ARCH_IRQ_H #define __ARCH_IRQ_H -/************************************************************ +/**************************************************************************** * Included Files - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************/ + ****************************************************************************/ /* No interrupts */ #define NR_IRQS 0 @@ -63,9 +63,9 @@ # define XCPTCONTEXT_REGS 6 #endif -/************************************************************ +/**************************************************************************** * Public Types - ************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ /* Number of registers saved in context switch */ @@ -86,9 +86,9 @@ struct xcptcontext }; #endif -/************************************************************ +/**************************************************************************** * Inline functions - ************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ static inline irqstate_t irqsave(void) @@ -101,13 +101,13 @@ static inline void irqrestore(irqstate_t flags) } #endif -/************************************************************ +/**************************************************************************** * Public Data - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************/ + ****************************************************************************/ #ifdef __cplusplus #define EXTERN extern "C" diff --git a/arch/sim/include/limits.h b/arch/sim/include/limits.h index d5621b65d7..6a52c2c1b1 100644 --- a/arch/sim/include/limits.h +++ b/arch/sim/include/limits.h @@ -1,4 +1,4 @@ -/************************************************************ +/**************************************************************************** * arch/sim/include/limits.h * * Copyright (C) 2007, 2009, 2012 Gregory Nutt. All rights reserved. @@ -31,18 +31,18 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ #ifndef __ARCH_SIM_INCLUDE_LIMITS_H #define __ARCH_SIM_INCLUDE_LIMITS_H -/************************************************************ +/**************************************************************************** * Included Files - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************/ + ****************************************************************************/ #define CHAR_BIT 8 #define SCHAR_MIN (-SCHAR_MAX - 1) diff --git a/arch/sim/include/types.h b/arch/sim/include/types.h index 3adf56fabd..d8f734e3fc 100644 --- a/arch/sim/include/types.h +++ b/arch/sim/include/types.h @@ -1,4 +1,4 @@ -/************************************************************************ +/**************************************************************************** * arch/sim/include/types.h * * Copyright (C) 2007, 2009, 2014 Gregory Nutt. All rights reserved. @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************/ + ****************************************************************************/ /* This file should never be included directed but, rather, * only indirectly through sys/types.h @@ -40,17 +40,17 @@ #ifndef __ARCH_SIM_INCLUDE_TYPES_H #define __ARCH_SIM_INCLUDE_TYPES_H -/************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Type Declarations - ************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ @@ -97,8 +97,8 @@ typedef unsigned int irqstate_t; #endif /* __ASSEMBLY__ */ -/************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************/ + ****************************************************************************/ #endif /* __ARCH_SIM_INCLUDE_TYPES_H */ diff --git a/arch/sim/src/up_internal.h b/arch/sim/src/up_internal.h index 5feb7868d0..32209c7995 100644 --- a/arch/sim/src/up_internal.h +++ b/arch/sim/src/up_internal.h @@ -1,4 +1,4 @@ -/************************************************************************** +/**************************************************************************** * arch/sim/src/up_internal.h * * Copyright (C) 2007, 2009, 2011-2012, 2014 Gregory Nutt. All rights reserved. @@ -31,14 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_SIM_SRC_UP_INTERNAL_H #define __ARCH_SIM_SRC_UP_INTERNAL_H -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include #include @@ -51,9 +51,9 @@ # include #endif -/************************************************************************** +/**************************************************************************** * Pre-processor Definitions - **************************************************************************/ + ****************************************************************************/ /* Configuration **********************************************************/ #ifndef CONFIG_SIM_X11FB @@ -180,13 +180,13 @@ #define SECTORS_PER_CLUSTER 4 #define LOGICAL_SECTOR_SIZE 512 -/************************************************************************** +/**************************************************************************** * Public Types - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Data - **************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ @@ -201,9 +201,9 @@ extern volatile int g_eventloop; extern volatile int g_uart_data_available; #endif -/************************************************************************** +/**************************************************************************** * Public Function Prototypes - **************************************************************************/ + ****************************************************************************/ /* up_setjmp32.S **********************************************************/ diff --git a/arch/x86/include/i486/types.h b/arch/x86/include/i486/types.h index c30026a221..1fde978be6 100644 --- a/arch/x86/include/i486/types.h +++ b/arch/x86/include/i486/types.h @@ -1,4 +1,4 @@ -/************************************************************************ +/**************************************************************************** * arch/x86/include/i486/types.h * * Copyright (C) 2011 Gregory Nutt. All rights reserved. @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************/ + ****************************************************************************/ /* This file should never be included directed but, rather, only * indirectly through arch/types.h (which is, in turn only accessed @@ -41,17 +41,17 @@ #ifndef __ARCH_X86_INCLUDE_I486_TYPES_H #define __ARCH_X86_INCLUDE_I486_TYPES_H -/************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************/ + ****************************************************************************/ -/************************************************************************ +/**************************************************************************** * Type Declarations - ************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ @@ -90,8 +90,8 @@ typedef unsigned int irqstate_t; #endif /* __ASSEMBLY__ */ -/************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************/ + ****************************************************************************/ #endif /* __ARCH_X86_INCLUDE_I486_TYPES_H */ diff --git a/arch/z16/include/serial.h b/arch/z16/include/serial.h index 19b9a9d668..c1ce4aa1f1 100644 --- a/arch/z16/include/serial.h +++ b/arch/z16/include/serial.h @@ -1,4 +1,4 @@ -/************************************************************ +/**************************************************************************** * arch/serial.h * * Copyright (C) 2007 Gregory Nutt. All rights reserved. @@ -31,25 +31,25 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ #ifndef __ARCH_SERIAL_H #define __ARCH_SERIAL_H -/************************************************************ +/**************************************************************************** * Included Files - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Public Data - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Public Functions - ************************************************************/ + ****************************************************************************/ #endif /* __ARCH_SERIAL_H */ From 7ced84c5f09e940e26335109d4b150e0697ae379 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 3 Oct 2015 07:25:03 -0600 Subject: [PATCH 12/33] Standardize the width of all comment boxes in C files --- arch/arm/src/armv7-m/up_itm.c | 28 +- arch/arm/src/dm320/dm320_usbdev.c | 204 ++++++------- arch/arm/src/efm32/efm32_adc.c | 24 +- arch/arm/src/efm32/efm32_bitband.c | 16 +- arch/arm/src/efm32/efm32_dma.c | 32 +- arch/arm/src/efm32/efm32_flash.c | 10 +- arch/arm/src/efm32/efm32_i2c.c | 146 ++++----- arch/arm/src/efm32/efm32_lowputc.c | 20 +- arch/arm/src/efm32/efm32_usbdev.c | 332 ++++++++++----------- arch/arm/src/efm32/efm32_usbhost.c | 296 +++++++++--------- arch/arm/src/kinetis/kinetis_lowputc.c | 8 +- arch/arm/src/kl/kl_lowputc.c | 8 +- arch/arm/src/lpc11xx/lpc11_i2c.c | 68 ++--- arch/arm/src/lpc17xx/lpc17_ethernet.c | 24 +- arch/arm/src/lpc17xx/lpc17_i2c.c | 72 ++--- arch/arm/src/lpc17xx/lpc17_usbdev.c | 232 +++++++------- arch/arm/src/lpc17xx/lpc17_usbhost.c | 214 ++++++------- arch/arm/src/lpc214x/lpc214x_usbdev.c | 224 +++++++------- arch/arm/src/lpc2378/lpc23xx_i2c.c | 48 +-- arch/arm/src/lpc31xx/lpc31_ehci.c | 316 ++++++++++---------- arch/arm/src/lpc31xx/lpc31_i2c.c | 56 ++-- arch/arm/src/lpc31xx/lpc31_usbdev.c | 228 +++++++------- arch/arm/src/lpc43xx/lpc43_ehci.c | 296 +++++++++--------- arch/arm/src/lpc43xx/lpc43_i2c.c | 52 ++-- arch/arm/src/lpc43xx/lpc43_usb0dev.c | 228 +++++++------- arch/arm/src/moxart/moxart_16550.c | 2 +- arch/arm/src/nuc1xx/nuc_lowputc.c | 8 +- arch/arm/src/sam34/sam_twi.c | 112 +++---- arch/arm/src/sam34/sam_udp.c | 16 +- arch/arm/src/sama5/sam_ehci.c | 320 ++++++++++---------- arch/arm/src/sama5/sam_ohci.c | 210 ++++++------- arch/arm/src/sama5/sam_twi.c | 112 +++---- arch/arm/src/sama5/sam_udphs.c | 16 +- arch/arm/src/samdl/sam_lowputc.c | 8 +- arch/arm/src/samv7/sam_twihs.c | 112 +++---- arch/arm/src/samv7/sam_usbdevhs.c | 16 +- arch/arm/src/stm32/stm32_adc.c | 24 +- arch/arm/src/stm32/stm32_dma2d.c | 156 +++++----- arch/arm/src/stm32/stm32_otgfsdev.c | 332 ++++++++++----------- arch/arm/src/stm32/stm32_otgfshost.c | 296 +++++++++--------- arch/arm/src/stm32/stm32_otghsdev.c | 332 ++++++++++----------- arch/arm/src/stm32/stm32_otghshost.c | 296 +++++++++--------- arch/arm/src/stm32/stm32_usbdev.c | 6 +- arch/arm/src/tiva/tiva_adclib.c | 2 +- arch/arm/src/tiva/tiva_adclow.c | 2 +- arch/avr/src/at32uc3/at32uc3_lowconsole.c | 64 ++-- arch/avr/src/at90usb/at90usb_lowconsole.c | 52 ++-- arch/avr/src/at90usb/at90usb_usbdev.c | 232 +++++++------- arch/avr/src/atmega/atmega_lowconsole.c | 44 +-- arch/mips/src/pic32mx/pic32mx-ethernet.c | 20 +- arch/mips/src/pic32mx/pic32mx-lowconsole.c | 64 ++-- arch/mips/src/pic32mz/pic32mz-ethernet.c | 20 +- arch/mips/src/pic32mz/pic32mz-lowconsole.c | 64 ++-- 53 files changed, 3060 insertions(+), 3060 deletions(-) diff --git a/arch/arm/src/armv7-m/up_itm.c b/arch/arm/src/armv7-m/up_itm.c index e25cd20532..695360a1e7 100644 --- a/arch/arm/src/armv7-m/up_itm.c +++ b/arch/arm/src/armv7-m/up_itm.c @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * arch/arm/src/armv7-m/up_itm.c * * Copyright (c) 2009 - 2013 ARM LIMITED @@ -59,11 +59,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *****************************************************************************/ + ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Included Files - *****************************************************************************/ + ****************************************************************************/ #include @@ -72,15 +72,15 @@ #include "up_arch.h" #include "itm.h" -/***************************************************************************** +/**************************************************************************** * Public Data - *****************************************************************************/ + ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Public Functions - *****************************************************************************/ + ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Name: itm_sendchar * * Description: @@ -95,7 +95,7 @@ * Returned Value: * Character to transmit. * - *****************************************************************************/ + ****************************************************************************/ uint32_t itm_sendchar(uint32_t ch) { @@ -109,7 +109,7 @@ uint32_t itm_sendchar(uint32_t ch) return ch; } -/***************************************************************************** +/**************************************************************************** * Name: itm_receivechar * * Description: @@ -120,7 +120,7 @@ uint32_t itm_sendchar(uint32_t ch) * Returned Value: * Received character or -1 No character pending. * - *****************************************************************************/ + ****************************************************************************/ int32_t itm_receivechar(void) { @@ -135,7 +135,7 @@ int32_t itm_receivechar(void) return ch; } -/***************************************************************************** +/**************************************************************************** * Name: itm_checkchar * * Description: @@ -148,7 +148,7 @@ int32_t itm_receivechar(void) * 0 No character available. * 1 Character available. * - *****************************************************************************/ + ****************************************************************************/ int32_t itm_checkchar (void) { diff --git a/arch/arm/src/dm320/dm320_usbdev.c b/arch/arm/src/dm320/dm320_usbdev.c index 28a1427f76..612af87271 100644 --- a/arch/arm/src/dm320/dm320_usbdev.c +++ b/arch/arm/src/dm320/dm320_usbdev.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/dm320/dm320_usbdev.c * * Copyright (C) 2008-2013 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -61,9 +61,9 @@ #include "up_internal.h" #include "dm320_usb.h" -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ @@ -184,9 +184,9 @@ #define dm320_rqempty(ep) ((ep)->head == NULL) #define dm320_rqpeek(ep) ((ep)->head) -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* A container for a request so that the request make be retained in a list */ @@ -262,9 +262,9 @@ struct dm320_epinfo_s #endif }; -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Register operations */ @@ -342,9 +342,9 @@ static int dm320_wakeup(struct usbdev_s *dev); static int dm320_selfpowered(struct usbdev_s *dev, bool selfpowered); static int dm320_pullup(struct usbdev_s *dev, bool enable); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ /* Endpoint methods */ @@ -410,17 +410,17 @@ static const struct dm320_epinfo_s g_epinfo[DM320_NENDPOINTS] = } }; -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: dm320_getreg8 * * Description: * Get the contents of an DM320 8-bit register * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_DM320_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static uint8_t dm320_getreg8(uint32_t addr) @@ -476,13 +476,13 @@ static uint8_t dm320_getreg8(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: dm320_getreg16 * * Description: * Get the contents of an DM320 16-bit register * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_DM320_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static uint32_t dm320_getreg16(uint32_t addr) @@ -538,13 +538,13 @@ static uint32_t dm320_getreg16(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: dm320_getreg32 * * Description: * Get the contents of an DM320 32-bit register * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_DM320_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static uint32_t dm320_getreg32(uint32_t addr) @@ -600,13 +600,13 @@ static uint32_t dm320_getreg32(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: dm320_putreg8 * * Description: * Set the contents of an DM320 8-bit register to a value * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_DM320_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static void dm320_putreg8(uint8_t val, uint32_t addr) @@ -621,13 +621,13 @@ static void dm320_putreg8(uint8_t val, uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: dm320_putreg16 * * Description: * Set the contents of an DM320 16-bit register to a value * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_DM320_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static void dm320_putreg16(uint16_t val, uint32_t addr) @@ -642,13 +642,13 @@ static void dm320_putreg16(uint16_t val, uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: dm320_putreg32 * * Description: * Set the contents of an DM320 32-bit register to a value * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_DM320_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static void dm320_putreg32(uint32_t val, uint32_t addr) @@ -663,13 +663,13 @@ static void dm320_putreg32(uint32_t val, uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: dm320_rqdequeue * * Description: * Remove a request from an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static FAR struct dm320_req_s *dm320_rqdequeue(FAR struct dm320_ep_s *privep) { @@ -689,13 +689,13 @@ static FAR struct dm320_req_s *dm320_rqdequeue(FAR struct dm320_ep_s *privep) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: dm320_rqenqueue * * Description: * Add a request from an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static void dm320_rqenqueue(FAR struct dm320_ep_s *privep, FAR struct dm320_req_s *req) @@ -713,13 +713,13 @@ static void dm320_rqenqueue(FAR struct dm320_ep_s *privep, } } -/******************************************************************************* +/**************************************************************************** * Name: dm320_ep0write * * Description: * Control endpoint write (IN) * - *******************************************************************************/ + ****************************************************************************/ static int dm320_ep0write(uint8_t *buf, uint16_t nbytes) { @@ -748,13 +748,13 @@ static int dm320_ep0write(uint8_t *buf, uint16_t nbytes) return nwritten; } -/******************************************************************************* +/**************************************************************************** * Name: dm320_epwrite * * Description: * Endpoint write (IN) * - *******************************************************************************/ + ****************************************************************************/ static int dm320_epwrite(uint8_t epphy, uint8_t *buf, uint16_t nbytes) { @@ -799,13 +799,13 @@ static int dm320_epwrite(uint8_t epphy, uint8_t *buf, uint16_t nbytes) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: dm320_epread * * Description: * Endpoint read (OUT) * - *******************************************************************************/ + ****************************************************************************/ static int dm320_epread(uint8_t epphy, uint8_t *buf, uint16_t nbytes) { @@ -853,13 +853,13 @@ static int dm320_epread(uint8_t epphy, uint8_t *buf, uint16_t nbytes) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: dm320_abortrequest * * Description: * Discard a request * - *******************************************************************************/ + ****************************************************************************/ static inline void dm320_abortrequest(struct dm320_ep_s *privep, struct dm320_req_s *privreq, @@ -876,13 +876,13 @@ static inline void dm320_abortrequest(struct dm320_ep_s *privep, privreq->req.callback(&privep->ep, &privreq->req); } -/******************************************************************************* +/**************************************************************************** * Name: dm320_reqcomplete * * Description: * Handle termination of a request. * - *******************************************************************************/ + ****************************************************************************/ static void dm320_reqcomplete(struct dm320_ep_s *privep, int16_t result) { @@ -925,7 +925,7 @@ static void dm320_reqcomplete(struct dm320_ep_s *privep, int16_t result) } } -/******************************************************************************* +/**************************************************************************** * Name: dm320_wrrequest * * Description: @@ -934,7 +934,7 @@ static void dm320_reqcomplete(struct dm320_ep_s *privep, int16_t result) * Returned Value: * 0:not finished; 1:completed; <0:error * - *******************************************************************************/ + ****************************************************************************/ static int dm320_wrrequest(struct dm320_ep_s *privep) { @@ -1019,13 +1019,13 @@ static int dm320_wrrequest(struct dm320_ep_s *privep) return OK; /* Won't get here */ } -/******************************************************************************* +/**************************************************************************** * Name: dm320_rdrequest * * Description: * Receive to the next queued read request * - *******************************************************************************/ + ****************************************************************************/ static int dm320_rdrequest(struct dm320_ep_s *privep) { @@ -1068,13 +1068,13 @@ static int dm320_rdrequest(struct dm320_ep_s *privep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: dm320_cancelrequests * * Description: * Cancel all pending requests for an endpoint * - *******************************************************************************/ + ****************************************************************************/ static void dm320_cancelrequests(struct dm320_ep_s *privep) { @@ -1086,14 +1086,14 @@ static void dm320_cancelrequests(struct dm320_ep_s *privep) } } -/******************************************************************************* +/**************************************************************************** * Name: dm320_epfindbyaddr * * Description: * Find the physical endpoint structure corresponding to a logic endpoint * address * - *******************************************************************************/ + ****************************************************************************/ static struct dm320_ep_s *dm320_epfindbyaddr(struct dm320_usbdev_s *priv, uint16_t eplog) @@ -1129,13 +1129,13 @@ static struct dm320_ep_s *dm320_epfindbyaddr(struct dm320_usbdev_s *priv, return NULL; } -/******************************************************************************* +/**************************************************************************** * Name: dm320_dispatchrequest * * Description: * Provide unhandled setup actions to the class driver * - *******************************************************************************/ + ****************************************************************************/ static void dm320_dispatchrequest(struct dm320_usbdev_s *priv, const struct usb_ctrlreq_s *ctrl) @@ -1156,13 +1156,13 @@ static void dm320_dispatchrequest(struct dm320_usbdev_s *priv, } } -/******************************************************************************* +/**************************************************************************** * Name: dm320_ep0setup * * Description: * USB Ctrl EP Setup Event * - *******************************************************************************/ + ****************************************************************************/ static inline void dm320_ep0setup(struct dm320_usbdev_s *priv) { @@ -1429,13 +1429,13 @@ static inline void dm320_ep0setup(struct dm320_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: dm320_highestpriinterrupt * * Description: * Part of the USB core controller interrupt handling logic * - *******************************************************************************/ + ****************************************************************************/ static inline uint32_t dm320_highestpriinterrupt(int intstatus) { @@ -1465,13 +1465,13 @@ static inline uint32_t dm320_highestpriinterrupt(int intstatus) return USB_INT_NOINTERRUPT; } -/******************************************************************************* +/**************************************************************************** * Name: dm320_ctlrinterrupt * * Description: * Handle USB controller core interrupts * - *******************************************************************************/ + ****************************************************************************/ static int dm320_ctlrinterrupt(int irq, FAR void *context) { @@ -1632,13 +1632,13 @@ static int dm320_ctlrinterrupt(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: dm320_attachinterrupt * * Description: * Attach GIO interrtup handler * - *******************************************************************************/ + ****************************************************************************/ static int dm320_attachinterrupt(int irq, FAR void *context) { @@ -1690,9 +1690,9 @@ static int dm320_attachinterrupt(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: dm320_epreset - *******************************************************************************/ + ****************************************************************************/ static void dm320_epreset(unsigned int index) { @@ -1702,13 +1702,13 @@ static void dm320_epreset(unsigned int index) dm320_putreg8(USB_CSR2_FLFIFO, DM320_USB_CSR2); } -/******************************************************************************* +/**************************************************************************** * Name: dm320_epinitialize * * Description: * Initialize endpoints. This is logically a part of dm320_ctrlinitialize * - *******************************************************************************/ + ****************************************************************************/ static inline void dm320_epinitialize(struct dm320_usbdev_s *priv) { @@ -1793,13 +1793,13 @@ static inline void dm320_epinitialize(struct dm320_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: dm320_ctrlinitialize * * Description: * Initialize the DM320 USB controller for peripheral mode operation . * - *******************************************************************************/ + ****************************************************************************/ static void dm320_ctrlinitialize(FAR struct dm320_usbdev_s *priv) { @@ -1853,11 +1853,11 @@ static void dm320_ctrlinitialize(FAR struct dm320_usbdev_s *priv) dm320_putreg8(USB_EP0_SELECT, DM320_USB_INDEX); } -/******************************************************************************* +/**************************************************************************** * Endpoint Methods - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: dm320_epconfigure * * Description: @@ -1870,7 +1870,7 @@ static void dm320_ctrlinitialize(FAR struct dm320_usbdev_s *priv) * needs to take special action when all of the endpoints have been * configured. * - *******************************************************************************/ + ****************************************************************************/ static int dm320_epconfigure(FAR struct usbdev_ep_s *ep, FAR const struct usb_epdesc_s *desc, @@ -1886,13 +1886,13 @@ static int dm320_epconfigure(FAR struct usbdev_ep_s *ep, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: dm320_epdisable * * Description: * The endpoint will no longer be used * - *******************************************************************************/ + ****************************************************************************/ static int dm320_epdisable(FAR struct usbdev_ep_s *ep) { @@ -1918,13 +1918,13 @@ static int dm320_epdisable(FAR struct usbdev_ep_s *ep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: dm320_epallocreq * * Description: * Allocate an I/O request * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_req_s *dm320_epallocreq(FAR struct usbdev_ep_s *ep) { @@ -1949,13 +1949,13 @@ static FAR struct usbdev_req_s *dm320_epallocreq(FAR struct usbdev_ep_s *ep) return &privreq->req; } -/******************************************************************************* +/**************************************************************************** * Name: dm320_epfreereq * * Description: * Free an I/O request * - *******************************************************************************/ + ****************************************************************************/ static void dm320_epfreereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -1973,13 +1973,13 @@ static void dm320_epfreereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s kmm_free(privreq); } -/******************************************************************************* +/**************************************************************************** * Name: dm320_epallocbuffer * * Description: * Allocate an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_DMA static void *dm320_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) @@ -1994,13 +1994,13 @@ static void *dm320_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) } #endif -/******************************************************************************* +/**************************************************************************** * Name: dm320_epfreebuffer * * Description: * Free an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_DMA static void dm320_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) @@ -2015,13 +2015,13 @@ static void dm320_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) } #endif -/******************************************************************************* +/**************************************************************************** * Name: dm320_epsubmit * * Description: * Submit an I/O request to the endpoint * - *******************************************************************************/ + ****************************************************************************/ static int dm320_epsubmit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -2112,13 +2112,13 @@ static int dm320_epsubmit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *r return ret; } -/******************************************************************************* +/**************************************************************************** * Name: dm320_epcancel * * Description: * Cancel an I/O request previously sent to an endpoint * - *******************************************************************************/ + ****************************************************************************/ static int dm320_epcancel(struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -2142,11 +2142,11 @@ static int dm320_epcancel(struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) return OK; } -/******************************************************************************* +/**************************************************************************** * Device Methods - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: dm320_allocep * * Description: @@ -2160,7 +2160,7 @@ static int dm320_epcancel(struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) * eptype - Endpoint type. One of {USB_EP_ATTR_XFER_ISOC, USB_EP_ATTR_XFER_BULK, * USB_EP_ATTR_XFER_INT} * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_ep_s *dm320_allocep(FAR struct usbdev_s *dev, uint8_t eplog, bool in, uint8_t eptype) @@ -2216,13 +2216,13 @@ static FAR struct usbdev_ep_s *dm320_allocep(FAR struct usbdev_s *dev, uint8_t e return NULL; } -/******************************************************************************* +/**************************************************************************** * Name: dm320_freeep * * Description: * Free the previously allocated endpoint * - *******************************************************************************/ + ****************************************************************************/ static void dm320_freeep(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) { @@ -2233,13 +2233,13 @@ static void dm320_freeep(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) /* Nothing needs to be done */ } -/******************************************************************************* +/**************************************************************************** * Name: dm320_getframe * * Description: * Returns the current frame number * - *******************************************************************************/ + ****************************************************************************/ static int dm320_getframe(struct usbdev_s *dev) { @@ -2267,13 +2267,13 @@ static int dm320_getframe(struct usbdev_s *dev) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: dm320_wakeup * * Description: * Tries to wake up the host connected to this device * - *******************************************************************************/ + ****************************************************************************/ static int dm320_wakeup(struct usbdev_s *dev) { @@ -2286,13 +2286,13 @@ static int dm320_wakeup(struct usbdev_s *dev) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: dm320_selfpowered * * Description: * Sets/clears the device selfpowered feature * - *******************************************************************************/ + ****************************************************************************/ static int dm320_selfpowered(struct usbdev_s *dev, bool selfpowered) { @@ -2312,13 +2312,13 @@ static int dm320_selfpowered(struct usbdev_s *dev, bool selfpowered) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: dm320_pullup * * Description: * Software-controlled connect to/disconnect from USB host * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_DM320_GIO_USBDPPULLUP static int dm320_pullup(struct usbdev_s *dev, bool enable) @@ -2342,17 +2342,17 @@ static int dm320_pullup(struct usbdev_s *dev, bool enable) } #endif -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_usbinitialize * * Description: * Initialize USB hardware * - *******************************************************************************/ + ****************************************************************************/ void up_usbinitialize(void) { @@ -2457,9 +2457,9 @@ errout: up_usbuninitialize(); } -/******************************************************************************* +/**************************************************************************** * Name: up_usbuninitialize - *******************************************************************************/ + ****************************************************************************/ void up_usbuninitialize(void) { diff --git a/arch/arm/src/efm32/efm32_adc.c b/arch/arm/src/efm32/efm32_adc.c index 5d3a73290f..c23654c66f 100644 --- a/arch/arm/src/efm32/efm32_adc.c +++ b/arch/arm/src/efm32/efm32_adc.c @@ -230,7 +230,7 @@ static void adc_putreg(struct efm32_dev_s *priv, int offset, uint32_t value) * ref - Reference to load calibrated values for. No values are loaded for * external references. * - ******************************************************************************/ + ****************************************************************************/ static void ADC_CalibrateLoadScan(ADC_TypeDef *adc, ADC_Ref_TypeDef ref) { @@ -314,7 +314,7 @@ static void ADC_CalibrateLoadScan(ADC_TypeDef *adc, ADC_Ref_TypeDef ref) * ref - Reference to load calibrated values for. No values are loaded for * external references. * - ******************************************************************************/ + ****************************************************************************/ static void ADC_CalibrateLoadSingle(ADC_TypeDef *adc, ADC_Ref_TypeDef ref) { @@ -381,9 +381,9 @@ static void ADC_CalibrateLoadSingle(ADC_TypeDef *adc, ADC_Ref_TypeDef ref) } } -/******************************************************************************* +/**************************************************************************** * Public Functions - ******************************************************************************/ + ****************************************************************************/ /***************************************************************************//** * Name: ADC_Init @@ -400,7 +400,7 @@ static void ADC_CalibrateLoadSingle(ADC_TypeDef *adc, ADC_Ref_TypeDef ref) * adc- Pointer to ADC peripheral register block. * int - Pointer to ADC initialization structure. * - ******************************************************************************/ + ****************************************************************************/ void ADC_Init(ADC_TypeDef *adc, const ADC_Init_TypeDef *init) { @@ -444,7 +444,7 @@ void ADC_Init(ADC_TypeDef *adc, const ADC_Init_TypeDef *init) * adc - Pointer to ADC peripheral register block. * init - Pointer to ADC initialization structure. * - ******************************************************************************/ + ****************************************************************************/ void ADC_InitScan(ADC_TypeDef *adc, const ADC_InitScan_TypeDef *init) { @@ -507,7 +507,7 @@ void ADC_InitScan(ADC_TypeDef *adc, const ADC_InitScan_TypeDef *init) * adc - Pointer to ADC peripheral register block. * init - Pointer to ADC initialization structure. * - ******************************************************************************/ + ****************************************************************************/ void ADC_InitSingle(ADC_TypeDef *adc, const ADC_InitSingle_TypeDef *init) { @@ -570,7 +570,7 @@ void ADC_InitSingle(ADC_TypeDef *adc, const ADC_InitSingle_TypeDef *init) * Prescaler value to use for ADC in order to achieve a clock value * <= @p adcFreq. * - ******************************************************************************/ + ****************************************************************************/ uint8_t ADC_PrescaleCalc(uint32_t adcFreq, uint32_t hfperFreq) { @@ -616,7 +616,7 @@ uint8_t ADC_PrescaleCalc(uint32_t adcFreq, uint32_t hfperFreq) * Input Parameters: * adc - Pointer to ADC peripheral register block. * - ******************************************************************************/ + ****************************************************************************/ void ADC_Reset(ADC_TypeDef *adc) { @@ -651,7 +651,7 @@ void ADC_Reset(ADC_TypeDef *adc) * Returned Value: * Timebase value to use for ADC in order to achieve at least 1 us. * - ******************************************************************************/ + ****************************************************************************/ uint8_t ADC_TimebaseCalc(uint32_t hfperFreq) { @@ -837,7 +837,7 @@ static void adc_hw_reset(struct efm32_dev_s *priv, bool reset) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: adc_enable * * Description : Enables or disables the specified ADC peripheral. @@ -851,7 +851,7 @@ static void adc_hw_reset(struct efm32_dev_s *priv, bool reset) * * Returned Value: * - *******************************************************************************/ + ****************************************************************************/ static void adc_enable(FAR struct efm32_dev_s *priv, bool enable) { diff --git a/arch/arm/src/efm32/efm32_bitband.c b/arch/arm/src/efm32/efm32_bitband.c index cb3f200da4..fa45b660b8 100644 --- a/arch/arm/src/efm32/efm32_bitband.c +++ b/arch/arm/src/efm32/efm32_bitband.c @@ -73,7 +73,7 @@ * Private Functions ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Name: bitband_set_peripheral * * Description: @@ -91,7 +91,7 @@ * bit Bit position to modify, 0-31. * val Value to set bit to, 0 or 1. * - ******************************************************************************/ + ****************************************************************************/ inline void bitband_set_peripheral(uint32_t addr, uint32_t bit, uint32_t val) { @@ -101,7 +101,7 @@ inline void bitband_set_peripheral(uint32_t addr, uint32_t bit, uint32_t val) *((volatile uint32_t *)regval) = (uint32_t)val; } -/****************************************************************************** +/**************************************************************************** * Name: bitband_get_peripheral * * Description: @@ -122,7 +122,7 @@ inline void bitband_set_peripheral(uint32_t addr, uint32_t bit, uint32_t val) * Returned Value: * Return bit value read, 0 or 1. * - ******************************************************************************/ + ****************************************************************************/ inline uint32_t bitband_get_peripheral(uint32_t addr, uint32_t bit) { @@ -132,7 +132,7 @@ inline uint32_t bitband_get_peripheral(uint32_t addr, uint32_t bit) return *((volatile uint32_t *)regval); } -/****************************************************************************** +/**************************************************************************** * Name: bitband_set_sram * * Description: @@ -150,7 +150,7 @@ inline uint32_t bitband_get_peripheral(uint32_t addr, uint32_t bit) * bit Bit position to modify, 0-31. * val Value to set bit to, 0 or 1. * - ******************************************************************************/ + ****************************************************************************/ inline void bitband_set_sram(uint32_t addr, uint32_t bit, uint32_t val) { @@ -160,7 +160,7 @@ inline void bitband_set_sram(uint32_t addr, uint32_t bit, uint32_t val) *((volatile uint32_t *)regval) = (uint32_t)val; } -/****************************************************************************** +/**************************************************************************** * Name: bitband_get_sram * * Description:: @@ -181,7 +181,7 @@ inline void bitband_set_sram(uint32_t addr, uint32_t bit, uint32_t val) * Returned Value: * Return bit value read, 0 or 1. * - ******************************************************************************/ + ****************************************************************************/ inline uint32_t bitband_get_sram(uint32_t addr, uint32_t bit) { diff --git a/arch/arm/src/efm32/efm32_dma.c b/arch/arm/src/efm32/efm32_dma.c index 8f32168fb7..8980f73790 100644 --- a/arch/arm/src/efm32/efm32_dma.c +++ b/arch/arm/src/efm32/efm32_dma.c @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * arch/arm/src/efm32/efm32_dma.c * * Copyright (C) 2014 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *****************************************************************************/ + ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Included Files - *****************************************************************************/ + ****************************************************************************/ #include @@ -53,17 +53,17 @@ #include "chip/efm32_dma.h" #include "efm32_dma.h" -/***************************************************************************** +/**************************************************************************** * Pre-processor Definitions - *****************************************************************************/ + ****************************************************************************/ #define ALIGN_MASK(s) ((1 << s) - 1) #define ALIGN_DOWN(v,m) ((v) & ~m) #define ALIGN_UP(v,m) (((v) + (m)) & ~m) -/***************************************************************************** +/**************************************************************************** * Public Types - *****************************************************************************/ + ****************************************************************************/ /* This structure describes one DMA channel */ struct dma_channel_s @@ -83,9 +83,9 @@ struct dma_controller_s sem_t chansem; /* Count of free channels */ }; -/***************************************************************************** +/**************************************************************************** * Private Data - *****************************************************************************/ + ****************************************************************************/ /* This is the overall state of the DMA controller */ @@ -130,13 +130,13 @@ static struct dma_descriptor_s g_descriptors[EFM32_DMA_NCHANNELS] __attribute__((aligned(DESC_TABLE_ALIGN))); #endif -/***************************************************************************** +/**************************************************************************** * Public Data - *****************************************************************************/ + ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Private Functions - *****************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Name: efm32_set_chctrl @@ -249,9 +249,9 @@ static int efm32_dmac_interrupt(int irq, void *context) return OK; } -/***************************************************************************** +/**************************************************************************** * Public Functions - *****************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Name: up_dmainitialize diff --git a/arch/arm/src/efm32/efm32_flash.c b/arch/arm/src/efm32/efm32_flash.c index adf34fe180..231612b0e8 100644 --- a/arch/arm/src/efm32/efm32_flash.c +++ b/arch/arm/src/efm32/efm32_flash.c @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * arch/arm/src/efm32/efm32_flash.c * * Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com @@ -183,7 +183,7 @@ void efm32_flash_unlock(void) #endif } -/******************************************************************************* +/**************************************************************************** * Name: msc_load_verify_address * * Description: @@ -206,7 +206,7 @@ void efm32_flash_unlock(void) * -EBUSY - Busy timeout. * -EINVAL - Operation tried to access a non-flash area. * -EACCES - Operation tried to access a locked area of the flash. - *******************************************************************************/ + ****************************************************************************/ int __ramfunc__ msc_load_verify_address(uint32_t* address) { @@ -251,7 +251,7 @@ int __ramfunc__ msc_load_verify_address(uint32_t* address) return OK; } -/******************************************************************************* +/**************************************************************************** * Name:msc_load_data * * Description: @@ -276,7 +276,7 @@ int __ramfunc__ msc_load_verify_address(uint32_t* address) * OK - Operation completed successfully. * -ETIMEDOUT - Operation timed out waiting for flash operation * to complete. - ******************************************************************************/ + ****************************************************************************/ int __ramfunc__ msc_load_write_data(uint32_t* data, uint32_t num_words, bool write_strategy_safe) diff --git a/arch/arm/src/efm32/efm32_i2c.c b/arch/arm/src/efm32/efm32_i2c.c index 415e11a7fb..b1cf913246 100644 --- a/arch/arm/src/efm32/efm32_i2c.c +++ b/arch/arm/src/efm32/efm32_i2c.c @@ -32,7 +32,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ******************************************************************************/ + ****************************************************************************/ /* Supports: * - Master operation, 100 kHz (standard) and 400 kHz (full speed) @@ -51,9 +51,9 @@ * */ -/******************************************************************************* +/**************************************************************************** * Included Files - ******************************************************************************/ + ****************************************************************************/ #include @@ -84,9 +84,9 @@ #if defined(CONFIG_EFM32_I2C0) || defined(CONFIG_EFM32_I2C1) -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - ******************************************************************************/ + ****************************************************************************/ /* Configuration **************************************************************/ @@ -281,9 +281,9 @@ struct efm32_i2c_inst_s uint32_t flags; /* Flags used in this instantiation */ }; -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - ******************************************************************************/ + ****************************************************************************/ static inline uint32_t efm32_i2c_getreg(FAR struct efm32_i2c_priv_s *priv, uint8_t offset); @@ -351,9 +351,9 @@ static int efm32_i2c_transfer(FAR struct i2c_dev_s *dev, static const char *efm32_i2c_state_str(int i2c_state); #endif -/******************************************************************************* +/**************************************************************************** * Private Data - ******************************************************************************/ + ****************************************************************************/ /* Trace events strings */ @@ -433,17 +433,17 @@ static const struct i2c_ops_s efm32_i2c_ops = #endif }; -/******************************************************************************* +/**************************************************************************** * Private Functions - ******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_getreg * * Description: * Get a 16-bit register value by offset * - ******************************************************************************/ + ****************************************************************************/ static inline uint32_t efm32_i2c_getreg(FAR struct efm32_i2c_priv_s *priv, uint8_t offset) @@ -451,13 +451,13 @@ static inline uint32_t efm32_i2c_getreg(FAR struct efm32_i2c_priv_s *priv, return getreg32(priv->config->base + offset); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_putreg * * Description: * Put a 16-bit register value by offset * - ******************************************************************************/ + ****************************************************************************/ static inline void efm32_i2c_putreg(FAR struct efm32_i2c_priv_s *priv, uint8_t offset, uint32_t value) @@ -465,13 +465,13 @@ static inline void efm32_i2c_putreg(FAR struct efm32_i2c_priv_s *priv, putreg32(value, priv->config->base + offset); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_modifyreg * * Description: * Modify a 16-bit register value by offset * - ******************************************************************************/ + ****************************************************************************/ static inline void efm32_i2c_modifyreg(FAR struct efm32_i2c_priv_s *priv, uint8_t offset, uint32_t clearbits, @@ -480,13 +480,13 @@ static inline void efm32_i2c_modifyreg(FAR struct efm32_i2c_priv_s *priv, modifyreg32(priv->config->base + offset, clearbits, setbits); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_state_str * * Description: * Convert i2c_state into corresponding text. * - ******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_I2C_TRACE static const char *efm32_i2c_state_str(int i2c_state) @@ -521,13 +521,13 @@ static const char *efm32_i2c_state_str(int i2c_state) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_sem_wait * * Description: * Take the exclusive access, waiting as necessary * - ******************************************************************************/ + ****************************************************************************/ static inline void efm32_i2c_sem_wait(FAR struct i2c_dev_s *dev) { @@ -537,14 +537,14 @@ static inline void efm32_i2c_sem_wait(FAR struct i2c_dev_s *dev) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_tousecs * * Description: * Return a micro-second delay based on the number of bytes left to be * processed. * - ******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_EFM32_I2C_DYNTIMEO static useconds_t efm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs) @@ -566,13 +566,13 @@ static useconds_t efm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_sem_waitdone * * Description: * Wait for a transfer to complete * - ******************************************************************************/ + ****************************************************************************/ #ifndef CONFIG_I2C_POLLED static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv) @@ -701,26 +701,26 @@ static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_sem_post * * Description: * Release the mutual exclusion semaphore * - ******************************************************************************/ + ****************************************************************************/ static inline void efm32_i2c_sem_post(FAR struct i2c_dev_s *dev) { sem_post(&((struct efm32_i2c_inst_s *)dev)->priv->sem_excl); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_sem_init * * Description: * Initialize semaphores * - ******************************************************************************/ + ****************************************************************************/ static inline void efm32_i2c_sem_init(FAR struct i2c_dev_s *dev) { @@ -730,13 +730,13 @@ static inline void efm32_i2c_sem_init(FAR struct i2c_dev_s *dev) #endif } -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_sem_destroy * * Description: * Destroy semaphores. * - ******************************************************************************/ + ****************************************************************************/ static inline void efm32_i2c_sem_destroy(FAR struct i2c_dev_s *dev) { @@ -746,13 +746,13 @@ static inline void efm32_i2c_sem_destroy(FAR struct i2c_dev_s *dev) #endif } -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_trace* * * Description: * I2C trace instrumentation * - ******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_I2C_TRACE static void efm32_i2c_traceclear(FAR struct efm32_i2c_priv_s *priv) @@ -841,13 +841,13 @@ static void efm32_i2c_tracedump(FAR struct efm32_i2c_priv_s *priv) } #endif /* CONFIG_I2C_TRACE */ -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_setclock * * Description: * Set the I2C clock * - ******************************************************************************/ + ****************************************************************************/ static void efm32_i2c_setclock(FAR struct efm32_i2c_priv_s *priv, uint32_t frequency) @@ -893,13 +893,13 @@ static void efm32_i2c_setclock(FAR struct efm32_i2c_priv_s *priv, efm32_i2c_putreg(priv, EFM32_I2C_CLKDIV_OFFSET, div); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_isr * * Description: * Common Interrupt Service Routine * - ******************************************************************************/ + ****************************************************************************/ static int efm32_i2c_isr(struct efm32_i2c_priv_s *priv) { @@ -1307,13 +1307,13 @@ done: #ifndef CONFIG_I2C_POLLED -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c0_isr * * Description: * I2C0 interrupt service routine * - ******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_EFM32_I2C0 static int efm32_i2c0_isr(int irq, void *context) @@ -1322,13 +1322,13 @@ static int efm32_i2c0_isr(int irq, void *context) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c1_isr * * Description: * I2C1 interrupt service routine * - ******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_EFM32_I2C1 static int efm32_i2c1_isr(int irq, void *context) @@ -1339,17 +1339,17 @@ static int efm32_i2c1_isr(int irq, void *context) #endif -/******************************************************************************* +/**************************************************************************** * Private Initialization and Deinitialization - ******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_reset * * Description: * Reset I2C to same state as after a HW reset. * - ******************************************************************************/ + ****************************************************************************/ static void efm32_i2c_reset(FAR struct efm32_i2c_priv_s *priv) { @@ -1363,14 +1363,14 @@ static void efm32_i2c_reset(FAR struct efm32_i2c_priv_s *priv) /* Do not reset route register, setting should be done independently */ } -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_init * * Description: * Setup the I2C hardware, ready for operation with defaults * Prepare and start an I2C transfer (single master mode only). * - ******************************************************************************/ + ****************************************************************************/ static int efm32_i2c_init(FAR struct efm32_i2c_priv_s *priv, int frequency) { @@ -1434,13 +1434,13 @@ static int efm32_i2c_init(FAR struct efm32_i2c_priv_s *priv, int frequency) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_deinit * * Description: * Shutdown the I2C hardware * - ******************************************************************************/ + ****************************************************************************/ static int efm32_i2c_deinit(FAR struct efm32_i2c_priv_s *priv) { @@ -1466,17 +1466,17 @@ static int efm32_i2c_deinit(FAR struct efm32_i2c_priv_s *priv) return OK; } -/******************************************************************************* +/**************************************************************************** * Device Driver Operations - ******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_setfrequency * * Description: * Set the I2C frequency * - ******************************************************************************/ + ****************************************************************************/ static uint32_t efm32_i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) @@ -1489,13 +1489,13 @@ static uint32_t efm32_i2c_setfrequency(FAR struct i2c_dev_s *dev, return frequency; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_setaddress * * Description: * Set the I2C slave address * - ******************************************************************************/ + ****************************************************************************/ static int efm32_i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) { @@ -1508,13 +1508,13 @@ static int efm32_i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_process * * Description: * Common I2C transfer logic * - ******************************************************************************/ + ****************************************************************************/ static int efm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *msgs, int count) @@ -1660,13 +1660,13 @@ static int efm32_i2c_process(FAR struct i2c_dev_s *dev, return -errval; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_write * * Description: * Write I2C data * - ******************************************************************************/ + ****************************************************************************/ static int efm32_i2c_write(FAR struct i2c_dev_s *dev, const uint8_t * buffer, int buflen) @@ -1682,13 +1682,13 @@ static int efm32_i2c_write(FAR struct i2c_dev_s *dev, const uint8_t * buffer, return efm32_i2c_process(dev, &msgv, 1); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_read * * Description: * Read I2C data * - ******************************************************************************/ + ****************************************************************************/ int efm32_i2c_read(FAR struct i2c_dev_s *dev, uint8_t * buffer, int buflen) { @@ -1703,13 +1703,13 @@ int efm32_i2c_read(FAR struct i2c_dev_s *dev, uint8_t * buffer, int buflen) return efm32_i2c_process(dev, &msgv, 1); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_writeread * * Description: * Read then write I2C data * - ******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_I2C_WRITEREAD static int efm32_i2c_writeread(FAR struct i2c_dev_s *dev, @@ -1735,13 +1735,13 @@ static int efm32_i2c_writeread(FAR struct i2c_dev_s *dev, } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_i2c_transfer * * Description: * Generic I2C transfer function * - ******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_I2C_TRANSFER static int efm32_i2c_transfer(FAR struct i2c_dev_s *dev, @@ -1751,17 +1751,17 @@ static int efm32_i2c_transfer(FAR struct i2c_dev_s *dev, } #endif -/******************************************************************************* +/**************************************************************************** * Public Functions - ******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_i2cinitialize * * Description: * Initialize one I2C bus * - ******************************************************************************/ + ****************************************************************************/ FAR struct i2c_dev_s *up_i2cinitialize(int port) { @@ -1821,13 +1821,13 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port) return (struct i2c_dev_s *)inst; } -/******************************************************************************* +/**************************************************************************** * Name: up_i2cuninitialize * * Description: * Uninitialize an I2C bus * - ******************************************************************************/ + ****************************************************************************/ int up_i2cuninitialize(FAR struct i2c_dev_s *dev) { @@ -1865,13 +1865,13 @@ int up_i2cuninitialize(FAR struct i2c_dev_s *dev) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: up_i2creset * * Description: * Reset an I2C bus * - ******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_I2C_RESET int up_i2creset(FAR struct i2c_dev_s *dev) diff --git a/arch/arm/src/efm32/efm32_lowputc.c b/arch/arm/src/efm32/efm32_lowputc.c index ebbfce3479..b3fa2ee386 100644 --- a/arch/arm/src/efm32/efm32_lowputc.c +++ b/arch/arm/src/efm32/efm32_lowputc.c @@ -488,13 +488,13 @@ void efm32_lowsetup(void) #endif } -/***************************************************************************** +/**************************************************************************** * Name: efm32_lowputc * * Description: * Output one character to the UART using a simple polling method. * - *****************************************************************************/ + ****************************************************************************/ #if defined(HAVE_UART_CONSOLE) void efm32_lowputc(uint32_t ch) @@ -527,13 +527,13 @@ void efm32_lowputc(uint32_t ch) } #endif -/***************************************************************************** +/**************************************************************************** * Name: efm32_uartconfigure * * Description: * Configure a U[S]ART as a RS-232 UART. * - *****************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE void efm32_uartconfigure(uintptr_t base, uint32_t baud, unsigned int parity, @@ -646,13 +646,13 @@ void efm32_uartconfigure(uintptr_t base, uint32_t baud, unsigned int parity, } #endif -/***************************************************************************** +/**************************************************************************** * Name: efm32_leuartconfigure * * Description: * Configure a LEUART as a RS-232 UART. * - *****************************************************************************/ + ****************************************************************************/ #ifdef HAVE_LEUART_DEVICE void efm32_leuartconfigure(uintptr_t base, uint32_t baud, unsigned int parity, @@ -722,7 +722,7 @@ void efm32_leuartconfigure(uintptr_t base, uint32_t baud, unsigned int parity, } #endif -/***************************************************************************** +/**************************************************************************** * Name: efm32_uart_reset * * Description: @@ -730,7 +730,7 @@ void efm32_leuartconfigure(uintptr_t base, uint32_t baud, unsigned int parity, * to the initial, reset value. Only the ROUTE data set by efm32_lowsetup * is preserved. * - *****************************************************************************/ + ****************************************************************************/ #if defined(HAVE_UART_DEVICE) || defined(HAVE_SPI_DEVICE) void efm32_uart_reset(uintptr_t base) @@ -755,7 +755,7 @@ void efm32_uart_reset(uintptr_t base) } #endif -/***************************************************************************** +/**************************************************************************** * Name: efm32_leuart_reset * * Description: @@ -763,7 +763,7 @@ void efm32_uart_reset(uintptr_t base) * to the initial, reset value. Only the ROUTE data set by efm32_lowsetup * is preserved. * - *****************************************************************************/ + ****************************************************************************/ #ifdef HAVE_LEUART_DEVICE void efm32_leuart_reset(uintptr_t base) diff --git a/arch/arm/src/efm32/efm32_usbdev.c b/arch/arm/src/efm32/efm32_usbdev.c index 9ce5b6a138..18fcb3c776 100644 --- a/arch/arm/src/efm32/efm32_usbdev.c +++ b/arch/arm/src/efm32/efm32_usbdev.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/efm32/efm32_usbdev.c * * Copyright (C) 2014 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -66,9 +66,9 @@ #if defined(CONFIG_USBDEV) && (defined(CONFIG_EFM32_OTGFS)) -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ #ifndef CONFIG_USBDEV_EP0_MAXSIZE @@ -278,9 +278,9 @@ # define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* Overall device state */ @@ -468,9 +468,9 @@ struct efm32_usbdev_s struct efm32_ep_s epout[EFM32_NENDPOINTS]; }; -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Register operations ********************************************************/ @@ -649,9 +649,9 @@ static int efm32_rxfifo_flush(void); static void efm32_swinitialize(FAR struct efm32_usbdev_s *priv); static void efm32_hwinitialize(FAR struct efm32_usbdev_s *priv); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ /* Since there is only a single USB interface, all status information can be * be simply retained in a single global instance. */ @@ -778,21 +778,21 @@ const struct trace_msg_t g_usb_trace_strings_intdecode[] = }; #endif -/******************************************************************************* +/**************************************************************************** * Public Data - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: efm32_getreg * * Description: * Get the contents of an EFM32 register * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_EFM32_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static uint32_t efm32_getreg(uint32_t addr) @@ -848,13 +848,13 @@ static uint32_t efm32_getreg(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_putreg * * Description: * Set the contents of an EFM32 register to a value * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_EFM32_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static void efm32_putreg(uint32_t val, uint32_t addr) @@ -869,13 +869,13 @@ static void efm32_putreg(uint32_t val, uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_req_remfirst * * Description: * Remove a request from the head of an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static FAR struct efm32_req_s *efm32_req_remfirst(FAR struct efm32_ep_s *privep) { @@ -895,13 +895,13 @@ static FAR struct efm32_req_s *efm32_req_remfirst(FAR struct efm32_ep_s *privep) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_req_addlast * * Description: * Add a request to the end of an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static bool efm32_req_addlast(FAR struct efm32_ep_s *privep, FAR struct efm32_req_s *req) @@ -922,13 +922,13 @@ static bool efm32_req_addlast(FAR struct efm32_ep_s *privep, return is_empty; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep0in_setupresponse * * Description: * Schedule a short transfer on Endpoint 0 (IN or OUT) * - *******************************************************************************/ + ****************************************************************************/ static void efm32_ep0in_setupresponse(FAR struct efm32_usbdev_s *priv, FAR uint8_t *buf, uint32_t nbytes) @@ -951,13 +951,13 @@ static inline void efm32_ep0in_transmitzlp(FAR struct efm32_usbdev_s *priv) efm32_ep0in_setupresponse(priv, NULL, 0); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep0in_activate * * Description: * Activate the endpoint 0 IN endpoint. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_ep0in_activate(void) { @@ -989,13 +989,13 @@ static void efm32_ep0in_activate(void) efm32_putreg(regval, EFM32_USB_DCTL); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep0out_ctrlsetup * * Description: * Setup to receive a SETUP packet. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_ep0out_ctrlsetup(FAR struct efm32_usbdev_s *priv) { @@ -1378,13 +1378,13 @@ static void efm32_epin_request(FAR struct efm32_usbdev_s *priv, } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_rxfifo_read * * Description: * Read packet from the RxFIFO into a read request. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_rxfifo_read(FAR struct efm32_ep_s *privep, FAR uint8_t *dest, uint16_t len) @@ -1421,13 +1421,13 @@ static void efm32_rxfifo_read(FAR struct efm32_ep_s *privep, } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_rxfifo_discard * * Description: * Discard packet data from the RxFIFO. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_rxfifo_discard(FAR struct efm32_ep_s *privep, int len) { @@ -1452,7 +1452,7 @@ static void efm32_rxfifo_discard(FAR struct efm32_ep_s *privep, int len) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_epout_complete * * Description: @@ -1460,7 +1460,7 @@ static void efm32_rxfifo_discard(FAR struct efm32_ep_s *privep, int len) * received. It completes the read request at the head of the endpoint's * request queue. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_epout_complete(FAR struct efm32_usbdev_s *priv, FAR struct efm32_ep_s *privep) @@ -1501,7 +1501,7 @@ static void efm32_epout_complete(FAR struct efm32_usbdev_s *priv, efm32_epout_request(priv, privep); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep0out_receive * * Description: @@ -1509,7 +1509,7 @@ static void efm32_epout_complete(FAR struct efm32_usbdev_s *priv, * data is available in the endpoint's RxFIFO. This function will simply * copy the incoming data into pending request's data buffer. * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_ep0out_receive(FAR struct efm32_ep_s *privep, int bcnt) { @@ -1559,7 +1559,7 @@ static inline void efm32_ep0out_receive(FAR struct efm32_ep_s *privep, int bcnt) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_epout_receive * * Description: @@ -1567,7 +1567,7 @@ static inline void efm32_ep0out_receive(FAR struct efm32_ep_s *privep, int bcnt) * data is available in the endpoint's RxFIFO. This function will simply * copy the incoming data into pending request's data buffer. * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_epout_receive(FAR struct efm32_ep_s *privep, int bcnt) { @@ -1641,7 +1641,7 @@ static inline void efm32_epout_receive(FAR struct efm32_ep_s *privep, int bcnt) privreq->req.xfrd += readlen; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_epout_request * * Description: @@ -1649,7 +1649,7 @@ static inline void efm32_epout_receive(FAR struct efm32_ep_s *privep, int bcnt) * (2) a pending receive request completes. If there is no read in pending, * then this function will initiate the next OUT (read) operation. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_epout_request(FAR struct efm32_usbdev_s *priv, FAR struct efm32_ep_s *privep) @@ -1780,13 +1780,13 @@ static void efm32_epout_request(FAR struct efm32_usbdev_s *priv, } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep_flush * * Description: * Flush any primed descriptors from this ep * - *******************************************************************************/ + ****************************************************************************/ static void efm32_ep_flush(struct efm32_ep_s *privep) { @@ -1800,13 +1800,13 @@ static void efm32_ep_flush(struct efm32_ep_s *privep) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_req_complete * * Description: * Handle termination of the request at the head of the endpoint request queue. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_req_complete(struct efm32_ep_s *privep, int16_t result) { @@ -1840,13 +1840,13 @@ static void efm32_req_complete(struct efm32_ep_s *privep, int16_t result) privep->stalled = stalled; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_req_cancel * * Description: * Cancel all pending requests for an endpoint * - *******************************************************************************/ + ****************************************************************************/ static void efm32_req_cancel(struct efm32_ep_s *privep, int16_t status) { @@ -1863,14 +1863,14 @@ static void efm32_req_cancel(struct efm32_ep_s *privep, int16_t status) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep_findbyaddr * * Description: * Find the physical endpoint structure corresponding to a logic endpoint * address * - *******************************************************************************/ + ****************************************************************************/ static struct efm32_ep_s *efm32_ep_findbyaddr(struct efm32_usbdev_s *priv, uint16_t eplog) @@ -1900,14 +1900,14 @@ static struct efm32_ep_s *efm32_ep_findbyaddr(struct efm32_usbdev_s *priv, return privep; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_req_dispatch * * Description: * Provide unhandled setup actions to the class driver. This is logically part * of the USB interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int efm32_req_dispatch(struct efm32_usbdev_s *priv, const struct usb_ctrlreq_s *ctrl) @@ -1934,13 +1934,13 @@ static int efm32_req_dispatch(struct efm32_usbdev_s *priv, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_usbreset * * Description: * Reset Usb engine * - *******************************************************************************/ + ****************************************************************************/ static void efm32_usbreset(struct efm32_usbdev_s *priv) { @@ -2034,13 +2034,13 @@ static void efm32_usbreset(struct efm32_usbdev_s *priv) efm32_ep0out_ctrlsetup(priv); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep0out_testmode * * Description: * Select test mode * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_ep0out_testmode(FAR struct efm32_usbdev_s *priv, uint16_t index) @@ -2081,14 +2081,14 @@ static inline void efm32_ep0out_testmode(FAR struct efm32_usbdev_s *priv, efm32_ep0in_transmitzlp(priv); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep0out_stdrequest * * Description: * Handle a stanard request on EP0. Pick off the things of interest to the * USB device controller driver; pass what is left to the class driver. * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_ep0out_stdrequest(struct efm32_usbdev_s *priv, FAR struct efm32_ctrlreq_s *ctrlreq) @@ -2449,14 +2449,14 @@ static inline void efm32_ep0out_stdrequest(struct efm32_usbdev_s *priv, } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep0out_setup * * Description: * USB Ctrl EP Setup Event. This is logically part of the USB interrupt * handler. This event occurs when a setup packet is receive on EP0 OUT. * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_ep0out_setup(struct efm32_usbdev_s *priv) { @@ -2524,14 +2524,14 @@ static inline void efm32_ep0out_setup(struct efm32_usbdev_s *priv) priv->ep0datlen = 0; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_epout * * Description: * This is part of the OUT endpoint interrupt processing. This function * handles the OUT event for a single endpoint. * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_epout(FAR struct efm32_usbdev_s *priv, uint8_t epno) { @@ -2576,7 +2576,7 @@ static inline void efm32_epout(FAR struct efm32_usbdev_s *priv, uint8_t epno) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_epout_interrupt * * Description: @@ -2587,7 +2587,7 @@ static inline void efm32_epout(FAR struct efm32_usbdev_s *priv, uint8_t epno) * corresponding OTGFS DOEPINTx register to determine the exact cause of the * interrupt. * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_epout_interrupt(FAR struct efm32_usbdev_s *priv) { @@ -2710,13 +2710,13 @@ static inline void efm32_epout_interrupt(FAR struct efm32_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_epin_runtestmode * * Description: * Execute the test mode setup by the SET FEATURE request * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_epin_runtestmode(FAR struct efm32_usbdev_s *priv) { @@ -2729,14 +2729,14 @@ static inline void efm32_epin_runtestmode(FAR struct efm32_usbdev_s *priv) priv->testmode = _USB_DCTL_TSTCTL_DISABLE; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_epin * * Description: * This is part of the IN endpoint interrupt processing. This function * handles the IN event for a single endpoint. * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_epin(FAR struct efm32_usbdev_s *priv, uint8_t epno) { @@ -2807,7 +2807,7 @@ static inline void efm32_epin_txfifoempty(FAR struct efm32_usbdev_s *priv, int e efm32_epin_request(priv, privep); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_epin_interrupt * * Description: @@ -2817,7 +2817,7 @@ static inline void efm32_epin_txfifoempty(FAR struct efm32_usbdev_s *priv, int e * endpoint on which the interrupt occurred, and then read the corresponding * OTGFS DIEPINTx register to determine the exact cause of the interrupt. * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_epin_interrupt(FAR struct efm32_usbdev_s *priv) { @@ -3006,13 +3006,13 @@ static inline void efm32_epin_interrupt(FAR struct efm32_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_resumeinterrupt * * Description: * Resume/remote wakeup detected interrupt * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_resumeinterrupt(FAR struct efm32_usbdev_s *priv) { @@ -3044,13 +3044,13 @@ static inline void efm32_resumeinterrupt(FAR struct efm32_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_suspendinterrupt * * Description: * USB suspend interrupt * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_suspendinterrupt(FAR struct efm32_usbdev_s *priv) { @@ -3099,14 +3099,14 @@ static inline void efm32_suspendinterrupt(FAR struct efm32_usbdev_s *priv) efm32_usbsuspend((FAR struct usbdev_s *)priv, false); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_rxinterrupt * * Description: * RxFIFO non-empty interrupt. This interrupt indicates that there is at * least one packet pending to be read from the RxFIFO. * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_rxinterrupt(FAR struct efm32_usbdev_s *priv) { @@ -3263,13 +3263,13 @@ static inline void efm32_rxinterrupt(FAR struct efm32_usbdev_s *priv) efm32_putreg(regval, EFM32_USB_GINTMSK); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_enuminterrupt * * Description: * Enumeration done interrupt * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_enuminterrupt(FAR struct efm32_usbdev_s *priv) { @@ -3287,7 +3287,7 @@ static inline void efm32_enuminterrupt(FAR struct efm32_usbdev_s *priv) efm32_putreg(regval, EFM32_USB_GUSBCFG); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_isocininterrupt * * Description: @@ -3295,7 +3295,7 @@ static inline void efm32_enuminterrupt(FAR struct efm32_usbdev_s *priv) * isochronous IN transfer interrupt indicates an incomplete isochronous IN * transfer on at least one of the isochronous IN endpoints. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_ISOCHRONOUS static inline void efm32_isocininterrupt(FAR struct efm32_usbdev_s *priv) @@ -3360,13 +3360,13 @@ static inline void efm32_isocininterrupt(FAR struct efm32_usbdev_s *priv) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_isocoutinterrupt * * Description: * Incomplete periodic transfer interrupt * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_ISOCHRONOUS static inline void efm32_isocoutinterrupt(FAR struct efm32_usbdev_s *priv) @@ -3442,13 +3442,13 @@ static inline void efm32_isocoutinterrupt(FAR struct efm32_usbdev_s *priv) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_sessioninterrupt * * Description: * Session request/new session detected interrupt * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_VBUSSENSING static inline void efm32_sessioninterrupt(FAR struct efm32_usbdev_s *priv) @@ -3457,13 +3457,13 @@ static inline void efm32_sessioninterrupt(FAR struct efm32_usbdev_s *priv) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_otginterrupt * * Description: * OTG interrupt * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_VBUSSENSING static inline void efm32_otginterrupt(FAR struct efm32_usbdev_s *priv) @@ -3484,13 +3484,13 @@ static inline void efm32_otginterrupt(FAR struct efm32_usbdev_s *priv) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_usbinterrupt * * Description: * USB interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static int efm32_usbinterrupt(int irq, FAR void *context) { @@ -3679,17 +3679,17 @@ static int efm32_usbinterrupt(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Endpoint operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: efm32_enablegonak * * Description: * Enable global OUT NAK mode * - *******************************************************************************/ + ****************************************************************************/ static void efm32_enablegonak(FAR struct efm32_ep_s *privep) { @@ -3729,13 +3729,13 @@ static void efm32_enablegonak(FAR struct efm32_ep_s *privep) #endif } -/******************************************************************************* +/**************************************************************************** * Name: efm32_disablegonak * * Description: * Disable global OUT NAK mode * - *******************************************************************************/ + ****************************************************************************/ static void efm32_disablegonak(FAR struct efm32_ep_s *privep) { @@ -3748,7 +3748,7 @@ static void efm32_disablegonak(FAR struct efm32_ep_s *privep) efm32_putreg(regval, EFM32_USB_DCTL); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_epout_configure * * Description: @@ -3759,7 +3759,7 @@ static void efm32_disablegonak(FAR struct efm32_ep_s *privep) * eptype - The type of the endpoint * maxpacket - The max packet size of the endpoint * - *******************************************************************************/ + ****************************************************************************/ static int efm32_epout_configure(FAR struct efm32_ep_s *privep, uint8_t eptype, uint16_t maxpacket) @@ -3843,7 +3843,7 @@ static int efm32_epout_configure(FAR struct efm32_ep_s *privep, uint8_t eptype, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_epin_configure * * Description: @@ -3854,7 +3854,7 @@ static int efm32_epout_configure(FAR struct efm32_ep_s *privep, uint8_t eptype, * eptype - The type of the endpoint * maxpacket - The max packet size of the endpoint * - *******************************************************************************/ + ****************************************************************************/ static int efm32_epin_configure(FAR struct efm32_ep_s *privep, uint8_t eptype, uint16_t maxpacket) @@ -3942,7 +3942,7 @@ static int efm32_epin_configure(FAR struct efm32_ep_s *privep, uint8_t eptype, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep_configure * * Description: @@ -3955,7 +3955,7 @@ static int efm32_epin_configure(FAR struct efm32_ep_s *privep, uint8_t eptype, * needs to take special action when all of the endpoints have been * configured. * - *******************************************************************************/ + ****************************************************************************/ static int efm32_ep_configure(FAR struct usbdev_ep_s *ep, FAR const struct usb_epdesc_s *desc, @@ -3988,13 +3988,13 @@ static int efm32_ep_configure(FAR struct usbdev_ep_s *ep, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep0_configure * * Description: * Reset Usb engine * - *******************************************************************************/ + ****************************************************************************/ static void efm32_ep0_configure(FAR struct efm32_usbdev_s *priv) { @@ -4006,13 +4006,13 @@ static void efm32_ep0_configure(FAR struct efm32_usbdev_s *priv) CONFIG_USBDEV_EP0_MAXSIZE); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_epout_disable * * Description: * Diable an OUT endpoint will no longer be used * - *******************************************************************************/ + ****************************************************************************/ static void efm32_epout_disable(FAR struct efm32_ep_s *privep) { @@ -4076,13 +4076,13 @@ static void efm32_epout_disable(FAR struct efm32_ep_s *privep) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_epin_disable * * Description: * Disable an IN endpoint when it will no longer be used * - *******************************************************************************/ + ****************************************************************************/ static void efm32_epin_disable(FAR struct efm32_ep_s *privep) { @@ -4170,13 +4170,13 @@ static void efm32_epin_disable(FAR struct efm32_ep_s *privep) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep_disable * * Description: * The endpoint will no longer be used * - *******************************************************************************/ + ****************************************************************************/ static int efm32_ep_disable(FAR struct usbdev_ep_s *ep) { @@ -4210,13 +4210,13 @@ static int efm32_ep_disable(FAR struct usbdev_ep_s *ep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep_allocreq * * Description: * Allocate an I/O request * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_req_s *efm32_ep_allocreq(FAR struct usbdev_ep_s *ep) { @@ -4243,13 +4243,13 @@ static FAR struct usbdev_req_s *efm32_ep_allocreq(FAR struct usbdev_ep_s *ep) return &privreq->req; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep_freereq * * Description: * Free an I/O request * - *******************************************************************************/ + ****************************************************************************/ static void efm32_ep_freereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -4267,13 +4267,13 @@ static void efm32_ep_freereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s kmm_free(privreq); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep_allocbuffer * * Description: * Allocate an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_DMA static void *efm32_ep_allocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) @@ -4288,13 +4288,13 @@ static void *efm32_ep_allocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep_freebuffer * * Description: * Free an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_DMA static void efm32_ep_freebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) @@ -4309,13 +4309,13 @@ static void efm32_ep_freebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep_submit * * Description: * Submit an I/O request to the endpoint * - *******************************************************************************/ + ****************************************************************************/ static int efm32_ep_submit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -4403,13 +4403,13 @@ static int efm32_ep_submit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s * return ret; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep_cancel * * Description: * Cancel an I/O request previously sent to an endpoint * - *******************************************************************************/ + ****************************************************************************/ static int efm32_ep_cancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -4439,13 +4439,13 @@ static int efm32_ep_cancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s * return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_epout_setstall * * Description: * Stall an OUT endpoint * - *******************************************************************************/ + ****************************************************************************/ static int efm32_epout_setstall(FAR struct efm32_ep_s *privep) { @@ -4511,13 +4511,13 @@ static int efm32_epout_setstall(FAR struct efm32_ep_s *privep) #endif } -/******************************************************************************* +/**************************************************************************** * Name: efm32_epin_setstall * * Description: * Stall an IN endpoint * - *******************************************************************************/ + ****************************************************************************/ static int efm32_epin_setstall(FAR struct efm32_ep_s *privep) { @@ -4540,13 +4540,13 @@ static int efm32_epin_setstall(FAR struct efm32_ep_s *privep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep_setstall * * Description: * Stall an endpoint * - *******************************************************************************/ + ****************************************************************************/ static int efm32_ep_setstall(FAR struct efm32_ep_s *privep) { @@ -4564,13 +4564,13 @@ static int efm32_ep_setstall(FAR struct efm32_ep_s *privep) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep_clrstall * * Description: * Resume a stalled endpoint * - *******************************************************************************/ + ****************************************************************************/ static int efm32_ep_clrstall(FAR struct efm32_ep_s *privep) { @@ -4623,13 +4623,13 @@ static int efm32_ep_clrstall(FAR struct efm32_ep_s *privep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep_stall * * Description: * Stall or resume an endpoint * - *******************************************************************************/ + ****************************************************************************/ static int efm32_ep_stall(FAR struct usbdev_ep_s *ep, bool resume) { @@ -4653,13 +4653,13 @@ static int efm32_ep_stall(FAR struct usbdev_ep_s *ep, bool resume) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep0_stall * * Description: * Stall endpoint 0 * - *******************************************************************************/ + ****************************************************************************/ static void efm32_ep0_stall(FAR struct efm32_usbdev_s *priv) { @@ -4669,11 +4669,11 @@ static void efm32_ep0_stall(FAR struct efm32_usbdev_s *priv) efm32_ep0out_ctrlsetup(priv); } -/******************************************************************************* +/**************************************************************************** * Device operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep_alloc * * Description: @@ -4687,7 +4687,7 @@ static void efm32_ep0_stall(FAR struct efm32_usbdev_s *priv) * eptype - Endpoint type. One of {USB_EP_ATTR_XFER_ISOC, USB_EP_ATTR_XFER_BULK, * USB_EP_ATTR_XFER_INT} * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_ep_s *efm32_ep_alloc(FAR struct usbdev_s *dev, uint8_t eplog, bool in, @@ -4766,13 +4766,13 @@ static FAR struct usbdev_ep_s *efm32_ep_alloc(FAR struct usbdev_s *dev, return NULL; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ep_free * * Description: * Free the previously allocated endpoint * - *******************************************************************************/ + ****************************************************************************/ static void efm32_ep_free(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) { @@ -4792,13 +4792,13 @@ static void efm32_ep_free(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_getframe * * Description: * Returns the current frame number * - *******************************************************************************/ + ****************************************************************************/ static int efm32_getframe(struct usbdev_s *dev) { @@ -4812,13 +4812,13 @@ static int efm32_getframe(struct usbdev_s *dev) return (int)((regval & _USB_DSTS_SOFFN_MASK) >> _USB_DSTS_SOFFN_SHIFT); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_wakeup * * Description: * Exit suspend mode. * - *******************************************************************************/ + ****************************************************************************/ static int efm32_wakeup(struct usbdev_s *dev) { @@ -4860,13 +4860,13 @@ static int efm32_wakeup(struct usbdev_s *dev) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_selfpowered * * Description: * Sets/clears the device self-powered feature * - *******************************************************************************/ + ****************************************************************************/ static int efm32_selfpowered(struct usbdev_s *dev, bool selfpowered) { @@ -4886,13 +4886,13 @@ static int efm32_selfpowered(struct usbdev_s *dev, bool selfpowered) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_pullup * * Description: * Software-controlled connect to/disconnect from USB host * - *******************************************************************************/ + ****************************************************************************/ static int efm32_pullup(struct usbdev_s *dev, bool enable) { @@ -4924,13 +4924,13 @@ static int efm32_pullup(struct usbdev_s *dev, bool enable) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_setaddress * * Description: * Set the devices USB address * - *******************************************************************************/ + ****************************************************************************/ static void efm32_setaddress(struct efm32_usbdev_s *priv, uint16_t address) { @@ -4959,13 +4959,13 @@ static void efm32_setaddress(struct efm32_usbdev_s *priv, uint16_t address) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_txfifo_flush * * Description: * Flush the specific TX fifo. * - *******************************************************************************/ + ****************************************************************************/ static int efm32_txfifo_flush(uint32_t txfnum) { @@ -4994,13 +4994,13 @@ static int efm32_txfifo_flush(uint32_t txfnum) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_rxfifo_flush * * Description: * Flush the RX fifo. * - *******************************************************************************/ + ****************************************************************************/ static int efm32_rxfifo_flush(void) { @@ -5028,13 +5028,13 @@ static int efm32_rxfifo_flush(void) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_swinitialize * * Description: * Initialize all driver data structures. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_swinitialize(FAR struct efm32_usbdev_s *priv) { @@ -5110,13 +5110,13 @@ static void efm32_swinitialize(FAR struct efm32_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_hwinitialize * * Description: * Configure the OTG FS core for operation. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_hwinitialize(FAR struct efm32_usbdev_s *priv) { @@ -5400,11 +5400,11 @@ static void efm32_hwinitialize(FAR struct efm32_usbdev_s *priv) EFM32_USB_GAHBCFG); } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_usbinitialize * * Description: @@ -5417,7 +5417,7 @@ static void efm32_hwinitialize(FAR struct efm32_usbdev_s *priv) * and P0.23 and PO.31 in PINSEL1 must be configured for Vbus and USB connect * LED. * - *******************************************************************************/ + ****************************************************************************/ void up_usbinitialize(void) { @@ -5510,9 +5510,9 @@ errout: up_usbuninitialize(); } -/******************************************************************************* +/**************************************************************************** * Name: up_usbuninitialize - *******************************************************************************/ + ****************************************************************************/ void up_usbuninitialize(void) { @@ -5580,14 +5580,14 @@ void up_usbuninitialize(void) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: usbdev_register * * Description: * Register a USB device class driver. The class driver's bind() method will be * called to bind it to a USB device driver. * - *******************************************************************************/ + ****************************************************************************/ int usbdev_register(struct usbdevclass_driver_s *driver) { @@ -5650,7 +5650,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: usbdev_unregister * * Description: @@ -5658,7 +5658,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) * it will first disconnect(). The driver is also requested to unbind() and clean * up any device state, before this procedure finally returns. * - *******************************************************************************/ + ****************************************************************************/ int usbdev_unregister(struct usbdevclass_driver_s *driver) { diff --git a/arch/arm/src/efm32/efm32_usbhost.c b/arch/arm/src/efm32/efm32_usbhost.c index 35c0bc65b9..f9681d293b 100644 --- a/arch/arm/src/efm32/efm32_usbhost.c +++ b/arch/arm/src/efm32/efm32_usbhost.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/efm32/efm32_usbhost.c * * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -69,9 +69,9 @@ #if defined(CONFIG_USBHOST) && defined(CONFIG_EFM32_OTGFS) -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ /* * EFM32 USB OTG FS Host Driver Support @@ -164,9 +164,9 @@ #define TRENTRY(id,fmt1,string) {string} -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* The following enumeration represents the various states of the USB host * state machine (for debug purposes only) @@ -291,9 +291,9 @@ struct efm32_usbhost_trace_s }; #endif -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Register operations ********************************************************/ @@ -482,9 +482,9 @@ static void efm32_host_initialize(FAR struct efm32_usbhost_s *priv); static inline void efm32_sw_initialize(FAR struct efm32_usbhost_s *priv); static inline int efm32_hw_initialize(FAR struct efm32_usbhost_s *priv); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ /* In this driver implementation, support is provided for only a single a single * USB device. All status information can be simply retained in a single global @@ -564,21 +564,21 @@ static const struct efm32_usbhost_trace_s g_trace2[TRACE2_NSTRINGS] = }; #endif /* HAVE_USBHOST_TRACE */ -/******************************************************************************* +/**************************************************************************** * Public Data - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: efm32_printreg * * Description: * Print the contents of an EFM32xx register operation * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_EFM32_USBHOST_REGDEBUG static void efm32_printreg(uint32_t addr, uint32_t val, bool iswrite) @@ -587,13 +587,13 @@ static void efm32_printreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_checkreg * * Description: * Get the contents of an EFM32 register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_EFM32_USBHOST_REGDEBUG static void efm32_checkreg(uint32_t addr, uint32_t val, bool iswrite) @@ -651,13 +651,13 @@ static void efm32_checkreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_getreg * * Description: * Get the contents of an EFM32 register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_EFM32_USBHOST_REGDEBUG static uint32_t efm32_getreg(uint32_t addr) @@ -673,13 +673,13 @@ static uint32_t efm32_getreg(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_putreg * * Description: * Set the contents of an EFM32 register to a value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_EFM32_USBHOST_REGDEBUG static void efm32_putreg(uint32_t addr, uint32_t val) @@ -694,13 +694,13 @@ static void efm32_putreg(uint32_t addr, uint32_t val) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_modifyreg * * Description: * Modify selected bits of an EFM32 register. * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_modifyreg(uint32_t addr, uint32_t clrbits, uint32_t setbits) { @@ -714,7 +714,7 @@ static inline void efm32_modifyreg(uint32_t addr, uint32_t clrbits, uint32_t set * This is just a wrapper to handle the annoying behavior of semaphore * waits that return due to the receipt of a signal. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_takesem(sem_t *sem) { @@ -736,20 +736,20 @@ static void efm32_takesem(sem_t *sem) * Description: * Get a (possibly unaligned) 16-bit little endian value. * - *******************************************************************************/ + ****************************************************************************/ static inline uint16_t efm32_getle16(const uint8_t *val) { return (uint16_t)val[1] << 8 | (uint16_t)val[0]; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_chan_alloc * * Description: * Allocate a channel. * - *******************************************************************************/ + ****************************************************************************/ static int efm32_chan_alloc(FAR struct efm32_usbhost_s *priv) { @@ -775,13 +775,13 @@ static int efm32_chan_alloc(FAR struct efm32_usbhost_s *priv) return -EBUSY; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_chan_free * * Description: * Free a previoiusly allocated channel. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_chan_free(FAR struct efm32_usbhost_s *priv, int chidx) { @@ -796,13 +796,13 @@ static void efm32_chan_free(FAR struct efm32_usbhost_s *priv, int chidx) priv->chan[chidx].inuse = false; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_chan_freeall * * Description: * Free all channels. * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_chan_freeall(FAR struct efm32_usbhost_s *priv) { @@ -816,7 +816,7 @@ static inline void efm32_chan_freeall(FAR struct efm32_usbhost_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_chan_configure * * Description: @@ -824,7 +824,7 @@ static inline void efm32_chan_freeall(FAR struct efm32_usbhost_s *priv) * when endpoint is allocated and EP0 (only) is re-configured with the * max packet size or device address changes. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_chan_configure(FAR struct efm32_usbhost_s *priv, int chidx) { @@ -977,14 +977,14 @@ static void efm32_chan_configure(FAR struct efm32_usbhost_s *priv, int chidx) efm32_putreg(EFM32_USB_HCn_CHAR(chidx), regval); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_chan_halt * * Description: * Halt the channel associated with 'chidx' by setting the CHannel DISable * (CHDIS) bit in in the HCCHAR register. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_chan_halt(FAR struct efm32_usbhost_s *priv, int chidx, enum efm32_chreason_e chreason) @@ -1062,7 +1062,7 @@ static void efm32_chan_halt(FAR struct efm32_usbhost_s *priv, int chidx, efm32_putreg(EFM32_USB_HCn_CHAR(chidx), hcchar); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_chan_waitsetup * * Description: @@ -1074,7 +1074,7 @@ static void efm32_chan_halt(FAR struct efm32_usbhost_s *priv, int chidx, * Assumptions: * Called from a normal thread context BEFORE the transfer has been started. * - *******************************************************************************/ + ****************************************************************************/ static int efm32_chan_waitsetup(FAR struct efm32_usbhost_s *priv, FAR struct efm32_chan_s *chan) @@ -1102,7 +1102,7 @@ static int efm32_chan_waitsetup(FAR struct efm32_usbhost_s *priv, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_chan_asynchsetup * * Description: @@ -1114,7 +1114,7 @@ static int efm32_chan_waitsetup(FAR struct efm32_usbhost_s *priv, * Assumptions: * Might be called from the level of an interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int efm32_chan_asynchsetup(FAR struct efm32_usbhost_s *priv, @@ -1143,7 +1143,7 @@ static int efm32_chan_asynchsetup(FAR struct efm32_usbhost_s *priv, } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_chan_wait * * Description: @@ -1152,7 +1152,7 @@ static int efm32_chan_asynchsetup(FAR struct efm32_usbhost_s *priv, * Assumptions: * Called from a normal thread context * - *******************************************************************************/ + ****************************************************************************/ static int efm32_chan_wait(FAR struct efm32_usbhost_s *priv, FAR struct efm32_chan_s *chan) @@ -1198,7 +1198,7 @@ static int efm32_chan_wait(FAR struct efm32_usbhost_s *priv, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_chan_wakeup * * Description: @@ -1209,7 +1209,7 @@ static int efm32_chan_wait(FAR struct efm32_usbhost_s *priv, * This function is called from the transfer complete interrupt handler for * the channel. Interrupts are disabled. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_chan_wakeup(FAR struct efm32_usbhost_s *priv, FAR struct efm32_chan_s *chan) @@ -1259,13 +1259,13 @@ static void efm32_chan_wakeup(FAR struct efm32_usbhost_s *priv, } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ctrlchan_alloc * * Description: * Allocate and configured channels for a control pipe. * - *******************************************************************************/ + ****************************************************************************/ static int efm32_ctrlchan_alloc(FAR struct efm32_usbhost_s *priv, uint8_t epno, uint8_t funcaddr, uint8_t speed, @@ -1322,7 +1322,7 @@ static int efm32_ctrlchan_alloc(FAR struct efm32_usbhost_s *priv, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ctrlep_alloc * * Description: @@ -1341,7 +1341,7 @@ static int efm32_ctrlchan_alloc(FAR struct efm32_usbhost_s *priv, * Assumptions: * This function will *not* be called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int efm32_ctrlep_alloc(FAR struct efm32_usbhost_s *priv, FAR const struct usbhost_epdesc_s *epdesc, @@ -1455,13 +1455,13 @@ static int efm32_xfrep_alloc(FAR struct efm32_usbhost_s *priv, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_transfer_start * * Description: * Start at transfer on the select IN or OUT channel. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_transfer_start(FAR struct efm32_usbhost_s *priv, int chidx) { @@ -1645,7 +1645,7 @@ static void efm32_transfer_start(FAR struct efm32_usbhost_s *priv, int chidx) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_getframe * * Description: @@ -1653,7 +1653,7 @@ static void efm32_transfer_start(FAR struct efm32_usbhost_s *priv, int chidx) * when a new SOF is transmitted on the USB, and is cleared to 0 when it * reaches 0x3fff. * - *******************************************************************************/ + ****************************************************************************/ #if 0 /* Not used */ static inline uint16_t efm32_getframe(void) @@ -1662,13 +1662,13 @@ static inline uint16_t efm32_getframe(void) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_ctrl_sendsetup * * Description: * Send an IN/OUT SETUP packet. * - *******************************************************************************/ + ****************************************************************************/ static int efm32_ctrl_sendsetup(FAR struct efm32_usbhost_s *priv, FAR struct efm32_ctrlinfo_s *ep0, @@ -1738,14 +1738,14 @@ static int efm32_ctrl_sendsetup(FAR struct efm32_usbhost_s *priv, return -ETIMEDOUT; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ctrl_senddata * * Description: * Send data in the data phase of an OUT control transfer. Or send status * in the status phase of an IN control transfer * - *******************************************************************************/ + ****************************************************************************/ static int efm32_ctrl_senddata(FAR struct efm32_usbhost_s *priv, FAR struct efm32_ctrlinfo_s *ep0, @@ -1791,14 +1791,14 @@ static int efm32_ctrl_senddata(FAR struct efm32_usbhost_s *priv, return efm32_chan_wait(priv, chan); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ctrl_recvdata * * Description: * Receive data in the data phase of an IN control transfer. Or receive status * in the status phase of an OUT control transfer * - *******************************************************************************/ + ****************************************************************************/ static int efm32_ctrl_recvdata(FAR struct efm32_usbhost_s *priv, FAR struct efm32_ctrlinfo_s *ep0, @@ -1832,13 +1832,13 @@ static int efm32_ctrl_recvdata(FAR struct efm32_usbhost_s *priv, return efm32_chan_wait(priv, chan); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_in_setup * * Description: * Initiate an IN transfer on an bulk, interrupt, or isochronous pipe. * - *******************************************************************************/ + ****************************************************************************/ static int efm32_in_setup(FAR struct efm32_usbhost_s *priv, int chidx) { @@ -1893,13 +1893,13 @@ static int efm32_in_setup(FAR struct efm32_usbhost_s *priv, int chidx) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_in_transfer * * Description: * Transfer 'buflen' bytes into 'buffer' from an IN channel. * - *******************************************************************************/ + ****************************************************************************/ static ssize_t efm32_in_transfer(FAR struct efm32_usbhost_s *priv, int chidx, FAR uint8_t *buffer, size_t buflen) @@ -1975,7 +1975,7 @@ static ssize_t efm32_in_transfer(FAR struct efm32_usbhost_s *priv, int chidx, return (ssize_t)chan->xfrd; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_in_next * * Description: @@ -1984,7 +1984,7 @@ static ssize_t efm32_in_transfer(FAR struct efm32_usbhost_s *priv, int chidx, * Assumptions: * This function is always called from an interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static void efm32_in_next(FAR struct efm32_usbhost_s *priv, @@ -2040,7 +2040,7 @@ static void efm32_in_next(FAR struct efm32_usbhost_s *priv, } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_in_asynch * * Description: @@ -2049,7 +2049,7 @@ static void efm32_in_next(FAR struct efm32_usbhost_s *priv, * Assumptions: * This function is never called from an interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int efm32_in_asynch(FAR struct efm32_usbhost_s *priv, int chidx, @@ -2087,13 +2087,13 @@ static int efm32_in_asynch(FAR struct efm32_usbhost_s *priv, int chidx, } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_out_setup * * Description: * Initiate an OUT transfer on an bulk, interrupt, or isochronous pipe. * - *******************************************************************************/ + ****************************************************************************/ static int efm32_out_setup(FAR struct efm32_usbhost_s *priv, int chidx) { @@ -2152,13 +2152,13 @@ static int efm32_out_setup(FAR struct efm32_usbhost_s *priv, int chidx) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_out_transfer * * Description: * Transfer the 'buflen' bytes in 'buffer' through an OUT channel. * - *******************************************************************************/ + ****************************************************************************/ static ssize_t efm32_out_transfer(FAR struct efm32_usbhost_s *priv, int chidx, FAR uint8_t *buffer, size_t buflen) @@ -2261,7 +2261,7 @@ static ssize_t efm32_out_transfer(FAR struct efm32_usbhost_s *priv, int chidx, return xfrd; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_out_next * * Description: @@ -2270,7 +2270,7 @@ static ssize_t efm32_out_transfer(FAR struct efm32_usbhost_s *priv, int chidx, * Assumptions: * This function is always called from an interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static void efm32_out_next(FAR struct efm32_usbhost_s *priv, @@ -2326,7 +2326,7 @@ static void efm32_out_next(FAR struct efm32_usbhost_s *priv, } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_out_asynch * * Description: @@ -2335,7 +2335,7 @@ static void efm32_out_next(FAR struct efm32_usbhost_s *priv, * Assumptions: * This function is never called from an interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int efm32_out_asynch(FAR struct efm32_usbhost_s *priv, int chidx, @@ -2373,14 +2373,14 @@ static int efm32_out_asynch(FAR struct efm32_usbhost_s *priv, int chidx, } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_gint_wrpacket * * Description: * Transfer the 'buflen' bytes in 'buffer' to the Tx FIFO associated with * 'chidx' (non-DMA). * - *******************************************************************************/ + ****************************************************************************/ static void efm32_gint_wrpacket(FAR struct efm32_usbhost_s *priv, FAR uint8_t *buffer, int chidx, int buflen) @@ -2413,7 +2413,7 @@ static void efm32_gint_wrpacket(FAR struct efm32_usbhost_s *priv, priv->chan[chidx].inflight += buflen; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_gint_hcinisr * * Description: @@ -2430,7 +2430,7 @@ static void efm32_gint_wrpacket(FAR struct efm32_usbhost_s *priv, * * EBUSY in the result field indicates that the transfer has not completed. * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_gint_hcinisr(FAR struct efm32_usbhost_s *priv, int chidx) @@ -2674,7 +2674,7 @@ static inline void efm32_gint_hcinisr(FAR struct efm32_usbhost_s *priv, efm32_chan_wakeup(priv, chan); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_gint_hcoutisr * * Description: @@ -2691,7 +2691,7 @@ static inline void efm32_gint_hcinisr(FAR struct efm32_usbhost_s *priv, * * EBUSY in the result field indicates that the transfer has not completed. * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_gint_hcoutisr(FAR struct efm32_usbhost_s *priv, int chidx) @@ -2884,13 +2884,13 @@ static inline void efm32_gint_hcoutisr(FAR struct efm32_usbhost_s *priv, efm32_chan_wakeup(priv, chan); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_gint_connected * * Description: * Handle a connection event. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_gint_connected(FAR struct efm32_usbhost_s *priv) { @@ -2916,13 +2916,13 @@ static void efm32_gint_connected(FAR struct efm32_usbhost_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_gint_disconnected * * Description: * Handle a disconnection event. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_gint_disconnected(FAR struct efm32_usbhost_s *priv) { @@ -2963,13 +2963,13 @@ static void efm32_gint_disconnected(FAR struct efm32_usbhost_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_gint_sofisr * * Description: * USB OTG FS start-of-frame interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_EFM32_OTGFS_SOFINTR static inline void efm32_gint_sofisr(FAR struct efm32_usbhost_s *priv) @@ -2983,13 +2983,13 @@ static inline void efm32_gint_sofisr(FAR struct efm32_usbhost_s *priv) } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_gint_rxflvlisr * * Description: * USB OTG FS RxFIFO non-empty interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_gint_rxflvlisr(FAR struct efm32_usbhost_s *priv) { @@ -3084,13 +3084,13 @@ static inline void efm32_gint_rxflvlisr(FAR struct efm32_usbhost_s *priv) efm32_putreg(EFM32_USB_GINTMSK, intmsk); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_gint_nptxfeisr * * Description: * USB OTG FS non-periodic TxFIFO empty interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_gint_nptxfeisr(FAR struct efm32_usbhost_s *priv) { @@ -3173,13 +3173,13 @@ static inline void efm32_gint_nptxfeisr(FAR struct efm32_usbhost_s *priv) efm32_gint_wrpacket(priv, chan->buffer, chidx, wrsize); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_gint_ptxfeisr * * Description: * USB OTG FS periodic TxFIFO empty interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_gint_ptxfeisr(FAR struct efm32_usbhost_s *priv) { @@ -3261,13 +3261,13 @@ static inline void efm32_gint_ptxfeisr(FAR struct efm32_usbhost_s *priv) efm32_gint_wrpacket(priv, chan->buffer, chidx, wrsize); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_gint_hcisr * * Description: * USB OTG FS host channels interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_gint_hcisr(FAR struct efm32_usbhost_s *priv) { @@ -3309,13 +3309,13 @@ static inline void efm32_gint_hcisr(FAR struct efm32_usbhost_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_gint_hprtisr * * Description: * USB OTG FS host port interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_gint_hprtisr(FAR struct efm32_usbhost_s *priv) { @@ -3443,13 +3443,13 @@ static inline void efm32_gint_hprtisr(FAR struct efm32_usbhost_s *priv) efm32_putreg(EFM32_USB_HPRT, newhprt); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_gint_discisr * * Description: * USB OTG FS disconnect detected interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_gint_discisr(FAR struct efm32_usbhost_s *priv) { @@ -3462,13 +3462,13 @@ static inline void efm32_gint_discisr(FAR struct efm32_usbhost_s *priv) efm32_putreg(EFM32_USB_GINTSTS, USB_GINTSTS_DISCONNINT); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_gint_ipxfrisr * * Description: * USB OTG FS incomplete periodic interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_gint_ipxfrisr(FAR struct efm32_usbhost_s *priv) { @@ -3487,13 +3487,13 @@ static inline void efm32_gint_ipxfrisr(FAR struct efm32_usbhost_s *priv) efm32_putreg(EFM32_USB_GINTSTS, USB_GINTSTS_INCOMPLP); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_gint_isr * * Description: * USB OTG FS global interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static int efm32_gint_isr(int irq, FAR void *context) { @@ -3604,7 +3604,7 @@ static int efm32_gint_isr(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_gint_enable and efm32_gint_disable * * Description: @@ -3616,7 +3616,7 @@ static int efm32_gint_isr(int irq, FAR void *context) * Returned Value: * None * - *******************************************************************************/ + ****************************************************************************/ static void efm32_gint_enable(void) { @@ -3640,7 +3640,7 @@ static void efm32_gint_disable(void) efm32_putreg(EFM32_USB_GAHBCFG, regval); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_hostinit_enable * * Description: @@ -3652,7 +3652,7 @@ static void efm32_gint_disable(void) * Returned Value: * None * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_hostinit_enable(void) { @@ -3712,7 +3712,7 @@ static inline void efm32_hostinit_enable(void) efm32_putreg(EFM32_USB_GINTMSK, regval); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_txfe_enable * * Description: @@ -3732,7 +3732,7 @@ static inline void efm32_hostinit_enable(void) * Called from user task context. Interrupts must be disabled to assure * exclusive access to the GINTMSK register. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_txfe_enable(FAR struct efm32_usbhost_s *priv, int chidx) { @@ -3769,11 +3769,11 @@ static void efm32_txfe_enable(FAR struct efm32_usbhost_s *priv, int chidx) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * USB Host Controller Operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: efm32_wait * * Description: @@ -3796,7 +3796,7 @@ static void efm32_txfe_enable(FAR struct efm32_usbhost_s *priv, int chidx) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int efm32_wait(FAR struct usbhost_connection_s *conn, FAR struct usbhost_hubport_s **hport) @@ -3857,7 +3857,7 @@ static int efm32_wait(FAR struct usbhost_connection_s *conn, } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_enumerate * * Description: @@ -3883,7 +3883,7 @@ static int efm32_wait(FAR struct usbhost_connection_s *conn, * Assumptions: * This function will *not* be called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int efm32_rh_enumerate(FAR struct efm32_usbhost_s *priv, FAR struct usbhost_connection_s *conn, @@ -4166,7 +4166,7 @@ static int efm32_epfree(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_alloc * * Description: @@ -4196,7 +4196,7 @@ static int efm32_epfree(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int efm32_alloc(FAR struct usbhost_driver_s *drvr, FAR uint8_t **buffer, FAR size_t *maxlen) @@ -4220,7 +4220,7 @@ static int efm32_alloc(FAR struct usbhost_driver_s *drvr, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_free * * Description: @@ -4241,7 +4241,7 @@ static int efm32_alloc(FAR struct usbhost_driver_s *drvr, * Assumptions: * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int efm32_free(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) { @@ -4332,7 +4332,7 @@ static int efm32_iofree(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_ctrlin and efm32_ctrlout * * Description: @@ -4365,7 +4365,7 @@ static int efm32_iofree(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int efm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, FAR const struct usb_ctrlreq_s *req, @@ -4539,7 +4539,7 @@ static int efm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, return -ETIMEDOUT; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_transfer * * Description: @@ -4575,7 +4575,7 @@ static int efm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static ssize_t efm32_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, FAR uint8_t *buffer, size_t buflen) @@ -4607,7 +4607,7 @@ static ssize_t efm32_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep return nbytes; } -/******************************************************************************* +/**************************************************************************** * Name: efm32_asynch * * Description: @@ -4640,7 +4640,7 @@ static ssize_t efm32_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int efm32_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, @@ -4813,7 +4813,7 @@ static int efm32_connect(FAR struct usbhost_driver_s *drvr, } #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_disconnect * * Description: @@ -4834,7 +4834,7 @@ static int efm32_connect(FAR struct usbhost_driver_s *drvr, * - Only a single class bound to a single device is supported. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_disconnect(FAR struct usbhost_driver_s *drvr, FAR struct usbhost_hubport_s *hport) @@ -4843,10 +4843,10 @@ static void efm32_disconnect(FAR struct usbhost_driver_s *drvr, hport->devclass = NULL; } -/******************************************************************************* +/**************************************************************************** * Initialization - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: efm32_portreset * * Description: @@ -4864,7 +4864,7 @@ static void efm32_disconnect(FAR struct usbhost_driver_s *drvr, * Returned Value: * None * - *******************************************************************************/ + ****************************************************************************/ static void efm32_portreset(FAR struct efm32_usbhost_s *priv) { @@ -4884,7 +4884,7 @@ static void efm32_portreset(FAR struct efm32_usbhost_s *priv) up_mdelay(20); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_flush_txfifos * * Description: @@ -4896,7 +4896,7 @@ static void efm32_portreset(FAR struct efm32_usbhost_s *priv) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_flush_txfifos(uint32_t txfnum) { @@ -4924,7 +4924,7 @@ static void efm32_flush_txfifos(uint32_t txfnum) up_udelay(3); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_flush_rxfifo * * Description: @@ -4936,7 +4936,7 @@ static void efm32_flush_txfifos(uint32_t txfnum) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_flush_rxfifo(void) { @@ -4963,7 +4963,7 @@ static void efm32_flush_rxfifo(void) up_udelay(3); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_vbusdrive * * Description: @@ -4976,7 +4976,7 @@ static void efm32_flush_rxfifo(void) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_vbusdrive(FAR struct efm32_usbhost_s *priv, bool state) { @@ -5007,7 +5007,7 @@ static void efm32_vbusdrive(FAR struct efm32_usbhost_s *priv, bool state) up_mdelay(200); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_host_initialize * * Description: @@ -5022,7 +5022,7 @@ static void efm32_vbusdrive(FAR struct efm32_usbhost_s *priv, bool state) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ static void efm32_host_initialize(FAR struct efm32_usbhost_s *priv) { @@ -5096,7 +5096,7 @@ static void efm32_host_initialize(FAR struct efm32_usbhost_s *priv) efm32_hostinit_enable(); } -/******************************************************************************* +/**************************************************************************** * Name: efm32_sw_initialize * * Description: @@ -5108,7 +5108,7 @@ static void efm32_host_initialize(FAR struct efm32_usbhost_s *priv) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ static inline void efm32_sw_initialize(FAR struct efm32_usbhost_s *priv) { @@ -5177,7 +5177,7 @@ static inline void efm32_sw_initialize(FAR struct efm32_usbhost_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: efm32_hw_initialize * * Description: @@ -5189,7 +5189,7 @@ static inline void efm32_sw_initialize(FAR struct efm32_usbhost_s *priv) * Returned Value: * Zero on success; a negated errno value on failure. * - *******************************************************************************/ + ****************************************************************************/ static inline int efm32_hw_initialize(FAR struct efm32_usbhost_s *priv) { @@ -5269,11 +5269,11 @@ static inline int efm32_hw_initialize(FAR struct efm32_usbhost_s *priv) return OK; } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: efm32_usbhost_initialize * * Description: @@ -5296,7 +5296,7 @@ static inline int efm32_hw_initialize(FAR struct efm32_usbhost_s *priv) * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - *******************************************************************************/ + ****************************************************************************/ FAR struct usbhost_connection_s *efm32_usbhost_initialize(int controller) { diff --git a/arch/arm/src/kinetis/kinetis_lowputc.c b/arch/arm/src/kinetis/kinetis_lowputc.c index 86c83327f0..a7b693ccca 100644 --- a/arch/arm/src/kinetis/kinetis_lowputc.c +++ b/arch/arm/src/kinetis/kinetis_lowputc.c @@ -268,13 +268,13 @@ void kinetis_lowsetup(void) #endif /* HAVE_UART_DEVICE */ } -/****************************************************************************** +/**************************************************************************** * Name: kinetis_uartreset * * Description: * Reset a UART. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE void kinetis_uartreset(uintptr_t uart_base) @@ -289,13 +289,13 @@ void kinetis_uartreset(uintptr_t uart_base) } #endif -/****************************************************************************** +/**************************************************************************** * Name: kinetis_uartconfigure * * Description: * Configure a UART as a RS-232 UART. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE void kinetis_uartconfigure(uintptr_t uart_base, uint32_t baud, diff --git a/arch/arm/src/kl/kl_lowputc.c b/arch/arm/src/kl/kl_lowputc.c index aee40a0663..01288ef874 100644 --- a/arch/arm/src/kl/kl_lowputc.c +++ b/arch/arm/src/kl/kl_lowputc.c @@ -222,13 +222,13 @@ void kl_lowsetup(void) #endif } -/****************************************************************************** +/**************************************************************************** * Name: kl_uartreset * * Description: * Reset a UART. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE void kl_uartreset(uintptr_t uart_base) @@ -243,13 +243,13 @@ void kl_uartreset(uintptr_t uart_base) } #endif -/****************************************************************************** +/**************************************************************************** * Name: kl_uartconfigure * * Description: * Configure a UART as a RS-232 UART. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE void kl_uartconfigure(uintptr_t uart_base, uint32_t baud, uint32_t clock, diff --git a/arch/arm/src/lpc11xx/lpc11_i2c.c b/arch/arm/src/lpc11xx/lpc11_i2c.c index 9b6462c676..8af2c0b25a 100644 --- a/arch/arm/src/lpc11xx/lpc11_i2c.c +++ b/arch/arm/src/lpc11xx/lpc11_i2c.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/lpc11xx/lpc11_i2c.c * * Copyright (C) 2011 Li Zhuoyi. All rights reserved. @@ -39,11 +39,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -72,9 +72,9 @@ #if defined(CONFIG_LPC11_I2C0) || defined(CONFIG_LPC11_I2C1) || defined(CONFIG_LPC11_I2C2) -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ #ifndef GPIO_I2C1_SCL # define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 @@ -95,9 +95,9 @@ #define I2C_TIMEOUT ((20 * CLK_TCK) / 1000) /* 20 mS */ -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ struct lpc11_i2cdev_s { @@ -115,9 +115,9 @@ struct lpc11_i2cdev_s uint16_t rdcnt; /* number of bytes read from rx fifo */ }; -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ static int i2c_start(struct lpc11_i2cdev_s *priv); static void i2c_stop(struct lpc11_i2cdev_s *priv); @@ -132,9 +132,9 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen); static int i2c_transfer(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *msgs, int count); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ static struct lpc11_i2cdev_s i2cdevices[3]; @@ -149,13 +149,13 @@ struct i2c_ops_s lpc11_i2c_ops = #endif }; -/******************************************************************************* +/**************************************************************************** * Name: lpc11_i2c_setfrequency * * Description: * Set the frequency for the next transfer * - *******************************************************************************/ + ****************************************************************************/ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) { @@ -185,13 +185,13 @@ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) return frequency; } -/******************************************************************************* +/**************************************************************************** * Name: lpc11_i2c_setaddress * * Description: * Set the I2C slave address for a subsequent read/write * - *******************************************************************************/ + ****************************************************************************/ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) { @@ -206,14 +206,14 @@ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc11_i2c_write * * Description: * Send a block of data on I2C using the previously selected I2C * frequency and slave address. * - *******************************************************************************/ + ****************************************************************************/ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int buflen) @@ -234,14 +234,14 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, return ret > 0 ? OK : -ETIMEDOUT; } -/******************************************************************************* +/**************************************************************************** * Name: lpc11_i2c_read * * Description: * Receive a block of data on I2C using the previously selected I2C * frequency and slave address. * - *******************************************************************************/ + ****************************************************************************/ static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen) { @@ -261,13 +261,13 @@ static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen) return ret > 0 ? OK : -ETIMEDOUT; } -/******************************************************************************* +/**************************************************************************** * Name: i2c_start * * Description: * Perform a I2C transfer start * - *******************************************************************************/ + ****************************************************************************/ static int i2c_start(struct lpc11_i2cdev_s *priv) { @@ -295,13 +295,13 @@ static int i2c_start(struct lpc11_i2cdev_s *priv) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: i2c_stop * * Description: * Perform a I2C transfer stop * - *******************************************************************************/ + ****************************************************************************/ static void i2c_stop(struct lpc11_i2cdev_s *priv) { @@ -313,13 +313,13 @@ static void i2c_stop(struct lpc11_i2cdev_s *priv) sem_post(&priv->wait); } -/******************************************************************************* +/**************************************************************************** * Name: i2c_timeout * * Description: * Watchdog timer for timeout of I2C operation * - *******************************************************************************/ + ****************************************************************************/ static void i2c_timeout(int argc, uint32_t arg, ...) { @@ -331,13 +331,13 @@ static void i2c_timeout(int argc, uint32_t arg, ...) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: i2c_interrupt * * Description: * The I2C Interrupt Handler * - *******************************************************************************/ + ****************************************************************************/ static int i2c_interrupt(int irq, FAR void *context) { @@ -439,17 +439,17 @@ static int i2c_interrupt(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_i2cinitialize * * Description: * Initialise an I2C device * - *******************************************************************************/ + ****************************************************************************/ struct i2c_dev_s *up_i2cinitialize(int port) { @@ -569,13 +569,13 @@ struct i2c_dev_s *up_i2cinitialize(int port) return &priv->dev; } -/******************************************************************************* +/**************************************************************************** * Name: up_i2cuninitalize * * Description: * Uninitialise an I2C device * - *******************************************************************************/ + ****************************************************************************/ int up_i2cuninitialize(FAR struct i2c_dev_s * dev) { diff --git a/arch/arm/src/lpc17xx/lpc17_ethernet.c b/arch/arm/src/lpc17xx/lpc17_ethernet.c index 02fcc2a335..9957c13e2c 100644 --- a/arch/arm/src/lpc17xx/lpc17_ethernet.c +++ b/arch/arm/src/lpc17xx/lpc17_ethernet.c @@ -448,13 +448,13 @@ static void lpc17_ethreset(struct lpc17_driver_s *priv); * Private Functions ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc17_printreg * * Description: * Print the contents of an LPC17xx register operation * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_NET_REGDEBUG static void lpc17_printreg(uint32_t addr, uint32_t val, bool iswrite) @@ -463,13 +463,13 @@ static void lpc17_printreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_checkreg * * Description: * Get the contents of an LPC17xx register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_NET_REGDEBUG static void lpc17_checkreg(uint32_t addr, uint32_t val, bool iswrite) @@ -527,13 +527,13 @@ static void lpc17_checkreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_getreg * * Description: * Get the contents of an LPC17xx register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_NET_REGDEBUG static uint32_t lpc17_getreg(uint32_t addr) @@ -549,13 +549,13 @@ static uint32_t lpc17_getreg(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_putreg * * Description: * Set the contents of an LPC17xx register to a value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_NET_REGDEBUG static void lpc17_putreg(uint32_t val, uint32_t addr) @@ -2315,7 +2315,7 @@ static int lpc17_rmmac(struct net_driver_s *dev, const uint8_t *mac) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_showpins * * Description: @@ -2329,7 +2329,7 @@ static int lpc17_rmmac(struct net_driver_s *dev, const uint8_t *mac) * * Assumptions: * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_NET_REGDEBUG) && defined(CONFIG_DEBUG_GPIO) static void lpc17_showpins(void) @@ -2339,7 +2339,7 @@ static void lpc17_showpins(void) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_showmii * * Description: @@ -2353,7 +2353,7 @@ static void lpc17_showpins(void) * * Assumptions: * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_NET_REGDEBUG) && defined(LPC17_HAVE_PHY) static void lpc17_showmii(uint8_t phyaddr, const char *msg) diff --git a/arch/arm/src/lpc17xx/lpc17_i2c.c b/arch/arm/src/lpc17xx/lpc17_i2c.c index bcab38befe..8d55944a24 100644 --- a/arch/arm/src/lpc17xx/lpc17_i2c.c +++ b/arch/arm/src/lpc17xx/lpc17_i2c.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/lpc17xx/lpc17_i2c.c * * Copyright (C) 2011 Li Zhuoyi. All rights reserved. @@ -39,11 +39,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -89,19 +89,19 @@ # define CONFIG_I2C2_FREQ 100000 #endif -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ #define I2C_TIMEOUT ((20 * CLK_TCK) / 1000) /* 20 mS */ -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ struct lpc17_i2cdev_s { @@ -121,18 +121,18 @@ struct lpc17_i2cdev_s static struct lpc17_i2cdev_s i2cdevices[3]; -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ + ****************************************************************************/ static int i2c_start(struct lpc17_i2cdev_s *priv); static void i2c_stop(struct lpc17_i2cdev_s *priv); static int i2c_interrupt(int irq, FAR void *context); static void i2c_timeout(int argc, uint32_t arg, ...); -/******************************************************************************* +/**************************************************************************** * I2C device operations - *******************************************************************************/ + ****************************************************************************/ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency); static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits); @@ -151,13 +151,13 @@ struct i2c_ops_s lpc17_i2c_ops = #endif }; -/******************************************************************************* +/**************************************************************************** * Name: lpc17_i2c_setfrequency * * Description: * Set the frequence for the next transfer * - *******************************************************************************/ + ****************************************************************************/ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) { @@ -183,13 +183,13 @@ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) return frequency; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_i2c_setaddress * * Description: * Set the I2C slave address for a subsequent read/write * - *******************************************************************************/ + ****************************************************************************/ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) { @@ -204,14 +204,14 @@ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_i2c_write * * Description: * Send a block of data on I2C using the previously selected I2C * frequency and slave address. * - *******************************************************************************/ + ****************************************************************************/ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int buflen) { @@ -231,14 +231,14 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int bufle return ret > 0 ? OK : -ETIMEDOUT; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_i2c_read * * Description: * Receive a block of data on I2C using the previously selected I2C * frequency and slave address. * - *******************************************************************************/ + ****************************************************************************/ static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen) { @@ -258,13 +258,13 @@ static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen) return ret > 0 ? OK : -ETIMEDOUT; } -/******************************************************************************* +/**************************************************************************** * Name: i2c_start * * Description: * Perform a I2C transfer start * - *******************************************************************************/ + ****************************************************************************/ static int i2c_start(struct lpc17_i2cdev_s *priv) { @@ -292,13 +292,13 @@ static int i2c_start(struct lpc17_i2cdev_s *priv) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: i2c_stop * * Description: * Perform a I2C transfer stop * - *******************************************************************************/ + ****************************************************************************/ static void i2c_stop(struct lpc17_i2cdev_s *priv) { @@ -310,13 +310,13 @@ static void i2c_stop(struct lpc17_i2cdev_s *priv) sem_post(&priv->wait); } -/******************************************************************************* +/**************************************************************************** * Name: i2c_timeout * * Description: * Watchdog timer for timeout of I2C operation * - *******************************************************************************/ + ****************************************************************************/ static void i2c_timeout(int argc, uint32_t arg, ...) { @@ -328,13 +328,13 @@ static void i2c_timeout(int argc, uint32_t arg, ...) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: i2c_interrupt * * Description: * The I2C Interrupt Handler * - *******************************************************************************/ + ****************************************************************************/ static int i2c_interrupt(int irq, FAR void *context) { @@ -436,17 +436,17 @@ static int i2c_interrupt(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_i2cinitialize * * Description: * Initialise an I2C device * - *******************************************************************************/ + ****************************************************************************/ struct i2c_dev_s *up_i2cinitialize(int port) { @@ -566,13 +566,13 @@ struct i2c_dev_s *up_i2cinitialize(int port) return &priv->dev; } -/******************************************************************************* +/**************************************************************************** * Name: up_i2cuninitalize * * Description: * Uninitialise an I2C device * - *******************************************************************************/ + ****************************************************************************/ int up_i2cuninitialize(FAR struct i2c_dev_s * dev) { diff --git a/arch/arm/src/lpc17xx/lpc17_usbdev.c b/arch/arm/src/lpc17xx/lpc17_usbdev.c index a7a914f0ae..d53a28e94c 100644 --- a/arch/arm/src/lpc17xx/lpc17_usbdev.c +++ b/arch/arm/src/lpc17xx/lpc17_usbdev.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/lpc17xx/lpc17_usbdev.c * * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -65,9 +65,9 @@ #include "lpc17_gpio.h" #include "lpc17_gpdma.h" -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ @@ -272,9 +272,9 @@ #define lpc17_rqempty(ep) ((ep)->head == NULL) #define lpc17_rqpeek(ep) ((ep)->head) -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* A container for a request so that the request make be retained in a list */ @@ -364,9 +364,9 @@ struct lpc17_usbdev_s struct lpc17_ep_s eplist[LPC17_NPHYSENDPOINTS]; }; -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Register operations ********************************************************/ @@ -457,9 +457,9 @@ static int lpc17_wakeup(struct usbdev_s *dev); static int lpc17_selfpowered(struct usbdev_s *dev, bool selfpowered); static int lpc17_pullup(struct usbdev_s *dev, bool enable); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ /* Since there is only a single USB interface, all status information can be * be simply retained in a single global instance. @@ -512,21 +512,21 @@ static uint32_t g_udca[LPC17_NPHYSENDPOINTS] __attribute__ ((alig static struct lpc17_dmadesc_s g_usbddesc[CONFIG_LPC17_USBDEV_NDMADESCRIPTORS]; #endif -/******************************************************************************* +/**************************************************************************** * Public Data - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc17_printreg * * Description: * Print the contents of an LPC17xx register operation * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_USBDEV_REGDEBUG static void lpc17_printreg(uint32_t addr, uint32_t val, bool iswrite) @@ -535,13 +535,13 @@ static void lpc17_printreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_checkreg * * Description: * Get the contents of an LPC17xx register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_USBDEV_REGDEBUG static void lpc17_checkreg(uint32_t addr, uint32_t val, bool iswrite) @@ -599,13 +599,13 @@ static void lpc17_checkreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_getreg * * Description: * Get the contents of an LPC17xx register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_USBDEV_REGDEBUG static uint32_t lpc17_getreg(uint32_t addr) @@ -621,13 +621,13 @@ static uint32_t lpc17_getreg(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_putreg * * Description: * Set the contents of an LPC17xx register to a value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_USBDEV_REGDEBUG static void lpc17_putreg(uint32_t val, uint32_t addr) @@ -642,13 +642,13 @@ static void lpc17_putreg(uint32_t val, uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_usbcmd * * Description: * Transmit commands to the USB engine * - *******************************************************************************/ + ****************************************************************************/ static uint32_t lpc17_usbcmd(uint16_t cmd, uint8_t data) { @@ -786,13 +786,13 @@ static uint32_t lpc17_usbcmd(uint16_t cmd, uint8_t data) return tmp; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_rqdequeue * * Description: * Remove a request from an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static FAR struct lpc17_req_s *lpc17_rqdequeue(FAR struct lpc17_ep_s *privep) { @@ -812,13 +812,13 @@ static FAR struct lpc17_req_s *lpc17_rqdequeue(FAR struct lpc17_ep_s *privep) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_rqenqueue * * Description: * Add a request from an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static void lpc17_rqenqueue(FAR struct lpc17_ep_s *privep, FAR struct lpc17_req_s *req) @@ -836,13 +836,13 @@ static void lpc17_rqenqueue(FAR struct lpc17_ep_s *privep, } } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_epwrite * * Description: * Endpoint write (IN) * - *******************************************************************************/ + ****************************************************************************/ static void lpc17_epwrite(uint8_t epphy, const uint8_t *data, uint32_t nbytes) { @@ -897,13 +897,13 @@ static void lpc17_epwrite(uint8_t epphy, const uint8_t *data, uint32_t nbytes) (void)lpc17_usbcmd(CMD_USBDEV_EPVALIDATEBUFFER, 0); } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_epread * * Description: * Endpoint read (OUT) * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_epread(uint8_t epphy, uint8_t *data, uint32_t nbytes) { @@ -983,13 +983,13 @@ static int lpc17_epread(uint8_t epphy, uint8_t *data, uint32_t nbytes) return pktlen; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_abortrequest * * Description: * Discard a request * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc17_abortrequest(struct lpc17_ep_s *privep, struct lpc17_req_s *privreq, @@ -1006,13 +1006,13 @@ static inline void lpc17_abortrequest(struct lpc17_ep_s *privep, privreq->req.callback(&privep->ep, &privreq->req); } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_reqcomplete * * Description: * Handle termination of the request at the head of the endpoint request queue. * - *******************************************************************************/ + ****************************************************************************/ static void lpc17_reqcomplete(struct lpc17_ep_s *privep, int16_t result) { @@ -1052,13 +1052,13 @@ static void lpc17_reqcomplete(struct lpc17_ep_s *privep, int16_t result) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_wrrequest * * Description: * Send from the next queued write request * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_wrrequest(struct lpc17_ep_s *privep) { @@ -1162,13 +1162,13 @@ static int lpc17_wrrequest(struct lpc17_ep_s *privep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_rdrequest * * Description: * Receive to the next queued read request * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_rdrequest(struct lpc17_ep_s *privep) { @@ -1223,13 +1223,13 @@ static int lpc17_rdrequest(struct lpc17_ep_s *privep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_cancelrequests * * Description: * Cancel all pending requests for an endpoint * - *******************************************************************************/ + ****************************************************************************/ static void lpc17_cancelrequests(struct lpc17_ep_s *privep) { @@ -1241,14 +1241,14 @@ static void lpc17_cancelrequests(struct lpc17_ep_s *privep) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_epfindbyaddr * * Description: * Find the physical endpoint structure corresponding to a logic endpoint * address * - *******************************************************************************/ + ****************************************************************************/ static struct lpc17_ep_s *lpc17_epfindbyaddr(struct lpc17_usbdev_s *priv, uint16_t eplog) @@ -1284,13 +1284,13 @@ static struct lpc17_ep_s *lpc17_epfindbyaddr(struct lpc17_usbdev_s *priv, return NULL; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_eprealize * * Description: * Enable or disable an endpoint * - *******************************************************************************/ + ****************************************************************************/ static void lpc17_eprealize(struct lpc17_ep_s *privep, bool prio, uint32_t packetsize) { @@ -1334,13 +1334,13 @@ static void lpc17_eprealize(struct lpc17_ep_s *privep, bool prio, uint32_t packe lpc17_putreg(USBDEV_INT_EPRLZED,LPC17_USBDEV_INTCLR); } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_epclrinterrupt * * Description: * Clear the EP interrupt flag and return the current EP status * - *******************************************************************************/ + ****************************************************************************/ static uint8_t lpc17_epclrinterrupt(uint8_t epphy) { @@ -1357,13 +1357,13 @@ static uint8_t lpc17_epclrinterrupt(uint8_t epphy) return lpc17_getreg(LPC17_USBDEV_CMDDATA); } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_ep0configure * * Description: * Configure endpoint 0 * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc17_ep0configure(struct lpc17_usbdev_s *priv) { @@ -1381,12 +1381,12 @@ static inline void lpc17_ep0configure(struct lpc17_usbdev_s *priv) lpc17_putreg(inten, LPC17_USBDEV_EPINTEN); } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_dmareset * * Description: Reset USB DMA * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_USBDEV_DMA static inline void lpc17_dmareset(uint32_t enable) @@ -1441,13 +1441,13 @@ static inline void lpc17_dmareset(uint32_t enable) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_usbreset * * Description: * Reset Usb engine * - *******************************************************************************/ + ****************************************************************************/ static void lpc17_usbreset(struct lpc17_usbdev_s *priv) { @@ -1500,14 +1500,14 @@ static void lpc17_usbreset(struct lpc17_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_dispatchrequest * * Description: * Provide unhandled setup actions to the class driver. This is logically part * of the USB interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static void lpc17_dispatchrequest(struct lpc17_usbdev_s *priv, const struct usb_ctrlreq_s *ctrl) @@ -1530,14 +1530,14 @@ static void lpc17_dispatchrequest(struct lpc17_usbdev_s *priv, } } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_ep0setup * * Description: * USB Ctrl EP Setup Event. This is logically part of the USB interrupt * handler. This event occurs when a setup packet is receive on EP0 OUT. * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc17_ep0setup(struct lpc17_usbdev_s *priv) { @@ -1911,7 +1911,7 @@ static inline void lpc17_ep0setup(struct lpc17_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_ep0dataoutinterrupt * * Description: @@ -1919,7 +1919,7 @@ static inline void lpc17_ep0setup(struct lpc17_usbdev_s *priv) * handler. Each non-isochronous OUT endpoint gives an interrupt when they * receive a packet without error. * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc17_ep0dataoutinterrupt(struct lpc17_usbdev_s *priv) { @@ -1972,7 +1972,7 @@ static inline void lpc17_ep0dataoutinterrupt(struct lpc17_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_ep0dataininterrupt * * Description: @@ -1981,7 +1981,7 @@ static inline void lpc17_ep0dataoutinterrupt(struct lpc17_usbdev_s *priv) * packet is successfully transmitted (OR a NAK handshake is sent on the bus * provided that the interrupt on NAK feature is enabled). * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc17_ep0dataininterrupt(struct lpc17_usbdev_s *priv) { @@ -2037,13 +2037,13 @@ static inline void lpc17_ep0dataininterrupt(struct lpc17_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_usbinterrupt * * Description: * USB interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_usbinterrupt(int irq, FAR void *context) { @@ -2394,13 +2394,13 @@ static int lpc17_usbinterrupt(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_dmasetup * * Description: * Setup for DMA Transfer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_USBDEV_DMA static int lpc17_dmasetup(struct lpc17_usbdev_s *priv, uint8_t epphy, @@ -2482,13 +2482,13 @@ static int lpc17_dmasetup(struct lpc17_usbdev_s *priv, uint8_t epphy, } #endif /* CONFIG_LPC17_USBDEV_DMA */ -/******************************************************************************* +/**************************************************************************** * Name: lpc17_dmarestart * * Description: * Restart DMA Transfer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_USBDEV_DMA static void lpc17_dmarestart(uint8_t epphy, uint32_t descndx) @@ -2517,13 +2517,13 @@ static void lpc17_dmarestart(uint8_t epphy, uint32_t descndx) } #endif /* CONFIG_LPC17_USBDEV_DMA */ -/******************************************************************************* +/**************************************************************************** * Name: lpc17_dmadisable * * Description: * Disable DMA transfer for the EP * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_USBDEV_DMA static void lpc17_dmadisable(uint8_t epphy) @@ -2532,11 +2532,11 @@ static void lpc17_dmadisable(uint8_t epphy) } #endif /* CONFIG_LPC17_USBDEV_DMA */ -/******************************************************************************* +/**************************************************************************** * Endpoint operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc17_epconfigure * * Description: @@ -2549,7 +2549,7 @@ static void lpc17_dmadisable(uint8_t epphy) * needs to take special action when all of the endpoints have been * configured. * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_epconfigure(FAR struct usbdev_ep_s *ep, FAR const struct usb_epdesc_s *desc, @@ -2593,13 +2593,13 @@ static int lpc17_epconfigure(FAR struct usbdev_ep_s *ep, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_epdisable * * Description: * The endpoint will no longer be used * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_epdisable(FAR struct usbdev_ep_s *ep) { @@ -2638,13 +2638,13 @@ static int lpc17_epdisable(FAR struct usbdev_ep_s *ep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_epallocreq * * Description: * Allocate an I/O request * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_req_s *lpc17_epallocreq(FAR struct usbdev_ep_s *ep) { @@ -2670,13 +2670,13 @@ static FAR struct usbdev_req_s *lpc17_epallocreq(FAR struct usbdev_ep_s *ep) return &privreq->req; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_epfreereq * * Description: * Free an I/O request * - *******************************************************************************/ + ****************************************************************************/ static void lpc17_epfreereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -2694,13 +2694,13 @@ static void lpc17_epfreereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s kmm_free(privreq); } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_epallocbuffer * * Description: * Allocate an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_DMA static FAR void *lpc17_epallocbuffer(FAR struct usbdev_ep_s *ep, uint16_t nbytes) @@ -2735,13 +2735,13 @@ static FAR void *lpc17_epallocbuffer(FAR struct usbdev_ep_s *ep, uint16_t nbytes } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_epfreebuffer * * Description: * Free an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_DMA static void lpc17_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) @@ -2774,13 +2774,13 @@ static void lpc17_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_epsubmit * * Description: * Submit an I/O request to the endpoint * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_epsubmit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -2862,13 +2862,13 @@ static int lpc17_epsubmit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *r return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_epcancel * * Description: * Cancel an I/O request previously sent to an endpoint * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_epcancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -2891,13 +2891,13 @@ static int lpc17_epcancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *r return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_epstall * * Description: * Stall or resume and endpoint * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_epstall(FAR struct usbdev_ep_s *ep, bool resume) { @@ -2920,11 +2920,11 @@ static int lpc17_epstall(FAR struct usbdev_ep_s *ep, bool resume) return OK; } -/******************************************************************************* +/**************************************************************************** * Device operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc17_allocep * * Description: @@ -2938,7 +2938,7 @@ static int lpc17_epstall(FAR struct usbdev_ep_s *ep, bool resume) * eptype - Endpoint type. One of {USB_EP_ATTR_XFER_ISOC, USB_EP_ATTR_XFER_BULK, * USB_EP_ATTR_XFER_INT} * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_ep_s *lpc17_allocep(FAR struct usbdev_s *dev, uint8_t eplog, bool in, uint8_t eptype) @@ -3048,13 +3048,13 @@ static FAR struct usbdev_ep_s *lpc17_allocep(FAR struct usbdev_s *dev, uint8_t e return NULL; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_freeep * * Description: * Free the previously allocated endpoint * - *******************************************************************************/ + ****************************************************************************/ static void lpc17_freeep(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) { @@ -3074,13 +3074,13 @@ static void lpc17_freeep(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_getframe * * Description: * Returns the current frame number * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_getframe(struct usbdev_s *dev) { @@ -3099,13 +3099,13 @@ static int lpc17_getframe(struct usbdev_s *dev) #endif } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_wakeup * * Description: * Tries to wake up the host connected to this device * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_wakeup(struct usbdev_s *dev) { @@ -3125,13 +3125,13 @@ static int lpc17_wakeup(struct usbdev_s *dev) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_selfpowered * * Description: * Sets/clears the device selfpowered feature * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_selfpowered(struct usbdev_s *dev, bool selfpowered) { @@ -3151,13 +3151,13 @@ static int lpc17_selfpowered(struct usbdev_s *dev, bool selfpowered) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_pullup * * Description: * Software-controlled connect to/disconnect from USB host * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_pullup(struct usbdev_s *dev, bool enable) { @@ -3171,11 +3171,11 @@ static int lpc17_pullup(struct usbdev_s *dev, bool enable) return OK; } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_usbinitialize * * Description: @@ -3185,7 +3185,7 @@ static int lpc17_pullup(struct usbdev_s *dev, bool enable) * This function is called very early in the initialization sequence in order * to initialize the USB device functionality. * - *******************************************************************************/ + ****************************************************************************/ void up_usbinitialize(void) { @@ -3350,9 +3350,9 @@ errout: up_usbuninitialize(); } -/******************************************************************************* +/**************************************************************************** * Name: up_usbuninitialize - *******************************************************************************/ + ****************************************************************************/ void up_usbuninitialize(void) { @@ -3388,14 +3388,14 @@ void up_usbuninitialize(void) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: usbdev_register * * Description: * Register a USB device class driver. The class driver's bind() method will be * called to bind it to a USB device driver. * - *******************************************************************************/ + ****************************************************************************/ int usbdev_register(struct usbdevclass_driver_s *driver) { @@ -3439,7 +3439,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: usbdev_unregister * * Description: @@ -3447,7 +3447,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) * it will first disconnect(). The driver is also requested to unbind() and clean * up any device state, before this procedure finally returns. * - *******************************************************************************/ + ****************************************************************************/ int usbdev_unregister(struct usbdevclass_driver_s *driver) { diff --git a/arch/arm/src/lpc17xx/lpc17_usbhost.c b/arch/arm/src/lpc17xx/lpc17_usbhost.c index 0643659616..d1e8ce0837 100644 --- a/arch/arm/src/lpc17xx/lpc17_usbhost.c +++ b/arch/arm/src/lpc17xx/lpc17_usbhost.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/lpc17xx/lpc17_usbhost.c * * Copyright (C) 2010-2012, 2014-2015 Gregory Nutt. All rights reserved. @@ -32,11 +32,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -69,9 +69,9 @@ #include "lpc17_gpio.h" #include "lpc17_ohciram.h" -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ @@ -143,9 +143,9 @@ #define TD_DELAY(n) (uint32_t)((n) << GTD_STATUS_DI_SHIFT) -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* This structure retains the state of the USB host controller */ @@ -260,9 +260,9 @@ struct lpc17_list_s /* Variable length buffer data follows */ }; -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Register operations ********************************************************/ @@ -404,9 +404,9 @@ static void lpc17_disconnect(struct usbhost_driver_s *drvr, static inline void lpc17_ep0init(struct lpc17_usbhost_s *priv); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ /* In this driver implementation, support is provided for only a single a single * USB device. All status information can be simply retained in a single global @@ -437,21 +437,21 @@ static struct lpc17_list_s *g_iofree; /* List of unused I/O buffers */ static struct lpc17_list_s *g_xfrfree; static struct lpc17_xfrinfo_s g_xfrbuffers[CONFIG_LPC17_USBHOST_NPREALLOC]; -/******************************************************************************* +/**************************************************************************** * Public Data - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc17_printreg * * Description: * Print the contents of an LPC17xx register operation * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_USBHOST_REGDEBUG static void lpc17_printreg(uint32_t addr, uint32_t val, bool iswrite) @@ -460,13 +460,13 @@ static void lpc17_printreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_checkreg * * Description: * Get the contents of an LPC17xx register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_USBHOST_REGDEBUG static void lpc17_checkreg(uint32_t addr, uint32_t val, bool iswrite) @@ -524,13 +524,13 @@ static void lpc17_checkreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_getreg * * Description: * Get the contents of an LPC17xx register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_USBHOST_REGDEBUG static uint32_t lpc17_getreg(uint32_t addr) @@ -546,13 +546,13 @@ static uint32_t lpc17_getreg(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_putreg * * Description: * Set the contents of an LPC17xx register to a value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_USBHOST_REGDEBUG static void lpc17_putreg(uint32_t val, uint32_t addr) @@ -574,7 +574,7 @@ static void lpc17_putreg(uint32_t val, uint32_t addr) * This is just a wrapper to handle the annoying behavior of semaphore * waits that return due to the receipt of a signal. * - *******************************************************************************/ + ****************************************************************************/ static void lpc17_takesem(sem_t *sem) { @@ -596,7 +596,7 @@ static void lpc17_takesem(sem_t *sem) * Description: * Get a (possibly unaligned) 16-bit little endian value. * - *******************************************************************************/ + ****************************************************************************/ static inline uint16_t lpc17_getle16(const uint8_t *val) { @@ -609,7 +609,7 @@ static inline uint16_t lpc17_getle16(const uint8_t *val) * Description: * Put a (possibly unaligned) 16-bit little endian value. * - *******************************************************************************/ + ****************************************************************************/ #if 0 /* Not used */ static void lpc17_putle16(uint8_t *dest, uint16_t val) @@ -619,13 +619,13 @@ static void lpc17_putle16(uint8_t *dest, uint16_t val) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_edfree * * Description: * Return an endpoint descriptor to the free list * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc17_edfree(struct lpc17_ed_s *ed) { @@ -637,7 +637,7 @@ static inline void lpc17_edfree(struct lpc17_ed_s *ed) g_edfree = entry; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_tdalloc * * Description: @@ -649,7 +649,7 @@ static inline void lpc17_edfree(struct lpc17_ed_s *ed) * handler * - Protection from re-entrance must be assured by the caller * - *******************************************************************************/ + ****************************************************************************/ static struct lpc17_gtd_s *lpc17_tdalloc(void) { @@ -671,7 +671,7 @@ static struct lpc17_gtd_s *lpc17_tdalloc(void) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_tdfree * * Description: @@ -681,7 +681,7 @@ static struct lpc17_gtd_s *lpc17_tdalloc(void) * - Only called from the WDH interrupt handler (and during initialization). * - Interrupts are disabled in any case. * - *******************************************************************************/ + ****************************************************************************/ static void lpc17_tdfree(struct lpc17_gtd_s *td) { @@ -698,7 +698,7 @@ static void lpc17_tdfree(struct lpc17_gtd_s *td) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_tballoc * * Description: @@ -708,7 +708,7 @@ static void lpc17_tdfree(struct lpc17_gtd_s *td) * - Never called from an interrupt handler. * - Protection from re-entrance must be assured by the caller * - *******************************************************************************/ + ****************************************************************************/ static uint8_t *lpc17_tballoc(void) { @@ -720,13 +720,13 @@ static uint8_t *lpc17_tballoc(void) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_tbfree * * Description: * Return an request/descriptor transfer buffer to the free list * - *******************************************************************************/ + ****************************************************************************/ static void lpc17_tbfree(uint8_t *buffer) { @@ -739,7 +739,7 @@ static void lpc17_tbfree(uint8_t *buffer) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_allocio * * Description: @@ -749,7 +749,7 @@ static void lpc17_tbfree(uint8_t *buffer) * - Never called from an interrupt handler. * - Protection from re-entrance must be assured by the caller * - *******************************************************************************/ + ****************************************************************************/ #if LPC17_IOBUFFERS > 0 static uint8_t *lpc17_allocio(void) @@ -771,13 +771,13 @@ static uint8_t *lpc17_allocio(void) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_freeio * * Description: * Return an TD buffer to the free list * - *******************************************************************************/ + ****************************************************************************/ #if LPC17_IOBUFFERS > 0 static void lpc17_freeio(uint8_t *buffer) @@ -795,7 +795,7 @@ static void lpc17_freeio(uint8_t *buffer) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_alloc_xfrinfo * * Description: @@ -805,7 +805,7 @@ static void lpc17_freeio(uint8_t *buffer) * - Never called from an interrupt handler. * - Protection from re-entrance must be assured by the caller * - *******************************************************************************/ + ****************************************************************************/ static struct lpc17_xfrinfo_s *lpc17_alloc_xfrinfo(void) { @@ -825,13 +825,13 @@ static struct lpc17_xfrinfo_s *lpc17_alloc_xfrinfo(void) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_freeio * * Description: * Return an TD buffer to the free list * - *******************************************************************************/ + ****************************************************************************/ static void lpc17_free_xfrinfo(struct lpc17_xfrinfo_s *xfrinfo) { @@ -847,13 +847,13 @@ static void lpc17_free_xfrinfo(struct lpc17_xfrinfo_s *xfrinfo) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_addctrled * * Description: * Helper function to add an ED to the control list. * - *******************************************************************************/ + ****************************************************************************/ static inline int lpc17_addctrled(struct lpc17_usbhost_s *priv, struct lpc17_ed_s *ed) @@ -885,13 +885,13 @@ static inline int lpc17_addctrled(struct lpc17_usbhost_s *priv, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_remctrled * * Description: * Helper function remove an ED from the control list. * - *******************************************************************************/ + ****************************************************************************/ static inline int lpc17_remctrled(struct lpc17_usbhost_s *priv, struct lpc17_ed_s *ed) @@ -967,13 +967,13 @@ static inline int lpc17_remctrled(struct lpc17_usbhost_s *priv, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_addbulked * * Description: * Helper function to add an ED to the bulk list. * - *******************************************************************************/ + ****************************************************************************/ static inline int lpc17_addbulked(struct lpc17_usbhost_s *priv, struct lpc17_ed_s *ed) @@ -1009,13 +1009,13 @@ static inline int lpc17_addbulked(struct lpc17_usbhost_s *priv, #endif } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_rembulked * * Description: * Helper function remove an ED from the bulk list. * - *******************************************************************************/ + ****************************************************************************/ static inline int lpc17_rembulked(struct lpc17_usbhost_s *priv, struct lpc17_ed_s *ed) @@ -1089,13 +1089,13 @@ static inline int lpc17_rembulked(struct lpc17_usbhost_s *priv, #endif } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_getinterval * * Description: * Convert the endpoint polling interval into a HCCA table increment * - *******************************************************************************/ + ****************************************************************************/ #if !defined(CONFIG_USBHOST_INT_DISABLE) || !defined(CONFIG_USBHOST_ISOC_DISABLE) static unsigned int lpc17_getinterval(uint8_t interval) @@ -1128,14 +1128,14 @@ static unsigned int lpc17_getinterval(uint8_t interval) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_setinttab * * Description: * Set the interrupt table to the selected value using the provided interval * and offset. * - *******************************************************************************/ + ****************************************************************************/ #if !defined(CONFIG_USBHOST_INT_DISABLE) || !defined(CONFIG_USBHOST_ISOC_DISABLE) static void lpc17_setinttab(uint32_t value, unsigned int interval, unsigned int offset) @@ -1148,7 +1148,7 @@ static void lpc17_setinttab(uint32_t value, unsigned int interval, unsigned int } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_addinted * * Description: @@ -1166,7 +1166,7 @@ static void lpc17_setinttab(uint32_t value, unsigned int interval, unsigned int * 1. The minimum support polling rate is 2MS, and * 2. Some devices may get polled at a much higher rate than they request. * - *******************************************************************************/ + ****************************************************************************/ static inline int lpc17_addinted(struct lpc17_usbhost_s *priv, const struct usbhost_epdesc_s *epdesc, @@ -1257,7 +1257,7 @@ static inline int lpc17_addinted(struct lpc17_usbhost_s *priv, #endif } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_reminted * * Description: @@ -1275,7 +1275,7 @@ static inline int lpc17_addinted(struct lpc17_usbhost_s *priv, * 1. The minimum support polling rate is 2MS, and * 2. Some devices may get polled at a much higher rate than they request. * - *******************************************************************************/ + ****************************************************************************/ static inline int lpc17_reminted(struct lpc17_usbhost_s *priv, struct lpc17_ed_s *ed) @@ -1398,13 +1398,13 @@ static inline int lpc17_reminted(struct lpc17_usbhost_s *priv, #endif } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_addisoced * * Description: * Helper functions to add an ED to the periodic table. * - *******************************************************************************/ + ****************************************************************************/ static inline int lpc17_addisoced(struct lpc17_usbhost_s *priv, const struct usbhost_epdesc_s *epdesc, @@ -1416,13 +1416,13 @@ static inline int lpc17_addisoced(struct lpc17_usbhost_s *priv, return -ENOSYS; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_remisoced * * Description: * Helper functions to remove an ED from the periodic table. * - *******************************************************************************/ + ****************************************************************************/ static inline int lpc17_remisoced(struct lpc17_usbhost_s *priv, struct lpc17_ed_s *ed) @@ -1433,14 +1433,14 @@ static inline int lpc17_remisoced(struct lpc17_usbhost_s *priv, return -ENOSYS; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_enqueuetd * * Description: * Enqueue a transfer descriptor. Notice that this function only supports * queue on TD per ED. * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_enqueuetd(struct lpc17_usbhost_s *priv, struct lpc17_ed_s *ed, uint32_t dirpid, @@ -1480,7 +1480,7 @@ static int lpc17_enqueuetd(struct lpc17_usbhost_s *priv, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_wdhwait * * Description: @@ -1489,7 +1489,7 @@ static int lpc17_enqueuetd(struct lpc17_usbhost_s *priv, * We do this to minimize race conditions. This logic would have to be expanded * if we want to have more than one packet in flight at a time! * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_wdhwait(struct lpc17_usbhost_s *priv, struct lpc17_ed_s *ed) { @@ -1516,7 +1516,7 @@ static int lpc17_wdhwait(struct lpc17_usbhost_s *priv, struct lpc17_ed_s *ed) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_ctrltd * * Description: @@ -1528,7 +1528,7 @@ static int lpc17_wdhwait(struct lpc17_usbhost_s *priv, struct lpc17_ed_s *ed) * These are blocking methods; these functions will not return until the * control transfer has completed. * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_ctrltd(struct lpc17_usbhost_s *priv, struct lpc17_ed_s *ed, uint32_t dirpid, uint8_t *buffer, size_t buflen) @@ -1620,13 +1620,13 @@ errout_with_xfrinfo: return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_usbinterrupt * * Description: * USB interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_usbinterrupt(int irq, void *context) { @@ -1906,11 +1906,11 @@ static int lpc17_usbinterrupt(int irq, void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * USB Host Controller Operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc17_wait * * Description: @@ -1933,7 +1933,7 @@ static int lpc17_usbinterrupt(int irq, void *context) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_wait(struct usbhost_connection_s *conn, struct usbhost_hubport_s **hport) @@ -1999,7 +1999,7 @@ static int lpc17_wait(struct usbhost_connection_s *conn, } } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_enumerate * * Description: @@ -2025,7 +2025,7 @@ static int lpc17_wait(struct usbhost_connection_s *conn, * Assumptions: * This function will *not* be called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_rh_enumerate(struct usbhost_connection_s *conn, struct usbhost_hubport_s *hport) @@ -2387,7 +2387,7 @@ static int lpc17_epfree(struct usbhost_driver_s *drvr, usbhost_ep_t ep) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_alloc * * Description: @@ -2417,7 +2417,7 @@ static int lpc17_epfree(struct usbhost_driver_s *drvr, usbhost_ep_t ep) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_alloc(struct usbhost_driver_s *drvr, uint8_t **buffer, size_t *maxlen) @@ -2441,7 +2441,7 @@ static int lpc17_alloc(struct usbhost_driver_s *drvr, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_free * * Description: @@ -2462,7 +2462,7 @@ static int lpc17_alloc(struct usbhost_driver_s *drvr, * Assumptions: * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_free(struct usbhost_driver_s *drvr, uint8_t *buffer) { @@ -2561,7 +2561,7 @@ static int lpc17_iofree(struct usbhost_driver_s *drvr, uint8_t *buffer) #endif } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_ctrlin and lpc17_ctrlout * * Description: @@ -2595,7 +2595,7 @@ static int lpc17_iofree(struct usbhost_driver_s *drvr, uint8_t *buffer) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_ctrlin(struct usbhost_driver_s *drvr, usbhost_ep_t ep0, const struct usb_ctrlreq_s *req, @@ -2673,7 +2673,7 @@ static int lpc17_ctrlout(struct usbhost_driver_s *drvr, usbhost_ep_t ep0, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_transfer_common * * Description: @@ -2697,7 +2697,7 @@ static int lpc17_ctrlout(struct usbhost_driver_s *drvr, usbhost_ep_t ep0, * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int lpc17_transfer_common(struct lpc17_usbhost_s *priv, struct lpc17_ed_s *ed, uint8_t *buffer, @@ -2751,7 +2751,7 @@ static int lpc17_transfer_common(struct lpc17_usbhost_s *priv, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_dma_alloc * * Description: @@ -2774,7 +2774,7 @@ static int lpc17_transfer_common(struct lpc17_usbhost_s *priv, * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ #if LPC17_IOBUFFERS > 0 static int lpc17_dma_alloc(struct lpc17_usbhost_s *priv, @@ -2823,7 +2823,7 @@ static int lpc17_dma_alloc(struct lpc17_usbhost_s *priv, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_dma_free * * Description: @@ -2846,7 +2846,7 @@ static int lpc17_dma_alloc(struct lpc17_usbhost_s *priv, * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static void lpc17_dma_free(struct lpc17_usbhost_s *priv, struct lpc17_ed_s *ed, uint8_t *userbuffer, @@ -2879,7 +2879,7 @@ static void lpc17_dma_free(struct lpc17_usbhost_s *priv, } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_transfer * * Description: @@ -2915,7 +2915,7 @@ static void lpc17_dma_free(struct lpc17_usbhost_s *priv, * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static ssize_t lpc17_transfer(struct usbhost_driver_s *drvr, usbhost_ep_t ep, uint8_t *buffer, size_t buflen) @@ -3062,7 +3062,7 @@ errout_with_sem: return nbytes; } -/******************************************************************************* +/**************************************************************************** * Name: lpc17_asynch_completion * * Description: @@ -3080,7 +3080,7 @@ errout_with_sem: * Assumptions: * - Called from the interrupt level * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static void lpc17_asynch_completion(struct lpc17_usbhost_s *priv, @@ -3151,7 +3151,7 @@ static void lpc17_asynch_completion(struct lpc17_usbhost_s *priv, } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_asynch * * Description: @@ -3184,7 +3184,7 @@ static void lpc17_asynch_completion(struct lpc17_usbhost_s *priv, * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int lpc17_asynch(struct usbhost_driver_s *drvr, usbhost_ep_t ep, @@ -3471,7 +3471,7 @@ static int lpc17_connect(FAR struct usbhost_driver_s *drvr, } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_disconnect * * Description: @@ -3494,7 +3494,7 @@ static int lpc17_connect(FAR struct usbhost_driver_s *drvr, * - Only a single class bound to a single device is supported. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static void lpc17_disconnect(struct usbhost_driver_s *drvr, struct usbhost_hubport_s *hport) @@ -3503,10 +3503,10 @@ static void lpc17_disconnect(struct usbhost_driver_s *drvr, hport->devclass = NULL; } -/******************************************************************************* +/**************************************************************************** * Initialization - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: lpc17_ep0init * * Description: @@ -3519,7 +3519,7 @@ static void lpc17_disconnect(struct usbhost_driver_s *drvr, * Returned Values: * None * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc17_ep0init(struct lpc17_usbhost_s *priv) { @@ -3544,11 +3544,11 @@ static inline void lpc17_ep0init(struct lpc17_usbhost_s *priv) lpc17_addctrled(priv, EDCTRL); } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc17_usbhost_initialize * * Description: @@ -3571,7 +3571,7 @@ static inline void lpc17_ep0init(struct lpc17_usbhost_s *priv) * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - *******************************************************************************/ + ****************************************************************************/ struct usbhost_connection_s *lpc17_usbhost_initialize(int controller) { diff --git a/arch/arm/src/lpc214x/lpc214x_usbdev.c b/arch/arm/src/lpc214x/lpc214x_usbdev.c index 5fb688c034..e9eef2cc9b 100644 --- a/arch/arm/src/lpc214x/lpc214x_usbdev.c +++ b/arch/arm/src/lpc214x/lpc214x_usbdev.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/lpc214x/lpc214x_usbdev.c * * Copyright (C) 2008-2010, 2012-2013 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -64,9 +64,9 @@ #include "lpc214x_pll.h" #include "lpc214x_power.h" -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ @@ -283,9 +283,9 @@ #define lpc214x_rqempty(ep) ((ep)->head == NULL) #define lpc214x_rqpeek(ep) ((ep)->head) -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* A container for a request so that the request make be retained in a list */ @@ -376,9 +376,9 @@ struct lpc214x_usbdev_s struct lpc214x_ep_s eplist[LPC214X_NPHYSENDPOINTS]; }; -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Register operations ********************************************************/ @@ -467,9 +467,9 @@ static int lpc214x_wakeup(struct usbdev_s *dev); static int lpc214x_selfpowered(struct usbdev_s *dev, bool selfpowered); static int lpc214x_pullup(struct usbdev_s *dev, bool enable); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ /* Since there is only a single USB interface, all status information can be * be simply retained in a single global instance. @@ -502,21 +502,21 @@ static const struct usbdev_ops_s g_devops = .pullup = lpc214x_pullup, }; -/******************************************************************************* +/**************************************************************************** * Public Data - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_getreg * * Description: * Get the contents of an LPC214x register * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_LPC214X_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static uint32_t lpc214x_getreg(uint32_t addr) @@ -572,13 +572,13 @@ static uint32_t lpc214x_getreg(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_putreg * * Description: * Set the contents of an LPC214x register to a value * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_LPC214X_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static void lpc214x_putreg(uint32_t val, uint32_t addr) @@ -593,13 +593,13 @@ static void lpc214x_putreg(uint32_t val, uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_usbcmd * * Description: * Transmit commands to the USB engine * - *******************************************************************************/ + ****************************************************************************/ static uint32_t lpc214x_usbcmd(uint16_t cmd, uint8_t data) { @@ -729,13 +729,13 @@ static uint32_t lpc214x_usbcmd(uint16_t cmd, uint8_t data) return tmp; } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_rqdequeue * * Description: * Remove a request from an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static FAR struct lpc214x_req_s *lpc214x_rqdequeue(FAR struct lpc214x_ep_s *privep) { @@ -755,13 +755,13 @@ static FAR struct lpc214x_req_s *lpc214x_rqdequeue(FAR struct lpc214x_ep_s *priv return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_rqenqueue * * Description: * Add a request from an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static void lpc214x_rqenqueue(FAR struct lpc214x_ep_s *privep, FAR struct lpc214x_req_s *req) @@ -779,13 +779,13 @@ static void lpc214x_rqenqueue(FAR struct lpc214x_ep_s *privep, } } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_epwrite * * Description: * Endpoint write (IN) * - *******************************************************************************/ + ****************************************************************************/ static void lpc214x_epwrite(uint8_t epphy, const uint8_t *data, uint32_t nbytes) { @@ -840,13 +840,13 @@ static void lpc214x_epwrite(uint8_t epphy, const uint8_t *data, uint32_t nbytes) (void)lpc214x_usbcmd(CMD_USB_EP_VALIDATEBUFFER, 0); } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_epread * * Description: * Endpoint read (OUT) * - *******************************************************************************/ + ****************************************************************************/ static int lpc214x_epread(uint8_t epphy, uint8_t *data, uint32_t nbytes) { @@ -926,13 +926,13 @@ static int lpc214x_epread(uint8_t epphy, uint8_t *data, uint32_t nbytes) return pktlen; } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_abortrequest * * Description: * Discard a request * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc214x_abortrequest(struct lpc214x_ep_s *privep, struct lpc214x_req_s *privreq, @@ -949,13 +949,13 @@ static inline void lpc214x_abortrequest(struct lpc214x_ep_s *privep, privreq->req.callback(&privep->ep, &privreq->req); } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_reqcomplete * * Description: * Handle termination of the request at the head of the endpoint request queue. * - *******************************************************************************/ + ****************************************************************************/ static void lpc214x_reqcomplete(struct lpc214x_ep_s *privep, int16_t result) { @@ -995,13 +995,13 @@ static void lpc214x_reqcomplete(struct lpc214x_ep_s *privep, int16_t result) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_wrrequest * * Description: * Send from the next queued write request * - *******************************************************************************/ + ****************************************************************************/ static int lpc214x_wrrequest(struct lpc214x_ep_s *privep) { @@ -1105,13 +1105,13 @@ static int lpc214x_wrrequest(struct lpc214x_ep_s *privep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_rdrequest * * Description: * Receive to the next queued read request * - *******************************************************************************/ + ****************************************************************************/ static int lpc214x_rdrequest(struct lpc214x_ep_s *privep) { @@ -1166,13 +1166,13 @@ static int lpc214x_rdrequest(struct lpc214x_ep_s *privep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_cancelrequests * * Description: * Cancel all pending requests for an endpoint * - *******************************************************************************/ + ****************************************************************************/ static void lpc214x_cancelrequests(struct lpc214x_ep_s *privep) { @@ -1184,14 +1184,14 @@ static void lpc214x_cancelrequests(struct lpc214x_ep_s *privep) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_epfindbyaddr * * Description: * Find the physical endpoint structure corresponding to a logic endpoint * address * - *******************************************************************************/ + ****************************************************************************/ static struct lpc214x_ep_s *lpc214x_epfindbyaddr(struct lpc214x_usbdev_s *priv, uint16_t eplog) @@ -1227,13 +1227,13 @@ static struct lpc214x_ep_s *lpc214x_epfindbyaddr(struct lpc214x_usbdev_s *priv, return NULL; } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_eprealize * * Description: * Enable or disable an endpoint * - *******************************************************************************/ + ****************************************************************************/ static void lpc214x_eprealize(struct lpc214x_ep_s *privep, bool prio, uint32_t packetsize) { @@ -1277,13 +1277,13 @@ static void lpc214x_eprealize(struct lpc214x_ep_s *privep, bool prio, uint32_t p lpc214x_putreg(USBDEV_DEVINT_EPRLZED,LPC214X_USBDEV_DEVINTCLR); } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_epclrinterrupt * * Description: * Clear the EP interrupt flag and return the current EP status * - *******************************************************************************/ + ****************************************************************************/ static uint8_t lpc214x_epclrinterrupt(uint8_t epphy) { @@ -1300,13 +1300,13 @@ static uint8_t lpc214x_epclrinterrupt(uint8_t epphy) return lpc214x_getreg(LPC214X_USBDEV_CMDDATA); } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_ep0configure * * Description: * Configure endpoint 0 * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc214x_ep0configure(struct lpc214x_usbdev_s *priv) { @@ -1324,12 +1324,12 @@ static inline void lpc214x_ep0configure(struct lpc214x_usbdev_s *priv) lpc214x_putreg(inten, LPC214X_USBDEV_EPINTEN); } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_dmareset * * Description: Reset USB DMA * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC214X_USBDEV_DMA static inline void lpc214x_dmareset(uint32_t enable) @@ -1384,13 +1384,13 @@ static inline void lpc214x_dmareset(uint32_t enable) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_usbreset * * Description: * Reset Usb engine * - *******************************************************************************/ + ****************************************************************************/ static void lpc214x_usbreset(struct lpc214x_usbdev_s *priv) { @@ -1457,14 +1457,14 @@ static void lpc214x_usbreset(struct lpc214x_usbdev_s *priv) LPC214X_USBDEV_DEVINTEN); } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_dispatchrequest * * Description: * Provide unhandled setup actions to the class driver. This is logically part * of the USB interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static void lpc214x_dispatchrequest(struct lpc214x_usbdev_s *priv, const struct usb_ctrlreq_s *ctrl) @@ -1487,14 +1487,14 @@ static void lpc214x_dispatchrequest(struct lpc214x_usbdev_s *priv, } } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_ep0setup * * Description: * USB Ctrl EP Setup Event. This is logically part of the USB interrupt * handler. This event occurs when a setup packet is receive on EP0 OUT. * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc214x_ep0setup(struct lpc214x_usbdev_s *priv) { @@ -1870,7 +1870,7 @@ static inline void lpc214x_ep0setup(struct lpc214x_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_ep0dataoutinterrupt * * Description: @@ -1878,7 +1878,7 @@ static inline void lpc214x_ep0setup(struct lpc214x_usbdev_s *priv) * handler. Each non-isochronous OUT endpoint gives an interrupt when they * receive a packet without error. * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc214x_ep0dataoutinterrupt(struct lpc214x_usbdev_s *priv) { @@ -1935,7 +1935,7 @@ static inline void lpc214x_ep0dataoutinterrupt(struct lpc214x_usbdev_s *priv) return; } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_ep0dataininterrupt * * Description: @@ -1944,7 +1944,7 @@ static inline void lpc214x_ep0dataoutinterrupt(struct lpc214x_usbdev_s *priv) * packet is successfully transmitted (OR a NAK handshake is sent on the bus * provided that the interrupt on NAK feature is enabled). * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc214x_ep0dataininterrupt(struct lpc214x_usbdev_s *priv) { @@ -2002,13 +2002,13 @@ static inline void lpc214x_ep0dataininterrupt(struct lpc214x_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_usbinterrupt * * Description: * USB interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static int lpc214x_usbinterrupt(int irq, FAR void *context) { @@ -2359,13 +2359,13 @@ static int lpc214x_usbinterrupt(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_dmasetup * * Description: * Setup for DMA Transfer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC214X_USBDEV_DMA static int lpc214x_dmasetup(struct lpc214x_usbdev_s *priv, uint8_t epphy, @@ -2447,13 +2447,13 @@ static int lpc214x_dmasetup(struct lpc214x_usbdev_s *priv, uint8_t epphy, } #endif /* CONFIG_LPC214X_USBDEV_DMA */ -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_dmarestart * * Description: * Restart DMA Transfer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC214X_USBDEV_DMA static void lpc214x_dmarestart(uint8_t epphy, uint32_t descndx) @@ -2482,13 +2482,13 @@ static void lpc214x_dmarestart(uint8_t epphy, uint32_t descndx) } #endif /* CONFIG_LPC214X_USBDEV_DMA */ -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_dmadisable * * Description: * Disable DMA transfer for the EP * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC214X_USBDEV_DMA static void lpc214x_dmadisable(uint8_t epphy) @@ -2497,11 +2497,11 @@ static void lpc214x_dmadisable(uint8_t epphy) } #endif /* CONFIG_LPC214X_USBDEV_DMA */ -/******************************************************************************* +/**************************************************************************** * Endpoint operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_epconfigure * * Description: @@ -2514,7 +2514,7 @@ static void lpc214x_dmadisable(uint8_t epphy) * needs to take special action when all of the endpoints have been * configured. * - *******************************************************************************/ + ****************************************************************************/ static int lpc214x_epconfigure(FAR struct usbdev_ep_s *ep, FAR const struct usb_epdesc_s *desc, @@ -2558,13 +2558,13 @@ static int lpc214x_epconfigure(FAR struct usbdev_ep_s *ep, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_epdisable * * Description: * The endpoint will no longer be used * - *******************************************************************************/ + ****************************************************************************/ static int lpc214x_epdisable(FAR struct usbdev_ep_s *ep) { @@ -2603,13 +2603,13 @@ static int lpc214x_epdisable(FAR struct usbdev_ep_s *ep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_epallocreq * * Description: * Allocate an I/O request * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_req_s *lpc214x_epallocreq(FAR struct usbdev_ep_s *ep) { @@ -2635,13 +2635,13 @@ static FAR struct usbdev_req_s *lpc214x_epallocreq(FAR struct usbdev_ep_s *ep) return &privreq->req; } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_epfreereq * * Description: * Free an I/O request * - *******************************************************************************/ + ****************************************************************************/ static void lpc214x_epfreereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -2659,13 +2659,13 @@ static void lpc214x_epfreereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_ kmm_free(privreq); } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_epallocbuffer * * Description: * Allocate an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC214X_USBDEV_DMA static FAR void *lpc214x_epallocbuffer(FAR struct usbdev_ep_s *ep, uint16_t nbytes) @@ -2700,13 +2700,13 @@ static FAR void *lpc214x_epallocbuffer(FAR struct usbdev_ep_s *ep, uint16_t nbyt } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_epfreebuffer * * Description: * Free an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_DMA @@ -2739,13 +2739,13 @@ static void lpc214x_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_epsubmit * * Description: * Submit an I/O request to the endpoint * - *******************************************************************************/ + ****************************************************************************/ static int lpc214x_epsubmit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -2827,13 +2827,13 @@ static int lpc214x_epsubmit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_epcancel * * Description: * Cancel an I/O request previously sent to an endpoint * - *******************************************************************************/ + ****************************************************************************/ static int lpc214x_epcancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -2855,13 +2855,13 @@ static int lpc214x_epcancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_epstall * * Description: * Stall or resume and endpoint * - *******************************************************************************/ + ****************************************************************************/ static int lpc214x_epstall(FAR struct usbdev_ep_s *ep, bool resume) { @@ -2884,11 +2884,11 @@ static int lpc214x_epstall(FAR struct usbdev_ep_s *ep, bool resume) return OK; } -/******************************************************************************* +/**************************************************************************** * Device operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lcp214x_allocep * * Description: @@ -2902,7 +2902,7 @@ static int lpc214x_epstall(FAR struct usbdev_ep_s *ep, bool resume) * eptype - Endpoint type. One of {USB_EP_ATTR_XFER_ISOC, USB_EP_ATTR_XFER_BULK, * USB_EP_ATTR_XFER_INT} * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_ep_s *lcp214x_allocep(FAR struct usbdev_s *dev, uint8_t eplog, bool in, uint8_t eptype) @@ -3012,13 +3012,13 @@ static FAR struct usbdev_ep_s *lcp214x_allocep(FAR struct usbdev_s *dev, uint8_t return NULL; } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_freeep * * Description: * Free the previously allocated endpoint * - *******************************************************************************/ + ****************************************************************************/ static void lpc214x_freeep(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) { @@ -3038,13 +3038,13 @@ static void lpc214x_freeep(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_getframe * * Description: * Returns the current frame number * - *******************************************************************************/ + ****************************************************************************/ static int lpc214x_getframe(struct usbdev_s *dev) { @@ -3063,13 +3063,13 @@ static int lpc214x_getframe(struct usbdev_s *dev) #endif } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_wakeup * * Description: * Tries to wake up the host connected to this device * - *******************************************************************************/ + ****************************************************************************/ static int lpc214x_wakeup(struct usbdev_s *dev) { @@ -3089,13 +3089,13 @@ static int lpc214x_wakeup(struct usbdev_s *dev) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_selfpowered * * Description: * Sets/clears the device selfpowered feature * - *******************************************************************************/ + ****************************************************************************/ static int lpc214x_selfpowered(struct usbdev_s *dev, bool selfpowered) { @@ -3115,13 +3115,13 @@ static int lpc214x_selfpowered(struct usbdev_s *dev, bool selfpowered) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc214x_pullup * * Description: * Software-controlled connect to/disconnect from USB host * - *******************************************************************************/ + ****************************************************************************/ static int lpc214x_pullup(struct usbdev_s *dev, bool enable) { @@ -3135,11 +3135,11 @@ static int lpc214x_pullup(struct usbdev_s *dev, bool enable) return OK; } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_usbinitialize * * Description: @@ -3152,7 +3152,7 @@ static int lpc214x_pullup(struct usbdev_s *dev, bool enable) * and P0.23 and PO.31 in PINSEL1 must be configured for Vbus and USB connect * LED. * - *******************************************************************************/ + ****************************************************************************/ void up_usbinitialize(void) { @@ -3265,9 +3265,9 @@ errout: up_usbuninitialize(); } -/******************************************************************************* +/**************************************************************************** * Name: up_usbuninitialize - *******************************************************************************/ + ****************************************************************************/ void up_usbuninitialize(void) { @@ -3303,14 +3303,14 @@ void up_usbuninitialize(void) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: usbdev_register * * Description: * Register a USB device class driver. The class driver's bind() method will be * called to bind it to a USB device driver. * - *******************************************************************************/ + ****************************************************************************/ int usbdev_register(struct usbdevclass_driver_s *driver) { @@ -3354,7 +3354,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: usbdev_unregister * * Description: @@ -3362,7 +3362,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) * it will first disconnect(). The driver is also requested to unbind() and clean * up any device state, before this procedure finally returns. * - *******************************************************************************/ + ****************************************************************************/ int usbdev_unregister(struct usbdevclass_driver_s *driver) { diff --git a/arch/arm/src/lpc2378/lpc23xx_i2c.c b/arch/arm/src/lpc2378/lpc23xx_i2c.c index cffd08116b..af014e2da8 100644 --- a/arch/arm/src/lpc2378/lpc23xx_i2c.c +++ b/arch/arm/src/lpc2378/lpc23xx_i2c.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/lpc2378/lpc23xx_i2c.c * * Copyright (C) 2013 Li Zhuoyi. All rights reserved. @@ -44,11 +44,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -153,13 +153,13 @@ struct i2c_ops_s lpc23xx_i2c_ops = #endif }; -/******************************************************************************* +/**************************************************************************** * Name: lpc23xx_i2c_setfrequency * * Description: * Set the frequence for the next transfer * - *******************************************************************************/ + ****************************************************************************/ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) { @@ -189,13 +189,13 @@ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) return frequency; } -/******************************************************************************* +/**************************************************************************** * Name: lpc23xx_i2c_setaddress * * Description: * Set the I2C slave address for a subsequent read/write * - *******************************************************************************/ + ****************************************************************************/ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) { @@ -210,14 +210,14 @@ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc23xx_i2c_write * * Description: * Send a block of data on I2C using the previously selected I2C * frequency and slave address. * - *******************************************************************************/ + ****************************************************************************/ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int buflen) { @@ -237,14 +237,14 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int bufle return ret >0 ? OK : -ETIMEDOUT; } -/******************************************************************************* +/**************************************************************************** * Name: lpc23xx_i2c_read * * Description: * Receive a block of data on I2C using the previously selected I2C * frequency and slave address. * - *******************************************************************************/ + ****************************************************************************/ static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen) { @@ -264,13 +264,13 @@ static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen) return ret > 0 ? OK : -ETIMEDOUT; } -/******************************************************************************* +/**************************************************************************** * Name: i2c_start * * Description: * Perform a I2C transfer start * - *******************************************************************************/ + ****************************************************************************/ static int i2c_start (struct lpc23xx_i2cdev_s *priv) { @@ -300,13 +300,13 @@ static int i2c_start (struct lpc23xx_i2cdev_s *priv) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: i2c_stop * * Description: * Perform a I2C transfer stop * - *******************************************************************************/ + ****************************************************************************/ static void i2c_stop (struct lpc23xx_i2cdev_s *priv) { @@ -318,13 +318,13 @@ static void i2c_stop (struct lpc23xx_i2cdev_s *priv) sem_post (&priv->wait); } -/******************************************************************************* +/**************************************************************************** * Name: i2c_timeout * * Description: * Watchdog timer for timeout of I2C operation * - *******************************************************************************/ + ****************************************************************************/ static void i2c_timeout (int argc, uint32_t arg, ...) { @@ -336,13 +336,13 @@ static void i2c_timeout (int argc, uint32_t arg, ...) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: i2c_interrupt * * Description: * The I2C Interrupt Handler * - *******************************************************************************/ + ****************************************************************************/ static int i2c_interrupt (int irq, FAR void *context) { @@ -447,13 +447,13 @@ static int i2c_interrupt (int irq, FAR void *context) /**************************************************************************** * Public Functions ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_i2cinitialize * * Description: * Initialise an I2C device * - *******************************************************************************/ + ****************************************************************************/ struct i2c_dev_s *up_i2cinitialize(int port) { @@ -586,13 +586,13 @@ struct i2c_dev_s *up_i2cinitialize(int port) return &priv->dev; } -/******************************************************************************* +/**************************************************************************** * Name: up_i2cuninitalize * * Description: * Uninitialise an I2C device * - *******************************************************************************/ + ****************************************************************************/ int up_i2cuninitialize(FAR struct i2c_dev_s * dev) { diff --git a/arch/arm/src/lpc31xx/lpc31_ehci.c b/arch/arm/src/lpc31xx/lpc31_ehci.c index 9250679b38..adbf4dda20 100644 --- a/arch/arm/src/lpc31xx/lpc31_ehci.c +++ b/arch/arm/src/lpc31xx/lpc31_ehci.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/lpc31xx/lpc31_ehci.c * * Copyright (C) 2013-2015 Gregory Nutt. All rights reserved. @@ -32,11 +32,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -69,9 +69,9 @@ #if defined(CONFIG_LPC31_USBOTG) && defined(CONFIG_USBHOST) -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ /* Pre-requisites */ @@ -195,9 +195,9 @@ #define RHPNDX(rh) ((rh)->hport.hport.port) #define RHPORT(rh) (RHPNDX(rh)+1) -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* Internal representation of the EHCI Queue Head (QH) */ struct lpc31_epinfo_s; @@ -397,9 +397,9 @@ struct lpc31_ehci_trace_s #endif /* HAVE_USBHOST_TRACE */ -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Register operations ********************************************************/ @@ -564,9 +564,9 @@ static void lpc31_disconnect(FAR struct usbhost_driver_s *drvr, static int lpc31_reset(void); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ /* In this driver implementation, support is provided for only a single a single * USB device. All status information can be simply retained in a single global * instance. @@ -705,19 +705,19 @@ static const struct lpc31_ehci_trace_s g_trace2[TRACE2_NSTRINGS] = }; #endif /* HAVE_USBHOST_TRACE */ -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Register Operations - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: lpc31_read16 * * Description: * Read 16-bit little endian data * - *******************************************************************************/ + ****************************************************************************/ static uint16_t lpc31_read16(const uint8_t *addr) { @@ -728,13 +728,13 @@ static uint16_t lpc31_read16(const uint8_t *addr) #endif } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_read32 * * Description: * Read 32-bit little endian data * - *******************************************************************************/ + ****************************************************************************/ static inline uint32_t lpc31_read32(const uint8_t *addr) { @@ -747,13 +747,13 @@ static inline uint32_t lpc31_read32(const uint8_t *addr) #endif } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_write16 * * Description: * Write 16-bit little endian data * - *******************************************************************************/ + ****************************************************************************/ #if 0 /* Not used */ static void lpc31_write16(uint16_t memval, uint8_t *addr) @@ -768,13 +768,13 @@ static void lpc31_write16(uint16_t memval, uint8_t *addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_write32 * * Description: * Write 32-bit little endian data * - *******************************************************************************/ + ****************************************************************************/ #if 0 /* Not used */ static void lpc31_write32(uint32_t memval, uint8_t *addr) @@ -789,13 +789,13 @@ static void lpc31_write32(uint32_t memval, uint8_t *addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_swap16 * * Description: * Swap bytes on a 16-bit value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ENDIAN_BIG static uint16_t lpc31_swap16(uint16_t value) @@ -804,13 +804,13 @@ static uint16_t lpc31_swap16(uint16_t value) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_swap32 * * Description: * Swap bytes on a 32-bit value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ENDIAN_BIG static uint32_t lpc31_swap32(uint32_t value) @@ -820,13 +820,13 @@ static uint32_t lpc31_swap32(uint32_t value) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_printreg * * Description: * Print the contents of a LPC31 EHCI register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC31_EHCI_REGDEBUG static void lpc31_printreg(volatile uint32_t *regaddr, uint32_t regval, @@ -836,14 +836,14 @@ static void lpc31_printreg(volatile uint32_t *regaddr, uint32_t regval, } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_checkreg * * Description: * Check if it is time to output debug information for accesses to a LPC31 * EHCI register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC31_EHCI_REGDEBUG static void lpc31_checkreg(volatile uint32_t *regaddr, uint32_t regval, bool iswrite) @@ -901,13 +901,13 @@ static void lpc31_checkreg(volatile uint32_t *regaddr, uint32_t regval, bool isw } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_getreg * * Description: * Get the contents of an LPC31 register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC31_EHCI_REGDEBUG static uint32_t lpc31_getreg(volatile uint32_t *regaddr) @@ -928,13 +928,13 @@ static inline uint32_t lpc31_getreg(volatile uint32_t *regaddr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_putreg * * Description: * Set the contents of an LPC31 register to a value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC31_EHCI_REGDEBUG static void lpc31_putreg(uint32_t regval, volatile uint32_t *regaddr) @@ -954,7 +954,7 @@ static inline void lpc31_putreg(uint32_t regval, volatile uint32_t *regaddr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: ehci_wait_usbsts * * Description: @@ -962,7 +962,7 @@ static inline void lpc31_putreg(uint32_t regval, volatile uint32_t *regaddr) * value, (2) for a timeout to occur, or (3) a error to occur. Return * a value to indicate which terminated the wait. * - *******************************************************************************/ + ****************************************************************************/ static int ehci_wait_usbsts(uint32_t maskbits, uint32_t donebits, unsigned int delay) @@ -1004,17 +1004,17 @@ static int ehci_wait_usbsts(uint32_t maskbits, uint32_t donebits, return (regval == donebits) ? OK : -ETIMEDOUT; } -/******************************************************************************* +/**************************************************************************** * Semaphores - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: lpc31_takesem * * Description: * This is just a wrapper to handle the annoying behavior of semaphore * waits that return due to the receipt of a signal. * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_takesem(sem_t *sem) { @@ -1030,10 +1030,10 @@ static void lpc31_takesem(sem_t *sem) } } -/******************************************************************************* +/**************************************************************************** * Allocators - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: lpc31_qh_alloc * * Description: @@ -1041,7 +1041,7 @@ static void lpc31_takesem(sem_t *sem) * * Assumption: Caller holds the exclsem * - *******************************************************************************/ + ****************************************************************************/ static struct lpc31_qh_s *lpc31_qh_alloc(void) { @@ -1059,7 +1059,7 @@ static struct lpc31_qh_s *lpc31_qh_alloc(void) return qh; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qh_free * * Description: @@ -1067,7 +1067,7 @@ static struct lpc31_qh_s *lpc31_qh_alloc(void) * * Assumption: Caller holds the exclsem * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_qh_free(struct lpc31_qh_s *qh) { @@ -1079,7 +1079,7 @@ static void lpc31_qh_free(struct lpc31_qh_s *qh) g_ehci.qhfree = entry; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qtd_alloc * * Description: @@ -1088,7 +1088,7 @@ static void lpc31_qh_free(struct lpc31_qh_s *qh) * * Assumption: Caller holds the exclsem * - *******************************************************************************/ + ****************************************************************************/ static struct lpc31_qtd_s *lpc31_qtd_alloc(void) { @@ -1106,7 +1106,7 @@ static struct lpc31_qtd_s *lpc31_qtd_alloc(void) return qtd; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qtd_free * * Description: @@ -1115,7 +1115,7 @@ static struct lpc31_qtd_s *lpc31_qtd_alloc(void) * * Assumption: Caller holds the exclsem * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_qtd_free(struct lpc31_qtd_s *qtd) { @@ -1127,11 +1127,11 @@ static void lpc31_qtd_free(struct lpc31_qtd_s *qtd) g_ehci.qtdfree = entry; } -/******************************************************************************* +/**************************************************************************** * List Management - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qh_foreach * * Description: @@ -1139,7 +1139,7 @@ static void lpc31_qtd_free(struct lpc31_qtd_s *qtd) * handler for each QH structure in the list (including the one at the head * of the list). * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_qh_foreach(struct lpc31_qh_s *qh, uint32_t **bp, foreach_qh_t handler, void *arg) @@ -1211,14 +1211,14 @@ static int lpc31_qh_foreach(struct lpc31_qh_s *qh, uint32_t **bp, foreach_qh_t h return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qtd_foreach * * Description: * Give a Queue Head (QH) instance, call the handler for each qTD structure * in the queue. * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_qtd_foreach(struct lpc31_qh_s *qh, foreach_qtd_t handler, void *arg) { @@ -1292,14 +1292,14 @@ static int lpc31_qtd_foreach(struct lpc31_qh_s *qh, foreach_qtd_t handler, void return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qtd_discard * * Description: * This is a lpc31_qtd_foreach callback. It simply unlinks the QTD, updates * the back pointer, and frees the QTD structure. * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_qtd_discard(struct lpc31_qtd_s *qtd, uint32_t **bp, void *arg) { @@ -1318,7 +1318,7 @@ static int lpc31_qtd_discard(struct lpc31_qtd_s *qtd, uint32_t **bp, void *arg) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qh_discard * * Description: @@ -1328,7 +1328,7 @@ static int lpc31_qtd_discard(struct lpc31_qtd_s *qtd, uint32_t **bp, void *arg) * The QH structure itself has already been unlinked from whatever list it * may have been in. * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_qh_discard(struct lpc31_qh_s *qh) { @@ -1350,18 +1350,18 @@ static int lpc31_qh_discard(struct lpc31_qh_s *qh) return ret; } -/******************************************************************************* +/**************************************************************************** * Cache Operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qtd_invalidate * * Description: * This is a callback from lpc31_qtd_foreach. It simply invalidates D-cache for * address range of the qTD entry. * - *******************************************************************************/ + ****************************************************************************/ #if 0 /* Not used */ static int lpc31_qtd_invalidate(struct lpc31_qtd_s *qtd, uint32_t **bp, void *arg) @@ -1376,13 +1376,13 @@ static int lpc31_qtd_invalidate(struct lpc31_qtd_s *qtd, uint32_t **bp, void *ar } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qh_invalidate * * Description: * Invalidate the Queue Head and all qTD entries in the queue. * - *******************************************************************************/ + ****************************************************************************/ #if 0 /* Not used */ static int lpc31_qh_invalidate(struct lpc31_qh_s *qh) @@ -1398,14 +1398,14 @@ static int lpc31_qh_invalidate(struct lpc31_qh_s *qh) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qtd_flush * * Description: * This is a callback from lpc31_qtd_foreach. It simply flushes D-cache for * address range of the qTD entry. * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_qtd_flush(struct lpc31_qtd_s *qtd, uint32_t **bp, void *arg) { @@ -1422,13 +1422,13 @@ static int lpc31_qtd_flush(struct lpc31_qtd_s *qtd, uint32_t **bp, void *arg) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qh_flush * * Description: * Invalidate the Queue Head and all qTD entries in the queue. * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_qh_flush(struct lpc31_qh_s *qh) { @@ -1447,17 +1447,17 @@ static int lpc31_qh_flush(struct lpc31_qh_s *qh) return lpc31_qtd_foreach(qh, lpc31_qtd_flush, NULL); } -/******************************************************************************* +/**************************************************************************** * Endpoint Transfer Handling - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qtd_print * * Description: * Print the context of one qTD * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC31_EHCI_REGDEBUG static void lpc31_qtd_print(struct lpc31_qtd_s *qtd) @@ -1472,13 +1472,13 @@ static void lpc31_qtd_print(struct lpc31_qtd_s *qtd) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qh_print * * Description: * Print the context of one QH * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC31_EHCI_REGDEBUG static void lpc31_qh_print(struct lpc31_qh_s *qh) @@ -1514,14 +1514,14 @@ static void lpc31_qh_print(struct lpc31_qh_s *qh) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qtd_dump * * Description: * This is a lpc31_qtd_foreach callout function. It dumps the context of one * qTD * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC31_EHCI_REGDEBUG static int lpc31_qtd_dump(struct lpc31_qtd_s *qtd, uint32_t **bp, void *arg) @@ -1531,14 +1531,14 @@ static int lpc31_qtd_dump(struct lpc31_qtd_s *qtd, uint32_t **bp, void *arg) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qh_dump * * Description: * This is a lpc31_qh_foreach callout function. It dumps a QH structure and * all of the qTD structures linked to the QH. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC31_EHCI_REGDEBUG static int lpc31_qh_dump(struct lpc31_qh_s *qh, uint32_t **bp, void *arg) @@ -1548,14 +1548,14 @@ static int lpc31_qh_dump(struct lpc31_qh_s *qh, uint32_t **bp, void *arg) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_ehci_speed * * Description: * Map a speed enumeration value per Chapter 9 of the USB specification to the * speed enumeration required in the EHCI queue head. * - *******************************************************************************/ + ****************************************************************************/ static inline uint8_t lpc31_ehci_speed(uint8_t usbspeed) { @@ -1563,7 +1563,7 @@ static inline uint8_t lpc31_ehci_speed(uint8_t usbspeed) return g_ehci_speed[usbspeed]; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_ioc_setup * * Description: @@ -1574,7 +1574,7 @@ static inline uint8_t lpc31_ehci_speed(uint8_t usbspeed) * * Assumption: The caller holds tex EHCI exclsem * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_ioc_setup(struct lpc31_rhport_s *rhport, struct lpc31_epinfo_s *epinfo) { @@ -1611,7 +1611,7 @@ static int lpc31_ioc_setup(struct lpc31_rhport_s *rhport, struct lpc31_epinfo_s return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_ioc_wait * * Description: @@ -1620,7 +1620,7 @@ static int lpc31_ioc_setup(struct lpc31_rhport_s *rhport, struct lpc31_epinfo_s * Assumption: The caller does *NOT* hold the EHCI exclsem. That would cause * a deadlock when the bottom-half, worker thread needs to take the semaphore. * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_ioc_wait(struct lpc31_epinfo_s *epinfo) { @@ -1634,7 +1634,7 @@ static int lpc31_ioc_wait(struct lpc31_epinfo_s *epinfo) return epinfo->result; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qh_enqueue * * Description: @@ -1642,7 +1642,7 @@ static int lpc31_ioc_wait(struct lpc31_epinfo_s *epinfo) * * Assumptions: The caller holds the EHCI exclsem * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_qh_enqueue(struct lpc31_qh_s *qhead, struct lpc31_qh_s *qh) { @@ -1675,13 +1675,13 @@ static void lpc31_qh_enqueue(struct lpc31_qh_s *qhead, struct lpc31_qh_s *qh) (uintptr_t)&qhead->hw + sizeof(struct ehci_qh_s)); } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qh_create * * Description: * Create a new Queue Head (QH) * - *******************************************************************************/ + ****************************************************************************/ static struct lpc31_qh_s *lpc31_qh_create(struct lpc31_rhport_s *rhport, struct lpc31_epinfo_s *epinfo) @@ -1812,13 +1812,13 @@ static struct lpc31_qh_s *lpc31_qh_create(struct lpc31_rhport_s *rhport, return qh; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qtd_addbpl * * Description: * Add a buffer pointer list to a qTD. * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_qtd_addbpl(struct lpc31_qtd_s *qtd, const void *buffer, size_t buflen) { @@ -1888,13 +1888,13 @@ static int lpc31_qtd_addbpl(struct lpc31_qtd_s *qtd, const void *buffer, size_t return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qtd_setupphase * * Description: * Create a SETUP phase request qTD. * - *******************************************************************************/ + ****************************************************************************/ static struct lpc31_qtd_s *lpc31_qtd_setupphase(struct lpc31_epinfo_s *epinfo, const struct usb_ctrlreq_s *req) @@ -1955,13 +1955,13 @@ static struct lpc31_qtd_s *lpc31_qtd_setupphase(struct lpc31_epinfo_s *epinfo, return qtd; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qtd_dataphase * * Description: * Create a data transfer or SET data phase qTD. * - *******************************************************************************/ + ****************************************************************************/ static struct lpc31_qtd_s *lpc31_qtd_dataphase(struct lpc31_epinfo_s *epinfo, void *buffer, int buflen, @@ -2023,13 +2023,13 @@ static struct lpc31_qtd_s *lpc31_qtd_dataphase(struct lpc31_epinfo_s *epinfo, return qtd; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qtd_statusphase * * Description: * Create a STATUS phase request qTD. * - *******************************************************************************/ + ****************************************************************************/ static struct lpc31_qtd_s *lpc31_qtd_statusphase(uint32_t tokenbits) { @@ -2072,7 +2072,7 @@ static struct lpc31_qtd_s *lpc31_qtd_statusphase(uint32_t tokenbits) return qtd; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_async_setup * * Description: @@ -2090,7 +2090,7 @@ static struct lpc31_qtd_s *lpc31_qtd_statusphase(uint32_t tokenbits) * Zero (OK) is returned on success; a negated errno value is return on * any failure. * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_async_setup(struct lpc31_rhport_s *rhport, struct lpc31_epinfo_s *epinfo, @@ -2325,7 +2325,7 @@ errout_with_qh: return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_intr_setup * * Description: @@ -2371,7 +2371,7 @@ errout_with_qh: * Zero (OK) is returned on success; a negated errno value is return on * any failure. * - *******************************************************************************/ + ****************************************************************************/ #ifndef CONFIG_USBHOST_INT_DISABLE static int lpc31_intr_setup(struct lpc31_rhport_s *rhport, @@ -2463,7 +2463,7 @@ errout_with_qh: } #endif /* CONFIG_USBHOST_INT_DISABLE */ -/******************************************************************************* +/**************************************************************************** * Name: lpc31_transfer_wait * * Description: @@ -2480,7 +2480,7 @@ errout_with_qh: * plus the size of the data (which could be short); For bulk transfers, this * will be the number of data bytes transfers (which could be short). * - *******************************************************************************/ + ****************************************************************************/ static ssize_t lpc31_transfer_wait(struct lpc31_epinfo_s *epinfo) { @@ -2542,7 +2542,7 @@ static ssize_t lpc31_transfer_wait(struct lpc31_epinfo_s *epinfo) return epinfo->xfrd; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_ioc_async_setup * * Description: @@ -2560,7 +2560,7 @@ static ssize_t lpc31_transfer_wait(struct lpc31_epinfo_s *epinfo) * Assumptions: * - Called from the interrupt level * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static inline int lpc31_ioc_async_setup(struct lpc31_rhport_s *rhport, @@ -2596,7 +2596,7 @@ static inline int lpc31_ioc_async_setup(struct lpc31_rhport_s *rhport, } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_asynch_completion * * Description: @@ -2613,7 +2613,7 @@ static inline int lpc31_ioc_async_setup(struct lpc31_rhport_s *rhport, * Assumptions: * - Called from the interrupt level * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static void lpc31_asynch_completion(struct lpc31_epinfo_s *epinfo) @@ -2651,11 +2651,11 @@ static void lpc31_asynch_completion(struct lpc31_epinfo_s *epinfo) } #endif -/******************************************************************************* +/**************************************************************************** * EHCI Interrupt Handling - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qtd_ioccheck * * Description: @@ -2663,7 +2663,7 @@ static void lpc31_asynch_completion(struct lpc31_epinfo_s *epinfo) * qTD in the asynchronous queue. It removes all of the qTD structures that * are no longer active. * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_qtd_ioccheck(struct lpc31_qtd_s *qtd, uint32_t **bp, void *arg) { @@ -2702,7 +2702,7 @@ static int lpc31_qtd_ioccheck(struct lpc31_qtd_s *qtd, uint32_t **bp, void *arg) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qh_ioccheck * * Description: @@ -2711,7 +2711,7 @@ static int lpc31_qtd_ioccheck(struct lpc31_qtd_s *qtd, uint32_t **bp, void *arg) * remove all of the structures that are no longer active. if all of the * qTD structures are removed, then QH itself will also be removed. * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_qh_ioccheck(struct lpc31_qh_s *qh, uint32_t **bp, void *arg) { @@ -2861,14 +2861,14 @@ static int lpc31_qh_ioccheck(struct lpc31_qh_s *qh, uint32_t **bp, void *arg) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qtd_cancel * * Description: * This function is a lpc31_qtd_foreach() callback function. It removes each * qTD attached to a QH. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int lpc31_qtd_cancel(struct lpc31_qtd_s *qtd, uint32_t **bp, void *arg) @@ -2900,7 +2900,7 @@ static int lpc31_qtd_cancel(struct lpc31_qtd_s *qtd, uint32_t **bp, void *arg) } #endif /* CONFIG_USBHOST_ASYNCH */ -/******************************************************************************* +/**************************************************************************** * Name: lpc31_qh_cancel * * Description: @@ -2909,7 +2909,7 @@ static int lpc31_qtd_cancel(struct lpc31_qtd_s *qtd, uint32_t **bp, void *arg) * and remove all of the structures that are no longer active. Then QH * itself will also be removed. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int lpc31_qh_cancel(struct lpc31_qh_s *qh, uint32_t **bp, void *arg) @@ -2975,7 +2975,7 @@ static int lpc31_qh_cancel(struct lpc31_qh_s *qh, uint32_t **bp, void *arg) } #endif /* CONFIG_USBHOST_ASYNCH */ -/******************************************************************************* +/**************************************************************************** * Name: lpc31_ioc_bottomhalf * * Description: @@ -2991,7 +2991,7 @@ static int lpc31_qh_cancel(struct lpc31_qh_s *qh, uint32_t **bp, void *arg) * * Assumptions: The caller holds the EHCI exclsem * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc31_ioc_bottomhalf(void) { @@ -3057,7 +3057,7 @@ static inline void lpc31_ioc_bottomhalf(void) #endif } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_portsc_bottomhalf * * Description: @@ -3077,7 +3077,7 @@ static inline void lpc31_ioc_bottomhalf(void) * bits (including: Force port resume, over-current change, enable/disable * change and connect status change)." * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc31_portsc_bottomhalf(void) { @@ -3180,7 +3180,7 @@ static inline void lpc31_portsc_bottomhalf(void) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_syserr_bottomhalf * * Description: @@ -3191,7 +3191,7 @@ static inline void lpc31_portsc_bottomhalf(void) * error occurs, the Host Controller clears the Run/Stop bit in the Command * register to prevent further execution of the scheduled TDs." * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc31_syserr_bottomhalf(void) { @@ -3199,7 +3199,7 @@ static inline void lpc31_syserr_bottomhalf(void) PANIC(); } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_async_advance_bottomhalf * * Description: @@ -3211,7 +3211,7 @@ static inline void lpc31_syserr_bottomhalf(void) * register. This status bit indicates the assertion of that interrupt * source." * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc31_async_advance_bottomhalf(void) { @@ -3220,13 +3220,13 @@ static inline void lpc31_async_advance_bottomhalf(void) /* REVISIT: Could remove all tagged QH entries here */ } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_ehci_bottomhalf * * Description: * EHCI "Bottom Half" interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_ehci_bottomhalf(FAR void *arg) { @@ -3354,13 +3354,13 @@ static void lpc31_ehci_bottomhalf(FAR void *arg) lpc31_putreg(EHCI_HANDLED_INTS, &HCOR->usbintr); } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_ehci_interrupt * * Description: * EHCI "Top Half" interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_ehci_interrupt(int irq, FAR void *context) { @@ -3412,10 +3412,10 @@ static int lpc31_ehci_interrupt(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * USB Host Controller Operations - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: lpc31_wait * * Description: @@ -3438,7 +3438,7 @@ static int lpc31_ehci_interrupt(int irq, FAR void *context) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_wait(FAR struct usbhost_connection_s *conn, FAR struct usbhost_hubport_s **hport) @@ -3510,7 +3510,7 @@ static int lpc31_wait(FAR struct usbhost_connection_s *conn, } } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_enumerate * * Description: @@ -3536,7 +3536,7 @@ static int lpc31_wait(FAR struct usbhost_connection_s *conn, * Assumptions: * This function will *not* be called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_rh_enumerate(FAR struct usbhost_connection_s *conn, FAR struct usbhost_hubport_s *hport) @@ -3981,7 +3981,7 @@ static int lpc31_epfree(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_alloc * * Description: @@ -4011,7 +4011,7 @@ static int lpc31_epfree(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_alloc(FAR struct usbhost_driver_s *drvr, FAR uint8_t **buffer, FAR size_t *maxlen) @@ -4034,7 +4034,7 @@ static int lpc31_alloc(FAR struct usbhost_driver_s *drvr, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_free * * Description: @@ -4055,7 +4055,7 @@ static int lpc31_alloc(FAR struct usbhost_driver_s *drvr, * Assumptions: * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_free(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) { @@ -4143,7 +4143,7 @@ static int lpc31_iofree(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_ctrlin and lpc31_ctrlout * * Description: @@ -4177,7 +4177,7 @@ static int lpc31_iofree(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, FAR const struct usb_ctrlreq_s *req, @@ -4249,7 +4249,7 @@ static int lpc31_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, return lpc31_ctrlin(drvr, ep0, req, (uint8_t *)buffer); } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_transfer * * Description: @@ -4285,7 +4285,7 @@ static int lpc31_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static ssize_t lpc31_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, FAR uint8_t *buffer, size_t buflen) @@ -4355,7 +4355,7 @@ errout_with_sem: return (ssize_t)ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_asynch * * Description: @@ -4388,7 +4388,7 @@ errout_with_sem: * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int lpc31_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, @@ -4706,7 +4706,7 @@ static int lpc31_connect(FAR struct usbhost_driver_s *drvr, } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_disconnect * * Description: @@ -4729,7 +4729,7 @@ static int lpc31_connect(FAR struct usbhost_driver_s *drvr, * - Only a single class bound to a single device is supported. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_disconnect(FAR struct usbhost_driver_s *drvr, FAR struct usbhost_hubport_s *hport) @@ -4738,10 +4738,10 @@ static void lpc31_disconnect(FAR struct usbhost_driver_s *drvr, hport->devclass = NULL; } -/******************************************************************************* +/**************************************************************************** * Initialization - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: lpc31_reset * * Description: @@ -4781,7 +4781,7 @@ static void lpc31_disconnect(FAR struct usbhost_driver_s *drvr, * Assumptions: * - Called during the initialization of the EHCI. * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_reset(void) { @@ -4855,10 +4855,10 @@ static int lpc31_reset(void) return (regval & EHCI_USBCMD_HCRESET) != 0 ? -ETIMEDOUT : OK; } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: lpc31_ehci_initialize * * Description: @@ -4881,7 +4881,7 @@ static int lpc31_reset(void) * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - *******************************************************************************/ + ****************************************************************************/ FAR struct usbhost_connection_s *lpc31_ehci_initialize(int controller) { diff --git a/arch/arm/src/lpc31xx/lpc31_i2c.c b/arch/arm/src/lpc31xx/lpc31_i2c.c index c29a28ab56..bb70f7b6aa 100644 --- a/arch/arm/src/lpc31xx/lpc31_i2c.c +++ b/arch/arm/src/lpc31xx/lpc31_i2c.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/lpc31xx/lpc31_i2c.c * * Author: David Hewson @@ -33,11 +33,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -64,9 +64,9 @@ #include "lpc31_evntrtr.h" #include "lpc31_syscreg.h" -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Pre-processor Definitions @@ -142,13 +142,13 @@ struct i2c_ops_s lpc31_i2c_ops = #endif }; -/******************************************************************************* +/**************************************************************************** * Name: up_i2cinitialize * * Description: * Initialise an I2C device * - *******************************************************************************/ + ****************************************************************************/ struct i2c_dev_s *up_i2cinitialize(int port) { @@ -191,13 +191,13 @@ struct i2c_dev_s *up_i2cinitialize(int port) return &priv->dev; } -/******************************************************************************* +/**************************************************************************** * Name: up_i2cuninitalize * * Description: * Uninitialise an I2C device * - *******************************************************************************/ + ****************************************************************************/ void up_i2cuninitalize(struct lpc31_i2cdev_s *priv) { @@ -218,13 +218,13 @@ void up_i2cuninitalize(struct lpc31_i2cdev_s *priv) lpc31_disableclock(priv->clkid); } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_i2c_setfrequency * * Description: * Set the frequence for the next transfer * - *******************************************************************************/ + ****************************************************************************/ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) { @@ -252,13 +252,13 @@ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) return frequency; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_i2c_setaddress * * Description: * Set the I2C slave address for a subsequent read/write * - *******************************************************************************/ + ****************************************************************************/ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) { @@ -273,14 +273,14 @@ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_i2c_write * * Description: * Send a block of data on I2C using the previously selected I2C * frequency and slave address. * - *******************************************************************************/ + ****************************************************************************/ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int buflen) { @@ -298,14 +298,14 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int bufle return ret == 1 ? OK : -ETIMEDOUT; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_i2c_read * * Description: * Receive a block of data on I2C using the previously selected I2C * frequency and slave address. * - *******************************************************************************/ + ****************************************************************************/ static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen) { @@ -323,13 +323,13 @@ static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen) return ret == 1 ? OK : -ETIMEDOUT; } -/******************************************************************************* +/**************************************************************************** * Name: i2c_transfer * * Description: * Perform a sequence of I2C transfers * - *******************************************************************************/ + ****************************************************************************/ static int i2c_transfer(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *msgs, int count) { @@ -367,13 +367,13 @@ static int i2c_transfer(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *msgs, i return ret; } -/******************************************************************************* +/**************************************************************************** * Name: i2c_interrupt * * Description: * The I2C Interrupt Handler * - *******************************************************************************/ + ****************************************************************************/ static int i2c_interrupt(int irq, FAR void *context) { @@ -390,13 +390,13 @@ static int i2c_interrupt(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: i2c_progress * * Description: * Progress any remaining I2C transfers * - *******************************************************************************/ + ****************************************************************************/ static void i2c_progress(struct lpc31_i2cdev_s *priv) { @@ -589,13 +589,13 @@ out: } } -/******************************************************************************* +/**************************************************************************** * Name: i2c_timeout * * Description: * Watchdog timer for timeout of I2C operation * - *******************************************************************************/ + ****************************************************************************/ static void i2c_timeout(int argc, uint32_t arg, ...) { @@ -630,13 +630,13 @@ static void i2c_timeout(int argc, uint32_t arg, ...) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: i2c_reset * * Description: * Perform a soft reset of the I2C controller * - *******************************************************************************/ + ****************************************************************************/ static void i2c_reset(struct lpc31_i2cdev_s *priv) { putreg32(I2C_CTRL_RESET, priv->base + LPC31_I2C_CTRL_OFFSET); diff --git a/arch/arm/src/lpc31xx/lpc31_usbdev.c b/arch/arm/src/lpc31xx/lpc31_usbdev.c index caac897092..a2e4386169 100644 --- a/arch/arm/src/lpc31xx/lpc31_usbdev.c +++ b/arch/arm/src/lpc31xx/lpc31_usbdev.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/lpc31xx/lpc31_usbdev.c * * Authors: David Hewson @@ -36,11 +36,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -69,9 +69,9 @@ #include "lpc31_evntrtr.h" #include "lpc31_syscreg.h" -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ @@ -255,9 +255,9 @@ struct lpc31_dqh_s #define lpc31_rqempty(ep) ((ep)->head == NULL) #define lpc31_rqpeek(ep) ((ep)->head) -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* A container for a request so that the request may be retained in a list */ @@ -333,9 +333,9 @@ struct lpc31_usbdev_s #define EP0STATE_DATA_IN 8 #define EP0STATE_DATA_OUT 9 -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Register operations ********************************************************/ @@ -422,9 +422,9 @@ static int lpc31_wakeup(struct usbdev_s *dev); static int lpc31_selfpowered(struct usbdev_s *dev, bool selfpowered); static int lpc31_pullup(struct usbdev_s *dev, bool enable); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ /* Since there is only a single USB interface, all status information can be * be simply retained in a single global instance. @@ -460,21 +460,21 @@ static const struct usbdev_ops_s g_devops = .pullup = lpc31_pullup, }; -/******************************************************************************* +/**************************************************************************** * Public Data - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc31_getreg * * Description: * Get the contents of an LPC313x register * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_LPC31_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static uint32_t lpc31_getreg(uint32_t addr) @@ -530,13 +530,13 @@ static uint32_t lpc31_getreg(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_putreg * * Description: * Set the contents of an LPC313x register to a value * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_LPC31_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static void lpc31_putreg(uint32_t val, uint32_t addr) @@ -551,13 +551,13 @@ static void lpc31_putreg(uint32_t val, uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_clrbits * * Description: * Clear bits in a register * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc31_clrbits(uint32_t mask, uint32_t addr) { @@ -566,13 +566,13 @@ static inline void lpc31_clrbits(uint32_t mask, uint32_t addr) lpc31_putreg(reg, addr); } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_setbits * * Description: * Set bits in a register * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc31_setbits(uint32_t mask, uint32_t addr) { @@ -581,13 +581,13 @@ static inline void lpc31_setbits(uint32_t mask, uint32_t addr) lpc31_putreg(reg, addr); } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_chgbits * * Description: * Change bits in a register * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc31_chgbits(uint32_t mask, uint32_t val, uint32_t addr) { @@ -597,13 +597,13 @@ static inline void lpc31_chgbits(uint32_t mask, uint32_t val, uint32_t addr) lpc31_putreg(reg, addr); } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_rqdequeue * * Description: * Remove a request from an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static FAR struct lpc31_req_s *lpc31_rqdequeue(FAR struct lpc31_ep_s *privep) { @@ -623,13 +623,13 @@ static FAR struct lpc31_req_s *lpc31_rqdequeue(FAR struct lpc31_ep_s *privep) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_rqenqueue * * Description: * Add a request from an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static bool lpc31_rqenqueue(FAR struct lpc31_ep_s *privep, FAR struct lpc31_req_s *req) @@ -650,13 +650,13 @@ static bool lpc31_rqenqueue(FAR struct lpc31_ep_s *privep, return is_empty; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_writedtd * * Description: * Initialise a DTD to transfer the data * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc31_writedtd(struct lpc31_dtd_s *dtd, const uint8_t *data, uint32_t nbytes) { @@ -670,13 +670,13 @@ static inline void lpc31_writedtd(struct lpc31_dtd_s *dtd, const uint8_t *data, dtd->xfer_len = nbytes; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_queuedtd * * Description: * Add the DTD to the device list * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_queuedtd(uint8_t epphy, struct lpc31_dtd_s *dtd) { @@ -694,13 +694,13 @@ static void lpc31_queuedtd(uint8_t epphy, struct lpc31_dtd_s *dtd) ; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_ep0xfer * * Description: * Schedule a short transfer for Endpoint 0 (IN or OUT) * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc31_ep0xfer(uint8_t epphy, uint8_t *buf, uint32_t nbytes) { @@ -711,13 +711,13 @@ static inline void lpc31_ep0xfer(uint8_t epphy, uint8_t *buf, uint32_t nbytes) lpc31_queuedtd(epphy, dtd); } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_readsetup * * Description: * Read a Setup packet from the DTD. * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_readsetup(uint8_t epphy, struct usb_ctrlreq_s *ctrl) { struct lpc31_dqh_s *dqh = &g_qh[epphy]; @@ -740,13 +740,13 @@ static void lpc31_readsetup(uint8_t epphy, struct usb_ctrlreq_s *ctrl) lpc31_putreg (LPC31_ENDPTMASK(LPC31_EP0_OUT), LPC31_USBDEV_ENDPTSETUPSTAT); } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_set_address * * Description: * Set the devices USB address * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc31_set_address(struct lpc31_usbdev_s *priv, uint16_t address) { @@ -757,13 +757,13 @@ static inline void lpc31_set_address(struct lpc31_usbdev_s *priv, uint16_t addre LPC31_USBDEV_DEVICEADDR); } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_flushep * * Description: * Flush any primed descriptors from this ep * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_flushep(struct lpc31_ep_s *privep) { @@ -778,13 +778,13 @@ static void lpc31_flushep(struct lpc31_ep_s *privep) } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_progressep * * Description: * Progress the Endpoint by priming the first request into the queue head * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_progressep(struct lpc31_ep_s *privep) { @@ -843,13 +843,13 @@ static int lpc31_progressep(struct lpc31_ep_s *privep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_abortrequest * * Description: * Discard a request * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc31_abortrequest(struct lpc31_ep_s *privep, struct lpc31_req_s *privreq, @@ -866,13 +866,13 @@ static inline void lpc31_abortrequest(struct lpc31_ep_s *privep, privreq->req.callback(&privep->ep, &privreq->req); } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_reqcomplete * * Description: * Handle termination of the request at the head of the endpoint request queue. * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_reqcomplete(struct lpc31_ep_s *privep, struct lpc31_req_s *privreq, int16_t result) @@ -898,13 +898,13 @@ static void lpc31_reqcomplete(struct lpc31_ep_s *privep, privep->stalled = stalled; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_cancelrequests * * Description: * Cancel all pending requests for an endpoint * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_cancelrequests(struct lpc31_ep_s *privep, int16_t status) { @@ -921,14 +921,14 @@ static void lpc31_cancelrequests(struct lpc31_ep_s *privep, int16_t status) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_epfindbyaddr * * Description: * Find the physical endpoint structure corresponding to a logic endpoint * address * - *******************************************************************************/ + ****************************************************************************/ static struct lpc31_ep_s *lpc31_epfindbyaddr(struct lpc31_usbdev_s *priv, uint16_t eplog) @@ -964,14 +964,14 @@ static struct lpc31_ep_s *lpc31_epfindbyaddr(struct lpc31_usbdev_s *priv, return NULL; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_dispatchrequest * * Description: * Provide unhandled setup actions to the class driver. This is logically part * of the USB interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_dispatchrequest(struct lpc31_usbdev_s *priv, const struct usb_ctrlreq_s *ctrl) @@ -995,13 +995,13 @@ static void lpc31_dispatchrequest(struct lpc31_usbdev_s *priv, } } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_ep0configure * * Description: * Reset Usb engine * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_ep0configure(struct lpc31_usbdev_s *priv) { @@ -1021,13 +1021,13 @@ static void lpc31_ep0configure(struct lpc31_usbdev_s *priv) lpc31_setbits (USBDEV_ENDPTCTRL0_RXE | USBDEV_ENDPTCTRL0_TXE, LPC31_USBDEV_ENDPTCTRL0); } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_usbreset * * Description: * Reset Usb engine * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_usbreset(struct lpc31_usbdev_s *priv) { @@ -1094,13 +1094,13 @@ static void lpc31_usbreset(struct lpc31_usbdev_s *priv) LPC31_USBDEV_USBINTR); } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_setstate * * Description: * Sets the EP0 state and manages the NAK interrupts * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc31_ep0state(struct lpc31_usbdev_s *priv, uint16_t state) { @@ -1120,14 +1120,14 @@ static inline void lpc31_ep0state(struct lpc31_usbdev_s *priv, uint16_t state) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_ep0setup * * Description: * USB Ctrl EP Setup Event. This is logically part of the USB interrupt * handler. This event occurs when a setup packet is receive on EP0 OUT. * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc31_ep0setup(struct lpc31_usbdev_s *priv) { @@ -1457,13 +1457,13 @@ static inline void lpc31_ep0setup(struct lpc31_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_ep0complete * * Description: * Transfer complete handler for Endpoint 0 * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_ep0complete(struct lpc31_usbdev_s *priv, uint8_t epphy) { @@ -1529,13 +1529,13 @@ static void lpc31_ep0complete(struct lpc31_usbdev_s *priv, uint8_t epphy) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_ep0nak * * Description: * Handle a NAK interrupt on EP0 * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_ep0nak(struct lpc31_usbdev_s *priv, uint8_t epphy) { @@ -1568,14 +1568,14 @@ static void lpc31_ep0nak(struct lpc31_usbdev_s *priv, uint8_t epphy) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_epcomplete * * Description: * Transfer complete handler for Endpoints other than 0 * returns whether the request at the head has completed * - *******************************************************************************/ + ****************************************************************************/ bool lpc31_epcomplete(struct lpc31_usbdev_s *priv, uint8_t epphy) { @@ -1638,13 +1638,13 @@ bool lpc31_epcomplete(struct lpc31_usbdev_s *priv, uint8_t epphy) } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_usbinterrupt * * Description: * USB interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_usbinterrupt(int irq, FAR void *context) { @@ -1803,11 +1803,11 @@ static int lpc31_usbinterrupt(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Endpoint operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc31_epconfigure * * Description: @@ -1820,7 +1820,7 @@ static int lpc31_usbinterrupt(int irq, FAR void *context) * needs to take special action when all of the endpoints have been * configured. * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_epconfigure(FAR struct usbdev_ep_s *ep, FAR const struct usb_epdesc_s *desc, @@ -1890,13 +1890,13 @@ static int lpc31_epconfigure(FAR struct usbdev_ep_s *ep, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_epdisable * * Description: * The endpoint will no longer be used * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_epdisable(FAR struct usbdev_ep_s *ep) { @@ -1929,13 +1929,13 @@ static int lpc31_epdisable(FAR struct usbdev_ep_s *ep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_epallocreq * * Description: * Allocate an I/O request * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_req_s *lpc31_epallocreq(FAR struct usbdev_ep_s *ep) { @@ -1961,13 +1961,13 @@ static FAR struct usbdev_req_s *lpc31_epallocreq(FAR struct usbdev_ep_s *ep) return &privreq->req; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_epfreereq * * Description: * Free an I/O request * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_epfreereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -1985,13 +1985,13 @@ static void lpc31_epfreereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s kmm_free(privreq); } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_epallocbuffer * * Description: * Allocate an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_DMA static void *lpc31_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) @@ -2006,13 +2006,13 @@ static void *lpc31_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_epfreebuffer * * Description: * Free an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_DMA static void lpc31_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) @@ -2027,13 +2027,13 @@ static void lpc31_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_epsubmit * * Description: * Submit an I/O request to the endpoint * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_epsubmit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -2095,13 +2095,13 @@ static int lpc31_epsubmit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *r return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_epcancel * * Description: * Cancel an I/O request previously sent to an endpoint * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_epcancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -2131,13 +2131,13 @@ static int lpc31_epcancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *r return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_epstall * * Description: * Stall or resume and endpoint * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_epstall(FAR struct usbdev_ep_s *ep, bool resume) { @@ -2172,11 +2172,11 @@ static int lpc31_epstall(FAR struct usbdev_ep_s *ep, bool resume) return OK; } -/******************************************************************************* +/**************************************************************************** * Device operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc31_allocep * * Description: @@ -2190,7 +2190,7 @@ static int lpc31_epstall(FAR struct usbdev_ep_s *ep, bool resume) * eptype - Endpoint type. One of {USB_EP_ATTR_XFER_ISOC, USB_EP_ATTR_XFER_BULK, * USB_EP_ATTR_XFER_INT} * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_ep_s *lpc31_allocep(FAR struct usbdev_s *dev, uint8_t eplog, bool in, uint8_t eptype) @@ -2300,13 +2300,13 @@ static FAR struct usbdev_ep_s *lpc31_allocep(FAR struct usbdev_s *dev, uint8_t e return NULL; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_freeep * * Description: * Free the previously allocated endpoint * - *******************************************************************************/ + ****************************************************************************/ static void lpc31_freeep(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) { @@ -2326,13 +2326,13 @@ static void lpc31_freeep(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_getframe * * Description: * Returns the current frame number * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_getframe(struct usbdev_s *dev) { @@ -2353,13 +2353,13 @@ static int lpc31_getframe(struct usbdev_s *dev) #endif } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_wakeup * * Description: * Tries to wake up the host connected to this device * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_wakeup(struct usbdev_s *dev) { @@ -2373,13 +2373,13 @@ static int lpc31_wakeup(struct usbdev_s *dev) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_selfpowered * * Description: * Sets/clears the device selfpowered feature * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_selfpowered(struct usbdev_s *dev, bool selfpowered) { @@ -2399,13 +2399,13 @@ static int lpc31_selfpowered(struct usbdev_s *dev, bool selfpowered) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc31_pullup * * Description: * Software-controlled connect to/disconnect from USB host * - *******************************************************************************/ + ****************************************************************************/ static int lpc31_pullup(struct usbdev_s *dev, bool enable) { @@ -2420,11 +2420,11 @@ static int lpc31_pullup(struct usbdev_s *dev, bool enable) return OK; } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_usbinitialize * * Description: @@ -2437,7 +2437,7 @@ static int lpc31_pullup(struct usbdev_s *dev, bool enable) * and P0.23 and PO.31 in PINSEL1 must be configured for Vbus and USB connect * LED. * - *******************************************************************************/ + ****************************************************************************/ void up_usbinitialize(void) { @@ -2562,9 +2562,9 @@ errout: up_usbuninitialize(); } -/******************************************************************************* +/**************************************************************************** * Name: up_usbuninitialize - *******************************************************************************/ + ****************************************************************************/ void up_usbuninitialize(void) { @@ -2604,14 +2604,14 @@ void up_usbuninitialize(void) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: usbdev_register * * Description: * Register a USB device class driver. The class driver's bind() method will be * called to bind it to a USB device driver. * - *******************************************************************************/ + ****************************************************************************/ int usbdev_register(struct usbdevclass_driver_s *driver) { @@ -2666,7 +2666,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: usbdev_unregister * * Description: @@ -2674,7 +2674,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) * it will first disconnect(). The driver is also requested to unbind() and clean * up any device state, before this procedure finally returns. * - *******************************************************************************/ + ****************************************************************************/ int usbdev_unregister(struct usbdevclass_driver_s *driver) { diff --git a/arch/arm/src/lpc43xx/lpc43_ehci.c b/arch/arm/src/lpc43xx/lpc43_ehci.c index 09c144ebbb..f9673ab12a 100644 --- a/arch/arm/src/lpc43xx/lpc43_ehci.c +++ b/arch/arm/src/lpc43xx/lpc43_ehci.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/lpc43xx/lpc43_ehci.c * * Copyright (C) 2013-2015 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -68,9 +68,9 @@ #if defined(CONFIG_LPC43_USBOTG) && defined(CONFIG_USBHOST) -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ /* Pre-requisites */ @@ -187,9 +187,9 @@ #define RHPNDX(rh) ((rh)->hport.hport.port) #define RHPORT(rh) (RHPNDX(rh)+1) -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* Internal representation of the EHCI Queue Head (QH) */ struct lpc43_epinfo_s; @@ -389,9 +389,9 @@ struct lpc43_ehci_trace_s #endif /* HAVE_USBHOST_TRACE */ -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Register operations ********************************************************/ @@ -548,9 +548,9 @@ static void lpc43_disconnect(FAR struct usbhost_driver_s *drvr, static int lpc43_reset(void); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ /* In this driver implementation, support is provided for only a single a single * USB device. All status information can be simply retained in a single global * instance. @@ -689,19 +689,19 @@ static const struct lpc43_ehci_trace_s g_trace2[TRACE2_NSTRINGS] = }; #endif /* HAVE_USBHOST_TRACE */ -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Register Operations - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: lpc43_read16 * * Description: * Read 16-bit little endian data * - *******************************************************************************/ + ****************************************************************************/ static uint16_t lpc43_read16(const uint8_t *addr) { @@ -712,13 +712,13 @@ static uint16_t lpc43_read16(const uint8_t *addr) #endif } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_read32 * * Description: * Read 32-bit little endian data * - *******************************************************************************/ + ****************************************************************************/ static inline uint32_t lpc43_read32(const uint8_t *addr) { @@ -731,13 +731,13 @@ static inline uint32_t lpc43_read32(const uint8_t *addr) #endif } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_write16 * * Description: * Write 16-bit little endian data * - *******************************************************************************/ + ****************************************************************************/ #if 0 /* Not used */ static void lpc43_write16(uint16_t memval, uint8_t *addr) @@ -752,13 +752,13 @@ static void lpc43_write16(uint16_t memval, uint8_t *addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc43_write32 * * Description: * Write 32-bit little endian data * - *******************************************************************************/ + ****************************************************************************/ #if 0 /* Not used */ static void lpc43_write32(uint32_t memval, uint8_t *addr) @@ -773,13 +773,13 @@ static void lpc43_write32(uint32_t memval, uint8_t *addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc43_swap16 * * Description: * Swap bytes on a 16-bit value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ENDIAN_BIG static uint16_t lpc43_swap16(uint16_t value) @@ -788,13 +788,13 @@ static uint16_t lpc43_swap16(uint16_t value) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc43_swap32 * * Description: * Swap bytes on a 32-bit value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ENDIAN_BIG static uint32_t lpc43_swap32(uint32_t value) @@ -804,13 +804,13 @@ static uint32_t lpc43_swap32(uint32_t value) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc43_printreg * * Description: * Print the contents of a LPC43 EHCI register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC43_EHCI_REGDEBUG static void lpc43_printreg(volatile uint32_t *regaddr, uint32_t regval, @@ -820,14 +820,14 @@ static void lpc43_printreg(volatile uint32_t *regaddr, uint32_t regval, } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc43_checkreg * * Description: * Check if it is time to output debug information for accesses to a LPC43 * EHCI register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC43_EHCI_REGDEBUG static void lpc43_checkreg(volatile uint32_t *regaddr, uint32_t regval, bool iswrite) @@ -885,13 +885,13 @@ static void lpc43_checkreg(volatile uint32_t *regaddr, uint32_t regval, bool isw } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc43_getreg * * Description: * Get the contents of an LPC43 register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC43_EHCI_REGDEBUG static uint32_t lpc43_getreg(volatile uint32_t *regaddr) @@ -912,13 +912,13 @@ static inline uint32_t lpc43_getreg(volatile uint32_t *regaddr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc43_putreg * * Description: * Set the contents of an LPC43 register to a value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC43_EHCI_REGDEBUG static void lpc43_putreg(uint32_t regval, volatile uint32_t *regaddr) @@ -938,7 +938,7 @@ static inline void lpc43_putreg(uint32_t regval, volatile uint32_t *regaddr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: ehci_wait_usbsts * * Description: @@ -946,7 +946,7 @@ static inline void lpc43_putreg(uint32_t regval, volatile uint32_t *regaddr) * value, (2) for a timeout to occur, or (3) a error to occur. Return * a value to indicate which terminated the wait. * - *******************************************************************************/ + ****************************************************************************/ static int ehci_wait_usbsts(uint32_t maskbits, uint32_t donebits, unsigned int delay) @@ -988,17 +988,17 @@ static int ehci_wait_usbsts(uint32_t maskbits, uint32_t donebits, return (regval == donebits) ? OK : -ETIMEDOUT; } -/******************************************************************************* +/**************************************************************************** * Semaphores - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: lpc43_takesem * * Description: * This is just a wrapper to handle the annoying behavior of semaphore * waits that return due to the receipt of a signal. * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_takesem(sem_t *sem) { @@ -1014,10 +1014,10 @@ static void lpc43_takesem(sem_t *sem) } } -/******************************************************************************* +/**************************************************************************** * Allocators - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: lpc43_qh_alloc * * Description: @@ -1025,7 +1025,7 @@ static void lpc43_takesem(sem_t *sem) * * Assumption: Caller holds the exclsem * - *******************************************************************************/ + ****************************************************************************/ static struct lpc43_qh_s *lpc43_qh_alloc(void) { @@ -1043,7 +1043,7 @@ static struct lpc43_qh_s *lpc43_qh_alloc(void) return qh; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qh_free * * Description: @@ -1051,7 +1051,7 @@ static struct lpc43_qh_s *lpc43_qh_alloc(void) * * Assumption: Caller holds the exclsem * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_qh_free(struct lpc43_qh_s *qh) { @@ -1063,7 +1063,7 @@ static void lpc43_qh_free(struct lpc43_qh_s *qh) g_ehci.qhfree = entry; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qtd_alloc * * Description: @@ -1072,7 +1072,7 @@ static void lpc43_qh_free(struct lpc43_qh_s *qh) * * Assumption: Caller holds the exclsem * - *******************************************************************************/ + ****************************************************************************/ static struct lpc43_qtd_s *lpc43_qtd_alloc(void) { @@ -1090,7 +1090,7 @@ static struct lpc43_qtd_s *lpc43_qtd_alloc(void) return qtd; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qtd_free * * Description: @@ -1099,7 +1099,7 @@ static struct lpc43_qtd_s *lpc43_qtd_alloc(void) * * Assumption: Caller holds the exclsem * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_qtd_free(struct lpc43_qtd_s *qtd) { @@ -1111,11 +1111,11 @@ static void lpc43_qtd_free(struct lpc43_qtd_s *qtd) g_ehci.qtdfree = entry; } -/******************************************************************************* +/**************************************************************************** * List Management - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qh_foreach * * Description: @@ -1123,7 +1123,7 @@ static void lpc43_qtd_free(struct lpc43_qtd_s *qtd) * handler for each QH structure in the list (including the one at the head * of the list). * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_qh_foreach(struct lpc43_qh_s *qh, uint32_t **bp, foreach_qh_t handler, void *arg) @@ -1195,14 +1195,14 @@ static int lpc43_qh_foreach(struct lpc43_qh_s *qh, uint32_t **bp, foreach_qh_t h return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qtd_foreach * * Description: * Give a Queue Head (QH) instance, call the handler for each qTD structure * in the queue. * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_qtd_foreach(struct lpc43_qh_s *qh, foreach_qtd_t handler, void *arg) { @@ -1276,14 +1276,14 @@ static int lpc43_qtd_foreach(struct lpc43_qh_s *qh, foreach_qtd_t handler, void return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qtd_discard * * Description: * This is a lpc43_qtd_foreach callback. It simply unlinks the QTD, updates * the back pointer, and frees the QTD structure. * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_qtd_discard(struct lpc43_qtd_s *qtd, uint32_t **bp, void *arg) { @@ -1302,7 +1302,7 @@ static int lpc43_qtd_discard(struct lpc43_qtd_s *qtd, uint32_t **bp, void *arg) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qh_discard * * Description: @@ -1312,7 +1312,7 @@ static int lpc43_qtd_discard(struct lpc43_qtd_s *qtd, uint32_t **bp, void *arg) * The QH structure itself has already been unlinked from whatever list it * may have been in. * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_qh_discard(struct lpc43_qh_s *qh) { @@ -1334,17 +1334,17 @@ static int lpc43_qh_discard(struct lpc43_qh_s *qh) return ret; } -/******************************************************************************* +/**************************************************************************** * Endpoint Transfer Handling - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qtd_print * * Description: * Print the context of one qTD * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC43_EHCI_REGDEBUG static void lpc43_qtd_print(struct lpc43_qtd_s *qtd) @@ -1359,13 +1359,13 @@ static void lpc43_qtd_print(struct lpc43_qtd_s *qtd) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qh_print * * Description: * Print the context of one QH * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC43_EHCI_REGDEBUG static void lpc43_qh_print(struct lpc43_qh_s *qh) @@ -1401,14 +1401,14 @@ static void lpc43_qh_print(struct lpc43_qh_s *qh) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qtd_dump * * Description: * This is a lpc43_qtd_foreach callout function. It dumps the context of one * qTD * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC43_EHCI_REGDEBUG static int lpc43_qtd_dump(struct lpc43_qtd_s *qtd, uint32_t **bp, void *arg) @@ -1418,14 +1418,14 @@ static int lpc43_qtd_dump(struct lpc43_qtd_s *qtd, uint32_t **bp, void *arg) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qh_dump * * Description: * This is a lpc43_qh_foreach callout function. It dumps a QH structure and * all of the qTD structures linked to the QH. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC43_EHCI_REGDEBUG static int lpc43_qh_dump(struct lpc43_qh_s *qh, uint32_t **bp, void *arg) @@ -1435,14 +1435,14 @@ static int lpc43_qh_dump(struct lpc43_qh_s *qh, uint32_t **bp, void *arg) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc43_ehci_speed * * Description: * Map a speed enumeration value per Chapter 9 of the USB specification to the * speed enumeration required in the EHCI queue head. * - *******************************************************************************/ + ****************************************************************************/ static inline uint8_t lpc43_ehci_speed(uint8_t usbspeed) { @@ -1450,7 +1450,7 @@ static inline uint8_t lpc43_ehci_speed(uint8_t usbspeed) return g_ehci_speed[usbspeed]; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_ioc_setup * * Description: @@ -1461,7 +1461,7 @@ static inline uint8_t lpc43_ehci_speed(uint8_t usbspeed) * * Assumption: The caller holds tex EHCI exclsem * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_ioc_setup(struct lpc43_rhport_s *rhport, struct lpc43_epinfo_s *epinfo) { @@ -1498,7 +1498,7 @@ static int lpc43_ioc_setup(struct lpc43_rhport_s *rhport, struct lpc43_epinfo_s return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_ioc_wait * * Description: @@ -1507,7 +1507,7 @@ static int lpc43_ioc_setup(struct lpc43_rhport_s *rhport, struct lpc43_epinfo_s * Assumption: The caller does *NOT* hold the EHCI exclsem. That would cause * a deadlock when the bottom-half, worker thread needs to take the semaphore. * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_ioc_wait(struct lpc43_epinfo_s *epinfo) { @@ -1521,7 +1521,7 @@ static int lpc43_ioc_wait(struct lpc43_epinfo_s *epinfo) return epinfo->result; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qh_enqueue * * Description: @@ -1529,7 +1529,7 @@ static int lpc43_ioc_wait(struct lpc43_epinfo_s *epinfo) * * Assumptions: The caller holds the EHCI exclsem * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_qh_enqueue(struct lpc43_qh_s *qhead, struct lpc43_qh_s *qh) { @@ -1559,13 +1559,13 @@ static void lpc43_qh_enqueue(struct lpc43_qh_s *qhead, struct lpc43_qh_s *qh) qhead->hw.hlp = lpc43_swap32(physaddr | QH_HLP_TYP_QH); } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qh_create * * Description: * Create a new Queue Head (QH) * - *******************************************************************************/ + ****************************************************************************/ static struct lpc43_qh_s *lpc43_qh_create(struct lpc43_rhport_s *rhport, struct lpc43_epinfo_s *epinfo) @@ -1696,13 +1696,13 @@ static struct lpc43_qh_s *lpc43_qh_create(struct lpc43_rhport_s *rhport, return qh; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qtd_addbpl * * Description: * Add a buffer pointer list to a qTD. * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_qtd_addbpl(struct lpc43_qtd_s *qtd, const void *buffer, size_t buflen) { @@ -1765,13 +1765,13 @@ static int lpc43_qtd_addbpl(struct lpc43_qtd_s *qtd, const void *buffer, size_t return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qtd_setupphase * * Description: * Create a SETUP phase request qTD. * - *******************************************************************************/ + ****************************************************************************/ static struct lpc43_qtd_s *lpc43_qtd_setupphase(struct lpc43_epinfo_s *epinfo, const struct usb_ctrlreq_s *req) @@ -1832,13 +1832,13 @@ static struct lpc43_qtd_s *lpc43_qtd_setupphase(struct lpc43_epinfo_s *epinfo, return qtd; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qtd_dataphase * * Description: * Create a data transfer or SET data phase qTD. * - *******************************************************************************/ + ****************************************************************************/ static struct lpc43_qtd_s *lpc43_qtd_dataphase(struct lpc43_epinfo_s *epinfo, void *buffer, int buflen, @@ -1900,13 +1900,13 @@ static struct lpc43_qtd_s *lpc43_qtd_dataphase(struct lpc43_epinfo_s *epinfo, return qtd; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qtd_statusphase * * Description: * Create a STATUS phase request qTD. * - *******************************************************************************/ + ****************************************************************************/ static struct lpc43_qtd_s *lpc43_qtd_statusphase(uint32_t tokenbits) { @@ -1949,7 +1949,7 @@ static struct lpc43_qtd_s *lpc43_qtd_statusphase(uint32_t tokenbits) return qtd; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_async_setup * * Description: @@ -1967,7 +1967,7 @@ static struct lpc43_qtd_s *lpc43_qtd_statusphase(uint32_t tokenbits) * Zero (OK) is returned on success; a negated errno value is return on * any failure. * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_async_setup(struct lpc43_rhport_s *rhport, struct lpc43_epinfo_s *epinfo, @@ -2201,7 +2201,7 @@ errout_with_qh: return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_intr_setup * * Description: @@ -2247,7 +2247,7 @@ errout_with_qh: * Zero (OK) is returned on success; a negated errno value is return on * any failure. * - *******************************************************************************/ + ****************************************************************************/ #ifndef CONFIG_USBHOST_INT_DISABLE static int lpc43_intr_setup(struct lpc43_rhport_s *rhport, @@ -2339,7 +2339,7 @@ errout_with_qh: } #endif /* CONFIG_USBHOST_INT_DISABLE */ -/******************************************************************************* +/**************************************************************************** * Name: lpc43_transfer_wait * * Description: @@ -2356,7 +2356,7 @@ errout_with_qh: * plus the size of the data (which could be short); For bulk transfers, this * will be the number of data bytes transfers (which could be short). * - *******************************************************************************/ + ****************************************************************************/ static ssize_t lpc43_transfer_wait(struct lpc43_epinfo_s *epinfo) { @@ -2400,7 +2400,7 @@ static ssize_t lpc43_transfer_wait(struct lpc43_epinfo_s *epinfo) return epinfo->xfrd; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_ioc_async_setup * * Description: @@ -2418,7 +2418,7 @@ static ssize_t lpc43_transfer_wait(struct lpc43_epinfo_s *epinfo) * Assumptions: * - Called from the interrupt level * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static inline int lpc43_ioc_async_setup(struct lpc43_rhport_s *rhport, @@ -2454,7 +2454,7 @@ static inline int lpc43_ioc_async_setup(struct lpc43_rhport_s *rhport, } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc43_asynch_completion * * Description: @@ -2471,7 +2471,7 @@ static inline int lpc43_ioc_async_setup(struct lpc43_rhport_s *rhport, * Assumptions: * - Called from the interrupt level * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static void lpc43_asynch_completion(struct lpc43_epinfo_s *epinfo) @@ -2509,11 +2509,11 @@ static void lpc43_asynch_completion(struct lpc43_epinfo_s *epinfo) } #endif -/******************************************************************************* +/**************************************************************************** * EHCI Interrupt Handling - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qtd_ioccheck * * Description: @@ -2521,7 +2521,7 @@ static void lpc43_asynch_completion(struct lpc43_epinfo_s *epinfo) * qTD in the asynchronous queue. It removes all of the qTD structures that * are no longer active. * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_qtd_ioccheck(struct lpc43_qtd_s *qtd, uint32_t **bp, void *arg) { @@ -2556,7 +2556,7 @@ static int lpc43_qtd_ioccheck(struct lpc43_qtd_s *qtd, uint32_t **bp, void *arg) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qh_ioccheck * * Description: @@ -2565,7 +2565,7 @@ static int lpc43_qtd_ioccheck(struct lpc43_qtd_s *qtd, uint32_t **bp, void *arg) * remove all of the structures that are no longer active. if all of the * qTD structures are removed, then QH itself will also be removed. * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_qh_ioccheck(struct lpc43_qh_s *qh, uint32_t **bp, void *arg) { @@ -2710,14 +2710,14 @@ static int lpc43_qh_ioccheck(struct lpc43_qh_s *qh, uint32_t **bp, void *arg) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qtd_cancel * * Description: * This function is a lpc43_qtd_foreach() callback function. It removes each * qTD attached to a QH. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int lpc43_qtd_cancel(struct lpc43_qtd_s *qtd, uint32_t **bp, void *arg) @@ -2745,7 +2745,7 @@ static int lpc43_qtd_cancel(struct lpc43_qtd_s *qtd, uint32_t **bp, void *arg) } #endif /* CONFIG_USBHOST_ASYNCH */ -/******************************************************************************* +/**************************************************************************** * Name: lpc43_qh_cancel * * Description: @@ -2754,7 +2754,7 @@ static int lpc43_qtd_cancel(struct lpc43_qtd_s *qtd, uint32_t **bp, void *arg) * and remove all of the structures that are no longer active. Then QH * itself will also be removed. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int lpc43_qh_cancel(struct lpc43_qh_s *qh, uint32_t **bp, void *arg) @@ -2815,7 +2815,7 @@ static int lpc43_qh_cancel(struct lpc43_qh_s *qh, uint32_t **bp, void *arg) } #endif /* CONFIG_USBHOST_ASYNCH */ -/******************************************************************************* +/**************************************************************************** * Name: lpc43_ioc_bottomhalf * * Description: @@ -2831,7 +2831,7 @@ static int lpc43_qh_cancel(struct lpc43_qh_s *qh, uint32_t **bp, void *arg) * * Assumptions: The caller holds the EHCI exclsem * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc43_ioc_bottomhalf(void) { @@ -2887,7 +2887,7 @@ static inline void lpc43_ioc_bottomhalf(void) #endif } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_portsc_bottomhalf * * Description: @@ -2907,7 +2907,7 @@ static inline void lpc43_ioc_bottomhalf(void) * bits (including: Force port resume, over-current change, enable/disable * change and connect status change)." * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc43_portsc_bottomhalf(void) { @@ -3010,7 +3010,7 @@ static inline void lpc43_portsc_bottomhalf(void) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_syserr_bottomhalf * * Description: @@ -3021,7 +3021,7 @@ static inline void lpc43_portsc_bottomhalf(void) * error occurs, the Host Controller clears the Run/Stop bit in the Command * register to prevent further execution of the scheduled TDs." * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc43_syserr_bottomhalf(void) { @@ -3029,7 +3029,7 @@ static inline void lpc43_syserr_bottomhalf(void) PANIC(); } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_async_advance_bottomhalf * * Description: @@ -3041,7 +3041,7 @@ static inline void lpc43_syserr_bottomhalf(void) * register. This status bit indicates the assertion of that interrupt * source." * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc43_async_advance_bottomhalf(void) { @@ -3050,13 +3050,13 @@ static inline void lpc43_async_advance_bottomhalf(void) /* REVISIT: Could remove all tagged QH entries here */ } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_ehci_bottomhalf * * Description: * EHCI "Bottom Half" interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_ehci_bottomhalf(FAR void *arg) { @@ -3184,13 +3184,13 @@ static void lpc43_ehci_bottomhalf(FAR void *arg) lpc43_putreg(EHCI_HANDLED_INTS, &HCOR->usbintr); } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_ehci_interrupt * * Description: * EHCI "Top Half" interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_ehci_interrupt(int irq, FAR void *context) { @@ -3242,10 +3242,10 @@ static int lpc43_ehci_interrupt(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * USB Host Controller Operations - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: lpc43_wait * * Description: @@ -3268,7 +3268,7 @@ static int lpc43_ehci_interrupt(int irq, FAR void *context) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_wait(FAR struct usbhost_connection_s *conn, FAR struct usbhost_hubport_s **hport) @@ -3340,7 +3340,7 @@ static int lpc43_wait(FAR struct usbhost_connection_s *conn, } } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_enumerate * * Description: @@ -3366,7 +3366,7 @@ static int lpc43_wait(FAR struct usbhost_connection_s *conn, * Assumptions: * This function will *not* be called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_rh_enumerate(FAR struct usbhost_connection_s *conn, FAR struct usbhost_hubport_s *hport) @@ -3811,7 +3811,7 @@ static int lpc43_epfree(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_alloc * * Description: @@ -3841,7 +3841,7 @@ static int lpc43_epfree(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_alloc(FAR struct usbhost_driver_s *drvr, FAR uint8_t **buffer, FAR size_t *maxlen) @@ -3861,7 +3861,7 @@ static int lpc43_alloc(FAR struct usbhost_driver_s *drvr, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_free * * Description: @@ -3882,7 +3882,7 @@ static int lpc43_alloc(FAR struct usbhost_driver_s *drvr, * Assumptions: * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_free(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) { @@ -3967,7 +3967,7 @@ static int lpc43_iofree(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_ctrlin and lpc43_ctrlout * * Description: @@ -4001,7 +4001,7 @@ static int lpc43_iofree(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, FAR const struct usb_ctrlreq_s *req, @@ -4073,7 +4073,7 @@ static int lpc43_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, return lpc43_ctrlin(drvr, ep0, req, (uint8_t *)buffer); } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_transfer * * Description: @@ -4109,7 +4109,7 @@ static int lpc43_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static ssize_t lpc43_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, FAR uint8_t *buffer, size_t buflen) @@ -4179,7 +4179,7 @@ errout_with_sem: return (ssize_t)ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_asynch * * Description: @@ -4212,7 +4212,7 @@ errout_with_sem: * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int lpc43_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, @@ -4530,7 +4530,7 @@ static int lpc43_connect(FAR struct usbhost_driver_s *drvr, } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc43_disconnect * * Description: @@ -4553,7 +4553,7 @@ static int lpc43_connect(FAR struct usbhost_driver_s *drvr, * - Only a single class bound to a single device is supported. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_disconnect(FAR struct usbhost_driver_s *drvr, FAR struct usbhost_hubport_s *hport) @@ -4562,10 +4562,10 @@ static void lpc43_disconnect(FAR struct usbhost_driver_s *drvr, hport->devclass = NULL; } -/******************************************************************************* +/**************************************************************************** * Initialization - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: lpc43_reset * * Description: @@ -4605,7 +4605,7 @@ static void lpc43_disconnect(FAR struct usbhost_driver_s *drvr, * Assumptions: * - Called during the initialization of the EHCI. * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_reset(void) { @@ -4679,10 +4679,10 @@ static int lpc43_reset(void) return (regval & EHCI_USBCMD_HCRESET) != 0 ? -ETIMEDOUT : OK; } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: lpc43_ehci_initialize * * Description: @@ -4705,7 +4705,7 @@ static int lpc43_reset(void) * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - *******************************************************************************/ + ****************************************************************************/ FAR struct usbhost_connection_s *lpc43_ehci_initialize(int controller) { diff --git a/arch/arm/src/lpc43xx/lpc43_i2c.c b/arch/arm/src/lpc43xx/lpc43_i2c.c index 90652f08ee..5211102490 100644 --- a/arch/arm/src/lpc43xx/lpc43_i2c.c +++ b/arch/arm/src/lpc43xx/lpc43_i2c.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/lpc43xx/lpc43_i2c.c * * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. @@ -44,11 +44,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -160,13 +160,13 @@ struct i2c_ops_s lpc43_i2c_ops = #endif }; -/******************************************************************************* +/**************************************************************************** * Name: lpc43_i2c_setfrequency * * Description: * Set the frequence for the next transfer * - *******************************************************************************/ + ****************************************************************************/ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) { struct lpc43_i2cdev_s *priv = (struct lpc43_i2cdev_s *) dev; @@ -191,13 +191,13 @@ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) return frequency; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_i2c_setaddress * * Description: * Set the I2C slave address for a subsequent read/write * - *******************************************************************************/ + ****************************************************************************/ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) { @@ -212,14 +212,14 @@ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_i2c_write * * Description: * Send a block of data on I2C using the previously selected I2C * frequency and slave address. * - *******************************************************************************/ + ****************************************************************************/ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int buflen) @@ -246,14 +246,14 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, return (ret == 0 ? 0 : -ETIMEDOUT); } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_i2c_read * * Description: * Receive a block of data on I2C using the previously selected I2C * frequency and slave address. * - *******************************************************************************/ + ****************************************************************************/ static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen) { @@ -279,13 +279,13 @@ static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen) return (ret == 0 ? 0 : -ETIMEDOUT); } -/******************************************************************************* +/**************************************************************************** * Name: i2c_start * * Description: * Perform a I2C transfer start * - *******************************************************************************/ + ****************************************************************************/ static int i2c_start(struct lpc43_i2cdev_s *priv) { @@ -308,13 +308,13 @@ static int i2c_start(struct lpc43_i2cdev_s *priv) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: i2c_stop * * Description: * Perform a I2C transfer stop * - *******************************************************************************/ + ****************************************************************************/ static void i2c_stop(struct lpc43_i2cdev_s *priv) { @@ -326,13 +326,13 @@ static void i2c_stop(struct lpc43_i2cdev_s *priv) sem_post(&priv->wait); } -/******************************************************************************* +/**************************************************************************** * Name: i2c_timeout * * Description: * Watchdog timer for timeout of I2C operation * - *******************************************************************************/ + ****************************************************************************/ static void i2c_timeout(int argc, uint32_t arg, ...) { @@ -344,13 +344,13 @@ static void i2c_timeout(int argc, uint32_t arg, ...) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: i2c_transfer * * Description: * Perform a sequence of I2C transfers * - *******************************************************************************/ + ****************************************************************************/ static int i2c_transfer(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *msgs, int count) { @@ -384,13 +384,13 @@ void startStopNextMessage(struct lpc43_i2cdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: i2c_interrupt * * Description: * The I2C Interrupt Handler * - *******************************************************************************/ + ****************************************************************************/ static int i2c_interrupt(int irq, FAR void *context) { @@ -489,13 +489,13 @@ static int i2c_interrupt(int irq, FAR void *context) * Public Functions ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_i2cinitialize * * Description: * Initialise an I2C device * - *******************************************************************************/ + ****************************************************************************/ struct i2c_dev_s *up_i2cinitialize(int port) { @@ -601,13 +601,13 @@ struct i2c_dev_s *up_i2cinitialize(int port) return &priv->dev; } -/******************************************************************************* +/**************************************************************************** * Name: up_i2cuninitalize * * Description: * Uninitialise an I2C device * - *******************************************************************************/ + ****************************************************************************/ int up_i2cuninitialize(FAR struct i2c_dev_s * dev) { diff --git a/arch/arm/src/lpc43xx/lpc43_usb0dev.c b/arch/arm/src/lpc43xx/lpc43_usb0dev.c index 0f09d91c28..45371bb6a1 100644 --- a/arch/arm/src/lpc43xx/lpc43_usb0dev.c +++ b/arch/arm/src/lpc43xx/lpc43_usb0dev.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/lpc43xx/lpc43_usbdev.c * * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. @@ -41,11 +41,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -76,9 +76,9 @@ #include "lpc43_cgu.h" #include "lpc43_rgu.h" -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ @@ -272,9 +272,9 @@ struct lpc43_dqh_s #define lpc43_rqempty(ep) ((ep)->head == NULL) #define lpc43_rqpeek(ep) ((ep)->head) -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* A container for a request so that the request may be retained in a list */ @@ -351,9 +351,9 @@ struct lpc43_usbdev_s #define EP0STATE_DATA_IN 8 #define EP0STATE_DATA_OUT 9 -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Register operations ********************************************************/ @@ -441,9 +441,9 @@ static int lpc43_wakeup(struct usbdev_s *dev); static int lpc43_selfpowered(struct usbdev_s *dev, bool selfpowered); static int lpc43_pullup(struct usbdev_s *dev, bool enable); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ /* Since there is only a single USB interface, all status information can be * be simply retained in a single global instance. @@ -479,21 +479,21 @@ static const struct usbdev_ops_s g_devops = .pullup = lpc43_pullup, }; -/******************************************************************************* +/**************************************************************************** * Public Data - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc43_getreg * * Description: * Get the contents of an LPC433x register * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_LPC43_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static uint32_t lpc43_getreg(uint32_t addr) @@ -549,13 +549,13 @@ static uint32_t lpc43_getreg(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc43_putreg * * Description: * Set the contents of an LPC433x register to a value * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_LPC43_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static void lpc43_putreg(uint32_t val, uint32_t addr) @@ -570,13 +570,13 @@ static void lpc43_putreg(uint32_t val, uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc43_clrbits * * Description: * Clear bits in a register * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc43_clrbits(uint32_t mask, uint32_t addr) { @@ -585,13 +585,13 @@ static inline void lpc43_clrbits(uint32_t mask, uint32_t addr) lpc43_putreg(reg, addr); } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_setbits * * Description: * Set bits in a register * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc43_setbits(uint32_t mask, uint32_t addr) { @@ -600,13 +600,13 @@ static inline void lpc43_setbits(uint32_t mask, uint32_t addr) lpc43_putreg(reg, addr); } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_chgbits * * Description: * Change bits in a register * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc43_chgbits(uint32_t mask, uint32_t val, uint32_t addr) { @@ -616,13 +616,13 @@ static inline void lpc43_chgbits(uint32_t mask, uint32_t val, uint32_t addr) lpc43_putreg(reg, addr); } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_rqdequeue * * Description: * Remove a request from an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static FAR struct lpc43_req_s *lpc43_rqdequeue(FAR struct lpc43_ep_s *privep) { @@ -642,13 +642,13 @@ static FAR struct lpc43_req_s *lpc43_rqdequeue(FAR struct lpc43_ep_s *privep) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_rqenqueue * * Description: * Add a request from an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static bool lpc43_rqenqueue(FAR struct lpc43_ep_s *privep, FAR struct lpc43_req_s *req) @@ -670,13 +670,13 @@ static bool lpc43_rqenqueue(FAR struct lpc43_ep_s *privep, return is_empty; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_writedtd * * Description: * Initialise a DTD to transfer the data * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc43_writedtd(struct lpc43_dtd_s *dtd, const uint8_t *data, uint32_t nbytes) { @@ -690,13 +690,13 @@ static inline void lpc43_writedtd(struct lpc43_dtd_s *dtd, const uint8_t *data, dtd->xfer_len = nbytes; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_queuedtd * * Description: * Add the DTD to the device list * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_queuedtd(uint8_t epphy, struct lpc43_dtd_s *dtd) { @@ -714,13 +714,13 @@ static void lpc43_queuedtd(uint8_t epphy, struct lpc43_dtd_s *dtd) ; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_ep0xfer * * Description: * Schedule a short transfer for Endpoint 0 (IN or OUT) * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc43_ep0xfer(uint8_t epphy, uint8_t *buf, uint32_t nbytes) { @@ -731,13 +731,13 @@ static inline void lpc43_ep0xfer(uint8_t epphy, uint8_t *buf, uint32_t nbytes) lpc43_queuedtd(epphy, dtd); } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_readsetup * * Description: * Read a Setup packet from the DTD. * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_readsetup(uint8_t epphy, struct usb_ctrlreq_s *ctrl) { struct lpc43_dqh_s *dqh = &g_qh[epphy]; @@ -767,13 +767,13 @@ static void lpc43_readsetup(uint8_t epphy, struct usb_ctrlreq_s *ctrl) lpc43_putreg (LPC43_ENDPTMASK(LPC43_EP0_OUT), LPC43_USBDEV_ENDPTSETUPSTAT); } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_set_address * * Description: * Set the devices USB address * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc43_set_address(struct lpc43_usbdev_s *priv, uint16_t address) { @@ -784,13 +784,13 @@ static inline void lpc43_set_address(struct lpc43_usbdev_s *priv, uint16_t addre LPC43_USBDEV_DEVICEADDR); } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_flushep * * Description: * Flush any primed descriptors from this ep * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_flushep(struct lpc43_ep_s *privep) { @@ -805,13 +805,13 @@ static void lpc43_flushep(struct lpc43_ep_s *privep) } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_progressep * * Description: * Progress the Endpoint by priming the first request into the queue head * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_progressep(struct lpc43_ep_s *privep) { @@ -886,13 +886,13 @@ static int lpc43_progressep(struct lpc43_ep_s *privep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_abortrequest * * Description: * Discard a request * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc43_abortrequest(struct lpc43_ep_s *privep, struct lpc43_req_s *privreq, @@ -909,13 +909,13 @@ static inline void lpc43_abortrequest(struct lpc43_ep_s *privep, privreq->req.callback(&privep->ep, &privreq->req); } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_reqcomplete * * Description: * Handle termination of the request at the head of the endpoint request queue. * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_reqcomplete(struct lpc43_ep_s *privep, struct lpc43_req_s *privreq, int16_t result) @@ -941,13 +941,13 @@ static void lpc43_reqcomplete(struct lpc43_ep_s *privep, privep->stalled = stalled; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_cancelrequests * * Description: * Cancel all pending requests for an endpoint * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_cancelrequests(struct lpc43_ep_s *privep, int16_t status) { @@ -964,14 +964,14 @@ static void lpc43_cancelrequests(struct lpc43_ep_s *privep, int16_t status) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_epfindbyaddr * * Description: * Find the physical endpoint structure corresponding to a logic endpoint * address * - *******************************************************************************/ + ****************************************************************************/ static struct lpc43_ep_s *lpc43_epfindbyaddr(struct lpc43_usbdev_s *priv, uint16_t eplog) @@ -1007,14 +1007,14 @@ static struct lpc43_ep_s *lpc43_epfindbyaddr(struct lpc43_usbdev_s *priv, return NULL; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_dispatchrequest * * Description: * Provide unhandled setup actions to the class driver. This is logically part * of the USB interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_dispatchrequest(struct lpc43_usbdev_s *priv, const struct usb_ctrlreq_s *ctrl) @@ -1038,13 +1038,13 @@ static void lpc43_dispatchrequest(struct lpc43_usbdev_s *priv, } } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_ep0configure * * Description: * Reset Usb engine * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_ep0configure(struct lpc43_usbdev_s *priv) { @@ -1066,13 +1066,13 @@ static void lpc43_ep0configure(struct lpc43_usbdev_s *priv) lpc43_setbits (USBDEV_ENDPTCTRL0_RXE | USBDEV_ENDPTCTRL0_TXE, LPC43_USBDEV_ENDPTCTRL0); } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_usbreset * * Description: * Reset Usb engine * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_usbreset(struct lpc43_usbdev_s *priv) { @@ -1148,13 +1148,13 @@ static void lpc43_usbreset(struct lpc43_usbdev_s *priv) LPC43_USBDEV_USBINTR); } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_setstate * * Description: * Sets the EP0 state and manages the NAK interrupts * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc43_ep0state(struct lpc43_usbdev_s *priv, uint16_t state) { @@ -1176,14 +1176,14 @@ static inline void lpc43_ep0state(struct lpc43_usbdev_s *priv, uint16_t state) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_ep0setup * * Description: * USB Ctrl EP Setup Event. This is logically part of the USB interrupt * handler. This event occurs when a setup packet is receive on EP0 OUT. * - *******************************************************************************/ + ****************************************************************************/ static inline void lpc43_ep0setup(struct lpc43_usbdev_s *priv) { @@ -1528,13 +1528,13 @@ static inline void lpc43_ep0setup(struct lpc43_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_ep0complete * * Description: * Transfer complete handler for Endpoint 0 * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_ep0complete(struct lpc43_usbdev_s *priv, uint8_t epphy) { @@ -1611,13 +1611,13 @@ static void lpc43_ep0complete(struct lpc43_usbdev_s *priv, uint8_t epphy) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_ep0nak * * Description: * Handle a NAK interrupt on EP0 * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_ep0nak(struct lpc43_usbdev_s *priv, uint8_t epphy) { @@ -1652,14 +1652,14 @@ static void lpc43_ep0nak(struct lpc43_usbdev_s *priv, uint8_t epphy) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_epcomplete * * Description: * Transfer complete handler for Endpoints other than 0 * returns whether the request at the head has completed * - *******************************************************************************/ + ****************************************************************************/ bool lpc43_epcomplete(struct lpc43_usbdev_s *priv, uint8_t epphy) { @@ -1727,13 +1727,13 @@ bool lpc43_epcomplete(struct lpc43_usbdev_s *priv, uint8_t epphy) } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_usbinterrupt * * Description: * USB interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_usbinterrupt(int irq, FAR void *context) { @@ -1913,11 +1913,11 @@ static int lpc43_usbinterrupt(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Endpoint operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc43_epconfigure * * Description: @@ -1930,7 +1930,7 @@ static int lpc43_usbinterrupt(int irq, FAR void *context) * needs to take special action when all of the endpoints have been * configured. * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_epconfigure(FAR struct usbdev_ep_s *ep, FAR const struct usb_epdesc_s *desc, @@ -2012,13 +2012,13 @@ static int lpc43_epconfigure(FAR struct usbdev_ep_s *ep, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_epdisable * * Description: * The endpoint will no longer be used * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_epdisable(FAR struct usbdev_ep_s *ep) { @@ -2057,13 +2057,13 @@ static int lpc43_epdisable(FAR struct usbdev_ep_s *ep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_epallocreq * * Description: * Allocate an I/O request * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_req_s *lpc43_epallocreq(FAR struct usbdev_ep_s *ep) { @@ -2089,13 +2089,13 @@ static FAR struct usbdev_req_s *lpc43_epallocreq(FAR struct usbdev_ep_s *ep) return &privreq->req; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_epfreereq * * Description: * Free an I/O request * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_epfreereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -2113,13 +2113,13 @@ static void lpc43_epfreereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s kmm_free(privreq); } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_epallocbuffer * * Description: * Allocate an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_DMA static void *lpc43_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) @@ -2134,13 +2134,13 @@ static void *lpc43_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc43_epfreebuffer * * Description: * Free an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_DMA static void lpc43_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) @@ -2155,13 +2155,13 @@ static void lpc43_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) } #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc43_epsubmit * * Description: * Submit an I/O request to the endpoint * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_epsubmit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -2227,13 +2227,13 @@ static int lpc43_epsubmit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *r return ret; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_epcancel * * Description: * Cancel an I/O request previously sent to an endpoint * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_epcancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -2263,13 +2263,13 @@ static int lpc43_epcancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *r return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_epstall * * Description: * Stall or resume and endpoint * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_epstall(FAR struct usbdev_ep_s *ep, bool resume) { @@ -2304,11 +2304,11 @@ static int lpc43_epstall(FAR struct usbdev_ep_s *ep, bool resume) return OK; } -/******************************************************************************* +/**************************************************************************** * Device operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc43_allocep * * Description: @@ -2322,7 +2322,7 @@ static int lpc43_epstall(FAR struct usbdev_ep_s *ep, bool resume) * eptype - Endpoint type. One of {USB_EP_ATTR_XFER_ISOC, USB_EP_ATTR_XFER_BULK, * USB_EP_ATTR_XFER_INT} * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_ep_s *lpc43_allocep(FAR struct usbdev_s *dev, uint8_t eplog, bool in, uint8_t eptype) @@ -2435,13 +2435,13 @@ static FAR struct usbdev_ep_s *lpc43_allocep(FAR struct usbdev_s *dev, uint8_t e return NULL; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_freeep * * Description: * Free the previously allocated endpoint * - *******************************************************************************/ + ****************************************************************************/ static void lpc43_freeep(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) { @@ -2461,13 +2461,13 @@ static void lpc43_freeep(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) } } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_getframe * * Description: * Returns the current frame number * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_getframe(struct usbdev_s *dev) { @@ -2489,13 +2489,13 @@ static int lpc43_getframe(struct usbdev_s *dev) #endif } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_wakeup * * Description: * Tries to wake up the host connected to this device * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_wakeup(struct usbdev_s *dev) { @@ -2509,13 +2509,13 @@ static int lpc43_wakeup(struct usbdev_s *dev) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_selfpowered * * Description: * Sets/clears the device selfpowered feature * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_selfpowered(struct usbdev_s *dev, bool selfpowered) { @@ -2535,13 +2535,13 @@ static int lpc43_selfpowered(struct usbdev_s *dev, bool selfpowered) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: lpc43_pullup * * Description: * Software-controlled connect to/disconnect from USB host * - *******************************************************************************/ + ****************************************************************************/ static int lpc43_pullup(struct usbdev_s *dev, bool enable) { @@ -2561,11 +2561,11 @@ static int lpc43_pullup(struct usbdev_s *dev, bool enable) return OK; } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_usbinitialize * * Description: @@ -2576,7 +2576,7 @@ static int lpc43_pullup(struct usbdev_s *dev, bool enable) * - PLL initialization is not performed here but should been in * the low-level boot logic: PLL0 must be configured for operation at 480MHz * - *******************************************************************************/ + ****************************************************************************/ void up_usbinitialize(void) { @@ -2712,9 +2712,9 @@ errout: up_usbuninitialize(); } -/******************************************************************************* +/**************************************************************************** * Name: up_usbuninitialize - *******************************************************************************/ + ****************************************************************************/ void up_usbuninitialize(void) { @@ -2753,14 +2753,14 @@ void up_usbuninitialize(void) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: usbdev_register * * Description: * Register a USB device class driver. The class driver's bind() method will be * called to bind it to a USB device driver. * - *******************************************************************************/ + ****************************************************************************/ int usbdev_register(struct usbdevclass_driver_s *driver) { @@ -2815,7 +2815,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: usbdev_unregister * * Description: @@ -2823,7 +2823,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) * it will first disconnect(). The driver is also requested to unbind() and clean * up any device state, before this procedure finally returns. * - *******************************************************************************/ + ****************************************************************************/ int usbdev_unregister(struct usbdevclass_driver_s *driver) { diff --git a/arch/arm/src/moxart/moxart_16550.c b/arch/arm/src/moxart/moxart_16550.c index 8152c28a80..ce24cf7312 100644 --- a/arch/arm/src/moxart/moxart_16550.c +++ b/arch/arm/src/moxart/moxart_16550.c @@ -1,4 +1,4 @@ -/****************************************************************************** +/**************************************************************************** * arch/arm/src/moxart/moxart_irq.c * Driver for MoxaRT IRQ controller * diff --git a/arch/arm/src/nuc1xx/nuc_lowputc.c b/arch/arm/src/nuc1xx/nuc_lowputc.c index dc22db8774..e9248ac780 100644 --- a/arch/arm/src/nuc1xx/nuc_lowputc.c +++ b/arch/arm/src/nuc1xx/nuc_lowputc.c @@ -108,7 +108,7 @@ * Wait until the console is ready to add another character to the TX * FIFO. * - *****************************************************************************/ + ****************************************************************************/ #ifdef HAVE_SERIAL_CONSOLE static inline void nuc_console_ready(void) @@ -142,7 +142,7 @@ static inline void nuc_console_ready(void) * Description: * Called at the very beginning of _start. Performs low level initialization. * - *****************************************************************************/ + ****************************************************************************/ void nuc_lowsetup(void) { @@ -323,7 +323,7 @@ void nuc_lowsetup(void) * Description: * Output one character to the UART using a simple polling method. * - *****************************************************************************/ + ****************************************************************************/ void nuc_lowputc(uint32_t ch) { @@ -353,7 +353,7 @@ void nuc_lowputc(uint32_t ch) * Here we assume that the default clock source for the UART modules is * the external high speed crystal. * - *****************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART void nuc_setbaud(uintptr_t base, uint32_t baud) diff --git a/arch/arm/src/sam34/sam_twi.c b/arch/arm/src/sam34/sam_twi.c index 32edc655a3..d9e6f6ceb2 100644 --- a/arch/arm/src/sam34/sam_twi.c +++ b/arch/arm/src/sam34/sam_twi.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/sam34/sam_twi.c * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. @@ -40,11 +40,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -72,9 +72,9 @@ #if defined(CONFIG_SAM34_TWI0) || defined(CONFIG_SAM34_TWI1) -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ #ifndef CONFIG_SAM34_TWI0_FREQUENCY @@ -110,9 +110,9 @@ # define i2cllvdbg(x...) #endif -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ struct twi_dev_s { @@ -144,9 +144,9 @@ struct twi_dev_s #endif }; -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Low-level helper functions */ @@ -216,9 +216,9 @@ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, static void twi_hw_initialize(struct twi_dev_s *priv, unsigned int pid, uint32_t frequency); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAM34_TWI0 static struct twi_dev_s g_twi0; @@ -407,7 +407,7 @@ static inline void twi_putrel(struct twi_dev_s *priv, unsigned int offset, * I2C transfer helper functions ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: twi_wait * * Description: @@ -416,7 +416,7 @@ static inline void twi_putrel(struct twi_dev_s *priv, unsigned int offset, * Assumptions: * Interrupts are disabled * - *******************************************************************************/ + ****************************************************************************/ static int twi_wait(struct twi_dev_s *priv) { @@ -441,13 +441,13 @@ static int twi_wait(struct twi_dev_s *priv) return priv->result; } -/******************************************************************************* +/**************************************************************************** * Name: twi_wakeup * * Description: * A terminal event has occurred. Wake-up the waiting thread * - *******************************************************************************/ + ****************************************************************************/ static void twi_wakeup(struct twi_dev_s *priv, int result) { @@ -465,13 +465,13 @@ static void twi_wakeup(struct twi_dev_s *priv, int result) twi_givesem(&priv->waitsem); } -/******************************************************************************* +/**************************************************************************** * Name: twi_interrupt * * Description: * The TWI Interrupt Handler * - *******************************************************************************/ + ****************************************************************************/ static int twi_interrupt(struct twi_dev_s *priv) { @@ -605,7 +605,7 @@ static int twi1_interrupt(int irq, FAR void *context) } #endif -/******************************************************************************* +/**************************************************************************** * Name: twi_timeout * * Description: @@ -614,7 +614,7 @@ static int twi1_interrupt(int irq, FAR void *context) * Assumptions: * Called from the timer interrupt handler with interrupts disabled. * - *******************************************************************************/ + ****************************************************************************/ static void twi_timeout(int argc, uint32_t arg, ...) { @@ -624,13 +624,13 @@ static void twi_timeout(int argc, uint32_t arg, ...) twi_wakeup(priv, -ETIMEDOUT); } -/******************************************************************************* +/**************************************************************************** * Name: twi_startread * * Description: * Start the next read message * - *******************************************************************************/ + ****************************************************************************/ static void twi_startread(struct twi_dev_s *priv, struct i2c_msg_s *msg) { @@ -661,13 +661,13 @@ static void twi_startread(struct twi_dev_s *priv, struct i2c_msg_s *msg) twi_putrel(priv, SAM_TWI_CR_OFFSET, TWI_CR_START); } -/******************************************************************************* +/**************************************************************************** * Name: twi_startwrite * * Description: * Start the next write message * - *******************************************************************************/ + ****************************************************************************/ static void twi_startwrite(struct twi_dev_s *priv, struct i2c_msg_s *msg) { @@ -694,13 +694,13 @@ static void twi_startwrite(struct twi_dev_s *priv, struct i2c_msg_s *msg) twi_putrel(priv, SAM_TWI_IER_OFFSET, TWI_INT_TXRDY | TWI_INT_ERRORS); } -/******************************************************************************* +/**************************************************************************** * Name: twi_startmessage * * Description: * Start the next write message * - *******************************************************************************/ + ****************************************************************************/ static void twi_startmessage(struct twi_dev_s *priv, struct i2c_msg_s *msg) { @@ -714,17 +714,17 @@ static void twi_startmessage(struct twi_dev_s *priv, struct i2c_msg_s *msg) } } -/******************************************************************************* +/**************************************************************************** * I2C device operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: twi_setfrequency * * Description: * Set the frequency for the next transfer * - *******************************************************************************/ + ****************************************************************************/ static uint32_t twi_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) { @@ -744,13 +744,13 @@ static uint32_t twi_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) return actual; } -/******************************************************************************* +/**************************************************************************** * Name: twi_setaddress * * Description: * Set the I2C slave address for a subsequent read/write * - *******************************************************************************/ + ****************************************************************************/ static int twi_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) { @@ -772,14 +772,14 @@ static int twi_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: twi_write * * Description: * Send a block of data on I2C using the previously selected I2C * frequency and slave address. * - *******************************************************************************/ + ****************************************************************************/ static int twi_write(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, int wbuflen) { @@ -838,14 +838,14 @@ static int twi_write(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, int wbuf return ret; } -/******************************************************************************* +/**************************************************************************** * Name: twi_read * * Description: * Receive a block of data on I2C using the previously selected I2C * frequency and slave address. * - *******************************************************************************/ + ****************************************************************************/ static int twi_read(FAR struct i2c_dev_s *dev, uint8_t *rbuffer, int rbuflen) { @@ -904,12 +904,12 @@ static int twi_read(FAR struct i2c_dev_s *dev, uint8_t *rbuffer, int rbuflen) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: twi_writeread * * Description: * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_I2C_WRITEREAD static int twi_writeread(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, @@ -971,12 +971,12 @@ static int twi_writeread(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, } #endif -/******************************************************************************* +/**************************************************************************** * Name: twi_setownaddress * * Description: * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_I2C_SLAVE static int twi_setownaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) @@ -986,12 +986,12 @@ static int twi_setownaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) } #endif -/******************************************************************************* +/**************************************************************************** * Name: twi_registercallback * * Description: * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_I2C_SLAVE static int twi_registercallback(FAR struct i2c_dev_s *dev, @@ -1002,14 +1002,14 @@ static int twi_registercallback(FAR struct i2c_dev_s *dev, } #endif -/******************************************************************************* +/**************************************************************************** * Name: twi_transfer * * Description: * Receive a block of data on I2C using the previously selected I2C * frequency and slave address. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_I2C_TRANSFER static int twi_transfer(FAR struct i2c_dev_s *dev, @@ -1055,17 +1055,17 @@ static int twi_transfer(FAR struct i2c_dev_s *dev, } #endif -/******************************************************************************* +/**************************************************************************** * Initialization - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: twi_hw_setfrequency * * Description: * Set the frequency for the next transfer * - *******************************************************************************/ + ****************************************************************************/ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency) { @@ -1115,13 +1115,13 @@ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency) return actual; } -/******************************************************************************* +/**************************************************************************** * Name: twi_hw_initialize * * Description: * Initialize one TWI peripheral for I2C operation * - *******************************************************************************/ + ****************************************************************************/ static void twi_hw_initialize(struct twi_dev_s *priv, unsigned int pid, uint32_t frequency) @@ -1191,17 +1191,17 @@ static void twi_hw_initialize(struct twi_dev_s *priv, unsigned int pid, (void)twi_hw_setfrequency(priv, frequency); } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_i2cinitialize * * Description: * Initialize a TWI device for I2C operation * - *******************************************************************************/ + ****************************************************************************/ struct i2c_dev_s *up_i2cinitialize(int bus) { @@ -1305,13 +1305,13 @@ struct i2c_dev_s *up_i2cinitialize(int bus) return &priv->dev; } -/******************************************************************************* +/**************************************************************************** * Name: up_i2cuninitalize * * Description: * Uninitialise an I2C device * - *******************************************************************************/ + ****************************************************************************/ int up_i2cuninitialize(FAR struct i2c_dev_s * dev) { diff --git a/arch/arm/src/sam34/sam_udp.c b/arch/arm/src/sam34/sam_udp.c index 3227b53afb..29e66e3cdf 100644 --- a/arch/arm/src/sam34/sam_udp.c +++ b/arch/arm/src/sam34/sam_udp.c @@ -594,13 +594,13 @@ const struct trace_msg_t g_usb_trace_strings_intdecode[] = /**************************************************************************** * Register Operations ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: sam_printreg * * Description: * Print the contents of a SAM34 UDP registers * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAM34_UDP_REGDEBUG static void sam_printreg(uintptr_t regaddr, uint32_t regval, bool iswrite) @@ -609,14 +609,14 @@ static void sam_printreg(uintptr_t regaddr, uint32_t regval, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_checkreg * * Description: * Check if it is time to output debug information for accesses to a SAM34 * UDP registers * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAM34_UDP_REGDEBUG static void sam_checkreg(uintptr_t regaddr, uint32_t regval, bool iswrite) @@ -674,13 +674,13 @@ static void sam_checkreg(uintptr_t regaddr, uint32_t regval, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_getreg * * Description: * Get the contents of an SAM34 register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAM34_UDP_REGDEBUG static uint32_t sam_getreg(uintptr_t regaddr) @@ -701,13 +701,13 @@ static inline uint32_t sam_getreg(uintptr_t regaddr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_putreg * * Description: * Set the contents of an SAM34 register to a value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAM34_UDP_REGDEBUG static void sam_putreg(uint32_t regval, uintptr_t regaddr) diff --git a/arch/arm/src/sama5/sam_ehci.c b/arch/arm/src/sama5/sam_ehci.c index 6fbc135769..cf622bd039 100644 --- a/arch/arm/src/sama5/sam_ehci.c +++ b/arch/arm/src/sama5/sam_ehci.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/sama5/sam_ehci.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -68,9 +68,9 @@ #ifdef CONFIG_SAMA5_EHCI -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ /* Pre-requisites */ @@ -162,9 +162,9 @@ #define RHPNDX(rh) ((rh)->hport.hport.port) #define RHPORT(rh) (RHPNDX(rh)+1) -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* Internal representation of the EHCI Queue Head (QH) */ struct sam_epinfo_s; @@ -276,9 +276,9 @@ struct sam_ehci_s struct sam_rhport_s rhport[SAM_EHCI_NRHPORT]; }; -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Register operations ********************************************************/ @@ -438,9 +438,9 @@ static void sam_disconnect(FAR struct usbhost_driver_s *drvr, static int sam_reset(void); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ /* In this driver implementation, support is provided for only a single a single * USB device. All status information can be simply retained in a single global * instance. @@ -507,19 +507,19 @@ static struct sam_qtd_s *g_qtdpool; #endif -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Register Operations - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: sam_read16 * * Description: * Read 16-bit little endian data * - *******************************************************************************/ + ****************************************************************************/ static uint16_t sam_read16(const uint8_t *addr) { @@ -530,13 +530,13 @@ static uint16_t sam_read16(const uint8_t *addr) #endif } -/******************************************************************************* +/**************************************************************************** * Name: sam_read32 * * Description: * Read 32-bit little endian data * - *******************************************************************************/ + ****************************************************************************/ static inline uint32_t sam_read32(const uint8_t *addr) { @@ -549,13 +549,13 @@ static inline uint32_t sam_read32(const uint8_t *addr) #endif } -/******************************************************************************* +/**************************************************************************** * Name: sam_write16 * * Description: * Write 16-bit little endian data * - *******************************************************************************/ + ****************************************************************************/ #if 0 /* Not used */ static void sam_write16(uint16_t memval, uint8_t *addr) @@ -570,13 +570,13 @@ static void sam_write16(uint16_t memval, uint8_t *addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_write32 * * Description: * Write 32-bit little endian data * - *******************************************************************************/ + ****************************************************************************/ #if 0 /* Not used */ static void sam_write32(uint32_t memval, uint8_t *addr) @@ -591,13 +591,13 @@ static void sam_write32(uint32_t memval, uint8_t *addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_swap16 * * Description: * Swap bytes on a 16-bit value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ENDIAN_BIG static uint16_t sam_swap16(uint16_t value) @@ -606,13 +606,13 @@ static uint16_t sam_swap16(uint16_t value) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_swap32 * * Description: * Swap bytes on a 32-bit value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ENDIAN_BIG static uint32_t sam_swap32(uint32_t value) @@ -622,13 +622,13 @@ static uint32_t sam_swap32(uint32_t value) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_printreg * * Description: * Print the contents of a SAMA5 EHCI register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_EHCI_REGDEBUG static void sam_printreg(volatile uint32_t *regaddr, uint32_t regval, @@ -638,14 +638,14 @@ static void sam_printreg(volatile uint32_t *regaddr, uint32_t regval, } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_checkreg * * Description: * Check if it is time to output debug information for accesses to a SAMA5 * EHCI register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_EHCI_REGDEBUG static void sam_checkreg(volatile uint32_t *regaddr, uint32_t regval, bool iswrite) @@ -703,13 +703,13 @@ static void sam_checkreg(volatile uint32_t *regaddr, uint32_t regval, bool iswri } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_getreg * * Description: * Get the contents of an SAMA5 register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_EHCI_REGDEBUG static uint32_t sam_getreg(volatile uint32_t *regaddr) @@ -730,13 +730,13 @@ static inline uint32_t sam_getreg(volatile uint32_t *regaddr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_putreg * * Description: * Set the contents of an SAMA5 register to a value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_EHCI_REGDEBUG static void sam_putreg(uint32_t regval, volatile uint32_t *regaddr) @@ -756,7 +756,7 @@ static inline void sam_putreg(uint32_t regval, volatile uint32_t *regaddr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: ehci_wait_usbsts * * Description: @@ -764,7 +764,7 @@ static inline void sam_putreg(uint32_t regval, volatile uint32_t *regaddr) * value, (2) for a timeout to occur, or (3) a error to occur. Return * a value to indicate which terminated the wait. * - *******************************************************************************/ + ****************************************************************************/ static int ehci_wait_usbsts(uint32_t maskbits, uint32_t donebits, unsigned int delay) @@ -806,17 +806,17 @@ static int ehci_wait_usbsts(uint32_t maskbits, uint32_t donebits, return (regval == donebits) ? OK : -ETIMEDOUT; } -/******************************************************************************* +/**************************************************************************** * Semaphores - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: sam_takesem * * Description: * This is just a wrapper to handle the annoying behavior of semaphore * waits that return due to the receipt of a signal. * - *******************************************************************************/ + ****************************************************************************/ static void sam_takesem(sem_t *sem) { @@ -832,10 +832,10 @@ static void sam_takesem(sem_t *sem) } } -/******************************************************************************* +/**************************************************************************** * Allocators - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: sam_qh_alloc * * Description: @@ -843,7 +843,7 @@ static void sam_takesem(sem_t *sem) * * Assumption: Caller holds the exclsem * - *******************************************************************************/ + ****************************************************************************/ static struct sam_qh_s *sam_qh_alloc(void) { @@ -861,7 +861,7 @@ static struct sam_qh_s *sam_qh_alloc(void) return qh; } -/******************************************************************************* +/**************************************************************************** * Name: sam_qh_free * * Description: @@ -869,7 +869,7 @@ static struct sam_qh_s *sam_qh_alloc(void) * * Assumption: Caller holds the exclsem * - *******************************************************************************/ + ****************************************************************************/ static void sam_qh_free(struct sam_qh_s *qh) { @@ -881,7 +881,7 @@ static void sam_qh_free(struct sam_qh_s *qh) g_ehci.qhfree = entry; } -/******************************************************************************* +/**************************************************************************** * Name: sam_qtd_alloc * * Description: @@ -890,7 +890,7 @@ static void sam_qh_free(struct sam_qh_s *qh) * * Assumption: Caller holds the exclsem * - *******************************************************************************/ + ****************************************************************************/ static struct sam_qtd_s *sam_qtd_alloc(void) { @@ -908,7 +908,7 @@ static struct sam_qtd_s *sam_qtd_alloc(void) return qtd; } -/******************************************************************************* +/**************************************************************************** * Name: sam_qtd_free * * Description: @@ -917,7 +917,7 @@ static struct sam_qtd_s *sam_qtd_alloc(void) * * Assumption: Caller holds the exclsem * - *******************************************************************************/ + ****************************************************************************/ static void sam_qtd_free(struct sam_qtd_s *qtd) { @@ -929,11 +929,11 @@ static void sam_qtd_free(struct sam_qtd_s *qtd) g_ehci.qtdfree = entry; } -/******************************************************************************* +/**************************************************************************** * List Management - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: sam_qh_foreach * * Description: @@ -941,7 +941,7 @@ static void sam_qtd_free(struct sam_qtd_s *qtd) * handler for each QH structure in the list (including the one at the head * of the list). * - *******************************************************************************/ + ****************************************************************************/ static int sam_qh_foreach(struct sam_qh_s *qh, uint32_t **bp, foreach_qh_t handler, void *arg) @@ -1013,14 +1013,14 @@ static int sam_qh_foreach(struct sam_qh_s *qh, uint32_t **bp, foreach_qh_t handl return OK; } -/******************************************************************************* +/**************************************************************************** * Name: sam_qtd_foreach * * Description: * Give a Queue Head (QH) instance, call the handler for each qTD structure * in the queue. * - *******************************************************************************/ + ****************************************************************************/ static int sam_qtd_foreach(struct sam_qh_s *qh, foreach_qtd_t handler, void *arg) { @@ -1094,14 +1094,14 @@ static int sam_qtd_foreach(struct sam_qh_s *qh, foreach_qtd_t handler, void *arg return OK; } -/******************************************************************************* +/**************************************************************************** * Name: sam_qtd_discard * * Description: * This is a sam_qtd_foreach callback. It simply unlinks the QTD, updates * the back pointer, and frees the QTD structure. * - *******************************************************************************/ + ****************************************************************************/ static int sam_qtd_discard(struct sam_qtd_s *qtd, uint32_t **bp, void *arg) { @@ -1120,7 +1120,7 @@ static int sam_qtd_discard(struct sam_qtd_s *qtd, uint32_t **bp, void *arg) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: sam_qh_discard * * Description: @@ -1130,7 +1130,7 @@ static int sam_qtd_discard(struct sam_qtd_s *qtd, uint32_t **bp, void *arg) * The QH structure itself has already been unlinked from whatever list it * may have been in. * - *******************************************************************************/ + ****************************************************************************/ static int sam_qh_discard(struct sam_qh_s *qh) { @@ -1152,18 +1152,18 @@ static int sam_qh_discard(struct sam_qh_s *qh) return ret; } -/******************************************************************************* +/**************************************************************************** * Cache Operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: sam_qtd_invalidate * * Description: * This is a callback from sam_qtd_foreach. It simply invalidates D-cache for * address range of the qTD entry. * - *******************************************************************************/ + ****************************************************************************/ #if 0 /* Not used */ static int sam_qtd_invalidate(struct sam_qtd_s *qtd, uint32_t **bp, void *arg) @@ -1178,13 +1178,13 @@ static int sam_qtd_invalidate(struct sam_qtd_s *qtd, uint32_t **bp, void *arg) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_qh_invalidate * * Description: * Invalidate the Queue Head and all qTD entries in the queue. * - *******************************************************************************/ + ****************************************************************************/ #if 0 /* Not used */ static int sam_qh_invalidate(struct sam_qh_s *qh) @@ -1200,14 +1200,14 @@ static int sam_qh_invalidate(struct sam_qh_s *qh) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_qtd_flush * * Description: * This is a callback from sam_qtd_foreach. It simply flushes D-cache for * address range of the qTD entry. * - *******************************************************************************/ + ****************************************************************************/ static int sam_qtd_flush(struct sam_qtd_s *qtd, uint32_t **bp, void *arg) { @@ -1229,13 +1229,13 @@ static int sam_qtd_flush(struct sam_qtd_s *qtd, uint32_t **bp, void *arg) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: sam_qh_flush * * Description: * Invalidate the Queue Head and all qTD entries in the queue. * - *******************************************************************************/ + ****************************************************************************/ static int sam_qh_flush(struct sam_qh_s *qh) { @@ -1259,17 +1259,17 @@ static int sam_qh_flush(struct sam_qh_s *qh) return sam_qtd_foreach(qh, sam_qtd_flush, NULL); } -/******************************************************************************* +/**************************************************************************** * Endpoint Transfer Handling - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: sam_qtd_print * * Description: * Print the context of one qTD * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_EHCI_REGDEBUG static void sam_qtd_print(struct sam_qtd_s *qtd) @@ -1284,13 +1284,13 @@ static void sam_qtd_print(struct sam_qtd_s *qtd) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_qh_print * * Description: * Print the context of one QH * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_EHCI_REGDEBUG static void sam_qh_print(struct sam_qh_s *qh) @@ -1326,14 +1326,14 @@ static void sam_qh_print(struct sam_qh_s *qh) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_qtd_dump * * Description: * This is a sam_qtd_foreach callout function. It dumps the context of one * qTD * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_EHCI_REGDEBUG static int sam_qtd_dump(struct sam_qtd_s *qtd, uint32_t **bp, void *arg) @@ -1343,14 +1343,14 @@ static int sam_qtd_dump(struct sam_qtd_s *qtd, uint32_t **bp, void *arg) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_qh_dump * * Description: * This is a sam_qh_foreach callout function. It dumps a QH structure and * all of the qTD structures linked to the QH. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_EHCI_REGDEBUG static int sam_qh_dump(struct sam_qh_s *qh, uint32_t **bp, void *arg) @@ -1360,14 +1360,14 @@ static int sam_qh_dump(struct sam_qh_s *qh, uint32_t **bp, void *arg) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_ehci_speed * * Description: * Map a speed enumeration value per Chapter 9 of the USB specification to the * speed enumeration required in the EHCI queue head. * - *******************************************************************************/ + ****************************************************************************/ static inline uint8_t sam_ehci_speed(uint8_t usbspeed) { @@ -1375,7 +1375,7 @@ static inline uint8_t sam_ehci_speed(uint8_t usbspeed) return g_ehci_speed[usbspeed]; } -/******************************************************************************* +/**************************************************************************** * Name: sam_ioc_setup * * Description: @@ -1386,7 +1386,7 @@ static inline uint8_t sam_ehci_speed(uint8_t usbspeed) * * Assumption: The caller holds tex EHCI exclsem * - *******************************************************************************/ + ****************************************************************************/ static int sam_ioc_setup(struct sam_rhport_s *rhport, struct sam_epinfo_s *epinfo) { @@ -1423,7 +1423,7 @@ static int sam_ioc_setup(struct sam_rhport_s *rhport, struct sam_epinfo_s *epinf return ret; } -/******************************************************************************* +/**************************************************************************** * Name: sam_ioc_wait * * Description: @@ -1432,7 +1432,7 @@ static int sam_ioc_setup(struct sam_rhport_s *rhport, struct sam_epinfo_s *epinf * Assumption: The caller does *NOT* hold the EHCI exclsem. That would cause * a deadlock when the bottom-half, worker thread needs to take the semaphore. * - *******************************************************************************/ + ****************************************************************************/ static int sam_ioc_wait(struct sam_epinfo_s *epinfo) { @@ -1446,7 +1446,7 @@ static int sam_ioc_wait(struct sam_epinfo_s *epinfo) return epinfo->result; } -/******************************************************************************* +/**************************************************************************** * Name: sam_qh_enqueue * * Description: @@ -1454,7 +1454,7 @@ static int sam_ioc_wait(struct sam_epinfo_s *epinfo) * * Assumptions: The caller holds the EHCI exclsem * - *******************************************************************************/ + ****************************************************************************/ static void sam_qh_enqueue(struct sam_qh_s *qhead, struct sam_qh_s *qh) { @@ -1487,13 +1487,13 @@ static void sam_qh_enqueue(struct sam_qh_s *qhead, struct sam_qh_s *qh) (uintptr_t)&qhead->hw + sizeof(struct ehci_qh_s)); } -/******************************************************************************* +/**************************************************************************** * Name: sam_qh_create * * Description: * Create a new Queue Head (QH) * - *******************************************************************************/ + ****************************************************************************/ static struct sam_qh_s *sam_qh_create(struct sam_rhport_s *rhport, struct sam_epinfo_s *epinfo) @@ -1624,13 +1624,13 @@ static struct sam_qh_s *sam_qh_create(struct sam_rhport_s *rhport, return qh; } -/******************************************************************************* +/**************************************************************************** * Name: sam_qtd_addbpl * * Description: * Add a buffer pointer list to a qTD. * - *******************************************************************************/ + ****************************************************************************/ static int sam_qtd_addbpl(struct sam_qtd_s *qtd, const void *buffer, size_t buflen) { @@ -1704,13 +1704,13 @@ static int sam_qtd_addbpl(struct sam_qtd_s *qtd, const void *buffer, size_t bufl return OK; } -/******************************************************************************* +/**************************************************************************** * Name: sam_qtd_setupphase * * Description: * Create a SETUP phase request qTD. * - *******************************************************************************/ + ****************************************************************************/ static struct sam_qtd_s *sam_qtd_setupphase(struct sam_epinfo_s *epinfo, const struct usb_ctrlreq_s *req) @@ -1771,13 +1771,13 @@ static struct sam_qtd_s *sam_qtd_setupphase(struct sam_epinfo_s *epinfo, return qtd; } -/******************************************************************************* +/**************************************************************************** * Name: sam_qtd_dataphase * * Description: * Create a data transfer or SET data phase qTD. * - *******************************************************************************/ + ****************************************************************************/ static struct sam_qtd_s *sam_qtd_dataphase(struct sam_epinfo_s *epinfo, void *buffer, int buflen, @@ -1839,13 +1839,13 @@ static struct sam_qtd_s *sam_qtd_dataphase(struct sam_epinfo_s *epinfo, return qtd; } -/******************************************************************************* +/**************************************************************************** * Name: sam_qtd_statusphase * * Description: * Create a STATUS phase request qTD. * - *******************************************************************************/ + ****************************************************************************/ static struct sam_qtd_s *sam_qtd_statusphase(uint32_t tokenbits) { @@ -1888,7 +1888,7 @@ static struct sam_qtd_s *sam_qtd_statusphase(uint32_t tokenbits) return qtd; } -/******************************************************************************* +/**************************************************************************** * Name: sam_async_setup * * Description: @@ -1906,7 +1906,7 @@ static struct sam_qtd_s *sam_qtd_statusphase(uint32_t tokenbits) * Zero (OK) is returned on success; a negated errno value is return on * any failure. * - *******************************************************************************/ + ****************************************************************************/ static int sam_async_setup(struct sam_rhport_s *rhport, struct sam_epinfo_s *epinfo, @@ -2140,7 +2140,7 @@ errout_with_qh: return ret; } -/******************************************************************************* +/**************************************************************************** * Name: sam_intr_setup * * Description: @@ -2186,7 +2186,7 @@ errout_with_qh: * Zero (OK) is returned on success; a negated errno value is return on * any failure. * - *******************************************************************************/ + ****************************************************************************/ #ifndef CONFIG_USBHOST_INT_DISABLE static int sam_intr_setup(struct sam_rhport_s *rhport, @@ -2278,7 +2278,7 @@ errout_with_qh: } #endif /* CONFIG_USBHOST_INT_DISABLE */ -/******************************************************************************* +/**************************************************************************** * Name: sam_transfer_wait * * Description: @@ -2295,7 +2295,7 @@ errout_with_qh: * plus the size of the data (which could be short); For bulk transfers, this * will be the number of data bytes transfers (which could be short). * - *******************************************************************************/ + ****************************************************************************/ static ssize_t sam_transfer_wait(struct sam_epinfo_s *epinfo) { @@ -2357,7 +2357,7 @@ static ssize_t sam_transfer_wait(struct sam_epinfo_s *epinfo) return epinfo->xfrd; } -/******************************************************************************* +/**************************************************************************** * Name: sam_ioc_async_setup * * Description: @@ -2375,7 +2375,7 @@ static ssize_t sam_transfer_wait(struct sam_epinfo_s *epinfo) * Assumptions: * - Called from the interrupt level * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static inline int sam_ioc_async_setup(struct sam_rhport_s *rhport, @@ -2411,7 +2411,7 @@ static inline int sam_ioc_async_setup(struct sam_rhport_s *rhport, } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_asynch_completion * * Description: @@ -2428,7 +2428,7 @@ static inline int sam_ioc_async_setup(struct sam_rhport_s *rhport, * Assumptions: * - Called from the interrupt level * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static void sam_asynch_completion(struct sam_epinfo_s *epinfo) @@ -2466,11 +2466,11 @@ static void sam_asynch_completion(struct sam_epinfo_s *epinfo) } #endif -/******************************************************************************* +/**************************************************************************** * EHCI Interrupt Handling - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: sam_qtd_ioccheck * * Description: @@ -2478,7 +2478,7 @@ static void sam_asynch_completion(struct sam_epinfo_s *epinfo) * qTD in the asynchronous queue. It removes all of the qTD structures that * are no longer active. * - *******************************************************************************/ + ****************************************************************************/ static int sam_qtd_ioccheck(struct sam_qtd_s *qtd, uint32_t **bp, void *arg) { @@ -2517,7 +2517,7 @@ static int sam_qtd_ioccheck(struct sam_qtd_s *qtd, uint32_t **bp, void *arg) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: sam_qh_ioccheck * * Description: @@ -2526,7 +2526,7 @@ static int sam_qtd_ioccheck(struct sam_qtd_s *qtd, uint32_t **bp, void *arg) * remove all of the structures that are no longer active. if all of the * qTD structures are removed, then QH itself will also be removed. * - *******************************************************************************/ + ****************************************************************************/ static int sam_qh_ioccheck(struct sam_qh_s *qh, uint32_t **bp, void *arg) { @@ -2676,14 +2676,14 @@ static int sam_qh_ioccheck(struct sam_qh_s *qh, uint32_t **bp, void *arg) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: sam_qtd_cancel * * Description: * This function is a sam_qtd_foreach() callback function. It removes each * qTD attached to a QH. * - *******************************************************************************/ + ****************************************************************************/ static int sam_qtd_cancel(struct sam_qtd_s *qtd, uint32_t **bp, void *arg) { @@ -2713,7 +2713,7 @@ static int sam_qtd_cancel(struct sam_qtd_s *qtd, uint32_t **bp, void *arg) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: sam_qh_cancel * * Description: @@ -2722,7 +2722,7 @@ static int sam_qtd_cancel(struct sam_qtd_s *qtd, uint32_t **bp, void *arg) * and remove all of the structures that are no longer active. Then QH * itself will also be removed. * - *******************************************************************************/ + ****************************************************************************/ static int sam_qh_cancel(struct sam_qh_s *qh, uint32_t **bp, void *arg) { @@ -2786,7 +2786,7 @@ static int sam_qh_cancel(struct sam_qh_s *qh, uint32_t **bp, void *arg) return 1; } -/******************************************************************************* +/**************************************************************************** * Name: sam_ioc_bottomhalf * * Description: @@ -2802,7 +2802,7 @@ static int sam_qh_cancel(struct sam_qh_s *qh, uint32_t **bp, void *arg) * * Assumptions: The caller holds the EHCI exclsem * - *******************************************************************************/ + ****************************************************************************/ static inline void sam_ioc_bottomhalf(void) { @@ -2868,7 +2868,7 @@ static inline void sam_ioc_bottomhalf(void) #endif } -/******************************************************************************* +/**************************************************************************** * Name: sam_portsc_bottomhalf * * Description: @@ -2888,7 +2888,7 @@ static inline void sam_ioc_bottomhalf(void) * bits (including: Force port resume, over-current change, enable/disable * change and connect status change)." * - *******************************************************************************/ + ****************************************************************************/ static inline void sam_portsc_bottomhalf(void) { @@ -2990,7 +2990,7 @@ static inline void sam_portsc_bottomhalf(void) } } -/******************************************************************************* +/**************************************************************************** * Name: sam_syserr_bottomhalf * * Description: @@ -3001,7 +3001,7 @@ static inline void sam_portsc_bottomhalf(void) * error occurs, the Host Controller clears the Run/Stop bit in the Command * register to prevent further execution of the scheduled TDs." * - *******************************************************************************/ + ****************************************************************************/ static inline void sam_syserr_bottomhalf(void) { @@ -3009,7 +3009,7 @@ static inline void sam_syserr_bottomhalf(void) PANIC(); } -/******************************************************************************* +/**************************************************************************** * Name: sam_async_advance_bottomhalf * * Description: @@ -3021,7 +3021,7 @@ static inline void sam_syserr_bottomhalf(void) * register. This status bit indicates the assertion of that interrupt * source." * - *******************************************************************************/ + ****************************************************************************/ static inline void sam_async_advance_bottomhalf(void) { @@ -3030,13 +3030,13 @@ static inline void sam_async_advance_bottomhalf(void) /* REVISIT: Could remove all tagged QH entries here */ } -/******************************************************************************* +/**************************************************************************** * Name: sam_ehci_bottomhalf * * Description: * EHCI "Bottom Half" interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static void sam_ehci_bottomhalf(FAR void *arg) { @@ -3164,13 +3164,13 @@ static void sam_ehci_bottomhalf(FAR void *arg) sam_putreg(EHCI_HANDLED_INTS, &HCOR->usbintr); } -/******************************************************************************* +/**************************************************************************** * Name: sam_ehci_tophalf * * Description: * EHCI "Top Half" interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static int sam_ehci_tophalf(int irq, FAR void *context) { @@ -3222,7 +3222,7 @@ static int sam_ehci_tophalf(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: sam_uhphs_interrupt * * Description: @@ -3230,7 +3230,7 @@ static int sam_ehci_tophalf(int irq, FAR void *context) * owns the interrupt and provides the interrupting event to both the OHCI and * EHCI controllers. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_OHCI static int sam_uhphs_interrupt(int irq, FAR void *context) @@ -3248,10 +3248,10 @@ static int sam_uhphs_interrupt(int irq, FAR void *context) } #endif -/******************************************************************************* +/**************************************************************************** * USB Host Controller Operations - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: sam_wait * * Description: @@ -3274,7 +3274,7 @@ static int sam_uhphs_interrupt(int irq, FAR void *context) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int sam_wait(FAR struct usbhost_connection_s *conn, FAR struct usbhost_hubport_s **hport) @@ -3346,7 +3346,7 @@ static int sam_wait(FAR struct usbhost_connection_s *conn, } } -/******************************************************************************* +/**************************************************************************** * Name: sam_enumerate * * Description: @@ -3372,7 +3372,7 @@ static int sam_wait(FAR struct usbhost_connection_s *conn, * Assumptions: * This function will *not* be called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int sam_rh_enumerate(FAR struct usbhost_connection_s *conn, FAR struct usbhost_hubport_s *hport) @@ -3801,7 +3801,7 @@ static int sam_epfree(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: sam_alloc * * Description: @@ -3831,7 +3831,7 @@ static int sam_epfree(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int sam_alloc(FAR struct usbhost_driver_s *drvr, FAR uint8_t **buffer, FAR size_t *maxlen) @@ -3854,7 +3854,7 @@ static int sam_alloc(FAR struct usbhost_driver_s *drvr, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: sam_free * * Description: @@ -3875,7 +3875,7 @@ static int sam_alloc(FAR struct usbhost_driver_s *drvr, * Assumptions: * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int sam_free(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) { @@ -3963,7 +3963,7 @@ static int sam_iofree(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: sam_ctrlin and sam_ctrlout * * Description: @@ -3996,7 +3996,7 @@ static int sam_iofree(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int sam_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, FAR const struct usb_ctrlreq_s *req, @@ -4068,7 +4068,7 @@ static int sam_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, return sam_ctrlin(drvr, ep0, req, (uint8_t *)buffer); } -/******************************************************************************* +/**************************************************************************** * Name: sam_transfer * * Description: @@ -4104,7 +4104,7 @@ static int sam_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static ssize_t sam_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, FAR uint8_t *buffer, size_t buflen) @@ -4175,7 +4175,7 @@ errout_with_sem: return (ssize_t)ret; } -/******************************************************************************* +/**************************************************************************** * Name: sam_asynch * * Description: @@ -4208,7 +4208,7 @@ errout_with_sem: * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int sam_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, @@ -4517,7 +4517,7 @@ static int sam_connect(FAR struct usbhost_driver_s *drvr, } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_disconnect * * Description: @@ -4540,7 +4540,7 @@ static int sam_connect(FAR struct usbhost_driver_s *drvr, * - Only a single class bound to a single device is supported. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static void sam_disconnect(FAR struct usbhost_driver_s *drvr, FAR struct usbhost_hubport_s *hport) @@ -4549,10 +4549,10 @@ static void sam_disconnect(FAR struct usbhost_driver_s *drvr, hport->devclass = NULL; } -/******************************************************************************* +/**************************************************************************** * Initialization - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: sam_reset * * Description: @@ -4592,7 +4592,7 @@ static void sam_disconnect(FAR struct usbhost_driver_s *drvr, * Assumptions: * - Called during the initialization of the EHCI. * - *******************************************************************************/ + ****************************************************************************/ static int sam_reset(void) { @@ -4666,10 +4666,10 @@ static int sam_reset(void) return (regval & EHCI_USBCMD_HCRESET) != 0 ? -ETIMEDOUT : OK; } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: sam_ehci_initialize * * Description: @@ -4692,7 +4692,7 @@ static int sam_reset(void) * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - *******************************************************************************/ + ****************************************************************************/ FAR struct usbhost_connection_s *sam_ehci_initialize(int controller) { diff --git a/arch/arm/src/sama5/sam_ohci.c b/arch/arm/src/sama5/sam_ohci.c index 273568dde1..39db1a99ef 100644 --- a/arch/arm/src/sama5/sam_ohci.c +++ b/arch/arm/src/sama5/sam_ohci.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/sama5/sam_ohci.c * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -75,9 +75,9 @@ #ifdef CONFIG_SAMA5_OHCI -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ /* Pre-requisites */ @@ -207,9 +207,9 @@ #define RHPNDX(rh) ((rh)->hport.hport.port) #define RHPORT(rh) (RHPNDX(rh)+1) -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* This structure contains one endpoint list. The main reason for the existence * of this structure is to contain the sem_t value associated with the ED. It * doesn't work well within the ED itself because then the semaphore counter @@ -335,9 +335,9 @@ struct sam_list_s /* Variable length buffer data follows */ }; -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Register operations ********************************************************/ @@ -463,9 +463,9 @@ static int sam_connect(struct usbhost_driver_s *drvr, static void sam_disconnect(struct usbhost_driver_s *drvr, struct usbhost_hubport_s *hport); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ /* In this driver implementation, support is provided for only a single a single * USB device. All status information can be simply retained in a single global @@ -505,21 +505,21 @@ static struct sam_gtd_s g_tdalloc[SAMA5_OHCI_NTDS] static uint8_t g_bufalloc[SAM_BUFALLOC] __attribute__ ((aligned (SAMA5_DMA_ALIGN))); -/******************************************************************************* +/**************************************************************************** * Public Data - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: sam_printreg * * Description: * Print the contents of an SAMA5 OHCI register operation * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_OHCI_REGDEBUG static void sam_printreg(uint32_t addr, uint32_t val, bool iswrite) @@ -528,13 +528,13 @@ static void sam_printreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_checkreg * * Description: * Get the contents of an SAMA5 OHCI register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_OHCI_REGDEBUG static void sam_checkreg(uint32_t addr, uint32_t val, bool iswrite) @@ -592,13 +592,13 @@ static void sam_checkreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_getreg * * Description: * Get the contents of an SAMA5 register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_OHCI_REGDEBUG static uint32_t sam_getreg(uint32_t addr) @@ -614,13 +614,13 @@ static uint32_t sam_getreg(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_putreg * * Description: * Set the contents of an SAMA5 register to a value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_OHCI_REGDEBUG static void sam_putreg(uint32_t val, uint32_t addr) @@ -642,7 +642,7 @@ static void sam_putreg(uint32_t val, uint32_t addr) * This is just a wrapper to handle the annoying behavior of semaphore * waits that return due to the receipt of a signal. * - *******************************************************************************/ + ****************************************************************************/ static void sam_takesem(sem_t *sem) { @@ -664,7 +664,7 @@ static void sam_takesem(sem_t *sem) * Description: * Get a (possibly unaligned) 16-bit little endian value. * - *******************************************************************************/ + ****************************************************************************/ static inline uint16_t sam_getle16(const uint8_t *val) { @@ -677,7 +677,7 @@ static inline uint16_t sam_getle16(const uint8_t *val) * Description: * Put a (possibly unaligned) 16-bit little endian value. * - *******************************************************************************/ + ****************************************************************************/ #if 0 /* Not used */ static void sam_putle16(uint8_t *dest, uint16_t val) @@ -687,13 +687,13 @@ static void sam_putle16(uint8_t *dest, uint16_t val) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_edalloc * * Description: * Allocate an endpoint descriptor by removing it from the free list * - *******************************************************************************/ + ****************************************************************************/ static struct sam_ed_s *sam_edalloc(void) { @@ -710,13 +710,13 @@ static struct sam_ed_s *sam_edalloc(void) return ed; } -/******************************************************************************* +/**************************************************************************** * Name: sam_edfree * * Description: * Free an endpoint descriptor by returning to the free list * - *******************************************************************************/ + ****************************************************************************/ static inline void sam_edfree(struct sam_ed_s *ed) { @@ -728,7 +728,7 @@ static inline void sam_edfree(struct sam_ed_s *ed) g_edfree = entry; } -/******************************************************************************* +/**************************************************************************** * Name: sam_tdalloc * * Description: @@ -740,7 +740,7 @@ static inline void sam_edfree(struct sam_ed_s *ed) * handler * - Protection from re-entrance must be assured by the caller * - *******************************************************************************/ + ****************************************************************************/ static struct sam_gtd_s *sam_tdalloc(void) { @@ -762,7 +762,7 @@ static struct sam_gtd_s *sam_tdalloc(void) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: sam_tdfree * * Description: @@ -772,7 +772,7 @@ static struct sam_gtd_s *sam_tdalloc(void) * - Only called from the WDH interrupt handler (and during initialization). * - Interrupts are disabled in any case. * - *******************************************************************************/ + ****************************************************************************/ static void sam_tdfree(struct sam_gtd_s *td) { @@ -783,7 +783,7 @@ static void sam_tdfree(struct sam_gtd_s *td) g_tdfree = tdfree; } -/******************************************************************************* +/**************************************************************************** * Name: sam_tballoc * * Description: @@ -793,7 +793,7 @@ static void sam_tdfree(struct sam_gtd_s *td) * - Never called from an interrupt handler. * - Protection from re-entrance must be assured by the caller * - *******************************************************************************/ + ****************************************************************************/ static uint8_t *sam_tballoc(void) { @@ -806,13 +806,13 @@ static uint8_t *sam_tballoc(void) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: sam_tbfree * * Description: * Return an request/descriptor transfer buffer to the free list * - *******************************************************************************/ + ****************************************************************************/ static void sam_tbfree(uint8_t *buffer) { @@ -825,13 +825,13 @@ static void sam_tbfree(uint8_t *buffer) } } -/******************************************************************************* +/**************************************************************************** * Name: sam_addctrled * * Description: * Helper function to add an ED to the control list. * - *******************************************************************************/ + ****************************************************************************/ static int sam_addctrled(struct sam_ed_s *ed) { @@ -866,13 +866,13 @@ static int sam_addctrled(struct sam_ed_s *ed) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: sam_remctrled * * Description: * Helper function remove an ED from the control list. * - *******************************************************************************/ + ****************************************************************************/ static inline int sam_remctrled(struct sam_ed_s *ed) { @@ -942,13 +942,13 @@ static inline int sam_remctrled(struct sam_ed_s *ed) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: sam_addbulked * * Description: * Helper function to add an ED to the bulk list. * - *******************************************************************************/ + ****************************************************************************/ static inline int sam_addbulked(struct sam_ed_s *ed) { @@ -987,13 +987,13 @@ static inline int sam_addbulked(struct sam_ed_s *ed) #endif } -/******************************************************************************* +/**************************************************************************** * Name: sam_rembulked * * Description: * Helper function remove an ED from the bulk list. * - *******************************************************************************/ + ****************************************************************************/ static inline int sam_rembulked(struct sam_ed_s *ed) { @@ -1067,13 +1067,13 @@ static inline int sam_rembulked(struct sam_ed_s *ed) #endif } -/******************************************************************************* +/**************************************************************************** * Name: sam_getinterval * * Description: * Convert the endpoint polling interval into a HCCA table increment * - *******************************************************************************/ + ****************************************************************************/ #if !defined(CONFIG_USBHOST_INT_DISABLE) || !defined(CONFIG_USBHOST_ISOC_DISABLE) static unsigned int sam_getinterval(uint8_t interval) @@ -1106,14 +1106,14 @@ static unsigned int sam_getinterval(uint8_t interval) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_setinttab * * Description: * Set the interrupt table to the selected value using the provided interval * and offset. * - *******************************************************************************/ + ****************************************************************************/ #if !defined(CONFIG_USBHOST_INT_DISABLE) || !defined(CONFIG_USBHOST_ISOC_DISABLE) static void sam_setinttab(uint32_t value, unsigned int interval, unsigned int offset) @@ -1135,7 +1135,7 @@ static void sam_setinttab(uint32_t value, unsigned int interval, unsigned int of } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_addinted * * Description: @@ -1153,7 +1153,7 @@ static void sam_setinttab(uint32_t value, unsigned int interval, unsigned int of * 1. The minimum support polling rate is 2MS, and * 2. Some devices may get polled at a much higher rate than they request. * - *******************************************************************************/ + ****************************************************************************/ static inline int sam_addinted(const struct usbhost_epdesc_s *epdesc, struct sam_ed_s *ed) @@ -1254,7 +1254,7 @@ static inline int sam_addinted(const struct usbhost_epdesc_s *epdesc, #endif } -/******************************************************************************* +/**************************************************************************** * Name: sam_reminted * * Description: @@ -1272,7 +1272,7 @@ static inline int sam_addinted(const struct usbhost_epdesc_s *epdesc, * 1. The minimum support polling rate is 2MS, and * 2. Some devices may get polled at a much higher rate than they request. * - *******************************************************************************/ + ****************************************************************************/ static inline int sam_reminted(struct sam_ed_s *ed) { @@ -1409,13 +1409,13 @@ static inline int sam_reminted(struct sam_ed_s *ed) #endif } -/******************************************************************************* +/**************************************************************************** * Name: sam_addisoced * * Description: * Helper functions to add an ED to the periodic table. * - *******************************************************************************/ + ****************************************************************************/ static inline int sam_addisoced(const struct usbhost_epdesc_s *epdesc, struct sam_ed_s *ed) @@ -1427,13 +1427,13 @@ static inline int sam_addisoced(const struct usbhost_epdesc_s *epdesc, } -/******************************************************************************* +/**************************************************************************** * Name: sam_remisoced * * Description: * Helper functions to remove an ED from the periodic table. * - *******************************************************************************/ + ****************************************************************************/ static inline int sam_remisoced(struct sam_ed_s *ed) { @@ -1443,14 +1443,14 @@ static inline int sam_remisoced(struct sam_ed_s *ed) return -ENOSYS; } -/******************************************************************************* +/**************************************************************************** * Name: sam_enqueuetd * * Description: * Enqueue a transfer descriptor. Notice that this function only supports * queue on TD per ED. * - *******************************************************************************/ + ****************************************************************************/ static int sam_enqueuetd(struct sam_rhport_s *rhport, struct sam_eplist_s *eplist, struct sam_ed_s *ed, uint32_t dirpid, uint32_t toggle, @@ -1531,7 +1531,7 @@ static int sam_enqueuetd(struct sam_rhport_s *rhport, struct sam_eplist_s *eplis return ret; } -/******************************************************************************* +/**************************************************************************** * Name: sam_ep0enqueue * * Description: @@ -1544,7 +1544,7 @@ static int sam_enqueuetd(struct sam_rhport_s *rhport, struct sam_eplist_s *eplis * Returned Values: * None * - *******************************************************************************/ + ****************************************************************************/ static int sam_ep0enqueue(struct sam_rhport_s *rhport) { @@ -1616,7 +1616,7 @@ static int sam_ep0enqueue(struct sam_rhport_s *rhport) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: sam_ep0dequeue * * Description: @@ -1630,7 +1630,7 @@ static int sam_ep0enqueue(struct sam_rhport_s *rhport) * Returned Values: * None * - *******************************************************************************/ + ****************************************************************************/ static void sam_ep0dequeue(struct sam_eplist_s *ep0) { @@ -1727,7 +1727,7 @@ static void sam_ep0dequeue(struct sam_eplist_s *ep0) ep0->tail = NULL; } -/******************************************************************************* +/**************************************************************************** * Name: sam_wdhwait * * Description: @@ -1736,7 +1736,7 @@ static void sam_ep0dequeue(struct sam_eplist_s *ep0) * We do this to minimize race conditions. This logic would have to be * expanded if we want to have more than one packet in flight at a time! * - *******************************************************************************/ + ****************************************************************************/ static int sam_wdhwait(struct sam_rhport_s *rhport, struct sam_ed_s *ed, uint8_t *buffer, uint16_t buflen) @@ -1773,7 +1773,7 @@ static int sam_wdhwait(struct sam_rhport_s *rhport, struct sam_ed_s *ed, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: sam_wdhasynch * * Description: @@ -1782,7 +1782,7 @@ static int sam_wdhwait(struct sam_rhport_s *rhport, struct sam_ed_s *ed, * transfer). We do this to minimize race conditions. This logic would have * to be expanded if we want to have more than one packet in flight at a time! * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int sam_wdhasynch(struct sam_rhport_s *rhport, struct sam_ed_s *ed, @@ -1820,7 +1820,7 @@ static int sam_wdhasynch(struct sam_rhport_s *rhport, struct sam_ed_s *ed, } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_ctrltd * * Description: @@ -1832,7 +1832,7 @@ static int sam_wdhasynch(struct sam_rhport_s *rhport, struct sam_ed_s *ed, * These are blocking methods; these functions will not return until the * control transfer has completed. * - *******************************************************************************/ + ****************************************************************************/ static int sam_ctrltd(struct sam_rhport_s *rhport, struct sam_eplist_s *eplist, uint32_t dirpid, uint8_t *buffer, size_t buflen) @@ -1926,13 +1926,13 @@ static int sam_ctrltd(struct sam_rhport_s *rhport, struct sam_eplist_s *eplist, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: sam_rhsc_bottomhalf * * Description: * OHCI root hub status change interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static void sam_rhsc_bottomhalf(void) { @@ -2074,13 +2074,13 @@ static void sam_rhsc_bottomhalf(void) } } -/******************************************************************************* +/**************************************************************************** * Name: sam_wdh_bottomhalf * * Description: * OHCI write done head interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static void sam_wdh_bottomhalf(void) { @@ -2224,7 +2224,7 @@ static void sam_wdh_bottomhalf(void) } } -/******************************************************************************* +/**************************************************************************** * Name: sam_ohci_bottomhalf * * Description: @@ -2234,7 +2234,7 @@ static void sam_wdh_bottomhalf(void) * disabled when this function is scheduled so no further interrupts can * occur until this work re-enables OHCI interrupts * - *******************************************************************************/ + ****************************************************************************/ static void sam_ohci_bottomhalf(void *arg) { @@ -2301,11 +2301,11 @@ static void sam_ohci_bottomhalf(void *arg) sam_givesem(&g_ohci.exclsem); } -/******************************************************************************* +/**************************************************************************** * USB Host Controller Operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: sam_wait * * Description: @@ -2328,7 +2328,7 @@ static void sam_ohci_bottomhalf(void *arg) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int sam_wait(struct usbhost_connection_s *conn, struct usbhost_hubport_s **hport) @@ -2416,7 +2416,7 @@ static int sam_wait(struct usbhost_connection_s *conn, } } -/******************************************************************************* +/**************************************************************************** * Name: sam_enumerate * * Description: @@ -2442,7 +2442,7 @@ static int sam_wait(struct usbhost_connection_s *conn, * Assumptions: * This function will *not* be called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int sam_rh_enumerate(struct usbhost_connection_s *conn, struct usbhost_hubport_s *hport) @@ -2894,7 +2894,7 @@ static int sam_epfree(struct usbhost_driver_s *drvr, usbhost_ep_t ep) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: sam_alloc * * Description: @@ -2924,7 +2924,7 @@ static int sam_epfree(struct usbhost_driver_s *drvr, usbhost_ep_t ep) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int sam_alloc(struct usbhost_driver_s *drvr, uint8_t **buffer, size_t *maxlen) @@ -2947,7 +2947,7 @@ static int sam_alloc(struct usbhost_driver_s *drvr, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: sam_free * * Description: @@ -2968,7 +2968,7 @@ static int sam_alloc(struct usbhost_driver_s *drvr, * Assumptions: * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int sam_free(struct usbhost_driver_s *drvr, uint8_t *buffer) { @@ -3053,7 +3053,7 @@ static int sam_iofree(struct usbhost_driver_s *drvr, uint8_t *buffer) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: sam_ctrlin and sam_ctrlout * * Description: @@ -3087,7 +3087,7 @@ static int sam_iofree(struct usbhost_driver_s *drvr, uint8_t *buffer) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int sam_ctrlin(struct usbhost_driver_s *drvr, usbhost_ep_t ep0, const struct usb_ctrlreq_s *req, @@ -3183,7 +3183,7 @@ static int sam_ctrlout(struct usbhost_driver_s *drvr, usbhost_ep_t ep0, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: sam_transfer_common * * Description: @@ -3207,7 +3207,7 @@ static int sam_ctrlout(struct usbhost_driver_s *drvr, usbhost_ep_t ep0, * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int sam_transfer_common(struct sam_rhport_s *rhport, struct sam_eplist_s *eplist, @@ -3267,7 +3267,7 @@ static int sam_transfer_common(struct sam_rhport_s *rhport, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: sam_transfer * * Description: @@ -3302,7 +3302,7 @@ static int sam_transfer_common(struct sam_rhport_s *rhport, * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static ssize_t sam_transfer(struct usbhost_driver_s *drvr, usbhost_ep_t ep, uint8_t *buffer, size_t buflen) @@ -3425,7 +3425,7 @@ errout: return (ssize_t)ret; } -/******************************************************************************* +/**************************************************************************** * Name: sam_asynch_completion * * Description: @@ -3443,7 +3443,7 @@ errout: * Assumptions: * - Called from the interrupt level * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static void sam_asynch_completion(struct sam_eplist_s *eplist) @@ -3522,7 +3522,7 @@ static void sam_asynch_completion(struct sam_eplist_s *eplist) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_asynch * * Description: @@ -3555,7 +3555,7 @@ static void sam_asynch_completion(struct sam_eplist_s *eplist) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int sam_asynch(struct usbhost_driver_s *drvr, usbhost_ep_t ep, @@ -3807,7 +3807,7 @@ static int sam_connect(struct usbhost_driver_s *drvr, } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_disconnect * * Description: @@ -3830,7 +3830,7 @@ static int sam_connect(struct usbhost_driver_s *drvr, * - Only a single class bound to a single device is supported. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static void sam_disconnect(struct usbhost_driver_s *drvr, struct usbhost_hubport_s *hport) @@ -3858,11 +3858,11 @@ static void sam_disconnect(struct usbhost_driver_s *drvr, hport->devclass = NULL; } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: sam_ohci_initialize * * Description: @@ -3885,7 +3885,7 @@ static void sam_disconnect(struct usbhost_driver_s *drvr, * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - *******************************************************************************/ + ****************************************************************************/ struct usbhost_connection_s *sam_ohci_initialize(int controller) { @@ -4157,7 +4157,7 @@ struct usbhost_connection_s *sam_ohci_initialize(int controller) return &g_ohciconn; } -/******************************************************************************* +/**************************************************************************** * Name: sam_ohci_tophalf * * Description: @@ -4165,7 +4165,7 @@ struct usbhost_connection_s *sam_ohci_initialize(int controller) * EHCI will manage the common UHPHS interrupt and will forward the interrupt * event to this function. * - *******************************************************************************/ + ****************************************************************************/ int sam_ohci_tophalf(int irq, void *context) { diff --git a/arch/arm/src/sama5/sam_twi.c b/arch/arm/src/sama5/sam_twi.c index d45a12c406..99764c8c81 100644 --- a/arch/arm/src/sama5/sam_twi.c +++ b/arch/arm/src/sama5/sam_twi.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/sama5/sam_twi.c * * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. @@ -40,11 +40,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -74,9 +74,9 @@ #if defined(CONFIG_SAMA5_TWI0) || defined(CONFIG_SAMA5_TWI1) || \ defined(CONFIG_SAMA5_TWI2) || defined(CONFIG_SAMA5_TWI3) -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ #ifndef CONFIG_SAMA5_TWI0_FREQUENCY @@ -138,9 +138,9 @@ # define i2cllvdbg(x...) #endif -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* Invariant attributes of a TWI bus */ struct twi_attr_s @@ -185,9 +185,9 @@ struct twi_dev_s #endif }; -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Low-level helper functions */ @@ -262,9 +262,9 @@ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency); static void twi_hw_initialize(struct twi_dev_s *priv, uint32_t frequency); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_TWI0 static const struct twi_attr_s g_twi0attr = @@ -505,7 +505,7 @@ static inline void twi_putrel(struct twi_dev_s *priv, unsigned int offset, * I2C transfer helper functions ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: twi_wait * * Description: @@ -514,7 +514,7 @@ static inline void twi_putrel(struct twi_dev_s *priv, unsigned int offset, * Assumptions: * Interrupts are disabled * - *******************************************************************************/ + ****************************************************************************/ static int twi_wait(struct twi_dev_s *priv, unsigned int size) { @@ -557,13 +557,13 @@ static int twi_wait(struct twi_dev_s *priv, unsigned int size) return priv->result; } -/******************************************************************************* +/**************************************************************************** * Name: twi_wakeup * * Description: * A terminal event has occurred. Wake-up the waiting thread * - *******************************************************************************/ + ****************************************************************************/ static void twi_wakeup(struct twi_dev_s *priv, int result) { @@ -581,13 +581,13 @@ static void twi_wakeup(struct twi_dev_s *priv, int result) twi_givesem(&priv->waitsem); } -/******************************************************************************* +/**************************************************************************** * Name: twi_interrupt * * Description: * The TWI Interrupt Handler * - *******************************************************************************/ + ****************************************************************************/ static int twi_interrupt(struct twi_dev_s *priv) { @@ -734,7 +734,7 @@ static int twi3_interrupt(int irq, FAR void *context) } #endif -/******************************************************************************* +/**************************************************************************** * Name: twi_timeout * * Description: @@ -743,7 +743,7 @@ static int twi3_interrupt(int irq, FAR void *context) * Assumptions: * Called from the timer interrupt handler with interrupts disabled. * - *******************************************************************************/ + ****************************************************************************/ static void twi_timeout(int argc, uint32_t arg, ...) { @@ -753,13 +753,13 @@ static void twi_timeout(int argc, uint32_t arg, ...) twi_wakeup(priv, -ETIMEDOUT); } -/******************************************************************************* +/**************************************************************************** * Name: twi_startread * * Description: * Start the next read message * - *******************************************************************************/ + ****************************************************************************/ static void twi_startread(struct twi_dev_s *priv, struct i2c_msg_s *msg) { @@ -791,13 +791,13 @@ static void twi_startread(struct twi_dev_s *priv, struct i2c_msg_s *msg) twi_putrel(priv, SAM_TWI_CR_OFFSET, TWI_CR_START); } -/******************************************************************************* +/**************************************************************************** * Name: twi_startwrite * * Description: * Start the next write message * - *******************************************************************************/ + ****************************************************************************/ static void twi_startwrite(struct twi_dev_s *priv, struct i2c_msg_s *msg) { @@ -824,13 +824,13 @@ static void twi_startwrite(struct twi_dev_s *priv, struct i2c_msg_s *msg) twi_putrel(priv, SAM_TWI_IER_OFFSET, TWI_INT_TXRDY | TWI_INT_ERRORS); } -/******************************************************************************* +/**************************************************************************** * Name: twi_startmessage * * Description: * Start the next write message * - *******************************************************************************/ + ****************************************************************************/ static void twi_startmessage(struct twi_dev_s *priv, struct i2c_msg_s *msg) { @@ -844,17 +844,17 @@ static void twi_startmessage(struct twi_dev_s *priv, struct i2c_msg_s *msg) } } -/******************************************************************************* +/**************************************************************************** * I2C device operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: twi_setfrequency * * Description: * Set the frequency for the next transfer * - *******************************************************************************/ + ****************************************************************************/ static uint32_t twi_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) { @@ -874,13 +874,13 @@ static uint32_t twi_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) return actual; } -/******************************************************************************* +/**************************************************************************** * Name: twi_setaddress * * Description: * Set the I2C slave address for a subsequent read/write * - *******************************************************************************/ + ****************************************************************************/ static int twi_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) { @@ -902,14 +902,14 @@ static int twi_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: twi_write * * Description: * Send a block of data on I2C using the previously selected I2C * frequency and slave address. * - *******************************************************************************/ + ****************************************************************************/ static int twi_write(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, int wbuflen) { @@ -960,14 +960,14 @@ static int twi_write(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, int wbuf return ret; } -/******************************************************************************* +/**************************************************************************** * Name: twi_read * * Description: * Receive a block of data on I2C using the previously selected I2C * frequency and slave address. * - *******************************************************************************/ + ****************************************************************************/ static int twi_read(FAR struct i2c_dev_s *dev, uint8_t *rbuffer, int rbuflen) { @@ -1018,12 +1018,12 @@ static int twi_read(FAR struct i2c_dev_s *dev, uint8_t *rbuffer, int rbuflen) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: twi_writeread * * Description: * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_I2C_WRITEREAD static int twi_writeread(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, @@ -1095,12 +1095,12 @@ static int twi_writeread(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, } #endif -/******************************************************************************* +/**************************************************************************** * Name: twi_setownaddress * * Description: * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_I2C_SLAVE static int twi_setownaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) @@ -1110,12 +1110,12 @@ static int twi_setownaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) } #endif -/******************************************************************************* +/**************************************************************************** * Name: twi_registercallback * * Description: * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_I2C_SLAVE static int twi_registercallback((FAR struct i2c_dev_s *dev, @@ -1126,7 +1126,7 @@ static int twi_registercallback((FAR struct i2c_dev_s *dev, } #endif -/******************************************************************************* +/**************************************************************************** * Name: twi_transfer * * Description: @@ -1136,7 +1136,7 @@ static int twi_registercallback((FAR struct i2c_dev_s *dev, * Returned Value: * Returns zero on success; a negated errno value on failure. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_I2C_TRANSFER static int twi_transfer(FAR struct i2c_dev_s *dev, @@ -1196,9 +1196,9 @@ static int twi_transfer(FAR struct i2c_dev_s *dev, } #endif -/******************************************************************************* +/**************************************************************************** * Initialization - *******************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Name: twi_enableclk @@ -1227,13 +1227,13 @@ static void twi_enableclk(struct twi_dev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: twi_hw_setfrequency * * Description: * Set the frequency for the next transfer * - *******************************************************************************/ + ****************************************************************************/ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency) { @@ -1287,7 +1287,7 @@ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency) return actual; } -/******************************************************************************* +/**************************************************************************** * Name: twi_hw_initialize * * Description: @@ -1295,7 +1295,7 @@ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency) * repeatable initialization after either (1) the one-time initialization, or * (2) after each bus reset. * - *******************************************************************************/ + ****************************************************************************/ static void twi_hw_initialize(struct twi_dev_s *priv, uint32_t frequency) { @@ -1384,17 +1384,17 @@ static void twi_hw_initialize(struct twi_dev_s *priv, uint32_t frequency) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_i2cinitialize * * Description: * Initialize a TWI device for I2C operation * - *******************************************************************************/ + ****************************************************************************/ struct i2c_dev_s *up_i2cinitialize(int bus) { @@ -1512,13 +1512,13 @@ errout_with_irq: return NULL; } -/******************************************************************************* +/**************************************************************************** * Name: up_i2cuninitalize * * Description: * Uninitialize an I2C device * - *******************************************************************************/ + ****************************************************************************/ int up_i2cuninitialize(FAR struct i2c_dev_s *dev) { diff --git a/arch/arm/src/sama5/sam_udphs.c b/arch/arm/src/sama5/sam_udphs.c index dc89075c26..0c31311f88 100644 --- a/arch/arm/src/sama5/sam_udphs.c +++ b/arch/arm/src/sama5/sam_udphs.c @@ -660,13 +660,13 @@ const struct trace_msg_t g_usb_trace_strings_intdecode[] = /**************************************************************************** * Register Operations ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: sam_printreg * * Description: * Print the contents of a SAMA5 UDPHS register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_UDPHS_REGDEBUG static void sam_printreg(uintptr_t regaddr, uint32_t regval, bool iswrite) @@ -675,14 +675,14 @@ static void sam_printreg(uintptr_t regaddr, uint32_t regval, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_checkreg * * Description: * Check if it is time to output debug information for accesses to a SAMA5 * UDPHS register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_UDPHS_REGDEBUG static void sam_checkreg(uintptr_t regaddr, uint32_t regval, bool iswrite) @@ -740,13 +740,13 @@ static void sam_checkreg(uintptr_t regaddr, uint32_t regval, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_getreg * * Description: * Get the contents of an SAMA5 register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_UDPHS_REGDEBUG static uint32_t sam_getreg(uintptr_t regaddr) @@ -767,13 +767,13 @@ static inline uint32_t sam_getreg(uintptr_t regaddr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_putreg * * Description: * Set the contents of an SAMA5 register to a value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_UDPHS_REGDEBUG static void sam_putreg(uint32_t regval, uintptr_t regaddr) diff --git a/arch/arm/src/samdl/sam_lowputc.c b/arch/arm/src/samdl/sam_lowputc.c index fcc512279d..3b5aff5fb1 100644 --- a/arch/arm/src/samdl/sam_lowputc.c +++ b/arch/arm/src/samdl/sam_lowputc.c @@ -291,7 +291,7 @@ sam_pad_configure(const struct sam_usart_config_s * const config) * This configures the SERCOM as a USART, but does not configure USART * interrupts or enable the USART. * - *****************************************************************************/ + ****************************************************************************/ #ifdef SAMDL_HAVE_USART int sam_usart_internal(const struct sam_usart_config_s * const config) @@ -398,7 +398,7 @@ void sam_lowsetup(void) * This configures the SERCOM as a USART, but does not configure USART * interrupts or enable the USART. * - *****************************************************************************/ + ****************************************************************************/ #ifdef SAMDL_HAVE_USART int sam_usart_initialize(const struct sam_usart_config_s * const config) @@ -428,7 +428,7 @@ int sam_usart_initialize(const struct sam_usart_config_s * const config) * Reset the USART SERCOM. This restores all SERCOM register to the * initial state and disables the SERCOM. * - *****************************************************************************/ + ****************************************************************************/ #ifdef SAMDL_HAVE_USART void sam_usart_reset(const struct sam_usart_config_s * const config) @@ -457,7 +457,7 @@ void sam_usart_reset(const struct sam_usart_config_s * const config) * Description: * Output one character to the USART using a simple polling method. * - *****************************************************************************/ + ****************************************************************************/ #ifdef HAVE_SERIAL_CONSOLE void sam_lowputc(uint32_t ch) diff --git a/arch/arm/src/samv7/sam_twihs.c b/arch/arm/src/samv7/sam_twihs.c index 9f1009653c..9b6957767e 100644 --- a/arch/arm/src/samv7/sam_twihs.c +++ b/arch/arm/src/samv7/sam_twihs.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/samv7/sam_twihs.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. @@ -40,11 +40,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -74,9 +74,9 @@ #if defined(CONFIG_SAMV7_TWIHS0) || defined(CONFIG_SAMV7_TWIHS1) || \ defined(CONFIG_SAMV7_TWIHS2) -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ #ifndef CONFIG_SAMV7_TWIHS0_FREQUENCY @@ -135,9 +135,9 @@ # define i2cllvdbg(x...) #endif -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* Invariant attributes of a TWIHS bus */ struct twi_attr_s @@ -183,9 +183,9 @@ struct twi_dev_s #endif }; -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Low-level helper functions */ @@ -257,9 +257,9 @@ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency); static void twi_hw_initialize(struct twi_dev_s *priv, uint32_t frequency); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMV7_TWIHS0 static const struct twi_attr_s g_twi0attr = @@ -485,7 +485,7 @@ static inline void twi_putrel(struct twi_dev_s *priv, unsigned int offset, * I2C transfer helper functions ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: twi_wait * * Description: @@ -494,7 +494,7 @@ static inline void twi_putrel(struct twi_dev_s *priv, unsigned int offset, * Assumptions: * Interrupts are disabled * - *******************************************************************************/ + ****************************************************************************/ static int twi_wait(struct twi_dev_s *priv, unsigned int size) { @@ -537,13 +537,13 @@ static int twi_wait(struct twi_dev_s *priv, unsigned int size) return priv->result; } -/******************************************************************************* +/**************************************************************************** * Name: twi_wakeup * * Description: * A terminal event has occurred. Wake-up the waiting thread * - *******************************************************************************/ + ****************************************************************************/ static void twi_wakeup(struct twi_dev_s *priv, int result) { @@ -561,13 +561,13 @@ static void twi_wakeup(struct twi_dev_s *priv, int result) twi_givesem(&priv->waitsem); } -/******************************************************************************* +/**************************************************************************** * Name: twi_interrupt * * Description: * The TWIHS Interrupt Handler * - *******************************************************************************/ + ****************************************************************************/ static int twi_interrupt(struct twi_dev_s *priv) { @@ -761,7 +761,7 @@ static int twi2_interrupt(int irq, FAR void *context) } #endif -/******************************************************************************* +/**************************************************************************** * Name: twi_timeout * * Description: @@ -770,7 +770,7 @@ static int twi2_interrupt(int irq, FAR void *context) * Assumptions: * Called from the timer interrupt handler with interrupts disabled. * - *******************************************************************************/ + ****************************************************************************/ static void twi_timeout(int argc, uint32_t arg, ...) { @@ -780,13 +780,13 @@ static void twi_timeout(int argc, uint32_t arg, ...) twi_wakeup(priv, -ETIMEDOUT); } -/******************************************************************************* +/**************************************************************************** * Name: twi_startread * * Description: * Start the next read message * - *******************************************************************************/ + ****************************************************************************/ static void twi_startread(struct twi_dev_s *priv, struct i2c_msg_s *msg) { @@ -818,13 +818,13 @@ static void twi_startread(struct twi_dev_s *priv, struct i2c_msg_s *msg) twi_putrel(priv, SAM_TWIHS_CR_OFFSET, TWIHS_CR_START); } -/******************************************************************************* +/**************************************************************************** * Name: twi_startwrite * * Description: * Start the next write message * - *******************************************************************************/ + ****************************************************************************/ static void twi_startwrite(struct twi_dev_s *priv, struct i2c_msg_s *msg) { @@ -851,13 +851,13 @@ static void twi_startwrite(struct twi_dev_s *priv, struct i2c_msg_s *msg) twi_putrel(priv, SAM_TWIHS_IER_OFFSET, TWIHS_INT_TXRDY | TWIHS_INT_ERRORS); } -/******************************************************************************* +/**************************************************************************** * Name: twi_startmessage * * Description: * Start the next write message * - *******************************************************************************/ + ****************************************************************************/ static void twi_startmessage(struct twi_dev_s *priv, struct i2c_msg_s *msg) { @@ -871,17 +871,17 @@ static void twi_startmessage(struct twi_dev_s *priv, struct i2c_msg_s *msg) } } -/******************************************************************************* +/**************************************************************************** * I2C device operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: twi_setfrequency * * Description: * Set the frequency for the next transfer * - *******************************************************************************/ + ****************************************************************************/ static uint32_t twi_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) { @@ -901,13 +901,13 @@ static uint32_t twi_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) return actual; } -/******************************************************************************* +/**************************************************************************** * Name: twi_setaddress * * Description: * Set the I2C slave address for a subsequent read/write * - *******************************************************************************/ + ****************************************************************************/ static int twi_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) { @@ -929,14 +929,14 @@ static int twi_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: twi_write * * Description: * Send a block of data on I2C using the previously selected I2C * frequency and slave address. * - *******************************************************************************/ + ****************************************************************************/ static int twi_write(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, int wbuflen) { @@ -987,14 +987,14 @@ static int twi_write(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, int wbuf return ret; } -/******************************************************************************* +/**************************************************************************** * Name: twi_read * * Description: * Receive a block of data on I2C using the previously selected I2C * frequency and slave address. * - *******************************************************************************/ + ****************************************************************************/ static int twi_read(FAR struct i2c_dev_s *dev, uint8_t *rbuffer, int rbuflen) { @@ -1045,12 +1045,12 @@ static int twi_read(FAR struct i2c_dev_s *dev, uint8_t *rbuffer, int rbuflen) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: twi_writeread * * Description: * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_I2C_WRITEREAD static int twi_writeread(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, @@ -1122,12 +1122,12 @@ static int twi_writeread(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, } #endif -/******************************************************************************* +/**************************************************************************** * Name: twi_setownaddress * * Description: * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_I2C_SLAVE static int twi_setownaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) @@ -1137,12 +1137,12 @@ static int twi_setownaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) } #endif -/******************************************************************************* +/**************************************************************************** * Name: twi_registercallback * * Description: * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_I2C_SLAVE static int twi_registercallback((FAR struct i2c_dev_s *dev, @@ -1153,7 +1153,7 @@ static int twi_registercallback((FAR struct i2c_dev_s *dev, } #endif -/******************************************************************************* +/**************************************************************************** * Name: twi_transfer * * Description: @@ -1163,7 +1163,7 @@ static int twi_registercallback((FAR struct i2c_dev_s *dev, * Returned Value: * Returns zero on success; a negated errno value on failure. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_I2C_TRANSFER static int twi_transfer(FAR struct i2c_dev_s *dev, @@ -1223,9 +1223,9 @@ static int twi_transfer(FAR struct i2c_dev_s *dev, } #endif -/******************************************************************************* +/**************************************************************************** * Initialization - *******************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Name: twi_enableclk @@ -1254,13 +1254,13 @@ static void twi_enableclk(struct twi_dev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: twi_hw_setfrequency * * Description: * Set the frequency for the next transfer * - *******************************************************************************/ + ****************************************************************************/ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency) { @@ -1314,7 +1314,7 @@ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency) return actual; } -/******************************************************************************* +/**************************************************************************** * Name: twi_hw_initialize * * Description: @@ -1322,7 +1322,7 @@ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency) * repeatable initialization after either (1) the one-time initialization, or * (2) after each bus reset. * - *******************************************************************************/ + ****************************************************************************/ static void twi_hw_initialize(struct twi_dev_s *priv, uint32_t frequency) { @@ -1411,17 +1411,17 @@ static void twi_hw_initialize(struct twi_dev_s *priv, uint32_t frequency) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_i2cinitialize * * Description: * Initialize a TWIHS device for I2C operation * - *******************************************************************************/ + ****************************************************************************/ struct i2c_dev_s *up_i2cinitialize(int bus) { @@ -1535,13 +1535,13 @@ errout_with_irq: return NULL; } -/******************************************************************************* +/**************************************************************************** * Name: up_i2cuninitalize * * Description: * Uninitialize an I2C device * - *******************************************************************************/ + ****************************************************************************/ int up_i2cuninitialize(FAR struct i2c_dev_s *dev) { diff --git a/arch/arm/src/samv7/sam_usbdevhs.c b/arch/arm/src/samv7/sam_usbdevhs.c index d912c400e2..ac95a43795 100644 --- a/arch/arm/src/samv7/sam_usbdevhs.c +++ b/arch/arm/src/samv7/sam_usbdevhs.c @@ -709,13 +709,13 @@ const struct trace_msg_t g_usb_trace_strings_intdecode[] = /**************************************************************************** * Register Operations ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: sam_printreg * * Description: * Print the contents of a SAMV7 USBHS register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMV7_USBHS_REGDEBUG static void sam_printreg(uintptr_t regaddr, uint32_t regval, bool iswrite) @@ -724,14 +724,14 @@ static void sam_printreg(uintptr_t regaddr, uint32_t regval, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_checkreg * * Description: * Check if it is time to output debug information for accesses to a SAMV7 * USBHS register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMV7_USBHS_REGDEBUG static void sam_checkreg(uintptr_t regaddr, uint32_t regval, bool iswrite) @@ -789,13 +789,13 @@ static void sam_checkreg(uintptr_t regaddr, uint32_t regval, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_getreg * * Description: * Get the contents of an SAMV7 register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMV7_USBHS_REGDEBUG static uint32_t sam_getreg(uintptr_t regaddr) @@ -816,13 +816,13 @@ static inline uint32_t sam_getreg(uintptr_t regaddr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_putreg * * Description: * Set the contents of an SAMV7 register to a value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMV7_USBHS_REGDEBUG static void sam_putreg(uint32_t regval, uintptr_t regaddr) diff --git a/arch/arm/src/stm32/stm32_adc.c b/arch/arm/src/stm32/stm32_adc.c index 3368ca8b98..0e72ead540 100644 --- a/arch/arm/src/stm32/stm32_adc.c +++ b/arch/arm/src/stm32/stm32_adc.c @@ -1077,7 +1077,7 @@ static void adc_rccreset(struct stm32_dev_s *priv, bool reset) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: adc_power_down_idle * * Description : Enables or disables power down during the idle phase. @@ -1091,7 +1091,7 @@ static void adc_rccreset(struct stm32_dev_s *priv, bool reset) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_STM32_STM32L15XX static void adc_power_down_idle(FAR struct stm32_dev_s *priv, bool pdi_high) @@ -1118,7 +1118,7 @@ static void adc_power_down_idle(FAR struct stm32_dev_s *priv, bool pdi_high) } #endif -/******************************************************************************* +/**************************************************************************** * Name: adc_power_down_delay * * Description : Enables or disables power down during the delay phase. @@ -1132,7 +1132,7 @@ static void adc_power_down_idle(FAR struct stm32_dev_s *priv, bool pdi_high) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_STM32_STM32L15XX static void adc_power_down_delay(FAR struct stm32_dev_s *priv, bool pdd_high) @@ -1159,7 +1159,7 @@ static void adc_power_down_delay(FAR struct stm32_dev_s *priv, bool pdd_high) } #endif -/******************************************************************************* +/**************************************************************************** * Name: adc_dels_after_conversion * * Description : Defines the length of the delay which is applied @@ -1173,7 +1173,7 @@ static void adc_power_down_delay(FAR struct stm32_dev_s *priv, bool pdd_high) * * Returned Value: * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_STM32_STM32L15XX static void adc_dels_after_conversion(FAR struct stm32_dev_s *priv, @@ -1190,7 +1190,7 @@ static void adc_dels_after_conversion(FAR struct stm32_dev_s *priv, } #endif -/******************************************************************************* +/**************************************************************************** * Name: adc_select_ch_bank * * Description : Selects the bank of channels to be converted @@ -1204,7 +1204,7 @@ static void adc_dels_after_conversion(FAR struct stm32_dev_s *priv, * * Returned Value: * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_STM32_STM32L15XX static void adc_select_ch_bank(FAR struct stm32_dev_s *priv, bool chb_selected) @@ -1228,7 +1228,7 @@ static void adc_select_ch_bank(FAR struct stm32_dev_s *priv, bool chb_selected) } #endif -/******************************************************************************* +/**************************************************************************** * Name: adc_enable * * Description : Enables or disables the specified ADC peripheral. @@ -1242,7 +1242,7 @@ static void adc_select_ch_bank(FAR struct stm32_dev_s *priv, bool chb_selected) * * Returned Value: * - *******************************************************************************/ + ****************************************************************************/ static void adc_enable(FAR struct stm32_dev_s *priv, bool enable) { @@ -2693,7 +2693,7 @@ static int adc123_interrupt(int irq, void *context) * Public Functions ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: adc_change_sample_time * * Description : Changes sample times for specified channels. This method @@ -2712,7 +2712,7 @@ static int adc123_interrupt(int irq, void *context) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_STM32_STM32L15XX void stm32_adcchange_sample_time(FAR struct adc_dev_s *dev, diff --git a/arch/arm/src/stm32/stm32_dma2d.c b/arch/arm/src/stm32/stm32_dma2d.c index 2b619637b5..f9d510821b 100644 --- a/arch/arm/src/stm32/stm32_dma2d.c +++ b/arch/arm/src/stm32/stm32_dma2d.c @@ -1,4 +1,4 @@ -/****************************************************************************** +/**************************************************************************** * arch/arm/src/stm32/stm32_dma2d.c * * Copyright (C) 2014-2015 Marco Krahl. All rights reserved. @@ -34,11 +34,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Included Files - ******************************************************************************/ + ****************************************************************************/ #include @@ -63,9 +63,9 @@ #include "chip/stm32_ccm.h" #include "stm32_dma2d.h" -/****************************************************************************** +/**************************************************************************** * Pre-processor Definitions - ******************************************************************************/ + ****************************************************************************/ /* output, foreground and background layer */ @@ -158,9 +158,9 @@ # error "Enable CONFIG_STM32_CCMEXCLUDE from the heap allocation" #endif -/****************************************************************************** +/**************************************************************************** * Private Types - ******************************************************************************/ + ****************************************************************************/ /* DMA2D General layer information */ @@ -275,9 +275,9 @@ static const uintptr_t stm32_cmar_layer_t[DMA2D_NLAYERS - 1] = STM32_DMA2D_BGCMAR }; -/****************************************************************************** +/**************************************************************************** * Private Function Prototypes - ******************************************************************************/ + ****************************************************************************/ /* Private functions */ @@ -348,9 +348,9 @@ static int stm32_dma2dblend(FAR struct dma2d_layer_s *dest, static int stm32_dma2dfillarea(FAR struct dma2d_layer_s *layer, FAR const struct ltdc_area_s *area, uint32_t color); -/****************************************************************************** +/**************************************************************************** * Private Data - ******************************************************************************/ + ****************************************************************************/ /* Remember the layer references for alloc/deallocation */ @@ -384,15 +384,15 @@ static struct stm32_interrupt_s g_interrupt = .sem = &g_semirq }; -/****************************************************************************** +/**************************************************************************** * Public Data - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Private Functions - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_control * * Description: @@ -477,7 +477,7 @@ static int stm32_dma2dirq(int irq, void *context) return OK; } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_waitforirq * * Description: @@ -522,7 +522,7 @@ static int stm32_dma2d_waitforirq(void) #ifdef CONFIG_STM32_DMA2D_L8 -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_loadclut * * Description: @@ -568,7 +568,7 @@ static int stm32_dma2d_loadclut(uintptr_t pfcreg) } #endif -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_start * * Description: @@ -610,7 +610,7 @@ static int stm32_dma2d_start(void) return ret; } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_memaddress * * Description: @@ -622,7 +622,7 @@ static int stm32_dma2d_start(void) * Return: * memory address * - *****************************************************************************/ + ****************************************************************************/ static uint32_t stm32_dma2d_memaddress(FAR const struct stm32_dma2d_s *layer, fb_coord_t xpos, fb_coord_t ypos) @@ -636,7 +636,7 @@ static uint32_t stm32_dma2d_memaddress(FAR const struct stm32_dma2d_s *layer, return ((uint32_t) pinfo->fbmem) + offset; } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_lineoffset * * Description: @@ -648,7 +648,7 @@ static uint32_t stm32_dma2d_memaddress(FAR const struct stm32_dma2d_s *layer, * Return: * line offset * - *****************************************************************************/ + ****************************************************************************/ static fb_coord_t stm32_dma2d_lineoffset(FAR const struct stm32_dma2d_s *layer, FAR const struct ltdc_area_s *area) @@ -659,7 +659,7 @@ static fb_coord_t stm32_dma2d_lineoffset(FAR const struct stm32_dma2d_s *layer, return layer->vinfo.xres - area->xres; } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_pixelformat * * Description: @@ -673,7 +673,7 @@ static fb_coord_t stm32_dma2d_lineoffset(FAR const struct stm32_dma2d_s *layer, * On success - OK * On error - -EINVAL * - *****************************************************************************/ + ****************************************************************************/ static int stm32_dma2d_pixelformat(uint8_t fmt, uint8_t *fmtmap) { @@ -718,7 +718,7 @@ static int stm32_dma2d_pixelformat(uint8_t fmt, uint8_t *fmtmap) return OK; } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_bpp * * Description: @@ -732,7 +732,7 @@ static int stm32_dma2d_pixelformat(uint8_t fmt, uint8_t *fmtmap) * On success - OK * On error - -EINVAL * - *****************************************************************************/ + ****************************************************************************/ static int stm32_dma2d_bpp(uint8_t fmt, uint8_t *bpp) { @@ -763,7 +763,7 @@ static int stm32_dma2d_bpp(uint8_t fmt, uint8_t *bpp) return OK; } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_lfreelid * * Description: @@ -773,7 +773,7 @@ static int stm32_dma2d_bpp(uint8_t fmt, uint8_t *bpp) * The number of the free layer * -1 if no free layer is available * - ******************************************************************************/ + ****************************************************************************/ static int stm32_dma2d_lfreelid(void) { @@ -790,7 +790,7 @@ static int stm32_dma2d_lfreelid(void) return -1; } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_lalloc * * Description: @@ -799,7 +799,7 @@ static int stm32_dma2d_lfreelid(void) * Return: * A new allocated layer structure or NULL on error. * - ******************************************************************************/ + ****************************************************************************/ static FAR struct stm32_dma2d_s * stm32_dma2d_lalloc(void) { @@ -823,7 +823,7 @@ static FAR struct stm32_dma2d_s * stm32_dma2d_lalloc(void) return layer; } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_lfree * * Description: @@ -832,7 +832,7 @@ static FAR struct stm32_dma2d_s * stm32_dma2d_lalloc(void) * Input Parameters: * A previous allocated layer structure * - ******************************************************************************/ + ****************************************************************************/ static void stm32_dma2d_lfree(FAR struct stm32_dma2d_s *layer) { @@ -853,13 +853,13 @@ static void stm32_dma2d_lfree(FAR struct stm32_dma2d_s *layer) } } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_llayerscleanup * * Description: * Cleanup all allocated layers * - ******************************************************************************/ + ****************************************************************************/ static void stm32_dma2d_llayerscleanup(void) { @@ -879,7 +879,7 @@ static void stm32_dma2d_llayerscleanup(void) } } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_lvalidate * * Description: @@ -888,7 +888,7 @@ static void stm32_dma2d_llayerscleanup(void) * Return: * true if validates otherwise false * - ******************************************************************************/ + ****************************************************************************/ static inline bool stm32_dma2d_lvalidate(FAR const struct stm32_dma2d_s *layer) { @@ -921,7 +921,7 @@ static bool stm32_dma2d_lvalidatesize(FAR const struct stm32_dma2d_s *layer, area->xres * area->yres); } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_linit * * Description: @@ -930,7 +930,7 @@ static bool stm32_dma2d_lvalidatesize(FAR const struct stm32_dma2d_s *layer, * Parameter: * * - ******************************************************************************/ + ****************************************************************************/ static void stm32_dma2d_linit(FAR struct stm32_dma2d_s *layer, int lid, uint8_t fmt) @@ -968,7 +968,7 @@ static void stm32_dma2d_linit(FAR struct stm32_dma2d_s *layer, layer->lock = &g_lock; } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_lfifo * * Description: @@ -992,7 +992,7 @@ static void stm32_dma2d_lfifo(FAR const struct stm32_dma2d_s *layer, int lid, putreg32(stm32_dma2d_lineoffset(layer, area), stm32_or_layer_t[lid]); } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_lcolor * * Description: @@ -1010,7 +1010,7 @@ static void stm32_dma2d_lcolor(FAR const struct stm32_dma2d_s *layer, putreg32(color, stm32_color_layer_t[lid]); } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_llnr * * Description: @@ -1034,7 +1034,7 @@ static void stm32_dma2d_llnr(FAR struct stm32_dma2d_s *layer, putreg32(nlrreg, STM32_DMA2D_NLR); } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_loutpfc * * Description: @@ -1067,7 +1067,7 @@ static int stm32_dma2d_loutpfc(FAR const struct stm32_dma2d_s *layer) return OK; } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2d_lpfc * * Description: @@ -1147,11 +1147,11 @@ static void stm32_dma2d_lpfc(FAR const struct stm32_dma2d_s *layer, putreg32(pfccrreg, stm32_pfccr_layer_t[lid]); } -/****************************************************************************** +/**************************************************************************** * Public Functions - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2dgetvideoinfo * * Description: @@ -1165,7 +1165,7 @@ static void stm32_dma2d_lpfc(FAR const struct stm32_dma2d_s *layer, * On success - OK * On error - -EINVAL * - ******************************************************************************/ + ****************************************************************************/ static int stm32_dma2dgetvideoinfo(FAR struct dma2d_layer_s *layer, FAR struct fb_videoinfo_s *vinfo) @@ -1187,7 +1187,7 @@ static int stm32_dma2dgetvideoinfo(FAR struct dma2d_layer_s *layer, return -ENOSYS; } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2dgetplaneinfo * * Description: @@ -1202,7 +1202,7 @@ static int stm32_dma2dgetvideoinfo(FAR struct dma2d_layer_s *layer, * On success - OK * On error - -EINVAL * - ******************************************************************************/ + ****************************************************************************/ static int stm32_dma2dgetplaneinfo(FAR struct dma2d_layer_s *layer, int planeno, FAR struct fb_planeinfo_s *pinfo) @@ -1224,7 +1224,7 @@ static int stm32_dma2dgetplaneinfo(FAR struct dma2d_layer_s *layer, int planeno, return -EINVAL; } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2dgetlid * * Description: @@ -1238,7 +1238,7 @@ static int stm32_dma2dgetplaneinfo(FAR struct dma2d_layer_s *layer, int planeno, * On success - OK * On error - -EINVAL * - ******************************************************************************/ + ****************************************************************************/ static int stm32_dma2dgetlid(FAR struct dma2d_layer_s *layer, int *lid) { @@ -1259,7 +1259,7 @@ static int stm32_dma2dgetlid(FAR struct dma2d_layer_s *layer, int *lid) } #ifdef CONFIG_STM32_DMA2D_L8 -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2dsetclut * * Description: @@ -1274,7 +1274,7 @@ static int stm32_dma2dgetlid(FAR struct dma2d_layer_s *layer, int *lid) * On success - OK * On error - -EINVAL * - ******************************************************************************/ + ****************************************************************************/ static int stm32_dma2dsetclut(FAR struct dma2d_layer_s *layer, const FAR struct fb_cmap_s *cmap) @@ -1378,7 +1378,7 @@ static int stm32_dma2dsetclut(FAR struct dma2d_layer_s *layer, return -EINVAL; } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2dgetclut * * Description: @@ -1393,7 +1393,7 @@ static int stm32_dma2dsetclut(FAR struct dma2d_layer_s *layer, * On success - OK * On error - -EINVAL * - ******************************************************************************/ + ****************************************************************************/ static int stm32_dma2dgetclut(FAR struct dma2d_layer_s *layer, FAR struct fb_cmap_s *cmap) @@ -1466,7 +1466,7 @@ static int stm32_dma2dgetclut(FAR struct dma2d_layer_s *layer, } #endif -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2dsetalpha * * Description: @@ -1485,7 +1485,7 @@ static int stm32_dma2dgetclut(FAR struct dma2d_layer_s *layer, * On success - OK * On error - -EINVAL * - ******************************************************************************/ + ****************************************************************************/ static int stm32_dma2dsetalpha(FAR struct dma2d_layer_s *layer, uint8_t alpha) { @@ -1506,7 +1506,7 @@ static int stm32_dma2dsetalpha(FAR struct dma2d_layer_s *layer, uint8_t alpha) return -EINVAL; } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2dgetalpha * * Description: @@ -1520,7 +1520,7 @@ static int stm32_dma2dsetalpha(FAR struct dma2d_layer_s *layer, uint8_t alpha) * On success - OK * On error - -EINVAL * - *****************************************************************************/ + ****************************************************************************/ static int stm32_dma2dgetalpha(FAR struct dma2d_layer_s *layer, uint8_t *alpha) { @@ -1541,7 +1541,7 @@ static int stm32_dma2dgetalpha(FAR struct dma2d_layer_s *layer, uint8_t *alpha) return -EINVAL; } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2dsetblendmode * * Description: @@ -1570,7 +1570,7 @@ static int stm32_dma2dgetalpha(FAR struct dma2d_layer_s *layer, uint8_t *alpha) * the constant alpha value. This is only useful for ARGB8888 * color format. * - ******************************************************************************/ + ****************************************************************************/ static int stm32_dma2dsetblendmode(FAR struct dma2d_layer_s *layer, uint32_t mode) @@ -1592,7 +1592,7 @@ static int stm32_dma2dsetblendmode(FAR struct dma2d_layer_s *layer, return -EINVAL; } -/****************************************************************************** +/**************************************************************************** * Name: stm32_getblendmode * * Description: @@ -1606,7 +1606,7 @@ static int stm32_dma2dsetblendmode(FAR struct dma2d_layer_s *layer, * On success - OK * On error - -EINVAL * - *****************************************************************************/ + ****************************************************************************/ static int stm32_dma2dgetblendmode(FAR struct dma2d_layer_s *layer, uint32_t *mode) @@ -1628,7 +1628,7 @@ static int stm32_dma2dgetblendmode(FAR struct dma2d_layer_s *layer, return -EINVAL; } -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2dblit * * Description: @@ -1927,7 +1927,7 @@ static int stm32_dma2dfillarea(FAR struct dma2d_layer_s *layer, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: up_dma2dgetlayer * * Description: @@ -1940,7 +1940,7 @@ static int stm32_dma2dfillarea(FAR struct dma2d_layer_s *layer, * Reference to the dma2d layer control structure on success or Null if no * related exist. * - ******************************************************************************/ + ****************************************************************************/ FAR struct dma2d_layer_s * up_dma2dgetlayer(int lid) { @@ -1959,7 +1959,7 @@ FAR struct dma2d_layer_s * up_dma2dgetlayer(int lid) return NULL; } -/****************************************************************************** +/**************************************************************************** * Name: up_dma2dcreatelayer * * Description: @@ -1977,7 +1977,7 @@ FAR struct dma2d_layer_s * up_dma2dgetlayer(int lid) * -ENOMEM if no memory available or exceeds * CONFIG_STM32_DMA2D_NLAYERS * - ******************************************************************************/ + ****************************************************************************/ FAR struct dma2d_layer_s *up_dma2dcreatelayer(fb_coord_t width, fb_coord_t height, @@ -2088,7 +2088,7 @@ FAR struct dma2d_layer_s *up_dma2dcreatelayer(fb_coord_t width, return (FAR struct dma2d_layer_s *)layer; } -/****************************************************************************** +/**************************************************************************** * Name: up_dma2dremovelayer * * Description: @@ -2101,7 +2101,7 @@ FAR struct dma2d_layer_s *up_dma2dcreatelayer(fb_coord_t width, * On success - OK * On error - -EINVAL * - *****************************************************************************/ + ****************************************************************************/ int up_dma2dremovelayer(FAR struct dma2d_layer_s *layer) { @@ -2133,7 +2133,7 @@ int up_dma2dremovelayer(FAR struct dma2d_layer_s *layer) return ret; } -/****************************************************************************** +/**************************************************************************** * Name: up_dma2dinitialize * * Description: @@ -2143,7 +2143,7 @@ int up_dma2dremovelayer(FAR struct dma2d_layer_s *layer) * OK - On success * An error if initializing failed. * - ******************************************************************************/ + ****************************************************************************/ int up_dma2dinitialize(void) { @@ -2207,13 +2207,13 @@ int up_dma2dinitialize(void) return OK; } -/****************************************************************************** +/**************************************************************************** * Name: up_dma2duninitialize * * Description: * Uninitialize the dma2d controller * - ******************************************************************************/ + ****************************************************************************/ void up_dma2duninitialize(void) { @@ -2236,7 +2236,7 @@ void up_dma2duninitialize(void) } #ifdef CONFIG_STM32_LTDC_INTERFACE -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2dinitltdc * * Description: @@ -2256,7 +2256,7 @@ void up_dma2duninitialize(void) * On error - NULL and errno is set to * -EINVAL if one of the parameter is invalid * - ******************************************************************************/ + ****************************************************************************/ FAR struct dma2d_layer_s * stm32_dma2dinitltdc(FAR struct stm32_ltdc_s *layer) { diff --git a/arch/arm/src/stm32/stm32_otgfsdev.c b/arch/arm/src/stm32/stm32_otgfsdev.c index 1da5733f6d..2cee02f8ac 100644 --- a/arch/arm/src/stm32/stm32_otgfsdev.c +++ b/arch/arm/src/stm32/stm32_otgfsdev.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/stm32/stm32_otgfsdev.c * * Copyright (C) 2012-2014 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -64,9 +64,9 @@ #if defined(CONFIG_USBDEV) && (defined(CONFIG_STM32_OTGFS)) -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ #ifndef CONFIG_USBDEV_EP0_MAXSIZE @@ -276,9 +276,9 @@ # define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* Overall device state */ @@ -466,9 +466,9 @@ struct stm32_usbdev_s struct stm32_ep_s epout[STM32_NENDPOINTS]; }; -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Register operations ********************************************************/ @@ -647,9 +647,9 @@ static int stm32_rxfifo_flush(void); static void stm32_swinitialize(FAR struct stm32_usbdev_s *priv); static void stm32_hwinitialize(FAR struct stm32_usbdev_s *priv); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ /* Since there is only a single USB interface, all status information can be * be simply retained in a single global instance. */ @@ -776,21 +776,21 @@ const struct trace_msg_t g_usb_trace_strings_intdecode[] = }; #endif -/******************************************************************************* +/**************************************************************************** * Public Data - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: stm32_getreg * * Description: * Get the contents of an STM32 register * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_STM32_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static uint32_t stm32_getreg(uint32_t addr) @@ -846,13 +846,13 @@ static uint32_t stm32_getreg(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_putreg * * Description: * Set the contents of an STM32 register to a value * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_STM32_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static void stm32_putreg(uint32_t val, uint32_t addr) @@ -867,13 +867,13 @@ static void stm32_putreg(uint32_t val, uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_req_remfirst * * Description: * Remove a request from the head of an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static FAR struct stm32_req_s *stm32_req_remfirst(FAR struct stm32_ep_s *privep) { @@ -893,13 +893,13 @@ static FAR struct stm32_req_s *stm32_req_remfirst(FAR struct stm32_ep_s *privep) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_req_addlast * * Description: * Add a request to the end of an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static bool stm32_req_addlast(FAR struct stm32_ep_s *privep, FAR struct stm32_req_s *req) @@ -920,13 +920,13 @@ static bool stm32_req_addlast(FAR struct stm32_ep_s *privep, return is_empty; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0in_setupresponse * * Description: * Schedule a short transfer on Endpoint 0 (IN or OUT) * - *******************************************************************************/ + ****************************************************************************/ static void stm32_ep0in_setupresponse(FAR struct stm32_usbdev_s *priv, FAR uint8_t *buf, uint32_t nbytes) @@ -949,13 +949,13 @@ static inline void stm32_ep0in_transmitzlp(FAR struct stm32_usbdev_s *priv) stm32_ep0in_setupresponse(priv, NULL, 0); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0in_activate * * Description: * Activate the endpoint 0 IN endpoint. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_ep0in_activate(void) { @@ -987,13 +987,13 @@ static void stm32_ep0in_activate(void) stm32_putreg(regval, STM32_OTGFS_DCTL); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0out_ctrlsetup * * Description: * Setup to receive a SETUP packet. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_ep0out_ctrlsetup(FAR struct stm32_usbdev_s *priv) { @@ -1376,13 +1376,13 @@ static void stm32_epin_request(FAR struct stm32_usbdev_s *priv, } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_rxfifo_read * * Description: * Read packet from the RxFIFO into a read request. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_rxfifo_read(FAR struct stm32_ep_s *privep, FAR uint8_t *dest, uint16_t len) @@ -1419,13 +1419,13 @@ static void stm32_rxfifo_read(FAR struct stm32_ep_s *privep, } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_rxfifo_discard * * Description: * Discard packet data from the RxFIFO. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_rxfifo_discard(FAR struct stm32_ep_s *privep, int len) { @@ -1450,7 +1450,7 @@ static void stm32_rxfifo_discard(FAR struct stm32_ep_s *privep, int len) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epout_complete * * Description: @@ -1458,7 +1458,7 @@ static void stm32_rxfifo_discard(FAR struct stm32_ep_s *privep, int len) * received. It completes the read request at the head of the endpoint's * request queue. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_epout_complete(FAR struct stm32_usbdev_s *priv, FAR struct stm32_ep_s *privep) @@ -1499,7 +1499,7 @@ static void stm32_epout_complete(FAR struct stm32_usbdev_s *priv, stm32_epout_request(priv, privep); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0out_receive * * Description: @@ -1507,7 +1507,7 @@ static void stm32_epout_complete(FAR struct stm32_usbdev_s *priv, * data is available in the endpoint's RxFIFO. This function will simply * copy the incoming data into pending request's data buffer. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_ep0out_receive(FAR struct stm32_ep_s *privep, int bcnt) { @@ -1557,7 +1557,7 @@ static inline void stm32_ep0out_receive(FAR struct stm32_ep_s *privep, int bcnt) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epout_receive * * Description: @@ -1565,7 +1565,7 @@ static inline void stm32_ep0out_receive(FAR struct stm32_ep_s *privep, int bcnt) * data is available in the endpoint's RxFIFO. This function will simply * copy the incoming data into pending request's data buffer. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_epout_receive(FAR struct stm32_ep_s *privep, int bcnt) { @@ -1639,7 +1639,7 @@ static inline void stm32_epout_receive(FAR struct stm32_ep_s *privep, int bcnt) privreq->req.xfrd += readlen; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epout_request * * Description: @@ -1647,7 +1647,7 @@ static inline void stm32_epout_receive(FAR struct stm32_ep_s *privep, int bcnt) * (2) a pending receive request completes. If there is no read in pending, * then this function will initiate the next OUT (read) operation. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_epout_request(FAR struct stm32_usbdev_s *priv, FAR struct stm32_ep_s *privep) @@ -1778,13 +1778,13 @@ static void stm32_epout_request(FAR struct stm32_usbdev_s *priv, } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_flush * * Description: * Flush any primed descriptors from this ep * - *******************************************************************************/ + ****************************************************************************/ static void stm32_ep_flush(struct stm32_ep_s *privep) { @@ -1798,13 +1798,13 @@ static void stm32_ep_flush(struct stm32_ep_s *privep) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_req_complete * * Description: * Handle termination of the request at the head of the endpoint request queue. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_req_complete(struct stm32_ep_s *privep, int16_t result) { @@ -1838,13 +1838,13 @@ static void stm32_req_complete(struct stm32_ep_s *privep, int16_t result) privep->stalled = stalled; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_req_cancel * * Description: * Cancel all pending requests for an endpoint * - *******************************************************************************/ + ****************************************************************************/ static void stm32_req_cancel(struct stm32_ep_s *privep, int16_t status) { @@ -1861,14 +1861,14 @@ static void stm32_req_cancel(struct stm32_ep_s *privep, int16_t status) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_findbyaddr * * Description: * Find the physical endpoint structure corresponding to a logic endpoint * address * - *******************************************************************************/ + ****************************************************************************/ static struct stm32_ep_s *stm32_ep_findbyaddr(struct stm32_usbdev_s *priv, uint16_t eplog) @@ -1898,14 +1898,14 @@ static struct stm32_ep_s *stm32_ep_findbyaddr(struct stm32_usbdev_s *priv, return privep; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_req_dispatch * * Description: * Provide unhandled setup actions to the class driver. This is logically part * of the USB interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_req_dispatch(struct stm32_usbdev_s *priv, const struct usb_ctrlreq_s *ctrl) @@ -1932,13 +1932,13 @@ static int stm32_req_dispatch(struct stm32_usbdev_s *priv, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_usbreset * * Description: * Reset Usb engine * - *******************************************************************************/ + ****************************************************************************/ static void stm32_usbreset(struct stm32_usbdev_s *priv) { @@ -2030,13 +2030,13 @@ static void stm32_usbreset(struct stm32_usbdev_s *priv) stm32_ep0out_ctrlsetup(priv); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0out_testmode * * Description: * Select test mode * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_ep0out_testmode(FAR struct stm32_usbdev_s *priv, uint16_t index) @@ -2077,14 +2077,14 @@ static inline void stm32_ep0out_testmode(FAR struct stm32_usbdev_s *priv, stm32_ep0in_transmitzlp(priv); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0out_stdrequest * * Description: * Handle a stanard request on EP0. Pick off the things of interest to the * USB device controller driver; pass what is left to the class driver. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, FAR struct stm32_ctrlreq_s *ctrlreq) @@ -2445,14 +2445,14 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0out_setup * * Description: * USB Ctrl EP Setup Event. This is logically part of the USB interrupt * handler. This event occurs when a setup packet is receive on EP0 OUT. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_ep0out_setup(struct stm32_usbdev_s *priv) { @@ -2520,14 +2520,14 @@ static inline void stm32_ep0out_setup(struct stm32_usbdev_s *priv) priv->ep0datlen = 0; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epout * * Description: * This is part of the OUT endpoint interrupt processing. This function * handles the OUT event for a single endpoint. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_epout(FAR struct stm32_usbdev_s *priv, uint8_t epno) { @@ -2572,7 +2572,7 @@ static inline void stm32_epout(FAR struct stm32_usbdev_s *priv, uint8_t epno) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epout_interrupt * * Description: @@ -2583,7 +2583,7 @@ static inline void stm32_epout(FAR struct stm32_usbdev_s *priv, uint8_t epno) * corresponding OTGFS DOEPINTx register to determine the exact cause of the * interrupt. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_epout_interrupt(FAR struct stm32_usbdev_s *priv) { @@ -2706,13 +2706,13 @@ static inline void stm32_epout_interrupt(FAR struct stm32_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epin_runtestmode * * Description: * Execute the test mode setup by the SET FEATURE request * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_epin_runtestmode(FAR struct stm32_usbdev_s *priv) { @@ -2725,14 +2725,14 @@ static inline void stm32_epin_runtestmode(FAR struct stm32_usbdev_s *priv) priv->testmode = OTGFS_TESTMODE_DISABLED; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epin * * Description: * This is part of the IN endpoint interrupt processing. This function * handles the IN event for a single endpoint. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_epin(FAR struct stm32_usbdev_s *priv, uint8_t epno) { @@ -2803,7 +2803,7 @@ static inline void stm32_epin_txfifoempty(FAR struct stm32_usbdev_s *priv, int e stm32_epin_request(priv, privep); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epin_interrupt * * Description: @@ -2813,7 +2813,7 @@ static inline void stm32_epin_txfifoempty(FAR struct stm32_usbdev_s *priv, int e * endpoint on which the interrupt occurred, and then read the corresponding * OTGFS DIEPINTx register to determine the exact cause of the interrupt. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_epin_interrupt(FAR struct stm32_usbdev_s *priv) { @@ -3002,13 +3002,13 @@ static inline void stm32_epin_interrupt(FAR struct stm32_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_resumeinterrupt * * Description: * Resume/remote wakeup detected interrupt * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_resumeinterrupt(FAR struct stm32_usbdev_s *priv) { @@ -3040,13 +3040,13 @@ static inline void stm32_resumeinterrupt(FAR struct stm32_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_suspendinterrupt * * Description: * USB suspend interrupt * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_suspendinterrupt(FAR struct stm32_usbdev_s *priv) { @@ -3095,14 +3095,14 @@ static inline void stm32_suspendinterrupt(FAR struct stm32_usbdev_s *priv) stm32_usbsuspend((FAR struct usbdev_s *)priv, false); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_rxinterrupt * * Description: * RxFIFO non-empty interrupt. This interrupt indicates that there is at * least one packet pending to be read from the RxFIFO. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_rxinterrupt(FAR struct stm32_usbdev_s *priv) { @@ -3263,13 +3263,13 @@ static inline void stm32_rxinterrupt(FAR struct stm32_usbdev_s *priv) stm32_putreg(regval, STM32_OTGFS_GINTMSK); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_enuminterrupt * * Description: * Enumeration done interrupt * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_enuminterrupt(FAR struct stm32_usbdev_s *priv) { @@ -3287,7 +3287,7 @@ static inline void stm32_enuminterrupt(FAR struct stm32_usbdev_s *priv) stm32_putreg(regval, STM32_OTGFS_GUSBCFG); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_isocininterrupt * * Description: @@ -3295,7 +3295,7 @@ static inline void stm32_enuminterrupt(FAR struct stm32_usbdev_s *priv) * isochronous IN transfer interrupt indicates an incomplete isochronous IN * transfer on at least one of the isochronous IN endpoints. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_ISOCHRONOUS static inline void stm32_isocininterrupt(FAR struct stm32_usbdev_s *priv) @@ -3360,13 +3360,13 @@ static inline void stm32_isocininterrupt(FAR struct stm32_usbdev_s *priv) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_isocoutinterrupt * * Description: * Incomplete periodic transfer interrupt * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_ISOCHRONOUS static inline void stm32_isocoutinterrupt(FAR struct stm32_usbdev_s *priv) @@ -3442,13 +3442,13 @@ static inline void stm32_isocoutinterrupt(FAR struct stm32_usbdev_s *priv) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_sessioninterrupt * * Description: * Session request/new session detected interrupt * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_VBUSSENSING static inline void stm32_sessioninterrupt(FAR struct stm32_usbdev_s *priv) @@ -3457,13 +3457,13 @@ static inline void stm32_sessioninterrupt(FAR struct stm32_usbdev_s *priv) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_otginterrupt * * Description: * OTG interrupt * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_VBUSSENSING static inline void stm32_otginterrupt(FAR struct stm32_usbdev_s *priv) @@ -3484,13 +3484,13 @@ static inline void stm32_otginterrupt(FAR struct stm32_usbdev_s *priv) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_usbinterrupt * * Description: * USB interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static int stm32_usbinterrupt(int irq, FAR void *context) { @@ -3682,17 +3682,17 @@ static int stm32_usbinterrupt(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Endpoint operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: stm32_enablegonak * * Description: * Enable global OUT NAK mode * - *******************************************************************************/ + ****************************************************************************/ static void stm32_enablegonak(FAR struct stm32_ep_s *privep) { @@ -3732,13 +3732,13 @@ static void stm32_enablegonak(FAR struct stm32_ep_s *privep) #endif } -/******************************************************************************* +/**************************************************************************** * Name: stm32_disablegonak * * Description: * Disable global OUT NAK mode * - *******************************************************************************/ + ****************************************************************************/ static void stm32_disablegonak(FAR struct stm32_ep_s *privep) { @@ -3751,7 +3751,7 @@ static void stm32_disablegonak(FAR struct stm32_ep_s *privep) stm32_putreg(regval, STM32_OTGFS_DCTL); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epout_configure * * Description: @@ -3762,7 +3762,7 @@ static void stm32_disablegonak(FAR struct stm32_ep_s *privep) * eptype - The type of the endpoint * maxpacket - The max packet size of the endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_epout_configure(FAR struct stm32_ep_s *privep, uint8_t eptype, uint16_t maxpacket) @@ -3846,7 +3846,7 @@ static int stm32_epout_configure(FAR struct stm32_ep_s *privep, uint8_t eptype, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epin_configure * * Description: @@ -3857,7 +3857,7 @@ static int stm32_epout_configure(FAR struct stm32_ep_s *privep, uint8_t eptype, * eptype - The type of the endpoint * maxpacket - The max packet size of the endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_epin_configure(FAR struct stm32_ep_s *privep, uint8_t eptype, uint16_t maxpacket) @@ -3944,7 +3944,7 @@ static int stm32_epin_configure(FAR struct stm32_ep_s *privep, uint8_t eptype, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_configure * * Description: @@ -3957,7 +3957,7 @@ static int stm32_epin_configure(FAR struct stm32_ep_s *privep, uint8_t eptype, * needs to take special action when all of the endpoints have been * configured. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ep_configure(FAR struct usbdev_ep_s *ep, FAR const struct usb_epdesc_s *desc, @@ -3990,13 +3990,13 @@ static int stm32_ep_configure(FAR struct usbdev_ep_s *ep, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0_configure * * Description: * Reset Usb engine * - *******************************************************************************/ + ****************************************************************************/ static void stm32_ep0_configure(FAR struct stm32_usbdev_s *priv) { @@ -4008,13 +4008,13 @@ static void stm32_ep0_configure(FAR struct stm32_usbdev_s *priv) CONFIG_USBDEV_EP0_MAXSIZE); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epout_disable * * Description: * Diable an OUT endpoint will no longer be used * - *******************************************************************************/ + ****************************************************************************/ static void stm32_epout_disable(FAR struct stm32_ep_s *privep) { @@ -4078,13 +4078,13 @@ static void stm32_epout_disable(FAR struct stm32_ep_s *privep) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epin_disable * * Description: * Disable an IN endpoint when it will no longer be used * - *******************************************************************************/ + ****************************************************************************/ static void stm32_epin_disable(FAR struct stm32_ep_s *privep) { @@ -4172,13 +4172,13 @@ static void stm32_epin_disable(FAR struct stm32_ep_s *privep) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_disable * * Description: * The endpoint will no longer be used * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ep_disable(FAR struct usbdev_ep_s *ep) { @@ -4212,13 +4212,13 @@ static int stm32_ep_disable(FAR struct usbdev_ep_s *ep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_allocreq * * Description: * Allocate an I/O request * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_req_s *stm32_ep_allocreq(FAR struct usbdev_ep_s *ep) { @@ -4245,13 +4245,13 @@ static FAR struct usbdev_req_s *stm32_ep_allocreq(FAR struct usbdev_ep_s *ep) return &privreq->req; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_freereq * * Description: * Free an I/O request * - *******************************************************************************/ + ****************************************************************************/ static void stm32_ep_freereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -4269,13 +4269,13 @@ static void stm32_ep_freereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s kmm_free(privreq); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_allocbuffer * * Description: * Allocate an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_DMA static void *stm32_ep_allocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) @@ -4290,13 +4290,13 @@ static void *stm32_ep_allocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_freebuffer * * Description: * Free an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_DMA static void stm32_ep_freebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) @@ -4311,13 +4311,13 @@ static void stm32_ep_freebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_submit * * Description: * Submit an I/O request to the endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ep_submit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -4405,13 +4405,13 @@ static int stm32_ep_submit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s * return ret; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_cancel * * Description: * Cancel an I/O request previously sent to an endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ep_cancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -4441,13 +4441,13 @@ static int stm32_ep_cancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s * return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epout_setstall * * Description: * Stall an OUT endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_epout_setstall(FAR struct stm32_ep_s *privep) { @@ -4513,13 +4513,13 @@ static int stm32_epout_setstall(FAR struct stm32_ep_s *privep) #endif } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epin_setstall * * Description: * Stall an IN endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_epin_setstall(FAR struct stm32_ep_s *privep) { @@ -4542,13 +4542,13 @@ static int stm32_epin_setstall(FAR struct stm32_ep_s *privep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_setstall * * Description: * Stall an endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ep_setstall(FAR struct stm32_ep_s *privep) { @@ -4566,13 +4566,13 @@ static int stm32_ep_setstall(FAR struct stm32_ep_s *privep) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_clrstall * * Description: * Resume a stalled endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ep_clrstall(FAR struct stm32_ep_s *privep) { @@ -4625,13 +4625,13 @@ static int stm32_ep_clrstall(FAR struct stm32_ep_s *privep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_stall * * Description: * Stall or resume an endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ep_stall(FAR struct usbdev_ep_s *ep, bool resume) { @@ -4655,13 +4655,13 @@ static int stm32_ep_stall(FAR struct usbdev_ep_s *ep, bool resume) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0_stall * * Description: * Stall endpoint 0 * - *******************************************************************************/ + ****************************************************************************/ static void stm32_ep0_stall(FAR struct stm32_usbdev_s *priv) { @@ -4671,11 +4671,11 @@ static void stm32_ep0_stall(FAR struct stm32_usbdev_s *priv) stm32_ep0out_ctrlsetup(priv); } -/******************************************************************************* +/**************************************************************************** * Device operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_alloc * * Description: @@ -4689,7 +4689,7 @@ static void stm32_ep0_stall(FAR struct stm32_usbdev_s *priv) * eptype - Endpoint type. One of {USB_EP_ATTR_XFER_ISOC, USB_EP_ATTR_XFER_BULK, * USB_EP_ATTR_XFER_INT} * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_ep_s *stm32_ep_alloc(FAR struct usbdev_s *dev, uint8_t eplog, bool in, @@ -4768,13 +4768,13 @@ static FAR struct usbdev_ep_s *stm32_ep_alloc(FAR struct usbdev_s *dev, return NULL; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_free * * Description: * Free the previously allocated endpoint * - *******************************************************************************/ + ****************************************************************************/ static void stm32_ep_free(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) { @@ -4794,13 +4794,13 @@ static void stm32_ep_free(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_getframe * * Description: * Returns the current frame number * - *******************************************************************************/ + ****************************************************************************/ static int stm32_getframe(struct usbdev_s *dev) { @@ -4814,13 +4814,13 @@ static int stm32_getframe(struct usbdev_s *dev) return (int)((regval & OTGFS_DSTS_SOFFN_MASK) >> OTGFS_DSTS_SOFFN_SHIFT); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_wakeup * * Description: * Exit suspend mode. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_wakeup(struct usbdev_s *dev) { @@ -4862,13 +4862,13 @@ static int stm32_wakeup(struct usbdev_s *dev) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_selfpowered * * Description: * Sets/clears the device self-powered feature * - *******************************************************************************/ + ****************************************************************************/ static int stm32_selfpowered(struct usbdev_s *dev, bool selfpowered) { @@ -4888,13 +4888,13 @@ static int stm32_selfpowered(struct usbdev_s *dev, bool selfpowered) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_pullup * * Description: * Software-controlled connect to/disconnect from USB host * - *******************************************************************************/ + ****************************************************************************/ static int stm32_pullup(struct usbdev_s *dev, bool enable) { @@ -4926,13 +4926,13 @@ static int stm32_pullup(struct usbdev_s *dev, bool enable) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_setaddress * * Description: * Set the devices USB address * - *******************************************************************************/ + ****************************************************************************/ static void stm32_setaddress(struct stm32_usbdev_s *priv, uint16_t address) { @@ -4961,13 +4961,13 @@ static void stm32_setaddress(struct stm32_usbdev_s *priv, uint16_t address) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_txfifo_flush * * Description: * Flush the specific TX fifo. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_txfifo_flush(uint32_t txfnum) { @@ -4996,13 +4996,13 @@ static int stm32_txfifo_flush(uint32_t txfnum) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_rxfifo_flush * * Description: * Flush the RX fifo. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_rxfifo_flush(void) { @@ -5030,13 +5030,13 @@ static int stm32_rxfifo_flush(void) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_swinitialize * * Description: * Initialize all driver data structures. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_swinitialize(FAR struct stm32_usbdev_s *priv) { @@ -5112,13 +5112,13 @@ static void stm32_swinitialize(FAR struct stm32_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_hwinitialize * * Description: * Configure the OTG FS core for operation. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_hwinitialize(FAR struct stm32_usbdev_s *priv) { @@ -5367,11 +5367,11 @@ static void stm32_hwinitialize(FAR struct stm32_usbdev_s *priv) STM32_OTGFS_GAHBCFG); } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_usbinitialize * * Description: @@ -5384,7 +5384,7 @@ static void stm32_hwinitialize(FAR struct stm32_usbdev_s *priv) * and P0.23 and PO.31 in PINSEL1 must be configured for Vbus and USB connect * LED. * - *******************************************************************************/ + ****************************************************************************/ void up_usbinitialize(void) { @@ -5477,9 +5477,9 @@ errout: up_usbuninitialize(); } -/******************************************************************************* +/**************************************************************************** * Name: up_usbuninitialize - *******************************************************************************/ + ****************************************************************************/ void up_usbuninitialize(void) { @@ -5537,14 +5537,14 @@ void up_usbuninitialize(void) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: usbdev_register * * Description: * Register a USB device class driver. The class driver's bind() method will be * called to bind it to a USB device driver. * - *******************************************************************************/ + ****************************************************************************/ int usbdev_register(struct usbdevclass_driver_s *driver) { @@ -5607,7 +5607,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: usbdev_unregister * * Description: @@ -5615,7 +5615,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) * it will first disconnect(). The driver is also requested to unbind() and clean * up any device state, before this procedure finally returns. * - *******************************************************************************/ + ****************************************************************************/ int usbdev_unregister(struct usbdevclass_driver_s *driver) { diff --git a/arch/arm/src/stm32/stm32_otgfshost.c b/arch/arm/src/stm32/stm32_otgfshost.c index d717ce2eb0..e4d83b5109 100644 --- a/arch/arm/src/stm32/stm32_otgfshost.c +++ b/arch/arm/src/stm32/stm32_otgfshost.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/stm32/stm32_otgfshost.c * * Copyright (C) 2012-2015 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -69,9 +69,9 @@ #if defined(CONFIG_USBHOST) && defined(CONFIG_STM32_OTGFS) -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ /* * STM32 USB OTG FS Host Driver Support @@ -164,9 +164,9 @@ # define MAX(a, b) (((a) > (b)) ? (a) : (b)) #endif -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* The following enumeration represents the various states of the USB host * state machine (for debug purposes only) @@ -278,9 +278,9 @@ struct stm32_usbhost_s struct stm32_chan_s chan[STM32_MAX_TX_FIFOS]; }; -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Register operations ********************************************************/ @@ -469,9 +469,9 @@ static void stm32_host_initialize(FAR struct stm32_usbhost_s *priv); static inline void stm32_sw_initialize(FAR struct stm32_usbhost_s *priv); static inline int stm32_hw_initialize(FAR struct stm32_usbhost_s *priv); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ /* In this driver implementation, support is provided for only a single a single * USB device. All status information can be simply retained in a single global @@ -488,21 +488,21 @@ static struct usbhost_connection_s g_usbconn = .enumerate = stm32_enumerate, }; -/******************************************************************************* +/**************************************************************************** * Public Data - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: stm32_printreg * * Description: * Print the contents of an STM32xx register operation * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_STM32_USBHOST_REGDEBUG static void stm32_printreg(uint32_t addr, uint32_t val, bool iswrite) @@ -511,13 +511,13 @@ static void stm32_printreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_checkreg * * Description: * Get the contents of an STM32 register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_STM32_USBHOST_REGDEBUG static void stm32_checkreg(uint32_t addr, uint32_t val, bool iswrite) @@ -575,13 +575,13 @@ static void stm32_checkreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_getreg * * Description: * Get the contents of an STM32 register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_STM32_USBHOST_REGDEBUG static uint32_t stm32_getreg(uint32_t addr) @@ -597,13 +597,13 @@ static uint32_t stm32_getreg(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_putreg * * Description: * Set the contents of an STM32 register to a value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_STM32_USBHOST_REGDEBUG static void stm32_putreg(uint32_t addr, uint32_t val) @@ -618,13 +618,13 @@ static void stm32_putreg(uint32_t addr, uint32_t val) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_modifyreg * * Description: * Modify selected bits of an STM32 register. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_modifyreg(uint32_t addr, uint32_t clrbits, uint32_t setbits) { @@ -638,7 +638,7 @@ static inline void stm32_modifyreg(uint32_t addr, uint32_t clrbits, uint32_t set * This is just a wrapper to handle the annoying behavior of semaphore * waits that return due to the receipt of a signal. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_takesem(sem_t *sem) { @@ -660,20 +660,20 @@ static void stm32_takesem(sem_t *sem) * Description: * Get a (possibly unaligned) 16-bit little endian value. * - *******************************************************************************/ + ****************************************************************************/ static inline uint16_t stm32_getle16(const uint8_t *val) { return (uint16_t)val[1] << 8 | (uint16_t)val[0]; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_alloc * * Description: * Allocate a channel. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_chan_alloc(FAR struct stm32_usbhost_s *priv) { @@ -699,13 +699,13 @@ static int stm32_chan_alloc(FAR struct stm32_usbhost_s *priv) return -EBUSY; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_free * * Description: * Free a previoiusly allocated channel. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_chan_free(FAR struct stm32_usbhost_s *priv, int chidx) { @@ -720,13 +720,13 @@ static void stm32_chan_free(FAR struct stm32_usbhost_s *priv, int chidx) priv->chan[chidx].inuse = false; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_freeall * * Description: * Free all channels. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_chan_freeall(FAR struct stm32_usbhost_s *priv) { @@ -740,7 +740,7 @@ static inline void stm32_chan_freeall(FAR struct stm32_usbhost_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_configure * * Description: @@ -748,7 +748,7 @@ static inline void stm32_chan_freeall(FAR struct stm32_usbhost_s *priv) * when endpoint is allocated and EP0 (only) is re-configured with the * max packet size or device address changes. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_chan_configure(FAR struct stm32_usbhost_s *priv, int chidx) { @@ -899,14 +899,14 @@ static void stm32_chan_configure(FAR struct stm32_usbhost_s *priv, int chidx) stm32_putreg(STM32_OTGFS_HCCHAR(chidx), regval); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_halt * * Description: * Halt the channel associated with 'chidx' by setting the CHannel DISable * (CHDIS) bit in in the HCCHAR register. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_chan_halt(FAR struct stm32_usbhost_s *priv, int chidx, enum stm32_chreason_e chreason) @@ -984,7 +984,7 @@ static void stm32_chan_halt(FAR struct stm32_usbhost_s *priv, int chidx, stm32_putreg(STM32_OTGFS_HCCHAR(chidx), hcchar); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_waitsetup * * Description: @@ -996,7 +996,7 @@ static void stm32_chan_halt(FAR struct stm32_usbhost_s *priv, int chidx, * Assumptions: * Called from a normal thread context BEFORE the transfer has been started. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_chan_waitsetup(FAR struct stm32_usbhost_s *priv, FAR struct stm32_chan_s *chan) @@ -1024,7 +1024,7 @@ static int stm32_chan_waitsetup(FAR struct stm32_usbhost_s *priv, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_asynchsetup * * Description: @@ -1036,7 +1036,7 @@ static int stm32_chan_waitsetup(FAR struct stm32_usbhost_s *priv, * Assumptions: * Might be called from the level of an interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int stm32_chan_asynchsetup(FAR struct stm32_usbhost_s *priv, @@ -1065,7 +1065,7 @@ static int stm32_chan_asynchsetup(FAR struct stm32_usbhost_s *priv, } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_wait * * Description: @@ -1074,7 +1074,7 @@ static int stm32_chan_asynchsetup(FAR struct stm32_usbhost_s *priv, * Assumptions: * Called from a normal thread context * - *******************************************************************************/ + ****************************************************************************/ static int stm32_chan_wait(FAR struct stm32_usbhost_s *priv, FAR struct stm32_chan_s *chan) @@ -1120,7 +1120,7 @@ static int stm32_chan_wait(FAR struct stm32_usbhost_s *priv, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_wakeup * * Description: @@ -1131,7 +1131,7 @@ static int stm32_chan_wait(FAR struct stm32_usbhost_s *priv, * This function is called from the transfer complete interrupt handler for * the channel. Interrupts are disabled. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_chan_wakeup(FAR struct stm32_usbhost_s *priv, FAR struct stm32_chan_s *chan) @@ -1181,13 +1181,13 @@ static void stm32_chan_wakeup(FAR struct stm32_usbhost_s *priv, } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ctrlchan_alloc * * Description: * Allocate and configured channels for a control pipe. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ctrlchan_alloc(FAR struct stm32_usbhost_s *priv, uint8_t epno, uint8_t funcaddr, uint8_t speed, @@ -1244,7 +1244,7 @@ static int stm32_ctrlchan_alloc(FAR struct stm32_usbhost_s *priv, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ctrlep_alloc * * Description: @@ -1263,7 +1263,7 @@ static int stm32_ctrlchan_alloc(FAR struct stm32_usbhost_s *priv, * Assumptions: * This function will *not* be called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ctrlep_alloc(FAR struct stm32_usbhost_s *priv, FAR const struct usbhost_epdesc_s *epdesc, @@ -1377,13 +1377,13 @@ static int stm32_xfrep_alloc(FAR struct stm32_usbhost_s *priv, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_transfer_start * * Description: * Start at transfer on the select IN or OUT channel. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_transfer_start(FAR struct stm32_usbhost_s *priv, int chidx) { @@ -1567,7 +1567,7 @@ static void stm32_transfer_start(FAR struct stm32_usbhost_s *priv, int chidx) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_getframe * * Description: @@ -1575,7 +1575,7 @@ static void stm32_transfer_start(FAR struct stm32_usbhost_s *priv, int chidx) * when a new SOF is transmitted on the USB, and is cleared to 0 when it * reaches 0x3fff. * - *******************************************************************************/ + ****************************************************************************/ #if 0 /* Not used */ static inline uint16_t stm32_getframe(void) @@ -1584,13 +1584,13 @@ static inline uint16_t stm32_getframe(void) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_ctrl_sendsetup * * Description: * Send an IN/OUT SETUP packet. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv, FAR struct stm32_ctrlinfo_s *ep0, @@ -1660,14 +1660,14 @@ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv, return -ETIMEDOUT; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ctrl_senddata * * Description: * Send data in the data phase of an OUT control transfer. Or send status * in the status phase of an IN control transfer * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ctrl_senddata(FAR struct stm32_usbhost_s *priv, FAR struct stm32_ctrlinfo_s *ep0, @@ -1713,14 +1713,14 @@ static int stm32_ctrl_senddata(FAR struct stm32_usbhost_s *priv, return stm32_chan_wait(priv, chan); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ctrl_recvdata * * Description: * Receive data in the data phase of an IN control transfer. Or receive status * in the status phase of an OUT control transfer * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ctrl_recvdata(FAR struct stm32_usbhost_s *priv, FAR struct stm32_ctrlinfo_s *ep0, @@ -1754,13 +1754,13 @@ static int stm32_ctrl_recvdata(FAR struct stm32_usbhost_s *priv, return stm32_chan_wait(priv, chan); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_in_setup * * Description: * Initiate an IN transfer on an bulk, interrupt, or isochronous pipe. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_in_setup(FAR struct stm32_usbhost_s *priv, int chidx) { @@ -1815,13 +1815,13 @@ static int stm32_in_setup(FAR struct stm32_usbhost_s *priv, int chidx) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_in_transfer * * Description: * Transfer 'buflen' bytes into 'buffer' from an IN channel. * - *******************************************************************************/ + ****************************************************************************/ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx, FAR uint8_t *buffer, size_t buflen) @@ -1897,7 +1897,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx, return (ssize_t)chan->xfrd; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_in_next * * Description: @@ -1906,7 +1906,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx, * Assumptions: * This function is always called from an interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static void stm32_in_next(FAR struct stm32_usbhost_s *priv, @@ -1962,7 +1962,7 @@ static void stm32_in_next(FAR struct stm32_usbhost_s *priv, } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_in_asynch * * Description: @@ -1971,7 +1971,7 @@ static void stm32_in_next(FAR struct stm32_usbhost_s *priv, * Assumptions: * This function is never called from an interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int stm32_in_asynch(FAR struct stm32_usbhost_s *priv, int chidx, @@ -2009,13 +2009,13 @@ static int stm32_in_asynch(FAR struct stm32_usbhost_s *priv, int chidx, } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_out_setup * * Description: * Initiate an OUT transfer on an bulk, interrupt, or isochronous pipe. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_out_setup(FAR struct stm32_usbhost_s *priv, int chidx) { @@ -2074,13 +2074,13 @@ static int stm32_out_setup(FAR struct stm32_usbhost_s *priv, int chidx) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_out_transfer * * Description: * Transfer the 'buflen' bytes in 'buffer' through an OUT channel. * - *******************************************************************************/ + ****************************************************************************/ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, FAR uint8_t *buffer, size_t buflen) @@ -2183,7 +2183,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, return xfrd; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_out_next * * Description: @@ -2192,7 +2192,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, * Assumptions: * This function is always called from an interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static void stm32_out_next(FAR struct stm32_usbhost_s *priv, @@ -2248,7 +2248,7 @@ static void stm32_out_next(FAR struct stm32_usbhost_s *priv, } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_out_asynch * * Description: @@ -2257,7 +2257,7 @@ static void stm32_out_next(FAR struct stm32_usbhost_s *priv, * Assumptions: * This function is never called from an interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int stm32_out_asynch(FAR struct stm32_usbhost_s *priv, int chidx, @@ -2295,14 +2295,14 @@ static int stm32_out_asynch(FAR struct stm32_usbhost_s *priv, int chidx, } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_wrpacket * * Description: * Transfer the 'buflen' bytes in 'buffer' to the Tx FIFO associated with * 'chidx' (non-DMA). * - *******************************************************************************/ + ****************************************************************************/ static void stm32_gint_wrpacket(FAR struct stm32_usbhost_s *priv, FAR uint8_t *buffer, int chidx, int buflen) @@ -2335,7 +2335,7 @@ static void stm32_gint_wrpacket(FAR struct stm32_usbhost_s *priv, priv->chan[chidx].inflight += buflen; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_hcinisr * * Description: @@ -2352,7 +2352,7 @@ static void stm32_gint_wrpacket(FAR struct stm32_usbhost_s *priv, * * EBUSY in the result field indicates that the transfer has not completed. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_hcinisr(FAR struct stm32_usbhost_s *priv, int chidx) @@ -2596,7 +2596,7 @@ static inline void stm32_gint_hcinisr(FAR struct stm32_usbhost_s *priv, stm32_chan_wakeup(priv, chan); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_hcoutisr * * Description: @@ -2613,7 +2613,7 @@ static inline void stm32_gint_hcinisr(FAR struct stm32_usbhost_s *priv, * * EBUSY in the result field indicates that the transfer has not completed. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_hcoutisr(FAR struct stm32_usbhost_s *priv, int chidx) @@ -2821,13 +2821,13 @@ static inline void stm32_gint_hcoutisr(FAR struct stm32_usbhost_s *priv, stm32_chan_wakeup(priv, chan); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_connected * * Description: * Handle a connection event. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_gint_connected(FAR struct stm32_usbhost_s *priv) { @@ -2853,13 +2853,13 @@ static void stm32_gint_connected(FAR struct stm32_usbhost_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_disconnected * * Description: * Handle a disconnection event. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_gint_disconnected(FAR struct stm32_usbhost_s *priv) { @@ -2900,13 +2900,13 @@ static void stm32_gint_disconnected(FAR struct stm32_usbhost_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_sofisr * * Description: * USB OTG FS start-of-frame interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_STM32_OTGFS_SOFINTR static inline void stm32_gint_sofisr(FAR struct stm32_usbhost_s *priv) @@ -2920,13 +2920,13 @@ static inline void stm32_gint_sofisr(FAR struct stm32_usbhost_s *priv) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_rxflvlisr * * Description: * USB OTG FS RxFIFO non-empty interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_rxflvlisr(FAR struct stm32_usbhost_s *priv) { @@ -3021,13 +3021,13 @@ static inline void stm32_gint_rxflvlisr(FAR struct stm32_usbhost_s *priv) stm32_putreg(STM32_OTGFS_GINTMSK, intmsk); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_nptxfeisr * * Description: * USB OTG FS non-periodic TxFIFO empty interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_nptxfeisr(FAR struct stm32_usbhost_s *priv) { @@ -3109,13 +3109,13 @@ static inline void stm32_gint_nptxfeisr(FAR struct stm32_usbhost_s *priv) stm32_gint_wrpacket(priv, chan->buffer, chidx, wrsize); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_ptxfeisr * * Description: * USB OTG FS periodic TxFIFO empty interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_ptxfeisr(FAR struct stm32_usbhost_s *priv) { @@ -3197,13 +3197,13 @@ static inline void stm32_gint_ptxfeisr(FAR struct stm32_usbhost_s *priv) stm32_gint_wrpacket(priv, chan->buffer, chidx, wrsize); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_hcisr * * Description: * USB OTG FS host channels interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_hcisr(FAR struct stm32_usbhost_s *priv) { @@ -3245,13 +3245,13 @@ static inline void stm32_gint_hcisr(FAR struct stm32_usbhost_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_hprtisr * * Description: * USB OTG FS host port interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_hprtisr(FAR struct stm32_usbhost_s *priv) { @@ -3378,13 +3378,13 @@ static inline void stm32_gint_hprtisr(FAR struct stm32_usbhost_s *priv) stm32_putreg(STM32_OTGFS_HPRT, newhprt); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_discisr * * Description: * USB OTG FS disconnect detected interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_discisr(FAR struct stm32_usbhost_s *priv) { @@ -3397,13 +3397,13 @@ static inline void stm32_gint_discisr(FAR struct stm32_usbhost_s *priv) stm32_putreg(STM32_OTGFS_GINTSTS, OTGFS_GINT_DISC); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_ipxfrisr * * Description: * USB OTG FS incomplete periodic interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_ipxfrisr(FAR struct stm32_usbhost_s *priv) { @@ -3422,13 +3422,13 @@ static inline void stm32_gint_ipxfrisr(FAR struct stm32_usbhost_s *priv) stm32_putreg(STM32_OTGFS_GINTSTS, OTGFS_GINT_IPXFR); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_isr * * Description: * USB OTG FS global interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static int stm32_gint_isr(int irq, FAR void *context) { @@ -3539,7 +3539,7 @@ static int stm32_gint_isr(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_enable and stm32_gint_disable * * Description: @@ -3551,7 +3551,7 @@ static int stm32_gint_isr(int irq, FAR void *context) * Returned Value: * None * - *******************************************************************************/ + ****************************************************************************/ static void stm32_gint_enable(void) { @@ -3575,7 +3575,7 @@ static void stm32_gint_disable(void) stm32_putreg(STM32_OTGFS_GAHBCFG, regval); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_hostinit_enable * * Description: @@ -3587,7 +3587,7 @@ static void stm32_gint_disable(void) * Returned Value: * None * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_hostinit_enable(void) { @@ -3645,7 +3645,7 @@ static inline void stm32_hostinit_enable(void) stm32_putreg(STM32_OTGFS_GINTMSK, regval); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_txfe_enable * * Description: @@ -3665,7 +3665,7 @@ static inline void stm32_hostinit_enable(void) * Called from user task context. Interrupts must be disabled to assure * exclusive access to the GINTMSK register. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_txfe_enable(FAR struct stm32_usbhost_s *priv, int chidx) { @@ -3702,11 +3702,11 @@ static void stm32_txfe_enable(FAR struct stm32_usbhost_s *priv, int chidx) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * USB Host Controller Operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: stm32_wait * * Description: @@ -3729,7 +3729,7 @@ static void stm32_txfe_enable(FAR struct stm32_usbhost_s *priv, int chidx) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_wait(FAR struct usbhost_connection_s *conn, FAR struct usbhost_hubport_s **hport) @@ -3790,7 +3790,7 @@ static int stm32_wait(FAR struct usbhost_connection_s *conn, } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_enumerate * * Description: @@ -3816,7 +3816,7 @@ static int stm32_wait(FAR struct usbhost_connection_s *conn, * Assumptions: * This function will *not* be called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_rh_enumerate(FAR struct stm32_usbhost_s *priv, FAR struct usbhost_connection_s *conn, @@ -4098,7 +4098,7 @@ static int stm32_epfree(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_alloc * * Description: @@ -4128,7 +4128,7 @@ static int stm32_epfree(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_alloc(FAR struct usbhost_driver_s *drvr, FAR uint8_t **buffer, FAR size_t *maxlen) @@ -4152,7 +4152,7 @@ static int stm32_alloc(FAR struct usbhost_driver_s *drvr, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_free * * Description: @@ -4173,7 +4173,7 @@ static int stm32_alloc(FAR struct usbhost_driver_s *drvr, * Assumptions: * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_free(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) { @@ -4264,7 +4264,7 @@ static int stm32_iofree(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ctrlin and stm32_ctrlout * * Description: @@ -4297,7 +4297,7 @@ static int stm32_iofree(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, FAR const struct usb_ctrlreq_s *req, @@ -4471,7 +4471,7 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, return -ETIMEDOUT; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_transfer * * Description: @@ -4507,7 +4507,7 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static ssize_t stm32_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, FAR uint8_t *buffer, size_t buflen) @@ -4539,7 +4539,7 @@ static ssize_t stm32_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep return nbytes; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_asynch * * Description: @@ -4572,7 +4572,7 @@ static ssize_t stm32_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int stm32_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, @@ -4745,7 +4745,7 @@ static int stm32_connect(FAR struct usbhost_driver_s *drvr, } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_disconnect * * Description: @@ -4768,7 +4768,7 @@ static int stm32_connect(FAR struct usbhost_driver_s *drvr, * - Only a single class bound to a single device is supported. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_disconnect(FAR struct usbhost_driver_s *drvr, FAR struct usbhost_hubport_s *hport) @@ -4777,10 +4777,10 @@ static void stm32_disconnect(FAR struct usbhost_driver_s *drvr, hport->devclass = NULL; } -/******************************************************************************* +/**************************************************************************** * Initialization - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: stm32_portreset * * Description: @@ -4798,7 +4798,7 @@ static void stm32_disconnect(FAR struct usbhost_driver_s *drvr, * Returned Value: * None * - *******************************************************************************/ + ****************************************************************************/ static void stm32_portreset(FAR struct stm32_usbhost_s *priv) { @@ -4817,7 +4817,7 @@ static void stm32_portreset(FAR struct stm32_usbhost_s *priv) up_mdelay(20); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_flush_txfifos * * Description: @@ -4829,7 +4829,7 @@ static void stm32_portreset(FAR struct stm32_usbhost_s *priv) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_flush_txfifos(uint32_t txfnum) { @@ -4857,7 +4857,7 @@ static void stm32_flush_txfifos(uint32_t txfnum) up_udelay(3); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_flush_rxfifo * * Description: @@ -4869,7 +4869,7 @@ static void stm32_flush_txfifos(uint32_t txfnum) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_flush_rxfifo(void) { @@ -4896,7 +4896,7 @@ static void stm32_flush_rxfifo(void) up_udelay(3); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_vbusdrive * * Description: @@ -4909,7 +4909,7 @@ static void stm32_flush_rxfifo(void) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_vbusdrive(FAR struct stm32_usbhost_s *priv, bool state) { @@ -4939,7 +4939,7 @@ static void stm32_vbusdrive(FAR struct stm32_usbhost_s *priv, bool state) up_mdelay(200); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_host_initialize * * Description: @@ -4954,7 +4954,7 @@ static void stm32_vbusdrive(FAR struct stm32_usbhost_s *priv, bool state) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_host_initialize(FAR struct stm32_usbhost_s *priv) { @@ -5028,7 +5028,7 @@ static void stm32_host_initialize(FAR struct stm32_usbhost_s *priv) stm32_hostinit_enable(); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_sw_initialize * * Description: @@ -5040,7 +5040,7 @@ static void stm32_host_initialize(FAR struct stm32_usbhost_s *priv) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_sw_initialize(FAR struct stm32_usbhost_s *priv) { @@ -5109,7 +5109,7 @@ static inline void stm32_sw_initialize(FAR struct stm32_usbhost_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_hw_initialize * * Description: @@ -5121,7 +5121,7 @@ static inline void stm32_sw_initialize(FAR struct stm32_usbhost_s *priv) * Returned Value: * Zero on success; a negated errno value on failure. * - *******************************************************************************/ + ****************************************************************************/ static inline int stm32_hw_initialize(FAR struct stm32_usbhost_s *priv) { @@ -5196,11 +5196,11 @@ static inline int stm32_hw_initialize(FAR struct stm32_usbhost_s *priv) return OK; } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: stm32_otgfshost_initialize * * Description: @@ -5223,7 +5223,7 @@ static inline int stm32_hw_initialize(FAR struct stm32_usbhost_s *priv) * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - *******************************************************************************/ + ****************************************************************************/ FAR struct usbhost_connection_s *stm32_otgfshost_initialize(int controller) { diff --git a/arch/arm/src/stm32/stm32_otghsdev.c b/arch/arm/src/stm32/stm32_otghsdev.c index 86979fd3ed..a69d4a7cd1 100644 --- a/arch/arm/src/stm32/stm32_otghsdev.c +++ b/arch/arm/src/stm32/stm32_otghsdev.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/stm32/stm32_otghsdev.c * * Copyright (C) 2012-2014 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -64,9 +64,9 @@ #if defined(CONFIG_USBDEV) && (defined(CONFIG_STM32_OTGHS)) -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ #ifndef CONFIG_USBDEV_EP0_MAXSIZE @@ -276,9 +276,9 @@ # define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* Overall device state */ @@ -466,9 +466,9 @@ struct stm32_usbdev_s struct stm32_ep_s epout[STM32_NENDPOINTS]; }; -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Register operations ********************************************************/ @@ -647,9 +647,9 @@ static int stm32_rxfifo_flush(void); static void stm32_swinitialize(FAR struct stm32_usbdev_s *priv); static void stm32_hwinitialize(FAR struct stm32_usbdev_s *priv); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ /* Since there is only a single USB interface, all status information can be * be simply retained in a single global instance. */ @@ -776,21 +776,21 @@ const struct trace_msg_t g_usb_trace_strings_intdecode[] = }; #endif -/******************************************************************************* +/**************************************************************************** * Public Data - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: stm32_getreg * * Description: * Get the contents of an STM32 register * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_STM32_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static uint32_t stm32_getreg(uint32_t addr) @@ -846,13 +846,13 @@ static uint32_t stm32_getreg(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_putreg * * Description: * Set the contents of an STM32 register to a value * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_STM32_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG) static void stm32_putreg(uint32_t val, uint32_t addr) @@ -867,13 +867,13 @@ static void stm32_putreg(uint32_t val, uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_req_remfirst * * Description: * Remove a request from the head of an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static FAR struct stm32_req_s *stm32_req_remfirst(FAR struct stm32_ep_s *privep) { @@ -893,13 +893,13 @@ static FAR struct stm32_req_s *stm32_req_remfirst(FAR struct stm32_ep_s *privep) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_req_addlast * * Description: * Add a request to the end of an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static bool stm32_req_addlast(FAR struct stm32_ep_s *privep, FAR struct stm32_req_s *req) @@ -920,13 +920,13 @@ static bool stm32_req_addlast(FAR struct stm32_ep_s *privep, return is_empty; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0in_setupresponse * * Description: * Schedule a short transfer on Endpoint 0 (IN or OUT) * - *******************************************************************************/ + ****************************************************************************/ static void stm32_ep0in_setupresponse(FAR struct stm32_usbdev_s *priv, FAR uint8_t *buf, uint32_t nbytes) @@ -949,13 +949,13 @@ static inline void stm32_ep0in_transmitzlp(FAR struct stm32_usbdev_s *priv) stm32_ep0in_setupresponse(priv, NULL, 0); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0in_activate * * Description: * Activate the endpoint 0 IN endpoint. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_ep0in_activate(void) { @@ -987,13 +987,13 @@ static void stm32_ep0in_activate(void) stm32_putreg(regval, STM32_OTGHS_DCTL); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0out_ctrlsetup * * Description: * Setup to receive a SETUP packet. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_ep0out_ctrlsetup(FAR struct stm32_usbdev_s *priv) { @@ -1376,13 +1376,13 @@ static void stm32_epin_request(FAR struct stm32_usbdev_s *priv, } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_rxfifo_read * * Description: * Read packet from the RxFIFO into a read request. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_rxfifo_read(FAR struct stm32_ep_s *privep, FAR uint8_t *dest, uint16_t len) @@ -1419,13 +1419,13 @@ static void stm32_rxfifo_read(FAR struct stm32_ep_s *privep, } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_rxfifo_discard * * Description: * Discard packet data from the RxFIFO. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_rxfifo_discard(FAR struct stm32_ep_s *privep, int len) { @@ -1450,7 +1450,7 @@ static void stm32_rxfifo_discard(FAR struct stm32_ep_s *privep, int len) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epout_complete * * Description: @@ -1458,7 +1458,7 @@ static void stm32_rxfifo_discard(FAR struct stm32_ep_s *privep, int len) * received. It completes the read request at the head of the endpoint's * request queue. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_epout_complete(FAR struct stm32_usbdev_s *priv, FAR struct stm32_ep_s *privep) @@ -1499,7 +1499,7 @@ static void stm32_epout_complete(FAR struct stm32_usbdev_s *priv, stm32_epout_request(priv, privep); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0out_receive * * Description: @@ -1507,7 +1507,7 @@ static void stm32_epout_complete(FAR struct stm32_usbdev_s *priv, * data is available in the endpoint's RxFIFO. This function will simply * copy the incoming data into pending request's data buffer. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_ep0out_receive(FAR struct stm32_ep_s *privep, int bcnt) { @@ -1557,7 +1557,7 @@ static inline void stm32_ep0out_receive(FAR struct stm32_ep_s *privep, int bcnt) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epout_receive * * Description: @@ -1565,7 +1565,7 @@ static inline void stm32_ep0out_receive(FAR struct stm32_ep_s *privep, int bcnt) * data is available in the endpoint's RxFIFO. This function will simply * copy the incoming data into pending request's data buffer. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_epout_receive(FAR struct stm32_ep_s *privep, int bcnt) { @@ -1639,7 +1639,7 @@ static inline void stm32_epout_receive(FAR struct stm32_ep_s *privep, int bcnt) privreq->req.xfrd += readlen; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epout_request * * Description: @@ -1647,7 +1647,7 @@ static inline void stm32_epout_receive(FAR struct stm32_ep_s *privep, int bcnt) * (2) a pending receive request completes. If there is no read in pending, * then this function will initiate the next OUT (read) operation. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_epout_request(FAR struct stm32_usbdev_s *priv, FAR struct stm32_ep_s *privep) @@ -1778,13 +1778,13 @@ static void stm32_epout_request(FAR struct stm32_usbdev_s *priv, } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_flush * * Description: * Flush any primed descriptors from this ep * - *******************************************************************************/ + ****************************************************************************/ static void stm32_ep_flush(struct stm32_ep_s *privep) { @@ -1798,13 +1798,13 @@ static void stm32_ep_flush(struct stm32_ep_s *privep) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_req_complete * * Description: * Handle termination of the request at the head of the endpoint request queue. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_req_complete(struct stm32_ep_s *privep, int16_t result) { @@ -1838,13 +1838,13 @@ static void stm32_req_complete(struct stm32_ep_s *privep, int16_t result) privep->stalled = stalled; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_req_cancel * * Description: * Cancel all pending requests for an endpoint * - *******************************************************************************/ + ****************************************************************************/ static void stm32_req_cancel(struct stm32_ep_s *privep, int16_t status) { @@ -1861,14 +1861,14 @@ static void stm32_req_cancel(struct stm32_ep_s *privep, int16_t status) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_findbyaddr * * Description: * Find the physical endpoint structure corresponding to a logic endpoint * address * - *******************************************************************************/ + ****************************************************************************/ static struct stm32_ep_s *stm32_ep_findbyaddr(struct stm32_usbdev_s *priv, uint16_t eplog) @@ -1898,14 +1898,14 @@ static struct stm32_ep_s *stm32_ep_findbyaddr(struct stm32_usbdev_s *priv, return privep; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_req_dispatch * * Description: * Provide unhandled setup actions to the class driver. This is logically part * of the USB interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_req_dispatch(struct stm32_usbdev_s *priv, const struct usb_ctrlreq_s *ctrl) @@ -1932,13 +1932,13 @@ static int stm32_req_dispatch(struct stm32_usbdev_s *priv, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_usbreset * * Description: * Reset Usb engine * - *******************************************************************************/ + ****************************************************************************/ static void stm32_usbreset(struct stm32_usbdev_s *priv) { @@ -2030,13 +2030,13 @@ static void stm32_usbreset(struct stm32_usbdev_s *priv) stm32_ep0out_ctrlsetup(priv); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0out_testmode * * Description: * Select test mode * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_ep0out_testmode(FAR struct stm32_usbdev_s *priv, uint16_t index) @@ -2077,14 +2077,14 @@ static inline void stm32_ep0out_testmode(FAR struct stm32_usbdev_s *priv, stm32_ep0in_transmitzlp(priv); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0out_stdrequest * * Description: * Handle a stanard request on EP0. Pick off the things of interest to the * USB device controller driver; pass what is left to the class driver. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, FAR struct stm32_ctrlreq_s *ctrlreq) @@ -2445,14 +2445,14 @@ static inline void stm32_ep0out_stdrequest(struct stm32_usbdev_s *priv, } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0out_setup * * Description: * USB Ctrl EP Setup Event. This is logically part of the USB interrupt * handler. This event occurs when a setup packet is receive on EP0 OUT. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_ep0out_setup(struct stm32_usbdev_s *priv) { @@ -2520,14 +2520,14 @@ static inline void stm32_ep0out_setup(struct stm32_usbdev_s *priv) priv->ep0datlen = 0; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epout * * Description: * This is part of the OUT endpoint interrupt processing. This function * handles the OUT event for a single endpoint. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_epout(FAR struct stm32_usbdev_s *priv, uint8_t epno) { @@ -2572,7 +2572,7 @@ static inline void stm32_epout(FAR struct stm32_usbdev_s *priv, uint8_t epno) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epout_interrupt * * Description: @@ -2583,7 +2583,7 @@ static inline void stm32_epout(FAR struct stm32_usbdev_s *priv, uint8_t epno) * corresponding OTGHS DOEPINTx register to determine the exact cause of the * interrupt. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_epout_interrupt(FAR struct stm32_usbdev_s *priv) { @@ -2706,13 +2706,13 @@ static inline void stm32_epout_interrupt(FAR struct stm32_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epin_runtestmode * * Description: * Execute the test mode setup by the SET FEATURE request * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_epin_runtestmode(FAR struct stm32_usbdev_s *priv) { @@ -2725,14 +2725,14 @@ static inline void stm32_epin_runtestmode(FAR struct stm32_usbdev_s *priv) priv->testmode = OTGHS_TESTMODE_DISABLED; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epin * * Description: * This is part of the IN endpoint interrupt processing. This function * handles the IN event for a single endpoint. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_epin(FAR struct stm32_usbdev_s *priv, uint8_t epno) { @@ -2803,7 +2803,7 @@ static inline void stm32_epin_txfifoempty(FAR struct stm32_usbdev_s *priv, int e stm32_epin_request(priv, privep); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epin_interrupt * * Description: @@ -2813,7 +2813,7 @@ static inline void stm32_epin_txfifoempty(FAR struct stm32_usbdev_s *priv, int e * endpoint on which the interrupt occurred, and then read the corresponding * OTGHS DIEPINTx register to determine the exact cause of the interrupt. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_epin_interrupt(FAR struct stm32_usbdev_s *priv) { @@ -3002,13 +3002,13 @@ static inline void stm32_epin_interrupt(FAR struct stm32_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_resumeinterrupt * * Description: * Resume/remote wakeup detected interrupt * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_resumeinterrupt(FAR struct stm32_usbdev_s *priv) { @@ -3040,13 +3040,13 @@ static inline void stm32_resumeinterrupt(FAR struct stm32_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_suspendinterrupt * * Description: * USB suspend interrupt * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_suspendinterrupt(FAR struct stm32_usbdev_s *priv) { @@ -3095,14 +3095,14 @@ static inline void stm32_suspendinterrupt(FAR struct stm32_usbdev_s *priv) stm32_usbsuspend((FAR struct usbdev_s *)priv, false); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_rxinterrupt * * Description: * RxFIFO non-empty interrupt. This interrupt indicates that there is at * least one packet pending to be read from the RxFIFO. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_rxinterrupt(FAR struct stm32_usbdev_s *priv) { @@ -3263,13 +3263,13 @@ static inline void stm32_rxinterrupt(FAR struct stm32_usbdev_s *priv) stm32_putreg(regval, STM32_OTGHS_GINTMSK); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_enuminterrupt * * Description: * Enumeration done interrupt * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_enuminterrupt(FAR struct stm32_usbdev_s *priv) { @@ -3287,7 +3287,7 @@ static inline void stm32_enuminterrupt(FAR struct stm32_usbdev_s *priv) stm32_putreg(regval, STM32_OTGHS_GUSBCFG); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_isocininterrupt * * Description: @@ -3295,7 +3295,7 @@ static inline void stm32_enuminterrupt(FAR struct stm32_usbdev_s *priv) * isochronous IN transfer interrupt indicates an incomplete isochronous IN * transfer on at least one of the isochronous IN endpoints. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_ISOCHRONOUS static inline void stm32_isocininterrupt(FAR struct stm32_usbdev_s *priv) @@ -3360,13 +3360,13 @@ static inline void stm32_isocininterrupt(FAR struct stm32_usbdev_s *priv) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_isocoutinterrupt * * Description: * Incomplete periodic transfer interrupt * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_ISOCHRONOUS static inline void stm32_isocoutinterrupt(FAR struct stm32_usbdev_s *priv) @@ -3442,13 +3442,13 @@ static inline void stm32_isocoutinterrupt(FAR struct stm32_usbdev_s *priv) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_sessioninterrupt * * Description: * Session request/new session detected interrupt * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_VBUSSENSING static inline void stm32_sessioninterrupt(FAR struct stm32_usbdev_s *priv) @@ -3457,13 +3457,13 @@ static inline void stm32_sessioninterrupt(FAR struct stm32_usbdev_s *priv) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_otginterrupt * * Description: * OTG interrupt * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_VBUSSENSING static inline void stm32_otginterrupt(FAR struct stm32_usbdev_s *priv) @@ -3484,13 +3484,13 @@ static inline void stm32_otginterrupt(FAR struct stm32_usbdev_s *priv) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_usbinterrupt * * Description: * USB interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static int stm32_usbinterrupt(int irq, FAR void *context) { @@ -3682,17 +3682,17 @@ static int stm32_usbinterrupt(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Endpoint operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: stm32_enablegonak * * Description: * Enable global OUT NAK mode * - *******************************************************************************/ + ****************************************************************************/ static void stm32_enablegonak(FAR struct stm32_ep_s *privep) { @@ -3732,13 +3732,13 @@ static void stm32_enablegonak(FAR struct stm32_ep_s *privep) #endif } -/******************************************************************************* +/**************************************************************************** * Name: stm32_disablegonak * * Description: * Disable global OUT NAK mode * - *******************************************************************************/ + ****************************************************************************/ static void stm32_disablegonak(FAR struct stm32_ep_s *privep) { @@ -3751,7 +3751,7 @@ static void stm32_disablegonak(FAR struct stm32_ep_s *privep) stm32_putreg(regval, STM32_OTGHS_DCTL); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epout_configure * * Description: @@ -3762,7 +3762,7 @@ static void stm32_disablegonak(FAR struct stm32_ep_s *privep) * eptype - The type of the endpoint * maxpacket - The max packet size of the endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_epout_configure(FAR struct stm32_ep_s *privep, uint8_t eptype, uint16_t maxpacket) @@ -3846,7 +3846,7 @@ static int stm32_epout_configure(FAR struct stm32_ep_s *privep, uint8_t eptype, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epin_configure * * Description: @@ -3857,7 +3857,7 @@ static int stm32_epout_configure(FAR struct stm32_ep_s *privep, uint8_t eptype, * eptype - The type of the endpoint * maxpacket - The max packet size of the endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_epin_configure(FAR struct stm32_ep_s *privep, uint8_t eptype, uint16_t maxpacket) @@ -3944,7 +3944,7 @@ static int stm32_epin_configure(FAR struct stm32_ep_s *privep, uint8_t eptype, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_configure * * Description: @@ -3957,7 +3957,7 @@ static int stm32_epin_configure(FAR struct stm32_ep_s *privep, uint8_t eptype, * needs to take special action when all of the endpoints have been * configured. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ep_configure(FAR struct usbdev_ep_s *ep, FAR const struct usb_epdesc_s *desc, @@ -3990,13 +3990,13 @@ static int stm32_ep_configure(FAR struct usbdev_ep_s *ep, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0_configure * * Description: * Reset Usb engine * - *******************************************************************************/ + ****************************************************************************/ static void stm32_ep0_configure(FAR struct stm32_usbdev_s *priv) { @@ -4008,13 +4008,13 @@ static void stm32_ep0_configure(FAR struct stm32_usbdev_s *priv) CONFIG_USBDEV_EP0_MAXSIZE); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epout_disable * * Description: * Diable an OUT endpoint will no longer be used * - *******************************************************************************/ + ****************************************************************************/ static void stm32_epout_disable(FAR struct stm32_ep_s *privep) { @@ -4078,13 +4078,13 @@ static void stm32_epout_disable(FAR struct stm32_ep_s *privep) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epin_disable * * Description: * Disable an IN endpoint when it will no longer be used * - *******************************************************************************/ + ****************************************************************************/ static void stm32_epin_disable(FAR struct stm32_ep_s *privep) { @@ -4172,13 +4172,13 @@ static void stm32_epin_disable(FAR struct stm32_ep_s *privep) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_disable * * Description: * The endpoint will no longer be used * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ep_disable(FAR struct usbdev_ep_s *ep) { @@ -4212,13 +4212,13 @@ static int stm32_ep_disable(FAR struct usbdev_ep_s *ep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_allocreq * * Description: * Allocate an I/O request * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_req_s *stm32_ep_allocreq(FAR struct usbdev_ep_s *ep) { @@ -4245,13 +4245,13 @@ static FAR struct usbdev_req_s *stm32_ep_allocreq(FAR struct usbdev_ep_s *ep) return &privreq->req; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_freereq * * Description: * Free an I/O request * - *******************************************************************************/ + ****************************************************************************/ static void stm32_ep_freereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -4269,13 +4269,13 @@ static void stm32_ep_freereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s kmm_free(privreq); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_allocbuffer * * Description: * Allocate an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_DMA static void *stm32_ep_allocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) @@ -4290,13 +4290,13 @@ static void *stm32_ep_allocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_freebuffer * * Description: * Free an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_DMA static void stm32_ep_freebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) @@ -4311,13 +4311,13 @@ static void stm32_ep_freebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_submit * * Description: * Submit an I/O request to the endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ep_submit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -4405,13 +4405,13 @@ static int stm32_ep_submit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s * return ret; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_cancel * * Description: * Cancel an I/O request previously sent to an endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ep_cancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) { @@ -4441,13 +4441,13 @@ static int stm32_ep_cancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s * return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epout_setstall * * Description: * Stall an OUT endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_epout_setstall(FAR struct stm32_ep_s *privep) { @@ -4513,13 +4513,13 @@ static int stm32_epout_setstall(FAR struct stm32_ep_s *privep) #endif } -/******************************************************************************* +/**************************************************************************** * Name: stm32_epin_setstall * * Description: * Stall an IN endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_epin_setstall(FAR struct stm32_ep_s *privep) { @@ -4542,13 +4542,13 @@ static int stm32_epin_setstall(FAR struct stm32_ep_s *privep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_setstall * * Description: * Stall an endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ep_setstall(FAR struct stm32_ep_s *privep) { @@ -4566,13 +4566,13 @@ static int stm32_ep_setstall(FAR struct stm32_ep_s *privep) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_clrstall * * Description: * Resume a stalled endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ep_clrstall(FAR struct stm32_ep_s *privep) { @@ -4625,13 +4625,13 @@ static int stm32_ep_clrstall(FAR struct stm32_ep_s *privep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_stall * * Description: * Stall or resume an endpoint * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ep_stall(FAR struct usbdev_ep_s *ep, bool resume) { @@ -4655,13 +4655,13 @@ static int stm32_ep_stall(FAR struct usbdev_ep_s *ep, bool resume) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0_stall * * Description: * Stall endpoint 0 * - *******************************************************************************/ + ****************************************************************************/ static void stm32_ep0_stall(FAR struct stm32_usbdev_s *priv) { @@ -4671,11 +4671,11 @@ static void stm32_ep0_stall(FAR struct stm32_usbdev_s *priv) stm32_ep0out_ctrlsetup(priv); } -/******************************************************************************* +/**************************************************************************** * Device operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_alloc * * Description: @@ -4689,7 +4689,7 @@ static void stm32_ep0_stall(FAR struct stm32_usbdev_s *priv) * eptype - Endpoint type. One of {USB_EP_ATTR_XFER_ISOC, USB_EP_ATTR_XFER_BULK, * USB_EP_ATTR_XFER_INT} * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_ep_s *stm32_ep_alloc(FAR struct usbdev_s *dev, uint8_t eplog, bool in, @@ -4768,13 +4768,13 @@ static FAR struct usbdev_ep_s *stm32_ep_alloc(FAR struct usbdev_s *dev, return NULL; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep_free * * Description: * Free the previously allocated endpoint * - *******************************************************************************/ + ****************************************************************************/ static void stm32_ep_free(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) { @@ -4794,13 +4794,13 @@ static void stm32_ep_free(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_getframe * * Description: * Returns the current frame number * - *******************************************************************************/ + ****************************************************************************/ static int stm32_getframe(struct usbdev_s *dev) { @@ -4814,13 +4814,13 @@ static int stm32_getframe(struct usbdev_s *dev) return (int)((regval & OTGHS_DSTS_SOFFN_MASK) >> OTGHS_DSTS_SOFFN_SHIFT); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_wakeup * * Description: * Exit suspend mode. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_wakeup(struct usbdev_s *dev) { @@ -4862,13 +4862,13 @@ static int stm32_wakeup(struct usbdev_s *dev) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_selfpowered * * Description: * Sets/clears the device self-powered feature * - *******************************************************************************/ + ****************************************************************************/ static int stm32_selfpowered(struct usbdev_s *dev, bool selfpowered) { @@ -4888,13 +4888,13 @@ static int stm32_selfpowered(struct usbdev_s *dev, bool selfpowered) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_pullup * * Description: * Software-controlled connect to/disconnect from USB host * - *******************************************************************************/ + ****************************************************************************/ static int stm32_pullup(struct usbdev_s *dev, bool enable) { @@ -4926,13 +4926,13 @@ static int stm32_pullup(struct usbdev_s *dev, bool enable) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_setaddress * * Description: * Set the devices USB address * - *******************************************************************************/ + ****************************************************************************/ static void stm32_setaddress(struct stm32_usbdev_s *priv, uint16_t address) { @@ -4961,13 +4961,13 @@ static void stm32_setaddress(struct stm32_usbdev_s *priv, uint16_t address) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_txfifo_flush * * Description: * Flush the specific TX fifo. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_txfifo_flush(uint32_t txfnum) { @@ -4996,13 +4996,13 @@ static int stm32_txfifo_flush(uint32_t txfnum) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_rxfifo_flush * * Description: * Flush the RX fifo. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_rxfifo_flush(void) { @@ -5030,13 +5030,13 @@ static int stm32_rxfifo_flush(void) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_swinitialize * * Description: * Initialize all driver data structures. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_swinitialize(FAR struct stm32_usbdev_s *priv) { @@ -5112,13 +5112,13 @@ static void stm32_swinitialize(FAR struct stm32_usbdev_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_hwinitialize * * Description: * Configure the OTG HS core for operation. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_hwinitialize(FAR struct stm32_usbdev_s *priv) { @@ -5356,11 +5356,11 @@ static void stm32_hwinitialize(FAR struct stm32_usbdev_s *priv) STM32_OTGHS_GAHBCFG); } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_usbinitialize * * Description: @@ -5373,7 +5373,7 @@ static void stm32_hwinitialize(FAR struct stm32_usbdev_s *priv) * and P0.23 and PO.31 in PINSEL1 must be configured for Vbus and USB connect * LED. * - *******************************************************************************/ + ****************************************************************************/ void up_usbinitialize(void) { @@ -5466,9 +5466,9 @@ errout: up_usbuninitialize(); } -/******************************************************************************* +/**************************************************************************** * Name: up_usbhsuninitialize - *******************************************************************************/ + ****************************************************************************/ void up_usbuninitialize(void) { @@ -5526,14 +5526,14 @@ void up_usbuninitialize(void) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: usbdev_register * * Description: * Register a USB device class driver. The class driver's bind() method will be * called to bind it to a USB device driver. * - *******************************************************************************/ + ****************************************************************************/ int usbdev_register(struct usbdevclass_driver_s *driver) { @@ -5596,7 +5596,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: usbdev_unregister * * Description: @@ -5604,7 +5604,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) * it will first disconnect(). The driver is also requested to unbind() and clean * up any device state, before this procedure finally returns. * - *******************************************************************************/ + ****************************************************************************/ int usbdev_unregister(struct usbdevclass_driver_s *driver) { diff --git a/arch/arm/src/stm32/stm32_otghshost.c b/arch/arm/src/stm32/stm32_otghshost.c index 3d7340ca90..3a909597ce 100644 --- a/arch/arm/src/stm32/stm32_otghshost.c +++ b/arch/arm/src/stm32/stm32_otghshost.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/stm32/stm32_otghshost.c * * Copyright (C) 2012-2015 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -69,9 +69,9 @@ #if defined(CONFIG_USBHOST) && defined(CONFIG_STM32_OTGHS) -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ /* * STM32 USB OTG HS Host Driver Support @@ -164,9 +164,9 @@ # define MAX(a, b) (((a) > (b)) ? (a) : (b)) #endif -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* The following enumeration represents the various states of the USB host * state machine (for debug purposes only) @@ -278,9 +278,9 @@ struct stm32_usbhost_s struct stm32_chan_s chan[STM32_MAX_TX_FIFOS]; }; -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Register operations ********************************************************/ @@ -469,9 +469,9 @@ static void stm32_host_initialize(FAR struct stm32_usbhost_s *priv); static inline void stm32_sw_initialize(FAR struct stm32_usbhost_s *priv); static inline int stm32_hw_initialize(FAR struct stm32_usbhost_s *priv); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ /* In this driver implementation, support is provided for only a single a single * USB device. All status information can be simply retained in a single global @@ -488,21 +488,21 @@ static struct usbhost_connection_s g_usbconn = .enumerate = stm32_enumerate, }; -/******************************************************************************* +/**************************************************************************** * Public Data - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: stm32_printreg * * Description: * Print the contents of an STM32xx register operation * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_STM32_USBHOST_REGDEBUG static void stm32_printreg(uint32_t addr, uint32_t val, bool iswrite) @@ -511,13 +511,13 @@ static void stm32_printreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_checkreg * * Description: * Get the contents of an STM32 register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_STM32_USBHOST_REGDEBUG static void stm32_checkreg(uint32_t addr, uint32_t val, bool iswrite) @@ -575,13 +575,13 @@ static void stm32_checkreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_getreg * * Description: * Get the contents of an STM32 register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_STM32_USBHOST_REGDEBUG static uint32_t stm32_getreg(uint32_t addr) @@ -597,13 +597,13 @@ static uint32_t stm32_getreg(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_putreg * * Description: * Set the contents of an STM32 register to a value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_STM32_USBHOST_REGDEBUG static void stm32_putreg(uint32_t addr, uint32_t val) @@ -618,13 +618,13 @@ static void stm32_putreg(uint32_t addr, uint32_t val) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_modifyreg * * Description: * Modify selected bits of an STM32 register. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_modifyreg(uint32_t addr, uint32_t clrbits, uint32_t setbits) { @@ -638,7 +638,7 @@ static inline void stm32_modifyreg(uint32_t addr, uint32_t clrbits, uint32_t set * This is just a wrapper to handle the annoying behavior of semaphore * waits that return due to the receipt of a signal. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_takesem(sem_t *sem) { @@ -660,20 +660,20 @@ static void stm32_takesem(sem_t *sem) * Description: * Get a (possibly unaligned) 16-bit little endian value. * - *******************************************************************************/ + ****************************************************************************/ static inline uint16_t stm32_getle16(const uint8_t *val) { return (uint16_t)val[1] << 8 | (uint16_t)val[0]; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_alloc * * Description: * Allocate a channel. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_chan_alloc(FAR struct stm32_usbhost_s *priv) { @@ -699,13 +699,13 @@ static int stm32_chan_alloc(FAR struct stm32_usbhost_s *priv) return -EBUSY; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_free * * Description: * Free a previoiusly allocated channel. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_chan_free(FAR struct stm32_usbhost_s *priv, int chidx) { @@ -720,13 +720,13 @@ static void stm32_chan_free(FAR struct stm32_usbhost_s *priv, int chidx) priv->chan[chidx].inuse = false; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_freeall * * Description: * Free all channels. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_chan_freeall(FAR struct stm32_usbhost_s *priv) { @@ -740,7 +740,7 @@ static inline void stm32_chan_freeall(FAR struct stm32_usbhost_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_configure * * Description: @@ -748,7 +748,7 @@ static inline void stm32_chan_freeall(FAR struct stm32_usbhost_s *priv) * when endpoint is allocated and EP0 (only) is re-configured with the * max packet size or device address changes. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_chan_configure(FAR struct stm32_usbhost_s *priv, int chidx) { @@ -899,14 +899,14 @@ static void stm32_chan_configure(FAR struct stm32_usbhost_s *priv, int chidx) stm32_putreg(STM32_OTGHS_HCCHAR(chidx), regval); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_halt * * Description: * Halt the channel associated with 'chidx' by setting the CHannel DISable * (CHDIS) bit in in the HCCHAR register. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_chan_halt(FAR struct stm32_usbhost_s *priv, int chidx, enum stm32_chreason_e chreason) @@ -984,7 +984,7 @@ static void stm32_chan_halt(FAR struct stm32_usbhost_s *priv, int chidx, stm32_putreg(STM32_OTGHS_HCCHAR(chidx), hcchar); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_waitsetup * * Description: @@ -996,7 +996,7 @@ static void stm32_chan_halt(FAR struct stm32_usbhost_s *priv, int chidx, * Assumptions: * Called from a normal thread context BEFORE the transfer has been started. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_chan_waitsetup(FAR struct stm32_usbhost_s *priv, FAR struct stm32_chan_s *chan) @@ -1024,7 +1024,7 @@ static int stm32_chan_waitsetup(FAR struct stm32_usbhost_s *priv, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_asynchsetup * * Description: @@ -1036,7 +1036,7 @@ static int stm32_chan_waitsetup(FAR struct stm32_usbhost_s *priv, * Assumptions: * Might be called from the level of an interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int stm32_chan_asynchsetup(FAR struct stm32_usbhost_s *priv, @@ -1065,7 +1065,7 @@ static int stm32_chan_asynchsetup(FAR struct stm32_usbhost_s *priv, } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_wait * * Description: @@ -1074,7 +1074,7 @@ static int stm32_chan_asynchsetup(FAR struct stm32_usbhost_s *priv, * Assumptions: * Called from a normal thread context * - *******************************************************************************/ + ****************************************************************************/ static int stm32_chan_wait(FAR struct stm32_usbhost_s *priv, FAR struct stm32_chan_s *chan) @@ -1120,7 +1120,7 @@ static int stm32_chan_wait(FAR struct stm32_usbhost_s *priv, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_chan_wakeup * * Description: @@ -1131,7 +1131,7 @@ static int stm32_chan_wait(FAR struct stm32_usbhost_s *priv, * This function is called from the transfer complete interrupt handler for * the channel. Interrupts are disabled. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_chan_wakeup(FAR struct stm32_usbhost_s *priv, FAR struct stm32_chan_s *chan) @@ -1181,13 +1181,13 @@ static void stm32_chan_wakeup(FAR struct stm32_usbhost_s *priv, } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ctrlchan_alloc * * Description: * Allocate and configured channels for a control pipe. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ctrlchan_alloc(FAR struct stm32_usbhost_s *priv, uint8_t epno, uint8_t funcaddr, uint8_t speed, @@ -1244,7 +1244,7 @@ static int stm32_ctrlchan_alloc(FAR struct stm32_usbhost_s *priv, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ctrlep_alloc * * Description: @@ -1263,7 +1263,7 @@ static int stm32_ctrlchan_alloc(FAR struct stm32_usbhost_s *priv, * Assumptions: * This function will *not* be called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ctrlep_alloc(FAR struct stm32_usbhost_s *priv, FAR const struct usbhost_epdesc_s *epdesc, @@ -1377,13 +1377,13 @@ static int stm32_xfrep_alloc(FAR struct stm32_usbhost_s *priv, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_transfer_start * * Description: * Start at transfer on the select IN or OUT channel. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_transfer_start(FAR struct stm32_usbhost_s *priv, int chidx) { @@ -1567,7 +1567,7 @@ static void stm32_transfer_start(FAR struct stm32_usbhost_s *priv, int chidx) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_getframe * * Description: @@ -1575,7 +1575,7 @@ static void stm32_transfer_start(FAR struct stm32_usbhost_s *priv, int chidx) * when a new SOF is transmitted on the USB, and is cleared to 0 when it * reaches 0x3fff. * - *******************************************************************************/ + ****************************************************************************/ #if 0 /* Not used */ static inline uint16_t stm32_getframe(void) @@ -1584,13 +1584,13 @@ static inline uint16_t stm32_getframe(void) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_ctrl_sendsetup * * Description: * Send an IN/OUT SETUP packet. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv, FAR struct stm32_ctrlinfo_s *ep0, @@ -1660,14 +1660,14 @@ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv, return -ETIMEDOUT; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ctrl_senddata * * Description: * Send data in the data phase of an OUT control transfer. Or send status * in the status phase of an IN control transfer * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ctrl_senddata(FAR struct stm32_usbhost_s *priv, FAR struct stm32_ctrlinfo_s *ep0, @@ -1713,14 +1713,14 @@ static int stm32_ctrl_senddata(FAR struct stm32_usbhost_s *priv, return stm32_chan_wait(priv, chan); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ctrl_recvdata * * Description: * Receive data in the data phase of an IN control transfer. Or receive status * in the status phase of an OUT control transfer * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ctrl_recvdata(FAR struct stm32_usbhost_s *priv, FAR struct stm32_ctrlinfo_s *ep0, @@ -1754,13 +1754,13 @@ static int stm32_ctrl_recvdata(FAR struct stm32_usbhost_s *priv, return stm32_chan_wait(priv, chan); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_in_setup * * Description: * Initiate an IN transfer on an bulk, interrupt, or isochronous pipe. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_in_setup(FAR struct stm32_usbhost_s *priv, int chidx) { @@ -1815,13 +1815,13 @@ static int stm32_in_setup(FAR struct stm32_usbhost_s *priv, int chidx) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_in_transfer * * Description: * Transfer 'buflen' bytes into 'buffer' from an IN channel. * - *******************************************************************************/ + ****************************************************************************/ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx, FAR uint8_t *buffer, size_t buflen) @@ -1897,7 +1897,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx, return (ssize_t)chan->xfrd; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_in_next * * Description: @@ -1906,7 +1906,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx, * Assumptions: * This function is always called from an interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static void stm32_in_next(FAR struct stm32_usbhost_s *priv, @@ -1962,7 +1962,7 @@ static void stm32_in_next(FAR struct stm32_usbhost_s *priv, } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_in_asynch * * Description: @@ -1971,7 +1971,7 @@ static void stm32_in_next(FAR struct stm32_usbhost_s *priv, * Assumptions: * This function is never called from an interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int stm32_in_asynch(FAR struct stm32_usbhost_s *priv, int chidx, @@ -2009,13 +2009,13 @@ static int stm32_in_asynch(FAR struct stm32_usbhost_s *priv, int chidx, } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_out_setup * * Description: * Initiate an OUT transfer on an bulk, interrupt, or isochronous pipe. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_out_setup(FAR struct stm32_usbhost_s *priv, int chidx) { @@ -2074,13 +2074,13 @@ static int stm32_out_setup(FAR struct stm32_usbhost_s *priv, int chidx) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_out_transfer * * Description: * Transfer the 'buflen' bytes in 'buffer' through an OUT channel. * - *******************************************************************************/ + ****************************************************************************/ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, FAR uint8_t *buffer, size_t buflen) @@ -2183,7 +2183,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, return xfrd; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_out_next * * Description: @@ -2192,7 +2192,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, * Assumptions: * This function is always called from an interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static void stm32_out_next(FAR struct stm32_usbhost_s *priv, @@ -2248,7 +2248,7 @@ static void stm32_out_next(FAR struct stm32_usbhost_s *priv, } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_out_asynch * * Description: @@ -2257,7 +2257,7 @@ static void stm32_out_next(FAR struct stm32_usbhost_s *priv, * Assumptions: * This function is never called from an interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int stm32_out_asynch(FAR struct stm32_usbhost_s *priv, int chidx, @@ -2295,14 +2295,14 @@ static int stm32_out_asynch(FAR struct stm32_usbhost_s *priv, int chidx, } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_wrpacket * * Description: * Transfer the 'buflen' bytes in 'buffer' to the Tx FIFO associated with * 'chidx' (non-DMA). * - *******************************************************************************/ + ****************************************************************************/ static void stm32_gint_wrpacket(FAR struct stm32_usbhost_s *priv, FAR uint8_t *buffer, int chidx, int buflen) @@ -2335,7 +2335,7 @@ static void stm32_gint_wrpacket(FAR struct stm32_usbhost_s *priv, priv->chan[chidx].inflight += buflen; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_hcinisr * * Description: @@ -2352,7 +2352,7 @@ static void stm32_gint_wrpacket(FAR struct stm32_usbhost_s *priv, * * EBUSY in the result field indicates that the transfer has not completed. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_hcinisr(FAR struct stm32_usbhost_s *priv, int chidx) @@ -2596,7 +2596,7 @@ static inline void stm32_gint_hcinisr(FAR struct stm32_usbhost_s *priv, stm32_chan_wakeup(priv, chan); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_hcoutisr * * Description: @@ -2613,7 +2613,7 @@ static inline void stm32_gint_hcinisr(FAR struct stm32_usbhost_s *priv, * * EBUSY in the result field indicates that the transfer has not completed. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_hcoutisr(FAR struct stm32_usbhost_s *priv, int chidx) @@ -2821,13 +2821,13 @@ static inline void stm32_gint_hcoutisr(FAR struct stm32_usbhost_s *priv, stm32_chan_wakeup(priv, chan); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_connected * * Description: * Handle a connection event. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_gint_connected(FAR struct stm32_usbhost_s *priv) { @@ -2853,13 +2853,13 @@ static void stm32_gint_connected(FAR struct stm32_usbhost_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_disconnected * * Description: * Handle a disconnection event. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_gint_disconnected(FAR struct stm32_usbhost_s *priv) { @@ -2900,13 +2900,13 @@ static void stm32_gint_disconnected(FAR struct stm32_usbhost_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_sofisr * * Description: * USB OTG HS start-of-frame interrupt handler * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_STM32_OTGHS_SOFINTR static inline void stm32_gint_sofisr(FAR struct stm32_usbhost_s *priv) @@ -2920,13 +2920,13 @@ static inline void stm32_gint_sofisr(FAR struct stm32_usbhost_s *priv) } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_rxflvlisr * * Description: * USB OTG HS RxFIFO non-empty interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_rxflvlisr(FAR struct stm32_usbhost_s *priv) { @@ -3021,13 +3021,13 @@ static inline void stm32_gint_rxflvlisr(FAR struct stm32_usbhost_s *priv) stm32_putreg(STM32_OTGHS_GINTMSK, intmsk); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_nptxfeisr * * Description: * USB OTG HS non-periodic TxFIFO empty interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_nptxfeisr(FAR struct stm32_usbhost_s *priv) { @@ -3109,13 +3109,13 @@ static inline void stm32_gint_nptxfeisr(FAR struct stm32_usbhost_s *priv) stm32_gint_wrpacket(priv, chan->buffer, chidx, wrsize); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_ptxfeisr * * Description: * USB OTG HS periodic TxFIFO empty interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_ptxfeisr(FAR struct stm32_usbhost_s *priv) { @@ -3197,13 +3197,13 @@ static inline void stm32_gint_ptxfeisr(FAR struct stm32_usbhost_s *priv) stm32_gint_wrpacket(priv, chan->buffer, chidx, wrsize); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_hcisr * * Description: * USB OTG HS host channels interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_hcisr(FAR struct stm32_usbhost_s *priv) { @@ -3245,13 +3245,13 @@ static inline void stm32_gint_hcisr(FAR struct stm32_usbhost_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_hprtisr * * Description: * USB OTG HS host port interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_hprtisr(FAR struct stm32_usbhost_s *priv) { @@ -3378,13 +3378,13 @@ static inline void stm32_gint_hprtisr(FAR struct stm32_usbhost_s *priv) stm32_putreg(STM32_OTGHS_HPRT, newhprt); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_discisr * * Description: * USB OTG HS disconnect detected interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_discisr(FAR struct stm32_usbhost_s *priv) { @@ -3397,13 +3397,13 @@ static inline void stm32_gint_discisr(FAR struct stm32_usbhost_s *priv) stm32_putreg(STM32_OTGHS_GINTSTS, OTGHS_GINT_DISC); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_ipxfrisr * * Description: * USB OTG HS incomplete periodic interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_gint_ipxfrisr(FAR struct stm32_usbhost_s *priv) { @@ -3422,13 +3422,13 @@ static inline void stm32_gint_ipxfrisr(FAR struct stm32_usbhost_s *priv) stm32_putreg(STM32_OTGHS_GINTSTS, OTGHS_GINT_IPXFR); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_isr * * Description: * USB OTG HS global interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static int stm32_gint_isr(int irq, FAR void *context) { @@ -3539,7 +3539,7 @@ static int stm32_gint_isr(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_gint_enable and stm32_gint_disable * * Description: @@ -3551,7 +3551,7 @@ static int stm32_gint_isr(int irq, FAR void *context) * Returned Value: * None * - *******************************************************************************/ + ****************************************************************************/ static void stm32_gint_enable(void) { @@ -3575,7 +3575,7 @@ static void stm32_gint_disable(void) stm32_putreg(STM32_OTGHS_GAHBCFG, regval); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_hostinit_enable * * Description: @@ -3587,7 +3587,7 @@ static void stm32_gint_disable(void) * Returned Value: * None * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_hostinit_enable(void) { @@ -3645,7 +3645,7 @@ static inline void stm32_hostinit_enable(void) stm32_putreg(STM32_OTGHS_GINTMSK, regval); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_txfe_enable * * Description: @@ -3665,7 +3665,7 @@ static inline void stm32_hostinit_enable(void) * Called from user task context. Interrupts must be disabled to assure * exclusive access to the GINTMSK register. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_txfe_enable(FAR struct stm32_usbhost_s *priv, int chidx) { @@ -3702,11 +3702,11 @@ static void stm32_txfe_enable(FAR struct stm32_usbhost_s *priv, int chidx) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * USB Host Controller Operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: stm32_wait * * Description: @@ -3729,7 +3729,7 @@ static void stm32_txfe_enable(FAR struct stm32_usbhost_s *priv, int chidx) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_wait(FAR struct usbhost_connection_s *conn, FAR struct usbhost_hubport_s **hport) @@ -3790,7 +3790,7 @@ static int stm32_wait(FAR struct usbhost_connection_s *conn, } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_enumerate * * Description: @@ -3816,7 +3816,7 @@ static int stm32_wait(FAR struct usbhost_connection_s *conn, * Assumptions: * This function will *not* be called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_rh_enumerate(FAR struct stm32_usbhost_s *priv, FAR struct usbhost_connection_s *conn, @@ -4098,7 +4098,7 @@ static int stm32_epfree(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_alloc * * Description: @@ -4128,7 +4128,7 @@ static int stm32_epfree(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_alloc(FAR struct usbhost_driver_s *drvr, FAR uint8_t **buffer, FAR size_t *maxlen) @@ -4152,7 +4152,7 @@ static int stm32_alloc(FAR struct usbhost_driver_s *drvr, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_free * * Description: @@ -4173,7 +4173,7 @@ static int stm32_alloc(FAR struct usbhost_driver_s *drvr, * Assumptions: * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_free(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) { @@ -4264,7 +4264,7 @@ static int stm32_iofree(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ctrlin and stm32_ctrlout * * Description: @@ -4297,7 +4297,7 @@ static int stm32_iofree(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, FAR const struct usb_ctrlreq_s *req, @@ -4471,7 +4471,7 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, return -ETIMEDOUT; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_transfer * * Description: @@ -4507,7 +4507,7 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static ssize_t stm32_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, FAR uint8_t *buffer, size_t buflen) @@ -4539,7 +4539,7 @@ static ssize_t stm32_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep return nbytes; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_asynch * * Description: @@ -4572,7 +4572,7 @@ static ssize_t stm32_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep * - Called from a single thread so no mutual exclusion is required. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST_ASYNCH static int stm32_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, @@ -4745,7 +4745,7 @@ static int stm32_connect(FAR struct usbhost_driver_s *drvr, } #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_disconnect * * Description: @@ -4768,7 +4768,7 @@ static int stm32_connect(FAR struct usbhost_driver_s *drvr, * - Only a single class bound to a single device is supported. * - Never called from an interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_disconnect(FAR struct usbhost_driver_s *drvr, FAR struct usbhost_hubport_s *hport) @@ -4777,10 +4777,10 @@ static void stm32_disconnect(FAR struct usbhost_driver_s *drvr, hport->devclass = NULL; } -/******************************************************************************* +/**************************************************************************** * Initialization - *******************************************************************************/ -/******************************************************************************* + ****************************************************************************/ +/**************************************************************************** * Name: stm32_portreset * * Description: @@ -4798,7 +4798,7 @@ static void stm32_disconnect(FAR struct usbhost_driver_s *drvr, * Returned Value: * None * - *******************************************************************************/ + ****************************************************************************/ static void stm32_portreset(FAR struct stm32_usbhost_s *priv) { @@ -4817,7 +4817,7 @@ static void stm32_portreset(FAR struct stm32_usbhost_s *priv) up_mdelay(20); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_flush_txfifos * * Description: @@ -4829,7 +4829,7 @@ static void stm32_portreset(FAR struct stm32_usbhost_s *priv) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_flush_txfifos(uint32_t txfnum) { @@ -4857,7 +4857,7 @@ static void stm32_flush_txfifos(uint32_t txfnum) up_udelay(3); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_flush_rxfifo * * Description: @@ -4869,7 +4869,7 @@ static void stm32_flush_txfifos(uint32_t txfnum) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_flush_rxfifo(void) { @@ -4896,7 +4896,7 @@ static void stm32_flush_rxfifo(void) up_udelay(3); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_vbusdrive * * Description: @@ -4909,7 +4909,7 @@ static void stm32_flush_rxfifo(void) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_vbusdrive(FAR struct stm32_usbhost_s *priv, bool state) { @@ -4939,7 +4939,7 @@ static void stm32_vbusdrive(FAR struct stm32_usbhost_s *priv, bool state) up_mdelay(200); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_host_initialize * * Description: @@ -4954,7 +4954,7 @@ static void stm32_vbusdrive(FAR struct stm32_usbhost_s *priv, bool state) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ static void stm32_host_initialize(FAR struct stm32_usbhost_s *priv) { @@ -5028,7 +5028,7 @@ static void stm32_host_initialize(FAR struct stm32_usbhost_s *priv) stm32_hostinit_enable(); } -/******************************************************************************* +/**************************************************************************** * Name: stm32_sw_initialize * * Description: @@ -5040,7 +5040,7 @@ static void stm32_host_initialize(FAR struct stm32_usbhost_s *priv) * Returned Value: * None. * - *******************************************************************************/ + ****************************************************************************/ static inline void stm32_sw_initialize(FAR struct stm32_usbhost_s *priv) { @@ -5109,7 +5109,7 @@ static inline void stm32_sw_initialize(FAR struct stm32_usbhost_s *priv) } } -/******************************************************************************* +/**************************************************************************** * Name: stm32_hw_initialize * * Description: @@ -5121,7 +5121,7 @@ static inline void stm32_sw_initialize(FAR struct stm32_usbhost_s *priv) * Returned Value: * Zero on success; a negated errno value on failure. * - *******************************************************************************/ + ****************************************************************************/ static inline int stm32_hw_initialize(FAR struct stm32_usbhost_s *priv) { @@ -5196,11 +5196,11 @@ static inline int stm32_hw_initialize(FAR struct stm32_usbhost_s *priv) return OK; } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: stm32_otghshost_initialize * * Description: @@ -5223,7 +5223,7 @@ static inline int stm32_hw_initialize(FAR struct stm32_usbhost_s *priv) * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - *******************************************************************************/ + ****************************************************************************/ FAR struct usbhost_connection_s *stm32_otghshost_initialize(int controller) { diff --git a/arch/arm/src/stm32/stm32_usbdev.c b/arch/arm/src/stm32/stm32_usbdev.c index b2a48800fd..0a82446b29 100644 --- a/arch/arm/src/stm32/stm32_usbdev.c +++ b/arch/arm/src/stm32/stm32_usbdev.c @@ -1324,7 +1324,7 @@ static void stm32_epwrite(struct stm32_usbdev_s *priv, * Description: * Handle the ep0 state on writes. * - *****************************************************************************/ + ****************************************************************************/ inline static int stm32_wrrequest_ep0(struct stm32_usbdev_s *priv, struct stm32_ep_s *privep) @@ -1438,7 +1438,7 @@ static int stm32_wrrequest(struct stm32_usbdev_s *priv, struct stm32_ep_s *prive return OK; } -/******************************************************************************* +/**************************************************************************** * Name: stm32_ep0_rdrequest * * Description: @@ -1446,7 +1446,7 @@ static int stm32_wrrequest(struct stm32_usbdev_s *priv, struct stm32_ep_s *prive * is EP0STATE_SETUP_OUT and uppon new incoming data is available in the endpoint * 0's buffer. This function will simply copy the OUT data into ep0data. * - *******************************************************************************/ + ****************************************************************************/ static inline int stm32_ep0_rdrequest(struct stm32_usbdev_s *priv) { diff --git a/arch/arm/src/tiva/tiva_adclib.c b/arch/arm/src/tiva/tiva_adclib.c index f003000edb..9254f03128 100644 --- a/arch/arm/src/tiva/tiva_adclib.c +++ b/arch/arm/src/tiva/tiva_adclib.c @@ -44,7 +44,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This is part of revision 2.1.0.12573 of the Tiva Peripheral Driver Library. - *****************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Included Files diff --git a/arch/arm/src/tiva/tiva_adclow.c b/arch/arm/src/tiva/tiva_adclow.c index dca7e5487c..3fe4772976 100644 --- a/arch/arm/src/tiva/tiva_adclow.c +++ b/arch/arm/src/tiva/tiva_adclow.c @@ -44,7 +44,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This is part of revision 2.1.0.12573 of the Tiva Peripheral Driver Library. - *****************************************************************************/ + ****************************************************************************/ /* Keep in mind that for every step there should be another entry in the * CONFIG_ADC_FIFOSIZE value. diff --git a/arch/avr/src/at32uc3/at32uc3_lowconsole.c b/arch/avr/src/at32uc3/at32uc3_lowconsole.c index 86e66143b4..4e6f4240fa 100644 --- a/arch/avr/src/at32uc3/at32uc3_lowconsole.c +++ b/arch/avr/src/at32uc3/at32uc3_lowconsole.c @@ -1,4 +1,4 @@ -/****************************************************************************** +/**************************************************************************** * arch/avr/src/at32uc3/at32uc3_lowconsole.c * * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Included Files - ******************************************************************************/ + ****************************************************************************/ #include #include "at32uc3_config.h" @@ -53,9 +53,9 @@ #include "at32uc3_usart.h" #include "at32uc3_pinmux.h" -/****************************************************************************** +/**************************************************************************** * Pre-processor Definitions - ******************************************************************************/ + ****************************************************************************/ /* Select USART parameters for the selected console */ @@ -81,33 +81,33 @@ # error "No CONFIG_USARTn_SERIAL_CONSOLE Setting" #endif -/****************************************************************************** +/**************************************************************************** * Private Types - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Private Function Prototypes - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Public Data - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Private Variables - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Private Functions - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Name: usart_putreg * * Description: * Write a value to a USART register * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_RS232_DEVICE static inline void usart_putreg(uintptr_t usart_base, unsigned int offset, uint32_t value) @@ -116,13 +116,13 @@ static inline void usart_putreg(uintptr_t usart_base, unsigned int offset, uint3 } #endif -/****************************************************************************** +/**************************************************************************** * Name: usart_getreg * * Description: * Get a value from a USART register * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_RS232_DEVICE static inline uint32_t usart_getreg(uintptr_t usart_base, unsigned int offset) @@ -131,13 +131,13 @@ static inline uint32_t usart_getreg(uintptr_t usart_base, unsigned int offset) } #endif -/****************************************************************************** +/**************************************************************************** * Name: usart_setbaudrate * * Description: * Configure the UART baud rate. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_RS232_DEVICE static void usart_setbaudrate(uintptr_t usart_base, uint32_t baudrate) @@ -186,17 +186,17 @@ static void usart_setbaudrate(uintptr_t usart_base, uint32_t baudrate) } #endif -/****************************************************************************** +/**************************************************************************** * Public Functions - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Name: usart_reset * * Description: * Reset a USART. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_RS232_DEVICE void usart_reset(uintptr_t usart_base) @@ -223,13 +223,13 @@ void usart_reset(uintptr_t usart_base) } #endif -/****************************************************************************** +/**************************************************************************** * Name: usart_configure * * Description: * Configure a USART as a RS-232 UART. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_RS232_DEVICE void usart_configure(uintptr_t usart_base, uint32_t baud, unsigned int parity, @@ -290,7 +290,7 @@ void usart_configure(uintptr_t usart_base, uint32_t baud, unsigned int parity, } #endif -/****************************************************************************** +/**************************************************************************** * Name: up_consoleinit * * Description: @@ -298,7 +298,7 @@ void usart_configure(uintptr_t usart_base, uint32_t baud, unsigned int parity, * early in the initialization sequence to configure the serial console uart * (only). * - ******************************************************************************/ + ****************************************************************************/ void up_consoleinit(void) { @@ -368,13 +368,13 @@ void up_consoleinit(void) #endif } -/****************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - ******************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { diff --git a/arch/avr/src/at90usb/at90usb_lowconsole.c b/arch/avr/src/at90usb/at90usb_lowconsole.c index 637793b771..c40328ec23 100644 --- a/arch/avr/src/at90usb/at90usb_lowconsole.c +++ b/arch/avr/src/at90usb/at90usb_lowconsole.c @@ -1,4 +1,4 @@ -/****************************************************************************** +/**************************************************************************** * arch/avr/src/at90usb/at90usb_lowconsole.c * * Copyright (C) 2011 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Included Files - ******************************************************************************/ + ****************************************************************************/ #include #include "at90usb_config.h" @@ -52,9 +52,9 @@ #include "at90usb_internal.h" -/****************************************************************************** +/**************************************************************************** * Pre-processor Definitions - ******************************************************************************/ + ****************************************************************************/ /* Baud rate settings for normal and double speed modes */ @@ -116,37 +116,37 @@ # endif #endif -/****************************************************************************** +/**************************************************************************** * Private Types - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Private Function Prototypes - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Public Data - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Private Variables - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Private Functions - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Public Functions - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Name: usart1_reset * * Description: * Reset a USART. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_USART_DEVICE void usart1_reset(void) @@ -168,13 +168,13 @@ void usart1_reset(void) } #endif -/****************************************************************************** +/**************************************************************************** * Name: usart1_configure * * Description: * Configure USART1. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_USART_DEVICE void usart1_configure(void) @@ -249,7 +249,7 @@ void usart1_configure(void) } #endif -/****************************************************************************** +/**************************************************************************** * Name: up_consoleinit * * Description: @@ -257,7 +257,7 @@ void usart1_configure(void) * early in the initialization sequence to configure the serial console uart * (only). * - ******************************************************************************/ + ****************************************************************************/ void up_consoleinit(void) { @@ -266,13 +266,13 @@ void up_consoleinit(void) #endif } -/****************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - ******************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { diff --git a/arch/avr/src/at90usb/at90usb_usbdev.c b/arch/avr/src/at90usb/at90usb_usbdev.c index 2a26f8f26d..336ec0751e 100644 --- a/arch/avr/src/at90usb/at90usb_usbdev.c +++ b/arch/avr/src/at90usb/at90usb_usbdev.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/at90usb/at90usb_usbdev.c * * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include @@ -62,9 +62,9 @@ #include "up_arch.h" #include "up_internal.h" -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* Configuration ***************************************************************/ /* PLL Settings are based on F_CPU frequency which is defined in the board.h file */ @@ -195,9 +195,9 @@ #define avr_rqempty(ep) ((ep)->head == NULL) #define avr_rqpeek(ep) ((ep)->head) -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ /* A container for a request so that the request may be retained in a list */ @@ -261,9 +261,9 @@ struct avr_usbdev_s struct avr_ep_s eplist[AVR_NENDPOINTS]; }; -/******************************************************************************* +/**************************************************************************** * Private Function Prototypes - *******************************************************************************/ + ****************************************************************************/ /* Request queue operations ****************************************************/ @@ -331,9 +331,9 @@ static int avr_wakeup(struct usbdev_s *dev); static int avr_selfpowered(struct usbdev_s *dev, bool selfpowered); static int avr_pullup(struct usbdev_s *dev, bool enable); -/******************************************************************************* +/**************************************************************************** * Private Data - *******************************************************************************/ + ****************************************************************************/ /* Since there is only a single USB interface, all status information can be * be simply retained in a single global instance. @@ -366,21 +366,21 @@ static const struct usbdev_ops_s g_devops = .pullup = avr_pullup, }; -/******************************************************************************* +/**************************************************************************** * Public Data - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Private Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: avr_rqdequeue * * Description: * Remove a request from an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static FAR struct avr_req_s *avr_rqdequeue(FAR struct avr_ep_s *privep) { @@ -400,13 +400,13 @@ static FAR struct avr_req_s *avr_rqdequeue(FAR struct avr_ep_s *privep) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: avr_rqenqueue * * Description: * Add a request from an endpoint request queue * - *******************************************************************************/ + ****************************************************************************/ static inline void avr_rqenqueue(FAR struct avr_ep_s *privep, FAR struct avr_req_s *req) @@ -424,13 +424,13 @@ static inline void avr_rqenqueue(FAR struct avr_ep_s *privep, } } -/******************************************************************************* +/**************************************************************************** * Name: avr_txready * * Description: * Wait for the selected endpoint to be ready for an IN (TX) transfer * - *******************************************************************************/ + ****************************************************************************/ static void avr_txready(void) { @@ -438,13 +438,13 @@ static void avr_txready(void) while (((UEINTX & (1 << TXINI)) == 0) && retries-- > 0); } -/******************************************************************************* +/**************************************************************************** * Name: avr_fifoready * * Description: * Wait for the selected endpoint FIFO to be ready * - *******************************************************************************/ + ****************************************************************************/ static int avr_fifoready(int timeout) { @@ -496,7 +496,7 @@ static int avr_fifoready(int timeout) } } -/******************************************************************************* +/**************************************************************************** * Name: avr_ep0send * * Description: @@ -505,7 +505,7 @@ static int avr_fifoready(int timeout) * Assumptions: * - Endpoint 0 is already selected. * - *******************************************************************************/ + ****************************************************************************/ static void avr_ep0send(FAR const uint8_t *buffer, uint16_t buflen) { @@ -577,13 +577,13 @@ static void avr_ep0send(FAR const uint8_t *buffer, uint16_t buflen) } } -/******************************************************************************* +/**************************************************************************** * Name: avr_epNsend * * Description: * Perform a TX transfer for Endpoint N * - *******************************************************************************/ + ****************************************************************************/ static inline int avr_epNsend(FAR struct avr_ep_s *privep, FAR struct avr_req_s *privreq) @@ -744,13 +744,13 @@ static inline int avr_epNsend(FAR struct avr_ep_s *privep, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: avr_epNrecv * * Description: * Perform an RX transfer for Endpoint N * - *******************************************************************************/ + ****************************************************************************/ static inline int avr_epNrecv(FAR struct avr_ep_s *privep, FAR struct usbdev_req_s *req) @@ -826,7 +826,7 @@ static inline int avr_epNrecv(FAR struct avr_ep_s *privep, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: avr_epINqueue * * Description: @@ -835,7 +835,7 @@ static inline int avr_epNrecv(FAR struct avr_ep_s *privep, * interrupt occurs. Thus function is also called from the requeust enqueuing * logic BUT with interrupts disabled. * - *******************************************************************************/ + ****************************************************************************/ static int avr_epINqueue(FAR struct avr_ep_s *privep) { @@ -887,7 +887,7 @@ static int avr_epINqueue(FAR struct avr_ep_s *privep) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: avr_epOUTqueue * * Description: @@ -895,7 +895,7 @@ static int avr_epINqueue(FAR struct avr_ep_s *privep) * from interrupt handling logic for an endpoint when the RXOUT endpoint * interrupt occurs. * - *******************************************************************************/ + ****************************************************************************/ static int avr_epOUTqueue(FAR struct avr_ep_s *privep) { @@ -926,13 +926,13 @@ static int avr_epOUTqueue(FAR struct avr_ep_s *privep) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: avr_reqcomplete * * Description: * Handle termination of the request at the head of the endpoint request queue. * - *******************************************************************************/ + ****************************************************************************/ static void avr_reqcomplete(FAR struct avr_ep_s *privep, FAR struct avr_req_s *privreq, int result) @@ -959,13 +959,13 @@ static void avr_reqcomplete(FAR struct avr_ep_s *privep, FAR struct avr_req_s *p privep->stalled = stalled; } -/******************************************************************************* +/**************************************************************************** * Name: avr_cancelrequests * * Description: * Cancel all pending requests for an endpoint * - *******************************************************************************/ + ****************************************************************************/ static void avr_cancelrequests(FAR struct avr_ep_s *privep, int status) { @@ -998,13 +998,13 @@ static void avr_cancelrequests(FAR struct avr_ep_s *privep, int status) } } -/******************************************************************************* +/**************************************************************************** * Name: avr_cancelall * * Description: * Cancel all pending requests for an endpoint * - *******************************************************************************/ + ****************************************************************************/ static void avr_cancelall(int status) { @@ -1021,14 +1021,14 @@ static void avr_cancelall(int status) } } -/******************************************************************************* +/**************************************************************************** * Name: avr_epfindbyaddr * * Description: * Find the physical endpoint structure corresponding to a logic endpoint * address * - *******************************************************************************/ + ****************************************************************************/ static struct avr_ep_s *avr_epfindbyaddr(uint8_t epno) { @@ -1063,14 +1063,14 @@ static struct avr_ep_s *avr_epfindbyaddr(uint8_t epno) return NULL; } -/******************************************************************************* +/**************************************************************************** * Name: avr_dispatchrequest * * Description: * Provide unhandled setup actions to the class driver. This is logically part * of the USB interrupt handler. * - *******************************************************************************/ + ****************************************************************************/ static void avr_dispatchrequest(FAR const struct usb_ctrlreq_s *ctrl) { @@ -1093,13 +1093,13 @@ static void avr_dispatchrequest(FAR const struct usb_ctrlreq_s *ctrl) } } -/******************************************************************************* +/**************************************************************************** * Name: avr_ep0configure * * Description: * Reset Usb engine * - *******************************************************************************/ + ****************************************************************************/ static int avr_ep0configure(void) { @@ -1139,7 +1139,7 @@ static int avr_ep0configure(void) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: avr_epreset * * Description: @@ -1148,7 +1148,7 @@ static int avr_ep0configure(void) * Input Parameters: * epno - The endpoint to be reset * - *******************************************************************************/ + ****************************************************************************/ static void avr_epreset(FAR struct avr_ep_s *privep, int status) { @@ -1172,13 +1172,13 @@ static void avr_epreset(FAR struct avr_ep_s *privep, int status) privep->stalled = false; } -/******************************************************************************* +/**************************************************************************** * Name: avr_usbreset * * Description: * Reset Usb engine * - *******************************************************************************/ + ****************************************************************************/ static void avr_usbreset(void) { @@ -1273,13 +1273,13 @@ static void avr_usbreset(void) UDIEN |= ((1 << SUSPE) | (1 << EORSTE)); } -/******************************************************************************* +/**************************************************************************** * Name: avr_usbshutdown * * Description: * Shutdown the USB interface and put the hardare in a known state * - *******************************************************************************/ + ****************************************************************************/ void avr_usbshutdown(void) { @@ -1322,13 +1322,13 @@ void avr_usbshutdown(void) USBCON &= ~(1 << OTGPADE); } -/******************************************************************************* +/**************************************************************************** * Name: avr_setaddress * * Description: * Set the devices USB address * - *******************************************************************************/ + ****************************************************************************/ static inline void avr_setaddress(uint8_t address) { @@ -1352,14 +1352,14 @@ static inline void avr_setaddress(uint8_t address) UDADDR = ((1 << ADDEN) | address); } -/******************************************************************************* +/**************************************************************************** * Name: avr_ep0setup * * Description: * USB Ctrl EP Setup Event. This is logically part of the USB interrupt * handler. This event occurs when a setup packet is receive on EP0 OUT. * - *******************************************************************************/ + ****************************************************************************/ static inline void avr_ep0setup(void) { @@ -1759,13 +1759,13 @@ static inline void avr_ep0setup(void) } } -/******************************************************************************* +/**************************************************************************** * Name: avr_ep0interrupt * * Description: * USB endpoint/pipe IN interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void avr_ep0interrupt(void) { @@ -1796,13 +1796,13 @@ static inline void avr_ep0interrupt(void) } } -/******************************************************************************* +/**************************************************************************** * Name: avr_epNinterrupt * * Description: * USB endpoint/pipe IN interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static inline void avr_epNinterrupt(void) { @@ -1868,13 +1868,13 @@ static inline void avr_epNinterrupt(void) } } -/******************************************************************************* +/**************************************************************************** * Name: avr_epinterrupt * * Description: * USB endpoint/pipe interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static int avr_epinterrupt(int irq, FAR void *context) { @@ -1892,14 +1892,14 @@ static int avr_epinterrupt(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: avr_genvbus * * Description: * A change in VBUS has been detected. Check if the device has been * connected to or disconnected from a host. * - *******************************************************************************/ + ****************************************************************************/ static void avr_genvbus(void) { @@ -1944,13 +1944,13 @@ static void avr_genvbus(void) } } -/******************************************************************************* +/**************************************************************************** * Name: avr_gensuspend * * Description: * The USB controller has been put in suspend mode. * - *******************************************************************************/ + ****************************************************************************/ static inline void avr_gensuspend(void) { @@ -1979,13 +1979,13 @@ static inline void avr_gensuspend(void) PLLCSR = 0; } -/******************************************************************************* +/**************************************************************************** * Name: avr_genwakeup * * Description: * Resume from suspend mode. * - *******************************************************************************/ + ****************************************************************************/ static void avr_genwakeup(void) { @@ -2011,13 +2011,13 @@ static void avr_genwakeup(void) } } -/******************************************************************************* +/**************************************************************************** * Name: avr_geneor * * Description: * Handle an end-of-reset interrupt * - *******************************************************************************/ + ****************************************************************************/ static inline void avr_geneor(void) { @@ -2052,13 +2052,13 @@ static inline void avr_geneor(void) UEIENX |= (1 << RXSTPE); } -/******************************************************************************* +/**************************************************************************** * Name: avr_geninterrupt * * Description: * USB general interrupt handler * - *******************************************************************************/ + ****************************************************************************/ static int avr_geninterrupt(int irq, FAR void *context) { @@ -2100,7 +2100,7 @@ static int avr_geninterrupt(int irq, FAR void *context) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: avr_epconfigure * * Description: @@ -2113,7 +2113,7 @@ static int avr_geninterrupt(int irq, FAR void *context) * needs to take special action when all of the endpoints have been * configured. * - *******************************************************************************/ + ****************************************************************************/ static int avr_epconfigure(FAR struct usbdev_ep_s *ep, FAR const struct usb_epdesc_s *desc, bool last) @@ -2233,13 +2233,13 @@ static int avr_epconfigure(FAR struct usbdev_ep_s *ep, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: avr_epdisable * * Description: * The endpoint will no longer be used * - *******************************************************************************/ + ****************************************************************************/ static int avr_epdisable(FAR struct usbdev_ep_s *ep) { @@ -2266,13 +2266,13 @@ static int avr_epdisable(FAR struct usbdev_ep_s *ep) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: avr_epallocreq * * Description: * Allocate an I/O request * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_req_s *avr_epallocreq(FAR struct usbdev_ep_s *ep) { @@ -2298,13 +2298,13 @@ static FAR struct usbdev_req_s *avr_epallocreq(FAR struct usbdev_ep_s *ep) return &privreq->req; } -/******************************************************************************* +/**************************************************************************** * Name: avr_epfreereq * * Description: * Free an I/O request * - *******************************************************************************/ + ****************************************************************************/ static void avr_epfreereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) @@ -2323,13 +2323,13 @@ static void avr_epfreereq(FAR struct usbdev_ep_s *ep, kmm_free(privreq); } -/******************************************************************************* +/**************************************************************************** * Name: avr_epallocbuffer * * Description: * Allocate an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_DMA static void *avr_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) @@ -2344,13 +2344,13 @@ static void *avr_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) } #endif -/******************************************************************************* +/**************************************************************************** * Name: avr_epfreebuffer * * Description: * Free an I/O buffer * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBDEV_DMA static void avr_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) @@ -2365,13 +2365,13 @@ static void avr_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) } #endif -/******************************************************************************* +/**************************************************************************** * Name: avr_epsubmit * * Description: * Submit an I/O request to the endpoint * - *******************************************************************************/ + ****************************************************************************/ static int avr_epsubmit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) @@ -2469,13 +2469,13 @@ static int avr_epsubmit(FAR struct usbdev_ep_s *ep, return ret; } -/******************************************************************************* +/**************************************************************************** * Name: avr_epcancel * * Description: * Cancel an I/O request previously sent to an endpoint * - *******************************************************************************/ + ****************************************************************************/ static int avr_epcancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) @@ -2503,13 +2503,13 @@ static int avr_epcancel(FAR struct usbdev_ep_s *ep, return OK; } -/******************************************************************************* +/**************************************************************************** * Name: avr_epstall * * Description: * Stall or resume and endpoint * - *******************************************************************************/ + ****************************************************************************/ static int avr_epstall(FAR struct usbdev_ep_s *ep, bool resume) { @@ -2537,11 +2537,11 @@ static int avr_epstall(FAR struct usbdev_ep_s *ep, bool resume) return OK; } -/******************************************************************************* +/**************************************************************************** * Device operations - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: avr_allocep * * Description: @@ -2555,7 +2555,7 @@ static int avr_epstall(FAR struct usbdev_ep_s *ep, bool resume) * eptype - Endpoint type. One of {USB_EP_ATTR_XFER_ISOC, USB_EP_ATTR_XFER_BULK, * USB_EP_ATTR_XFER_INT} * - *******************************************************************************/ + ****************************************************************************/ static FAR struct usbdev_ep_s *avr_allocep(FAR struct usbdev_s *dev, uint8_t epno, bool in, @@ -2650,13 +2650,13 @@ static FAR struct usbdev_ep_s *avr_allocep(FAR struct usbdev_s *dev, return NULL; } -/******************************************************************************* +/**************************************************************************** * Name: avr_freeep * * Description: * Free the previously allocated endpoint * - *******************************************************************************/ + ****************************************************************************/ static void avr_freeep(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) { @@ -2676,13 +2676,13 @@ static void avr_freeep(FAR struct usbdev_s *dev, FAR struct usbdev_ep_s *ep) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: avr_getframe * * Description: * Returns the current frame number * - *******************************************************************************/ + ****************************************************************************/ static int avr_getframe(struct usbdev_s *dev) { @@ -2692,13 +2692,13 @@ static int avr_getframe(struct usbdev_s *dev) return (int)UDFNUMH << 8 | (int)UDFNUML; } -/******************************************************************************* +/**************************************************************************** * Name: avr_wakeup * * Description: * Tries to wake up the host connected to this device * - *******************************************************************************/ + ****************************************************************************/ static int avr_wakeup(struct usbdev_s *dev) { @@ -2712,13 +2712,13 @@ static int avr_wakeup(struct usbdev_s *dev) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: avr_selfpowered * * Description: * Sets/clears the device selfpowered feature * - *******************************************************************************/ + ****************************************************************************/ static int avr_selfpowered(struct usbdev_s *dev, bool selfpowered) { @@ -2736,13 +2736,13 @@ static int avr_selfpowered(struct usbdev_s *dev, bool selfpowered) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: avr_pullup * * Description: * Software-controlled connect to/disconnect from USB host * - *******************************************************************************/ + ****************************************************************************/ static int avr_pullup(struct usbdev_s *dev, bool enable) { @@ -2750,11 +2750,11 @@ static int avr_pullup(struct usbdev_s *dev, bool enable) return OK; } -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_usbinitialize * * Description: @@ -2767,7 +2767,7 @@ static int avr_pullup(struct usbdev_s *dev, bool enable) * and P0.23 and PO.31 in PINSEL1 must be configured for Vbus and USB connect * LED. * - *******************************************************************************/ + ****************************************************************************/ void up_usbinitialize(void) { @@ -2823,9 +2823,9 @@ errout: up_usbuninitialize(); } -/******************************************************************************* +/**************************************************************************** * Name: up_usbuninitialize - *******************************************************************************/ + ****************************************************************************/ void up_usbuninitialize(void) { @@ -2856,14 +2856,14 @@ void up_usbuninitialize(void) irqrestore(flags); } -/******************************************************************************* +/**************************************************************************** * Name: usbdev_register * * Description: * Register a USB device class driver. The class driver's bind() method will be * called to bind it to a USB device driver. * - *******************************************************************************/ + ****************************************************************************/ int usbdev_register(struct usbdevclass_driver_s *driver) { @@ -2912,7 +2912,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) return ret; } -/******************************************************************************* +/**************************************************************************** * Name: usbdev_unregister * * Description: @@ -2920,7 +2920,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) * it will first disconnect(). The driver is also requested to unbind() and clean * up any device state, before this procedure finally returns. * - *******************************************************************************/ + ****************************************************************************/ int usbdev_unregister(struct usbdevclass_driver_s *driver) { @@ -2944,7 +2944,7 @@ int usbdev_unregister(struct usbdevclass_driver_s *driver) return OK; } -/******************************************************************************* +/**************************************************************************** * Name: avr_pollvbus * * Description: @@ -2955,7 +2955,7 @@ int usbdev_unregister(struct usbdevclass_driver_s *driver) * (especially if a relay is used to switch VBUS!). This poll is, then, * simply a failsafe to assure that VBUS connection events are never missed. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USB_NOISYVBUS void avr_pollvbus(void) diff --git a/arch/avr/src/atmega/atmega_lowconsole.c b/arch/avr/src/atmega/atmega_lowconsole.c index a5ed1fc345..17f1b0145f 100644 --- a/arch/avr/src/atmega/atmega_lowconsole.c +++ b/arch/avr/src/atmega/atmega_lowconsole.c @@ -1,4 +1,4 @@ -/****************************************************************************** +/**************************************************************************** * arch/avr/src/atmega/atmega_lowconsole.c * * Copyright (C) 2011 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Included Files - ******************************************************************************/ + ****************************************************************************/ #include #include "atmega_config.h" @@ -51,9 +51,9 @@ #include "up_internal.h" #include "atmega_internal.h" -/****************************************************************************** +/**************************************************************************** * Pre-processor Definitions - ******************************************************************************/ + ****************************************************************************/ /* USART0 Baud rate settings for normal and double speed modes */ @@ -175,29 +175,29 @@ # endif #endif -/****************************************************************************** +/**************************************************************************** * Private Types - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Private Function Prototypes - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Public Data - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Private Variables - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Private Functions - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Public Functions - ******************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Name: usart0_reset and usart1_reset @@ -431,7 +431,7 @@ void usart1_configure(void) } #endif -/****************************************************************************** +/**************************************************************************** * Name: up_consoleinit * * Description: @@ -439,7 +439,7 @@ void usart1_configure(void) * early in the initialization sequence to configure the serial console uart * (only). * - ******************************************************************************/ + ****************************************************************************/ void up_consoleinit(void) { @@ -452,13 +452,13 @@ void up_consoleinit(void) #endif } -/****************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console * - ******************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { diff --git a/arch/mips/src/pic32mx/pic32mx-ethernet.c b/arch/mips/src/pic32mx/pic32mx-ethernet.c index 32120fba1a..6da8b8e766 100644 --- a/arch/mips/src/pic32mx/pic32mx-ethernet.c +++ b/arch/mips/src/pic32mx/pic32mx-ethernet.c @@ -477,13 +477,13 @@ static void pic32mx_ethreset(struct pic32mx_driver_s *priv); * Private Functions ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: pic32mx_printreg * * Description: * Print the contents of an PIC32MX register operation * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_NET_REGDEBUG static void pic32mx_printreg(uint32_t addr, uint32_t val, bool iswrite) @@ -492,13 +492,13 @@ static void pic32mx_printreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: pic32mx_checkreg * * Description: * Get the contents of an PIC32MX register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_NET_REGDEBUG static void pic32mx_checkreg(uint32_t addr, uint32_t val, bool iswrite) @@ -556,13 +556,13 @@ static void pic32mx_checkreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: pic32mx_getreg * * Description: * Get the contents of an PIC32MX register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_NET_REGDEBUG static uint32_t pic32mx_getreg(uint32_t addr) @@ -578,13 +578,13 @@ static uint32_t pic32mx_getreg(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: pic32mx_putreg * * Description: * Set the contents of an PIC32MX register to a value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_NET_REGDEBUG static void pic32mx_putreg(uint32_t val, uint32_t addr) @@ -2401,7 +2401,7 @@ static int pic32mx_rmmac(struct net_driver_s *dev, const uint8_t *mac) } #endif -/******************************************************************************* +/**************************************************************************** * Name: pic32mx_showmii * * Description: @@ -2415,7 +2415,7 @@ static int pic32mx_rmmac(struct net_driver_s *dev, const uint8_t *mac) * * Assumptions: * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_NET_REGDEBUG) && defined(PIC32MX_HAVE_PHY) static void pic32mx_showmii(uint8_t phyaddr, const char *msg) diff --git a/arch/mips/src/pic32mx/pic32mx-lowconsole.c b/arch/mips/src/pic32mx/pic32mx-lowconsole.c index c613ab3828..4bfe0c9570 100644 --- a/arch/mips/src/pic32mx/pic32mx-lowconsole.c +++ b/arch/mips/src/pic32mx/pic32mx-lowconsole.c @@ -1,4 +1,4 @@ -/****************************************************************************** +/**************************************************************************** * arch/mips/src/pic32mx/pic32mx-lowconsole.c * * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Included Files - ******************************************************************************/ + ****************************************************************************/ #include @@ -51,9 +51,9 @@ #include "pic32mx-config.h" #include "pic32mx-internal.h" -/****************************************************************************** +/**************************************************************************** * Pre-processor Definitions - ******************************************************************************/ + ****************************************************************************/ /* Select UART parameters for the selected console */ @@ -99,33 +99,33 @@ # endif #endif -/****************************************************************************** +/**************************************************************************** * Private Types - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Private Function Prototypes - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Public Data - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Private Variables - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Private Functions - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Name: pic32mx_putreg * * Description: * Write a value to a UART register * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE static inline void pic32mx_putreg(uintptr_t uart_base, unsigned int offset, @@ -135,13 +135,13 @@ static inline void pic32mx_putreg(uintptr_t uart_base, unsigned int offset, } #endif -/****************************************************************************** +/**************************************************************************** * Name: pic32mx_getreg * * Description: * Get a value from a UART register * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE static inline uint32_t pic32mx_getreg(uintptr_t uart_base, @@ -151,7 +151,7 @@ static inline uint32_t pic32mx_getreg(uintptr_t uart_base, } #endif -/****************************************************************************** +/**************************************************************************** * Name: pic32mx_uartsetbaud * * Description: @@ -165,7 +165,7 @@ static inline uint32_t pic32mx_getreg(uintptr_t uart_base, * BRG = PBCLK / 4 / BAUD - 1 * * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE static void pic32mx_uartsetbaud(uintptr_t uart_base, uint32_t baudrate) @@ -203,17 +203,17 @@ static void pic32mx_uartsetbaud(uintptr_t uart_base, uint32_t baudrate) } #endif -/****************************************************************************** +/**************************************************************************** * Public Functions - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Name: pic32mx_uartreset * * Description: * Reset hardware and disable Rx and Tx. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE void pic32mx_uartreset(uintptr_t uart_base) @@ -226,13 +226,13 @@ void pic32mx_uartreset(uintptr_t uart_base) } #endif -/****************************************************************************** +/**************************************************************************** * Name: pic32mx_uartconfigure * * Description: * Configure a UART as a RS-232 UART. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE void pic32mx_uartconfigure(uintptr_t uart_base, uint32_t baudrate, @@ -316,7 +316,7 @@ void pic32mx_uartconfigure(uintptr_t uart_base, uint32_t baudrate, } #endif -/****************************************************************************** +/**************************************************************************** * Name: pic32mx_consoleinit * * Description: @@ -324,7 +324,7 @@ void pic32mx_uartconfigure(uintptr_t uart_base, uint32_t baudrate, * very early in the initialization sequence to configure the serial console * UART (only). * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_SERIAL_CONSOLE void pic32mx_consoleinit(void) @@ -335,13 +335,13 @@ void pic32mx_consoleinit(void) } #endif -/****************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console. * - ******************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { diff --git a/arch/mips/src/pic32mz/pic32mz-ethernet.c b/arch/mips/src/pic32mz/pic32mz-ethernet.c index 7a0e65f097..743cedf18a 100644 --- a/arch/mips/src/pic32mz/pic32mz-ethernet.c +++ b/arch/mips/src/pic32mz/pic32mz-ethernet.c @@ -495,13 +495,13 @@ static void pic32mz_ethreset(struct pic32mz_driver_s *priv); * Private Functions ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: pic32mz_printreg * * Description: * Print the contents of an PIC32MZ register operation * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_NET_REGDEBUG static void pic32mz_printreg(uint32_t addr, uint32_t val, bool iswrite) @@ -510,13 +510,13 @@ static void pic32mz_printreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: pic32mz_checkreg * * Description: * Get the contents of an PIC32MZ register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_NET_REGDEBUG static void pic32mz_checkreg(uint32_t addr, uint32_t val, bool iswrite) @@ -574,13 +574,13 @@ static void pic32mz_checkreg(uint32_t addr, uint32_t val, bool iswrite) } #endif -/******************************************************************************* +/**************************************************************************** * Name: pic32mz_getreg * * Description: * Get the contents of an PIC32MZ register * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_NET_REGDEBUG static uint32_t pic32mz_getreg(uint32_t addr) @@ -596,13 +596,13 @@ static uint32_t pic32mz_getreg(uint32_t addr) } #endif -/******************************************************************************* +/**************************************************************************** * Name: pic32mz_putreg * * Description: * Set the contents of an PIC32MZ register to a value * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_NET_REGDEBUG static void pic32mz_putreg(uint32_t val, uint32_t addr) @@ -2425,7 +2425,7 @@ static int pic32mz_rmmac(struct net_driver_s *dev, const uint8_t *mac) } #endif -/******************************************************************************* +/**************************************************************************** * Name: pic32mz_showmii * * Description: @@ -2439,7 +2439,7 @@ static int pic32mz_rmmac(struct net_driver_s *dev, const uint8_t *mac) * * Assumptions: * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_NET_REGDEBUG) && defined(PIC32MZ_HAVE_PHY) static void pic32mz_showmii(uint8_t phyaddr, const char *msg) diff --git a/arch/mips/src/pic32mz/pic32mz-lowconsole.c b/arch/mips/src/pic32mz/pic32mz-lowconsole.c index f21b3b0554..1d677179bc 100644 --- a/arch/mips/src/pic32mz/pic32mz-lowconsole.c +++ b/arch/mips/src/pic32mz/pic32mz-lowconsole.c @@ -1,4 +1,4 @@ -/****************************************************************************** +/**************************************************************************** * arch/mips/src/pic32mz/pic32mz-lowconsole.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Included Files - ******************************************************************************/ + ****************************************************************************/ #include @@ -53,9 +53,9 @@ #include -/****************************************************************************** +/**************************************************************************** * Pre-processor Definitions - ******************************************************************************/ + ****************************************************************************/ /* Select UART parameters for the selected console */ @@ -101,33 +101,33 @@ # endif #endif -/****************************************************************************** +/**************************************************************************** * Private Types - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Private Function Prototypes - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Public Data - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Private Variables - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Private Functions - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Name: pic32mz_putreg * * Description: * Write a value to a UART register * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE static inline void pic32mz_putreg(uintptr_t uart_base, unsigned int offset, @@ -137,13 +137,13 @@ static inline void pic32mz_putreg(uintptr_t uart_base, unsigned int offset, } #endif -/****************************************************************************** +/**************************************************************************** * Name: pic32mz_getreg * * Description: * Get a value from a UART register * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE static inline uint32_t pic32mz_getreg(uintptr_t uart_base, @@ -153,7 +153,7 @@ static inline uint32_t pic32mz_getreg(uintptr_t uart_base, } #endif -/****************************************************************************** +/**************************************************************************** * Name: pic32mz_uartsetbaud * * Description: @@ -167,7 +167,7 @@ static inline uint32_t pic32mz_getreg(uintptr_t uart_base, * BRG = PBCLK2 / 4 / BAUD - 1 * * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE static void pic32mz_uartsetbaud(uintptr_t uart_base, uint32_t baudrate) @@ -205,17 +205,17 @@ static void pic32mz_uartsetbaud(uintptr_t uart_base, uint32_t baudrate) } #endif -/****************************************************************************** +/**************************************************************************** * Public Functions - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Name: pic32mz_uartreset * * Description: * Reset hardware and disable Rx and Tx. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE void pic32mz_uartreset(uintptr_t uart_base) @@ -228,13 +228,13 @@ void pic32mz_uartreset(uintptr_t uart_base) } #endif -/****************************************************************************** +/**************************************************************************** * Name: pic32mz_uartconfigure * * Description: * Configure a UART as a RS-232 UART. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE void pic32mz_uartconfigure(uintptr_t uart_base, uint32_t baudrate, @@ -313,7 +313,7 @@ void pic32mz_uartconfigure(uintptr_t uart_base, uint32_t baudrate, } #endif -/****************************************************************************** +/**************************************************************************** * Name: pic32mz_consoleinit * * Description: @@ -321,7 +321,7 @@ void pic32mz_uartconfigure(uintptr_t uart_base, uint32_t baudrate, * very early in the initialization sequence to configure the serial console * UART (only). * - ******************************************************************************/ + ****************************************************************************/ void pic32mz_consoleinit(void) { @@ -469,13 +469,13 @@ void pic32mz_consoleinit(void) #endif /* HAVE_UART_DEVICE */ } -/****************************************************************************** +/**************************************************************************** * Name: up_lowputc * * Description: * Output one byte on the serial console. * - ******************************************************************************/ + ****************************************************************************/ void up_lowputc(char ch) { From 9caf33e13bd60f0307ac77b0eaa15f6971b370de Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 3 Oct 2015 07:28:30 -0600 Subject: [PATCH 13/33] Standardize the width of all comment boxes in C header files --- arch/arm/include/efm32/efm32g_irq.h | 24 ++++++------ arch/arm/include/efm32/efm32gg_irq.h | 24 ++++++------ arch/arm/include/efm32/efm32tg_irq.h | 24 ++++++------ arch/arm/include/stm32/dma2d.h | 44 +++++++++++----------- arch/arm/include/stm32/ltdc.h | 28 +++++++------- arch/arm/src/efm32/chip/efm32g_vectors.h | 8 ++-- arch/arm/src/efm32/chip/efm32gg_vectors.h | 8 ++-- arch/arm/src/efm32/chip/efm32tg_vectors.h | 8 ++-- arch/arm/src/efm32/efm32_bitband.h | 2 +- arch/arm/src/efm32/efm32_lowputc.h | 20 +++++----- arch/arm/src/efm32/efm32_pwm.h | 12 +++--- arch/arm/src/efm32/efm32_rmu.h | 2 +- arch/arm/src/efm32/efm32_rtc.h | 2 +- arch/arm/src/efm32/efm32_spi.h | 2 +- arch/arm/src/efm32/efm32_timer.h | 2 +- arch/arm/src/efm32/efm32_usb.h | 4 +- arch/arm/src/kinetis/kinetis_internal.h | 8 ++-- arch/arm/src/lpc17xx/lpc17_usbhost.h | 4 +- arch/arm/src/lpc214x/lpc214x_usbdev.h | 24 ++++++------ arch/arm/src/lpc31xx/lpc31_internal.h | 4 +- arch/arm/src/lpc43xx/lpc43_ehci.h | 4 +- arch/arm/src/lpc43xx/lpc43_rit.h | 22 +++++------ arch/arm/src/nuc1xx/nuc_lowputc.h | 4 +- arch/arm/src/sama5/sam_usbhost.h | 12 +++--- arch/arm/src/stm32/chip/stm32_dma2d.h | 16 ++++---- arch/arm/src/stm32/stm32_dma2d.h | 28 +++++++------- arch/arm/src/stm32/stm32_otgfs.h | 4 +- arch/arm/src/stm32/stm32_otghs.h | 4 +- arch/avr/src/at32uc3/at32uc3_internal.h | 2 +- arch/avr/src/at90usb/at90usb_internal.h | 2 +- arch/avr/src/atmega/atmega_internal.h | 2 +- arch/mips/src/pic32mx/pic32mx-internal.h | 8 ++-- arch/mips/src/pic32mz/pic32mz-lowconsole.h | 8 ++-- 33 files changed, 185 insertions(+), 185 deletions(-) diff --git a/arch/arm/include/efm32/efm32g_irq.h b/arch/arm/include/efm32/efm32g_irq.h index 0780d75b14..fdd6062ba7 100644 --- a/arch/arm/include/efm32/efm32g_irq.h +++ b/arch/arm/include/efm32/efm32g_irq.h @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * arch/arm/include/efm32s/efm32g_irq.h * * Copyright (C) 2014 Gregory Nutt. All rights reserved. @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *****************************************************************************/ + ****************************************************************************/ /* This file should never be included directed but, rather, only indirectly * through nuttx/irq.h @@ -40,13 +40,13 @@ #ifndef __ARCH_ARM_INCLUDE_EFM32G_IRQ_H #define __ARCH_ARM_INCLUDE_EFM32G_IRQ_H -/***************************************************************************** +/**************************************************************************** * Included Files - *****************************************************************************/ + ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Pre-processor Definitions - *****************************************************************************/ + ****************************************************************************/ /* IRQ numbers. The IRQ number corresponds vector number and hence map * directly to bits in the NVIC. This does, however, waste several words of @@ -91,13 +91,13 @@ #define NR_VECTORS (EFM32_IRQ_INTERRUPTS+30) -/***************************************************************************** +/**************************************************************************** * Public Types - *****************************************************************************/ + ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Public Data - *****************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ #ifdef __cplusplus @@ -108,9 +108,9 @@ extern "C" #define EXTERN extern #endif -/***************************************************************************** +/**************************************************************************** * Public Functions - *****************************************************************************/ + ****************************************************************************/ #undef EXTERN #ifdef __cplusplus diff --git a/arch/arm/include/efm32/efm32gg_irq.h b/arch/arm/include/efm32/efm32gg_irq.h index 3d3f24b059..ea501e7b1f 100644 --- a/arch/arm/include/efm32/efm32gg_irq.h +++ b/arch/arm/include/efm32/efm32gg_irq.h @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * arch/arm/include/efm32s/efm32gg_irq.h * * Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved. @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *****************************************************************************/ + ****************************************************************************/ /* This file should never be included directed but, rather, only indirectly * through nuttx/irq.h @@ -40,13 +40,13 @@ #ifndef __ARCH_ARM_INCLUDE_EFM32GG_IRQ_H #define __ARCH_ARM_INCLUDE_EFM32GG_IRQ_H -/***************************************************************************** +/**************************************************************************** * Included Files - *****************************************************************************/ + ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Pre-processor Definitions - *****************************************************************************/ + ****************************************************************************/ /* IRQ numbers. The IRQ number corresponds vector number and hence map * directly to bits in the NVIC. This does, however, waste several words of @@ -100,13 +100,13 @@ #define NR_VECTORS (EFM32_IRQ_INTERRUPTS+39) -/***************************************************************************** +/**************************************************************************** * Public Types - *****************************************************************************/ + ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Public Data - *****************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ #ifdef __cplusplus @@ -117,9 +117,9 @@ extern "C" #define EXTERN extern #endif -/***************************************************************************** +/**************************************************************************** * Public Functions - *****************************************************************************/ + ****************************************************************************/ #undef EXTERN #ifdef __cplusplus diff --git a/arch/arm/include/efm32/efm32tg_irq.h b/arch/arm/include/efm32/efm32tg_irq.h index b517872265..bbf64b108d 100644 --- a/arch/arm/include/efm32/efm32tg_irq.h +++ b/arch/arm/include/efm32/efm32tg_irq.h @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * arch/arm/include/efm32s/efm32tg_irq.h * * Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved. @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *****************************************************************************/ + ****************************************************************************/ /* This file should never be included directed but, rather, only indirectly * through nuttx/irq.h @@ -40,13 +40,13 @@ #ifndef __ARCH_ARM_INCLUDE_EFM32TG_IRQ_H #define __ARCH_ARM_INCLUDE_EFM32TG_IRQ_H -/***************************************************************************** +/**************************************************************************** * Included Files - *****************************************************************************/ + ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Pre-processor Definitions - *****************************************************************************/ + ****************************************************************************/ /* IRQ numbers. The IRQ number corresponds vector number and hence map * directly to bits in the NVIC. This does, however, waste several words of @@ -84,13 +84,13 @@ #define NR_VECTORS (EFM32_IRQ_INTERRUPTS+23) -/***************************************************************************** +/**************************************************************************** * Public Types - *****************************************************************************/ + ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Public Data - *****************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ #ifdef __cplusplus @@ -101,9 +101,9 @@ extern "C" #define EXTERN extern #endif -/***************************************************************************** +/**************************************************************************** * Public Functions - *****************************************************************************/ + ****************************************************************************/ #undef EXTERN #ifdef __cplusplus diff --git a/arch/arm/include/stm32/dma2d.h b/arch/arm/include/stm32/dma2d.h index 70fc71c7c2..349944148f 100644 --- a/arch/arm/include/stm32/dma2d.h +++ b/arch/arm/include/stm32/dma2d.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/include/stm32/dma2d.h * * Copyright (C) 2015 Marco Krahl. All rights reserved. @@ -31,26 +31,26 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ******************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_ARM_INCLUDE_STM32_DMA2D_H #define __ARCH_ARM_INCLUDE_STM32_DMA2D_H -/******************************************************************************* +/**************************************************************************** * Included Files - ******************************************************************************/ + ****************************************************************************/ #include #include #include -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - ******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Public Types - ******************************************************************************/ + ****************************************************************************/ struct ltdc_area_s; /* see arch/chip/ltdc.h */ @@ -322,15 +322,15 @@ struct dma2d_layer_s uint32_t color); }; -/******************************************************************************* +/**************************************************************************** * Public Data - ******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Public Functions - ******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_dma2dgetlayer * * Description: @@ -343,11 +343,11 @@ struct dma2d_layer_s * Reference to the dma2d layer control structure on success or Null if no * related exist. * - ******************************************************************************/ + ****************************************************************************/ FAR struct dma2d_layer_s * up_dma2dgetlayer(int lid); -/****************************************************************************** +/**************************************************************************** * Name: up_dma2dcreatelayer * * Description: @@ -365,13 +365,13 @@ FAR struct dma2d_layer_s * up_dma2dgetlayer(int lid); * -ENOMEM if no memory available or exceeds * CONFIG_STM32_DMA2D_NLAYERS * - ******************************************************************************/ + ****************************************************************************/ FAR struct dma2d_layer_s *up_dma2dcreatelayer(fb_coord_t width, fb_coord_t height, uint8_t fmt); -/****************************************************************************** +/**************************************************************************** * Name: up_dma2dremovelayer * * Description: @@ -384,11 +384,11 @@ FAR struct dma2d_layer_s *up_dma2dcreatelayer(fb_coord_t width, * On success - OK * On error - -EINVAL * - *****************************************************************************/ + ****************************************************************************/ int up_dma2dremovelayer(FAR struct dma2d_layer_s *layer); -/****************************************************************************** +/**************************************************************************** * Name: up_dma2dinitialize * * Description: @@ -398,17 +398,17 @@ int up_dma2dremovelayer(FAR struct dma2d_layer_s *layer); * OK - On success * An error if initializing failed. * - ******************************************************************************/ + ****************************************************************************/ int up_dma2dinitialize(void); -/****************************************************************************** +/**************************************************************************** * Name: up_dma2duninitialize * * Description: * Uninitialize the dma2d controller * - ******************************************************************************/ + ****************************************************************************/ void up_dma2duninitialize(void); diff --git a/arch/arm/include/stm32/ltdc.h b/arch/arm/include/stm32/ltdc.h index bd57f45b76..70f978058a 100644 --- a/arch/arm/include/stm32/ltdc.h +++ b/arch/arm/include/stm32/ltdc.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/include/stm32/ltdc.h * * Copyright (C) 2014-2015 Marco Krahl. All rights reserved. @@ -31,27 +31,27 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ******************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_ARM_INCLUDE_STM32_LTDC_H #define __ARCH_ARM_INCLUDE_STM32_LTDC_H -/******************************************************************************* +/**************************************************************************** * Included Files - ******************************************************************************/ + ****************************************************************************/ #include #include #include #ifdef CONFIG_STM32_LTDC -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - ******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Public Types - ******************************************************************************/ + ****************************************************************************/ struct dma2d_layer_s; /* see arch/chip/dma2d.h */ @@ -565,15 +565,15 @@ struct ltdc_layer_s #endif }; -/******************************************************************************* +/**************************************************************************** * Public Data - ******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Public Functions - ******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: up_ltdcgetlayer * * Description: @@ -586,7 +586,7 @@ struct ltdc_layer_s * Reference to the layer control structure on success or Null if parameter * invalid. * - ******************************************************************************/ + ****************************************************************************/ FAR struct ltdc_layer_s *up_ltdcgetlayer(int lid); #endif /* CONFIG_STM32_LTDC */ #endif /* __ARCH_ARM_INCLUDE_STM32_LTDC_H */ diff --git a/arch/arm/src/efm32/chip/efm32g_vectors.h b/arch/arm/src/efm32/chip/efm32g_vectors.h index 40abe8d6d9..01132533e7 100644 --- a/arch/arm/src/efm32/chip/efm32g_vectors.h +++ b/arch/arm/src/efm32/chip/efm32g_vectors.h @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * arch/arm/src/efm32/chip/efm32ggxxx_vectors.h * * Copyright (C) 2014 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *****************************************************************************/ + ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Pre-processor Definitions - *****************************************************************************/ + ****************************************************************************/ /* This file is included by efm32_vectors.S. It provides the macro VECTOR * that supplies each EFM32G vector in terms of a (lower-case) ISR label and * an (upper-case) IRQ number as defined in arch/arm/include/efm32/efm32g_irq.h. diff --git a/arch/arm/src/efm32/chip/efm32gg_vectors.h b/arch/arm/src/efm32/chip/efm32gg_vectors.h index 891fd31ddf..834c988b1c 100644 --- a/arch/arm/src/efm32/chip/efm32gg_vectors.h +++ b/arch/arm/src/efm32/chip/efm32gg_vectors.h @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * arch/arm/src/efm32/chip/efm32ggxxx_vectors.h * * Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *****************************************************************************/ + ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Pre-processor Definitions - *****************************************************************************/ + ****************************************************************************/ /* This file is included by efm32_vectors.S. It provides the macro VECTOR * that supplies each EFM32GG vector in terms of a (lower-case) ISR label and * an (upper-case) IRQ number as defined in arch/arm/include/efm32/efm32gg_irq.h. diff --git a/arch/arm/src/efm32/chip/efm32tg_vectors.h b/arch/arm/src/efm32/chip/efm32tg_vectors.h index b5e34e7764..16689f9bfe 100644 --- a/arch/arm/src/efm32/chip/efm32tg_vectors.h +++ b/arch/arm/src/efm32/chip/efm32tg_vectors.h @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * arch/arm/src/efm32/chip/efm32tg_vectors.h * * Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *****************************************************************************/ + ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Pre-processor Definitions - *****************************************************************************/ + ****************************************************************************/ /* This file is included by efm32_vectors.S. It provides the macro VECTOR that * supplies ach EFM32TG vector in terms of a (lower-case) ISR label and an * (upper-case) IRQ number as defined in arch/arm/include/efm32/efm32tg_irq.h. diff --git a/arch/arm/src/efm32/efm32_bitband.h b/arch/arm/src/efm32/efm32_bitband.h index 12308a11d7..9c655de78a 100644 --- a/arch/arm/src/efm32/efm32_bitband.h +++ b/arch/arm/src/efm32/efm32_bitband.h @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * arch/arm/src/efm32/efm32_bitband.h * * Copyright (C) 2015 Pierre-noel Bouteville . All rights reserved. diff --git a/arch/arm/src/efm32/efm32_lowputc.h b/arch/arm/src/efm32/efm32_lowputc.h index 0d8f7f5e65..f6ad56f474 100644 --- a/arch/arm/src/efm32/efm32_lowputc.h +++ b/arch/arm/src/efm32/efm32_lowputc.h @@ -63,45 +63,45 @@ void efm32_lowsetup(void); -/***************************************************************************** +/**************************************************************************** * Name: efm32_lowputc * * Description: * Output one character to the UART using a simple polling method. * - *****************************************************************************/ + ****************************************************************************/ #if defined(HAVE_UART_CONSOLE) || defined(HAVE_LEUART_CONSOLE) void efm32_lowputc(uint32_t ch); #endif -/***************************************************************************** +/**************************************************************************** * Name: efm32_uartconfigure * * Description: * Configure a U[S]ART as a RS-232 UART. * - *****************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE void efm32_uartconfigure(uintptr_t base, uint32_t baud, unsigned int parity, unsigned int nbits, bool stop2); #endif -/***************************************************************************** +/**************************************************************************** * Name: efm32_leuartconfigure * * Description: * Configure a LEUART as a RS-232 UART. * - *****************************************************************************/ + ****************************************************************************/ #ifdef HAVE_LEUART_DEVICE void efm32_leuartconfigure(uintptr_t base, uint32_t baud, unsigned int parity, unsigned int nbits, bool stop2); #endif -/***************************************************************************** +/**************************************************************************** * Name: efm32_uart_reset * * Description: @@ -109,13 +109,13 @@ void efm32_leuartconfigure(uintptr_t base, uint32_t baud, unsigned int parity, * to the initial, reset value. Only the ROUTE data set by efm32_lowsetup * is preserved. * - *****************************************************************************/ + ****************************************************************************/ #if defined(HAVE_UART_DEVICE) || defined(HAVE_SPI_DEVICE) void efm32_uart_reset(uintptr_t base); #endif -/***************************************************************************** +/**************************************************************************** * Name: efm32_uart_reset * * Description: @@ -123,7 +123,7 @@ void efm32_uart_reset(uintptr_t base); * to the initial, reset value. Only the ROUTE data set by efm32_lowsetup * is preserved. * - *****************************************************************************/ + ****************************************************************************/ #ifdef HAVE_LEUART_DEVICE void efm32_leuart_reset(uintptr_t base); diff --git a/arch/arm/src/efm32/efm32_pwm.h b/arch/arm/src/efm32/efm32_pwm.h index 23470f7c20..af46c3b6f8 100644 --- a/arch/arm/src/efm32/efm32_pwm.h +++ b/arch/arm/src/efm32/efm32_pwm.h @@ -1,4 +1,4 @@ -/****************************************************************************** +/**************************************************************************** * arch/arm/src/efm32/efm32_pwm.h * * Copyright (C) 2014 Pierre-Noel Bouteville. All rights reserved. @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ******************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_ARM_SRC_EFM32_EFM32_PWM_H #define __ARCH_ARM_SRC_EFM32_EFM32_PWM_H @@ -42,17 +42,17 @@ * EFM32 timers. That interface is described in include/nuttx/pwm.h. */ -/****************************************************************************** +/**************************************************************************** * Included Files - ******************************************************************************/ + ****************************************************************************/ #include #include "chip.h" -/****************************************************************************** +/**************************************************************************** * Pre-processor Definitions - ******************************************************************************/ + ****************************************************************************/ /* Configuration **************************************************************/ /* Timer devices may be used for different purposes. One special purpose is * to generate modulated outputs for such things as motor control. diff --git a/arch/arm/src/efm32/efm32_rmu.h b/arch/arm/src/efm32/efm32_rmu.h index ce1def0c78..0aae6fbb0d 100644 --- a/arch/arm/src/efm32/efm32_rmu.h +++ b/arch/arm/src/efm32/efm32_rmu.h @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * arch/arm/src/efm32/efm32_rmu.h * * Copyright (C) 2015 Pierre-noel Bouteville . All rights reserved. diff --git a/arch/arm/src/efm32/efm32_rtc.h b/arch/arm/src/efm32/efm32_rtc.h index ba86e2da2c..0bedb9f696 100644 --- a/arch/arm/src/efm32/efm32_rtc.h +++ b/arch/arm/src/efm32/efm32_rtc.h @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * arch/arm/src/efm32/efm32_rtc.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. diff --git a/arch/arm/src/efm32/efm32_spi.h b/arch/arm/src/efm32/efm32_spi.h index befc5583b5..8797fdef23 100644 --- a/arch/arm/src/efm32/efm32_spi.h +++ b/arch/arm/src/efm32/efm32_spi.h @@ -68,7 +68,7 @@ struct spi_dev_s; struct spi_dev_s *efm32_spi_initialize(int port); -/***************************************************************************** +/**************************************************************************** * Name: efm32_spi[n]_select, efm32_spi[n]_status, and efm32_spi[n]_cmddata * * Description: diff --git a/arch/arm/src/efm32/efm32_timer.h b/arch/arm/src/efm32/efm32_timer.h index c28e586396..3ed36baad7 100644 --- a/arch/arm/src/efm32/efm32_timer.h +++ b/arch/arm/src/efm32/efm32_timer.h @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * arch/arm/src/efm32/efm32_timer.h * * Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved. diff --git a/arch/arm/src/efm32/efm32_usb.h b/arch/arm/src/efm32/efm32_usb.h index 06398d9b67..7b31eb467a 100644 --- a/arch/arm/src/efm32/efm32_usb.h +++ b/arch/arm/src/efm32/efm32_usb.h @@ -149,7 +149,7 @@ extern "C" #define EXTERN extern #endif -/******************************************************************************* +/**************************************************************************** * Name: efm32_usbhost_initialize * * Description: @@ -172,7 +172,7 @@ extern "C" * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST struct usbhost_connection_s; diff --git a/arch/arm/src/kinetis/kinetis_internal.h b/arch/arm/src/kinetis/kinetis_internal.h index 6627c8633e..226ee351e3 100644 --- a/arch/arm/src/kinetis/kinetis_internal.h +++ b/arch/arm/src/kinetis/kinetis_internal.h @@ -386,25 +386,25 @@ void kinetis_clockconfig(void); void kinetis_lowsetup(void); -/****************************************************************************** +/**************************************************************************** * Name: kinetis_uartreset * * Description: * Reset a UART. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE void kinetis_uartreset(uintptr_t uart_base); #endif -/****************************************************************************** +/**************************************************************************** * Name: kinetis_uartconfigure * * Description: * Configure a UART as a RS-232 UART. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE void kinetis_uartconfigure(uintptr_t uart_base, uint32_t baud, uint32_t clock, diff --git a/arch/arm/src/lpc17xx/lpc17_usbhost.h b/arch/arm/src/lpc17xx/lpc17_usbhost.h index c5056a9ee3..5efec074f9 100644 --- a/arch/arm/src/lpc17xx/lpc17_usbhost.h +++ b/arch/arm/src/lpc17xx/lpc17_usbhost.h @@ -69,7 +69,7 @@ extern "C" #define EXTERN extern #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc17_usbhost_initialize * * Description: @@ -92,7 +92,7 @@ extern "C" * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST struct usbhost_connection_s; diff --git a/arch/arm/src/lpc214x/lpc214x_usbdev.h b/arch/arm/src/lpc214x/lpc214x_usbdev.h index 69ad7656b7..df2d3195f5 100644 --- a/arch/arm/src/lpc214x/lpc214x_usbdev.h +++ b/arch/arm/src/lpc214x/lpc214x_usbdev.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * arch/arm/src/lpc214x/lpc214x_usbdev.h * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. @@ -31,20 +31,20 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *******************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_ARM_SRC_LPC214X_LPC214X_USBDEV_H #define __ARCH_ARM_SRC_LPC214X_LPC214X_USBDEV_H -/******************************************************************************* +/**************************************************************************** * Included Files - *******************************************************************************/ + ****************************************************************************/ #include -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - *******************************************************************************/ + ****************************************************************************/ /* PINSEL1 bit definitions for UART0/1: * @@ -331,16 +331,16 @@ #define USB_DMAPKTSIZE_FRAMENOSHIFT (17) /* Bit 17-31: Frame number */ -/******************************************************************************* +/**************************************************************************** * Private Types - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Public Data - *******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Public Functions - *******************************************************************************/ + ****************************************************************************/ #endif /* __ARCH_ARM_SRC_LPC214X_LPC214X_USBDEV_H */ diff --git a/arch/arm/src/lpc31xx/lpc31_internal.h b/arch/arm/src/lpc31xx/lpc31_internal.h index f4f0816142..723833364e 100644 --- a/arch/arm/src/lpc31xx/lpc31_internal.h +++ b/arch/arm/src/lpc31xx/lpc31_internal.h @@ -240,7 +240,7 @@ struct usbdev_s; void lpc31_usbsuspend(FAR struct usbdev_s *dev, bool resume); #endif -/******************************************************************************* +/**************************************************************************** * Name: lpc31_ehci_initialize * * Description: @@ -263,7 +263,7 @@ void lpc31_usbsuspend(FAR struct usbdev_s *dev, bool resume); * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_LPC31_USBOTG) && defined(CONFIG_USBHOST) struct usbhost_connection_s; diff --git a/arch/arm/src/lpc43xx/lpc43_ehci.h b/arch/arm/src/lpc43xx/lpc43_ehci.h index 302b03fb16..0e50b93303 100644 --- a/arch/arm/src/lpc43xx/lpc43_ehci.h +++ b/arch/arm/src/lpc43xx/lpc43_ehci.h @@ -70,7 +70,7 @@ extern "C" * Public Function Prototypes ************************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: lpc31_ehci_initialize * * Description: @@ -93,7 +93,7 @@ extern "C" * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - *******************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_LPC43_USBOTG) && defined(CONFIG_USBHOST) struct usbhost_connection_s; diff --git a/arch/arm/src/lpc43xx/lpc43_rit.h b/arch/arm/src/lpc43xx/lpc43_rit.h index 5855b8ca51..d5a3ce7846 100644 --- a/arch/arm/src/lpc43xx/lpc43_rit.h +++ b/arch/arm/src/lpc43xx/lpc43_rit.h @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * arch/arm/src/lpc43xx/lpc43_rit.h * * Copyright (C) 2012 Gregory Nutt. All rights reserved. @@ -31,32 +31,32 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *****************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_ARM_SRC_LPC43XX_LPC43_RIT_H #define __ARCH_ARM_SRC_LPC43XX_LPC43_RIT_H -/***************************************************************************** +/**************************************************************************** * Included Files - *****************************************************************************/ + ****************************************************************************/ #include -/***************************************************************************** +/**************************************************************************** * Pre-processor Definitions - *****************************************************************************/ + ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Public Types - *****************************************************************************/ + ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Public Data - *****************************************************************************/ + ****************************************************************************/ /************************************************************************************ * Public Functions - *****************************************************************************/ + ****************************************************************************/ void up_timer_initialize(void); int up_timer_gettime(FAR struct timespec *ts); diff --git a/arch/arm/src/nuc1xx/nuc_lowputc.h b/arch/arm/src/nuc1xx/nuc_lowputc.h index e9a4be12a8..a6aab6cd72 100644 --- a/arch/arm/src/nuc1xx/nuc_lowputc.h +++ b/arch/arm/src/nuc1xx/nuc_lowputc.h @@ -95,7 +95,7 @@ void nuc_lowsetup(void); * Here we assume that the default clock source for the UART modules is * the external high speed crystal. * - *****************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART void nuc_setbaud(uintptr_t base, uint32_t baud); @@ -107,7 +107,7 @@ void nuc_setbaud(uintptr_t base, uint32_t baud); * Description: * Output one character to the UART using a simple polling method. * - *****************************************************************************/ + ****************************************************************************/ #ifdef HAVE_SERIAL_CONSOLE void nuc_lowputc(uint32_t ch); diff --git a/arch/arm/src/sama5/sam_usbhost.h b/arch/arm/src/sama5/sam_usbhost.h index a40e46e772..1517815006 100644 --- a/arch/arm/src/sama5/sam_usbhost.h +++ b/arch/arm/src/sama5/sam_usbhost.h @@ -230,7 +230,7 @@ extern "C" * Public Functions ************************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: sam_ohci_initialize * * Description: @@ -253,14 +253,14 @@ extern "C" * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_OHCI struct usbhost_connection_s; FAR struct usbhost_connection_s *sam_ohci_initialize(int controller); #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_ohci_tophalf * * Description: @@ -268,13 +268,13 @@ FAR struct usbhost_connection_s *sam_ohci_initialize(int controller); * EHCI will manage the common UHPHS interrupt and will forward the interrupt * event to this function. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_OHCI int sam_ohci_tophalf(int irq, FAR void *context); #endif -/******************************************************************************* +/**************************************************************************** * Name: sam_ehci_initialize * * Description: @@ -297,7 +297,7 @@ int sam_ohci_tophalf(int irq, FAR void *context); * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMA5_EHCI struct usbhost_connection_s; diff --git a/arch/arm/src/stm32/chip/stm32_dma2d.h b/arch/arm/src/stm32/chip/stm32_dma2d.h index f36c8de55e..7a44561a1d 100644 --- a/arch/arm/src/stm32/chip/stm32_dma2d.h +++ b/arch/arm/src/stm32/chip/stm32_dma2d.h @@ -1,4 +1,4 @@ -/****************************************************************************** +/**************************************************************************** * arch/arm/src/stm32/chip/stm32_dma2d.h * * Copyright (C) 2014-2015 Marco Krahl. All rights reserved. @@ -31,21 +31,21 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *****************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_ARM_SRC_STM32_CHIP_STM32_DMA2D_H #define __ARCH_ARM_SRC_STM32_CHIP_STM32_DMA2D_H -/***************************************************************************** +/**************************************************************************** * Included Files - *****************************************************************************/ + ****************************************************************************/ #include #include "chip/stm32_memorymap.h" -/***************************************************************************** +/**************************************************************************** * Pre-processor Definitions - *****************************************************************************/ + ****************************************************************************/ #define STM32_DMA2D_NCLUT 256 /* Number of entries in the CLUT */ @@ -223,8 +223,8 @@ #define DMA2D_AMTCR_DT_MASK (0xFF << DMA2D_AMTCR_DT_SHIFT) #define DMA2D_AMTCR_DT(n) ((uint32_t)(n) << DMA2D_AMTCR_DT_SHIFT) -/***************************************************************************** +/**************************************************************************** * Public Types - *****************************************************************************/ + ****************************************************************************/ #endif /* __ARCH_ARM_SRC_STM32_CHIP_STM32_DMA2D_H */ diff --git a/arch/arm/src/stm32/stm32_dma2d.h b/arch/arm/src/stm32/stm32_dma2d.h index 4110c54912..7755ffe39d 100644 --- a/arch/arm/src/stm32/stm32_dma2d.h +++ b/arch/arm/src/stm32/stm32_dma2d.h @@ -1,4 +1,4 @@ -/****************************************************************************** +/**************************************************************************** * arch/arm/src/stm32/stm32_dma2d.h * * Copyright (C) 2014-2015 Marco Krahl. All rights reserved. @@ -31,38 +31,38 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ******************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_ARM_SRC_STM32_STM32_DMA2D_H #define __ARCH_ARM_SRC_STM32_STM32_DMA2D_H -/****************************************************************************** +/**************************************************************************** * Included Files - ******************************************************************************/ + ****************************************************************************/ #include #include #include #ifdef CONFIG_STM32_DMA2D -/****************************************************************************** +/**************************************************************************** * Pre-processor Definitions - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Public Types - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Public Data - ******************************************************************************/ + ****************************************************************************/ -/****************************************************************************** +/**************************************************************************** * Public Functions - ******************************************************************************/ + ****************************************************************************/ # ifdef CONFIG_STM32_LTDC_INTERFACE -/****************************************************************************** +/**************************************************************************** * Name: stm32_dma2dinitltdc * * Description: @@ -81,7 +81,7 @@ * On error - NULL and errno is set to * -EINVAL if one of the parameter is invalid * - ******************************************************************************/ + ****************************************************************************/ FAR struct dma2d_layer_s * stm32_dma2dinitltdc(FAR struct stm32_ltdc_s *layer); # endif /* CONFIG_STM32_LTDC_INTERFACE */ diff --git a/arch/arm/src/stm32/stm32_otgfs.h b/arch/arm/src/stm32/stm32_otgfs.h index 64369969df..bccf3ef297 100644 --- a/arch/arm/src/stm32/stm32_otgfs.h +++ b/arch/arm/src/stm32/stm32_otgfs.h @@ -78,7 +78,7 @@ extern "C" #define EXTERN extern #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_otgfshost_initialize * * Description: @@ -101,7 +101,7 @@ extern "C" * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST struct usbhost_connection_s; diff --git a/arch/arm/src/stm32/stm32_otghs.h b/arch/arm/src/stm32/stm32_otghs.h index 2380862c04..2c36cb801f 100644 --- a/arch/arm/src/stm32/stm32_otghs.h +++ b/arch/arm/src/stm32/stm32_otghs.h @@ -73,7 +73,7 @@ extern "C" #define EXTERN extern #endif -/******************************************************************************* +/**************************************************************************** * Name: stm32_otgfshost_initialize * * Description: @@ -96,7 +96,7 @@ extern "C" * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - *******************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST struct usbhost_connection_s; diff --git a/arch/avr/src/at32uc3/at32uc3_internal.h b/arch/avr/src/at32uc3/at32uc3_internal.h index 718e78fc12..2331005815 100644 --- a/arch/avr/src/at32uc3/at32uc3_internal.h +++ b/arch/avr/src/at32uc3/at32uc3_internal.h @@ -317,7 +317,7 @@ int gpio_irqattach(int irq, xcpt_t newisr, xcpt_t *oldisr); void gpio_irqenable(int irq); #endif -/***************************************************************************** +/**************************************************************************** * Name: gpio_irqdisable * * Description: diff --git a/arch/avr/src/at90usb/at90usb_internal.h b/arch/avr/src/at90usb/at90usb_internal.h index 6c50fa78df..0967fb01ab 100644 --- a/arch/avr/src/at90usb/at90usb_internal.h +++ b/arch/avr/src/at90usb/at90usb_internal.h @@ -186,7 +186,7 @@ int gpio_irqattach(int irq, xcpt_t newisr, xcpt_t *oldisr); void gpio_irqenable(int irq); #endif -/***************************************************************************** +/**************************************************************************** * Name: gpio_irqdisable * * Description: diff --git a/arch/avr/src/atmega/atmega_internal.h b/arch/avr/src/atmega/atmega_internal.h index e776cc3c0a..2eedba3b9d 100644 --- a/arch/avr/src/atmega/atmega_internal.h +++ b/arch/avr/src/atmega/atmega_internal.h @@ -188,7 +188,7 @@ int gpio_irqattach(int irq, xcpt_t newisr, xcpt_t *oldisr); void gpio_irqenable(int irq); #endif -/***************************************************************************** +/**************************************************************************** * Name: gpio_irqdisable * * Description: diff --git a/arch/mips/src/pic32mx/pic32mx-internal.h b/arch/mips/src/pic32mx/pic32mx-internal.h index 72ebf3eea6..e48b0505d7 100644 --- a/arch/mips/src/pic32mx/pic32mx-internal.h +++ b/arch/mips/src/pic32mx/pic32mx-internal.h @@ -204,25 +204,25 @@ void pic32mx_consoleinit(void); # define pic32mx_consoleinit() #endif -/****************************************************************************** +/**************************************************************************** * Name: pic32mx_uartreset * * Description: * Reset a UART. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE void pic32mx_uartreset(uintptr_t uart_base); #endif -/****************************************************************************** +/**************************************************************************** * Name: pic32mx_uartconfigure * * Description: * Configure a UART as a RS-232 UART. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE void pic32mx_uartconfigure(uintptr_t uart_base, uint32_t baudrate, diff --git a/arch/mips/src/pic32mz/pic32mz-lowconsole.h b/arch/mips/src/pic32mz/pic32mz-lowconsole.h index 9382bac81b..0fb2679977 100644 --- a/arch/mips/src/pic32mz/pic32mz-lowconsole.h +++ b/arch/mips/src/pic32mz/pic32mz-lowconsole.h @@ -89,25 +89,25 @@ void pic32mz_consoleinit(void); # define pic32mz_consoleinit() #endif -/****************************************************************************** +/**************************************************************************** * Name: pic32mz_uartreset * * Description: * Reset a UART. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE void pic32mz_uartreset(uintptr_t uart_base); #endif -/****************************************************************************** +/**************************************************************************** * Name: pic32mz_uartconfigure * * Description: * Configure a UART as a RS-232 UART. * - ******************************************************************************/ + ****************************************************************************/ #ifdef HAVE_UART_DEVICE void pic32mz_uartconfigure(uintptr_t uart_base, uint32_t baudrate, From 4435c1bfb7741ca22ddc07fb89c916ea798072a7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 3 Oct 2015 07:33:06 -0600 Subject: [PATCH 14/33] Standardize the width of all comment boxes in C header files --- arch/arm/src/lpc43xx/lpc43_ehci.h | 4 ++-- arch/arm/src/lpc43xx/lpc43_rit.h | 2 +- arch/arm/src/sama5/sam_usbhost.h | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/arm/src/lpc43xx/lpc43_ehci.h b/arch/arm/src/lpc43xx/lpc43_ehci.h index 0e50b93303..b6ad0474e5 100644 --- a/arch/arm/src/lpc43xx/lpc43_ehci.h +++ b/arch/arm/src/lpc43xx/lpc43_ehci.h @@ -70,7 +70,7 @@ extern "C" * Public Function Prototypes ************************************************************************************/ -/**************************************************************************** +/************************************************************************************ * Name: lpc31_ehci_initialize * * Description: @@ -93,7 +93,7 @@ extern "C" * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - ****************************************************************************/ + ************************************************************************************/ #if defined(CONFIG_LPC43_USBOTG) && defined(CONFIG_USBHOST) struct usbhost_connection_s; diff --git a/arch/arm/src/lpc43xx/lpc43_rit.h b/arch/arm/src/lpc43xx/lpc43_rit.h index d5a3ce7846..3088b8fe11 100644 --- a/arch/arm/src/lpc43xx/lpc43_rit.h +++ b/arch/arm/src/lpc43xx/lpc43_rit.h @@ -54,7 +54,7 @@ * Public Data ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/arch/arm/src/sama5/sam_usbhost.h b/arch/arm/src/sama5/sam_usbhost.h index 1517815006..a67a0a42dd 100644 --- a/arch/arm/src/sama5/sam_usbhost.h +++ b/arch/arm/src/sama5/sam_usbhost.h @@ -230,7 +230,7 @@ extern "C" * Public Functions ************************************************************************************/ -/**************************************************************************** +/************************************************************************************ * Name: sam_ohci_initialize * * Description: @@ -253,14 +253,14 @@ extern "C" * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - ****************************************************************************/ + ************************************************************************************/ #ifdef CONFIG_SAMA5_OHCI struct usbhost_connection_s; FAR struct usbhost_connection_s *sam_ohci_initialize(int controller); #endif -/**************************************************************************** +/************************************************************************************ * Name: sam_ohci_tophalf * * Description: @@ -268,13 +268,13 @@ FAR struct usbhost_connection_s *sam_ohci_initialize(int controller); * EHCI will manage the common UHPHS interrupt and will forward the interrupt * event to this function. * - ****************************************************************************/ + ************************************************************************************/ #ifdef CONFIG_SAMA5_OHCI int sam_ohci_tophalf(int irq, FAR void *context); #endif -/**************************************************************************** +/************************************************************************************ * Name: sam_ehci_initialize * * Description: @@ -297,7 +297,7 @@ int sam_ohci_tophalf(int irq, FAR void *context); * - Class drivers should be initialized prior to calling this function. * Otherwise, there is a race condition if the device is already connected. * - ****************************************************************************/ + ************************************************************************************/ #ifdef CONFIG_SAMA5_EHCI struct usbhost_connection_s; From 6fc6d177601a2186cfe5a0a2b5211e82a88c8ca7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 4 Oct 2015 14:59:08 -0600 Subject: [PATCH 15/33] Fix some spacing problems --- arch/arm/src/a1x/a1x_irq.c | 8 +-- arch/arm/src/a1x/a1x_pio.c | 4 +- arch/arm/src/arm/up_assert.c | 16 +++--- arch/arm/src/armv6-m/up_assert.c | 16 +++--- arch/arm/src/armv7-a/arm_assert.c | 16 +++--- arch/arm/src/armv7-a/arm_virtpgaddr.c | 2 +- arch/arm/src/kinetis/kinetis_enet.c | 4 +- arch/arm/src/kinetis/kinetis_sdhc.c | 32 ++++++------ arch/arm/src/kl/kl_spi.c | 9 ++-- arch/arm/src/lpc11xx/lpc11_lowgetc.c | 2 +- arch/arm/src/lpc11xx/lpc11_spi.c | 6 +-- arch/arm/src/lpc17xx/lpc176x_rtc.c | 2 +- arch/arm/src/lpc17xx/lpc17_can.c | 17 +++---- arch/arm/src/lpc17xx/lpc17_gpioint.c | 33 ++++++------ arch/arm/src/lpc17xx/lpc17_sdcard.c | 32 ++++++------ arch/arm/src/lpc17xx/lpc17_spi.c | 7 ++- arch/arm/src/lpc17xx/lpc17_usbhost.c | 4 +- arch/arm/src/lpc214x/lpc214x_decodeirq.c | 2 +- arch/arm/src/lpc214x/lpc214x_irq.c | 2 +- arch/arm/src/lpc2378/lpc23xx_io.c | 15 +++--- arch/arm/src/lpc2378/lpc23xx_pllsetup.c | 10 ++-- arch/arm/src/lpc2378/lpc23xx_timerisr.c | 12 ++--- arch/arm/src/lpc31xx/lpc31_ehci.c | 2 +- arch/arm/src/lpc43xx/lpc43_allocateheap.c | 18 +++---- arch/arm/src/lpc43xx/lpc43_ehci.c | 2 +- arch/arm/src/lpc43xx/lpc43_ethernet.c | 8 +-- arch/arm/src/lpc43xx/lpc43_spi.c | 6 +-- arch/arm/src/lpc43xx/lpc43_spifi.c | 2 +- arch/arm/src/lpc43xx/lpc43_uart.c | 24 ++++----- arch/arm/src/nuc1xx/nuc_gpio.c | 2 +- arch/arm/src/sam34/sam4l_gpio.c | 6 +-- arch/arm/src/sam34/sam_allocateheap.c | 6 +-- arch/arm/src/sam34/sam_gpio.c | 2 +- arch/arm/src/sam34/sam_hsmci.c | 26 +++++----- arch/arm/src/sam34/sam_serial.c | 2 +- arch/arm/src/sam34/sam_spi.c | 6 +-- arch/arm/src/sam34/sam_udp.c | 6 +-- arch/arm/src/sam34/sam_wdt.c | 18 +++---- arch/arm/src/sama5/sam_dbgu.c | 2 +- arch/arm/src/sama5/sam_emacb.c | 2 +- arch/arm/src/sama5/sam_flexcom_serial.c | 4 +- arch/arm/src/sama5/sam_irq.c | 58 ++++++++++----------- arch/arm/src/sama5/sam_nand.c | 12 ++--- arch/arm/src/sama5/sam_ohci.c | 4 +- arch/arm/src/sama5/sam_pmc.c | 12 ++--- arch/arm/src/sama5/sam_serial.c | 2 +- arch/arm/src/sama5/sam_spi.c | 10 ++-- arch/arm/src/samdl/sam_serial.c | 6 +-- arch/arm/src/samdl/sam_spi.c | 10 ++-- arch/arm/src/samv7/sam_gpio.c | 6 +-- arch/arm/src/samv7/sam_hsmci.c | 62 +++++++++++------------ arch/arm/src/samv7/sam_qspi.c | 4 +- arch/arm/src/samv7/sam_serial.c | 2 +- arch/arm/src/samv7/sam_spi.c | 6 +-- arch/arm/src/samv7/sam_timerisr.c | 2 +- arch/arm/src/stm32/stm32_bbsram.c | 16 +++--- arch/arm/src/stm32/stm32_can.c | 6 +-- arch/arm/src/stm32/stm32_dac.c | 2 +- arch/arm/src/stm32/stm32_exti_alarm.c | 2 +- arch/arm/src/stm32/stm32_exti_gpio.c | 2 +- arch/arm/src/stm32/stm32_exti_pwr.c | 2 +- arch/arm/src/stm32/stm32_sdio.c | 16 +++--- arch/arm/src/stm32f7/stm32_exti_alarm.c | 2 +- arch/arm/src/stm32f7/stm32_exti_pwr.c | 2 +- arch/arm/src/str71x/str71x_timerisr.c | 44 ++++++++-------- arch/avr/src/at90usb/at90usb_usbdev.c | 2 +- arch/hc/src/m9s12/m9s12_dumpgpio.c | 12 ++--- arch/mips/src/mips32/up_vfork.c | 12 ++--- arch/mips/src/pic32mx/pic32mx-ethernet.c | 8 +-- arch/mips/src/pic32mx/pic32mx-spi.c | 9 ++-- arch/mips/src/pic32mz/pic32mz-ethernet.c | 8 +-- arch/rgmp/src/x86/com.c | 60 ++++++++++++---------- arch/sim/src/up_netdriver.c | 4 +- arch/x86/src/qemu/qemu_lowputc.c | 2 +- arch/z80/src/ez80/ez80_timerisr.c | 2 +- 75 files changed, 404 insertions(+), 400 deletions(-) diff --git a/arch/arm/src/a1x/a1x_irq.c b/arch/arm/src/a1x/a1x_irq.c index 1cfa198fdf..de49179bff 100644 --- a/arch/arm/src/a1x/a1x_irq.c +++ b/arch/arm/src/a1x/a1x_irq.c @@ -226,10 +226,10 @@ uint32_t *arm_decodeirq(uint32_t *regs) #if 0 /* Use PEND registers instead */ uint32_t regval; - /* During initialization, the BASE address register was set to zero. - * Therefore, when we read the VECTOR address register, we get the IRQ number - * shifted left by two. - */ + /* During initialization, the BASE address register was set to zero. + * Therefore, when we read the VECTOR address register, we get the IRQ number + * shifted left by two. + */ regval = getreg32(A1X_INTC_VECTOR); diff --git a/arch/arm/src/a1x/a1x_pio.c b/arch/arm/src/a1x/a1x_pio.c index afec6abcb9..fbda960808 100644 --- a/arch/arm/src/a1x/a1x_pio.c +++ b/arch/arm/src/a1x/a1x_pio.c @@ -154,9 +154,9 @@ static int a1x_pio_interrupt(int irq, void *context) pending >>= 2; } - /* Check for pending interrupts in any of the last bits */ + /* Check for pending interrupts in any of the last bits */ - else + else { if ((pending & 0x00000001) == 0) { diff --git a/arch/arm/src/arm/up_assert.c b/arch/arm/src/arm/up_assert.c index 427799d987..1db9f9f687 100644 --- a/arch/arm/src/arm/up_assert.c +++ b/arch/arm/src/arm/up_assert.c @@ -312,16 +312,16 @@ static void _up_assert(int errorcode) if (current_regs || ((struct tcb_s*)g_readytorun.head)->pid == 0) { - (void)irqsave(); - for (;;) - { + (void)irqsave(); + for (;;) + { #ifdef CONFIG_ARCH_LEDS - board_led_on(LED_PANIC); - up_mdelay(250); - board_led_off(LED_PANIC); - up_mdelay(250); + board_led_on(LED_PANIC); + up_mdelay(250); + board_led_off(LED_PANIC); + up_mdelay(250); #endif - } + } } else { diff --git a/arch/arm/src/armv6-m/up_assert.c b/arch/arm/src/armv6-m/up_assert.c index 5752fe195e..11563b19c1 100644 --- a/arch/arm/src/armv6-m/up_assert.c +++ b/arch/arm/src/armv6-m/up_assert.c @@ -367,16 +367,16 @@ static void _up_assert(int errorcode) if (current_regs || ((struct tcb_s*)g_readytorun.head)->pid == 0) { - (void)irqsave(); - for (;;) - { + (void)irqsave(); + for (;;) + { #ifdef CONFIG_ARCH_LEDS - board_led_on(LED_PANIC); - up_mdelay(250); - board_led_off(LED_PANIC); - up_mdelay(250); + board_led_on(LED_PANIC); + up_mdelay(250); + board_led_off(LED_PANIC); + up_mdelay(250); #endif - } + } } else { diff --git a/arch/arm/src/armv7-a/arm_assert.c b/arch/arm/src/armv7-a/arm_assert.c index 0667380378..eaac377db0 100644 --- a/arch/arm/src/armv7-a/arm_assert.c +++ b/arch/arm/src/armv7-a/arm_assert.c @@ -367,16 +367,16 @@ static void _up_assert(int errorcode) if (current_regs || ((struct tcb_s*)g_readytorun.head)->pid == 0) { - (void)irqsave(); - for (;;) - { + (void)irqsave(); + for (;;) + { #ifdef CONFIG_ARCH_LEDS - board_led_on(LED_PANIC); - up_mdelay(250); - board_led_off(LED_PANIC); - up_mdelay(250); + board_led_on(LED_PANIC); + up_mdelay(250); + board_led_off(LED_PANIC); + up_mdelay(250); #endif - } + } } else { diff --git a/arch/arm/src/armv7-a/arm_virtpgaddr.c b/arch/arm/src/armv7-a/arm_virtpgaddr.c index b4ef3a3eb5..71b5099b76 100644 --- a/arch/arm/src/armv7-a/arm_virtpgaddr.c +++ b/arch/arm/src/armv7-a/arm_virtpgaddr.c @@ -47,7 +47,7 @@ * Pre-processor Definitions ****************************************************************************/ - /**************************************************************************** +/**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/arm/src/kinetis/kinetis_enet.c b/arch/arm/src/kinetis/kinetis_enet.c index 628263e710..57c877213a 100644 --- a/arch/arm/src/kinetis/kinetis_enet.c +++ b/arch/arm/src/kinetis/kinetis_enet.c @@ -195,7 +195,7 @@ struct kinetis_driver_s * requirements. */ - uint8_t desc[NENET_NBUFFERS * sizeof(struct enet_desc_s) + 16]; + uint8_t desc[NENET_NBUFFERS * sizeof(struct enet_desc_s) + 16]; /* The DMA buffers. Again, A unaligned uint8_t is used to allocate the * memory; 16 is added to assure that we can meet the descriptor alignment @@ -883,7 +883,7 @@ static int kinetis_ifup(struct net_driver_s *dev) ndbg("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, - (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24 ); + (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); /* Initialize ENET buffers */ diff --git a/arch/arm/src/kinetis/kinetis_sdhc.c b/arch/arm/src/kinetis/kinetis_sdhc.c index 8dc394a400..bfda25be61 100644 --- a/arch/arm/src/kinetis/kinetis_sdhc.c +++ b/arch/arm/src/kinetis/kinetis_sdhc.c @@ -2198,14 +2198,14 @@ static int kinetis_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t r uint32_t regval; int ret = OK; - /* R2 CID, CSD register (136-bit) - * 135 0 Start bit - * 134 0 Transmission bit (0=from card) - * 133:128 bit5 - bit0 Reserved - * 127:1 bit127 - bit1 127-bit CID or CSD register - * (including internal CRC) - * 0 1 End bit - */ + /* R2 CID, CSD register (136-bit) + * 135 0 Start bit + * 134 0 Transmission bit (0=from card) + * 133:128 bit5 - bit0 Reserved + * 127:1 bit127 - bit1 127-bit CID or CSD register + * (including internal CRC) + * 0 1 End bit + */ #ifdef CONFIG_DEBUG /* Check that R1 is the correct response to this command */ @@ -2250,14 +2250,14 @@ static int kinetis_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t uint32_t regval; int ret = OK; - /* R3 OCR (48-bit) - * 47 0 Start bit - * 46 0 Transmission bit (0=from card) - * 45:40 bit5 - bit0 Reserved - * 39:8 bit31 - bit0 32-bit OCR register - * 7:1 bit6 - bit0 Reserved - * 0 1 End bit - */ + /* R3 OCR (48-bit) + * 47 0 Start bit + * 46 0 Transmission bit (0=from card) + * 45:40 bit5 - bit0 Reserved + * 39:8 bit31 - bit0 32-bit OCR register + * 7:1 bit6 - bit0 Reserved + * 0 1 End bit + */ /* Check that this is the correct response to this command */ diff --git a/arch/arm/src/kl/kl_spi.c b/arch/arm/src/kl/kl_spi.c index 899acb2c6c..4bcd00199d 100644 --- a/arch/arm/src/kl/kl_spi.c +++ b/arch/arm/src/kl/kl_spi.c @@ -499,9 +499,9 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) * from the SPI data registr */ - while ((spi_getreg(priv, KL_SPI_S_OFFSET) & SPI_S_SPRF) == 0); + while ((spi_getreg(priv, KL_SPI_S_OFFSET) & SPI_S_SPRF) == 0); - /* Return the data */ + /* Return the data */ return (uint16_t)spi_getreg(priv, KL_SPI_D_OFFSET); } @@ -538,7 +538,7 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, /* Loop, sending each word in the user-provied data buffer. */ - for ( ; nwords > 0; nwords--) + for (; nwords > 0; nwords--) { /* Get the data to send (0xff if there is no data source) */ @@ -597,7 +597,8 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, ************************************************************************************/ #ifndef CONFIG_SPI_EXCHANGE -static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *txbuffer, size_t nwords) +static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *txbuffer, + size_t nwords) { spivdbg("txbuffer=%p nwords=%d\n", txbuffer, nwords); return spi_exchange(dev, txbuffer, NULL, nwords); diff --git a/arch/arm/src/lpc11xx/lpc11_lowgetc.c b/arch/arm/src/lpc11xx/lpc11_lowgetc.c index 5bfe75fbd1..2591d90067 100644 --- a/arch/arm/src/lpc11xx/lpc11_lowgetc.c +++ b/arch/arm/src/lpc11xx/lpc11_lowgetc.c @@ -122,7 +122,7 @@ int lpc11_lowgetc(void) while ((getreg32(CONSOLE_BASE+LPC11_UART_LSR_OFFSET) & UART_LSR_RDR) == 0); - /* Then read a character from the UART data register */ + /* Then read a character from the UART data register */ ch = getreg8(CONSOLE_BASE+LPC11_UART_RBR_OFFSET); #endif diff --git a/arch/arm/src/lpc11xx/lpc11_spi.c b/arch/arm/src/lpc11xx/lpc11_spi.c index db0eb55729..80a179c39c 100644 --- a/arch/arm/src/lpc11xx/lpc11_spi.c +++ b/arch/arm/src/lpc11xx/lpc11_spi.c @@ -436,11 +436,11 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) * data transfer. */ - while ((getreg32(LPC11_SPI_SR) & SPI_SR_SPIF) == 0); + while ((getreg32(LPC11_SPI_SR) & SPI_SR_SPIF) == 0); - /* Read the SPI Status Register again to clear the status bit */ + /* Read the SPI Status Register again to clear the status bit */ - (void)getreg32(LPC11_SPI_SR); + (void)getreg32(LPC11_SPI_SR); return (uint16_t)getreg32(LPC11_SPI_DR); } diff --git a/arch/arm/src/lpc17xx/lpc176x_rtc.c b/arch/arm/src/lpc17xx/lpc176x_rtc.c index b25095dda4..7e471feb8b 100644 --- a/arch/arm/src/lpc17xx/lpc176x_rtc.c +++ b/arch/arm/src/lpc17xx/lpc176x_rtc.c @@ -199,7 +199,7 @@ static int rtc_setup(void) putreg32((uint32_t)0xff, LPC17_RTC_AMR); putreg32((uint32_t)0x00, LPC17_RTC_CALIB); - /* Enable power to the RTC module */ + /* Enable power to the RTC module */ regval = getreg32(LPC17_SYSCON_PCONP); regval |= SYSCON_PCONP_PCRTC; diff --git a/arch/arm/src/lpc17xx/lpc17_can.c b/arch/arm/src/lpc17xx/lpc17_can.c index 310330dc4e..a4f357bdcb 100644 --- a/arch/arm/src/lpc17xx/lpc17_can.c +++ b/arch/arm/src/lpc17xx/lpc17_can.c @@ -1192,7 +1192,7 @@ static int can_bittiming(struct up_dev_s *priv) canllvdbg("TS1: %d TS2: %d BRP: %d SJW= %d\n", ts1, ts2, brp, sjw); - /* Configure bit timing */ + /* Configure bit timing */ btr = (((brp - 1) << CAN_BTR_BRP_SHIFT) | ((ts1 - 1) << CAN_BTR_TSEG1_SHIFT) | @@ -1290,14 +1290,14 @@ FAR struct can_dev_s *lpc17_caninitialize(int port) lpc17_configgpio(GPIO_CAN2_TD); candev = &g_can2dev; - } - else + } + else #endif - { - candbg("Unsupported port: %d\n", port); - irqrestore(flags); - return NULL; - } + { + candbg("Unsupported port: %d\n", port); + irqrestore(flags); + return NULL; + } /* Then just perform a CAN reset operation */ @@ -1306,4 +1306,3 @@ FAR struct can_dev_s *lpc17_caninitialize(int port) return candev; } #endif - diff --git a/arch/arm/src/lpc17xx/lpc17_gpioint.c b/arch/arm/src/lpc17xx/lpc17_gpioint.c index 132ab14be3..9a65617201 100644 --- a/arch/arm/src/lpc17xx/lpc17_gpioint.c +++ b/arch/arm/src/lpc17xx/lpc17_gpioint.c @@ -163,10 +163,10 @@ static void lpc17_setintedge(uint32_t intbase, unsigned int pin, static int lpc17_irq2port(int irq) { - /* Set 1: - * LPC176x: 12 interrupts p0.0-p0.11 - * LPC178x: 16 interrupts p0.0-p0.15 - */ + /* Set 1: + * LPC176x: 12 interrupts p0.0-p0.11 + * LPC178x: 16 interrupts p0.0-p0.15 + */ if (irq >= LPC17_VALID_FIRST0L && irq < (LPC17_VALID_FIRST0L + LPC17_VALID_NIRQS0L)) @@ -364,24 +364,24 @@ static void lpc17_gpiodemux(uint32_t intbase, uint32_t intmask, if ((intmask & bit) != 0) { - /* This pin can support an interrupt. Is there an interrupt pending - * and enabled? - */ + /* This pin can support an interrupt. Is there an interrupt pending + * and enabled? + */ - if ((intstatus & bit) != 0) - { - /* Clear the interrupt status */ + if ((intstatus & bit) != 0) + { + /* Clear the interrupt status */ - putreg32(bit, intbase + LPC17_GPIOINT_INTCLR_OFFSET); + putreg32(bit, intbase + LPC17_GPIOINT_INTCLR_OFFSET); - /* And dispatch the interrupt */ + /* And dispatch the interrupt */ - irq_dispatch(irq, context); - } + irq_dispatch(irq, context); + } - /* Increment the IRQ number on each interrupt pin */ + /* Increment the IRQ number on each interrupt pin */ - irq++; + irq++; } /* Next bit */ @@ -544,4 +544,3 @@ void lpc17_gpioirqdisable(int irq) } #endif /* CONFIG_GPIO_IRQ */ - diff --git a/arch/arm/src/lpc17xx/lpc17_sdcard.c b/arch/arm/src/lpc17xx/lpc17_sdcard.c index 9bb2f5fd56..1e61d471c4 100644 --- a/arch/arm/src/lpc17xx/lpc17_sdcard.c +++ b/arch/arm/src/lpc17xx/lpc17_sdcard.c @@ -2036,14 +2036,14 @@ static int lpc17_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlo uint32_t regval; int ret = OK; - /* R2 CID, CSD register (136-bit) - * 135 0 Start bit - * 134 0 Transmission bit (0=from card) - * 133:128 bit5 - bit0 Reserved - * 127:1 bit127 - bit1 127-bit CID or CSD register - * (including internal CRC) - * 0 1 End bit - */ + /* R2 CID, CSD register (136-bit) + * 135 0 Start bit + * 134 0 Transmission bit (0=from card) + * 133:128 bit5 - bit0 Reserved + * 127:1 bit127 - bit1 127-bit CID or CSD register + * (including internal CRC) + * 0 1 End bit + */ #ifdef CONFIG_DEBUG /* Check that R1 is the correct response to this command */ @@ -2089,14 +2089,14 @@ static int lpc17_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *r uint32_t regval; int ret = OK; - /* R3 OCR (48-bit) - * 47 0 Start bit - * 46 0 Transmission bit (0=from card) - * 45:40 bit5 - bit0 Reserved - * 39:8 bit31 - bit0 32-bit OCR register - * 7:1 bit6 - bit0 Reserved - * 0 1 End bit - */ + /* R3 OCR (48-bit) + * 47 0 Start bit + * 46 0 Transmission bit (0=from card) + * 45:40 bit5 - bit0 Reserved + * 39:8 bit31 - bit0 32-bit OCR register + * 7:1 bit6 - bit0 Reserved + * 0 1 End bit + */ /* Check that this is the correct response to this command */ diff --git a/arch/arm/src/lpc17xx/lpc17_spi.c b/arch/arm/src/lpc17xx/lpc17_spi.c index e595496c44..bbdd568c39 100644 --- a/arch/arm/src/lpc17xx/lpc17_spi.c +++ b/arch/arm/src/lpc17xx/lpc17_spi.c @@ -429,11 +429,11 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) * data transfer. */ - while ((getreg32(LPC17_SPI_SR) & SPI_SR_SPIF) == 0); + while ((getreg32(LPC17_SPI_SR) & SPI_SR_SPIF) == 0); - /* Read the SPI Status Register again to clear the status bit */ + /* Read the SPI Status Register again to clear the status bit */ - (void)getreg32(LPC17_SPI_SR); + (void)getreg32(LPC17_SPI_SR); return (uint16_t)getreg32(LPC17_SPI_DR); } @@ -610,4 +610,3 @@ FAR struct spi_dev_s *lpc17_spiinitialize(int port) } #endif /* CONFIG_LPC17_SPI */ - diff --git a/arch/arm/src/lpc17xx/lpc17_usbhost.c b/arch/arm/src/lpc17xx/lpc17_usbhost.c index d1e8ce0837..237882eee4 100644 --- a/arch/arm/src/lpc17xx/lpc17_usbhost.c +++ b/arch/arm/src/lpc17xx/lpc17_usbhost.c @@ -181,7 +181,7 @@ struct lpc17_usbhost_s volatile struct usbhost_hubport_s *hport; #endif - }; +}; /* This structure describes one asynchronous transfer */ @@ -691,7 +691,7 @@ static void lpc17_tdfree(struct lpc17_gtd_s *td) * allocated tail TD. */ - if (tdfree != NULL && td != TDTAIL) + if (tdfree != NULL && td != TDTAIL) { tdfree->flink = g_tdfree; g_tdfree = tdfree; diff --git a/arch/arm/src/lpc214x/lpc214x_decodeirq.c b/arch/arm/src/lpc214x/lpc214x_decodeirq.c index f5e4673586..b5cd57f2af 100644 --- a/arch/arm/src/lpc214x/lpc214x_decodeirq.c +++ b/arch/arm/src/lpc214x/lpc214x_decodeirq.c @@ -107,7 +107,7 @@ static uint8_t g_nibblemap[16] = { 0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, #ifndef CONFIG_VECTORED_INTERRUPTS void up_decodeirq(uint32_t *regs) #else -static void lpc214x_decodeirq( uint32_t *regs) +static void lpc214x_decodeirq(uint32_t *regs) #endif { #ifdef CONFIG_SUPPRESS_INTERRUPTS diff --git a/arch/arm/src/lpc214x/lpc214x_irq.c b/arch/arm/src/lpc214x/lpc214x_irq.c index 3976d4deed..3c12b75d91 100644 --- a/arch/arm/src/lpc214x/lpc214x_irq.c +++ b/arch/arm/src/lpc214x/lpc214x_irq.c @@ -193,7 +193,7 @@ void up_attach_vector(int irq, int vector, vic_vector_t handler) /* Enable the vectored interrupt */ vic_putreg(((irq << LPC214X_VECTCNTL_IRQSHIFT) | LPC214X_VECTCNTL_ENABLE), - LPC214X_VIC_VECTCNTL0_OFFSET + offset); + LPC214X_VIC_VECTCNTL0_OFFSET + offset); irqrestore(flags); } } diff --git a/arch/arm/src/lpc2378/lpc23xx_io.c b/arch/arm/src/lpc2378/lpc23xx_io.c index 1634d80ea7..8dd17f8d36 100644 --- a/arch/arm/src/lpc2378/lpc23xx_io.c +++ b/arch/arm/src/lpc2378/lpc23xx_io.c @@ -58,7 +58,8 @@ * Descriptions: Initialize the target board before running the main() * ************************************************************************/ -void IO_Init( void ) + +void IO_Init(void) { uint32_t regval; @@ -76,20 +77,20 @@ void IO_Init( void ) pinsel_putreg(0, PINSEL9_OFFSET); pinsel_putreg(0, PINSEL10_OFFSET); -/* - regval = scb_getreg(SCB_PCONP_OFFSET) & ~(PCSDC | PCUART1 | PCI2C0 | PCSSP1 | PCEMC | ); - scb_getreg(regval, SCB_PCONP_OFFSET ); -*/ +#if 0 + regval = scb_getreg(SCB_PCONP_OFFSET) & ~(PCSDC | PCUART1 | PCI2C0 | PCSSP1 | PCEMC); + scb_getreg(regval, SCB_PCONP_OFFSET); +#endif /* Turn off all peripheral power */ - scb_putreg(0, SCB_PCONP_OFFSET ); + scb_putreg(0, SCB_PCONP_OFFSET); /* Turn on UART0/2 / Timer0 */ /* regval = PCUART0 | PCUART2 | PCTIM0 | PCRTC ; */ regval = PCUART0 | PCUART2 | PCTIM0 ; - scb_putreg(regval , SCB_PCONP_OFFSET ); + scb_putreg(regval , SCB_PCONP_OFFSET); /* Status LED P1.19 */ diff --git a/arch/arm/src/lpc2378/lpc23xx_pllsetup.c b/arch/arm/src/lpc2378/lpc23xx_pllsetup.c index 853da420a9..b10eb24e39 100644 --- a/arch/arm/src/lpc2378/lpc23xx_pllsetup.c +++ b/arch/arm/src/lpc2378/lpc23xx_pllsetup.c @@ -106,16 +106,16 @@ void IO_Init(void); */ #ifdef CONFIG_LPC2378_PLL_CLKSRC -# if ( (CONFIG_LPC2378_PLL_CLKSRC < 0) || (CONFIG_LPC2378_PLL_CLKSRC > 2) ) -# error "PLL clock source not valid, check configuration " -# endif +# if ((CONFIG_LPC2378_PLL_CLKSRC < 0) || (CONFIG_LPC2378_PLL_CLKSRC > 2)) +# error "PLL clock source not valid, check configuration " +# endif #else -# error "PLL clock source not defined, check configuration file" +# error "PLL clock source not defined, check configuration file" #endif /* PLL provides CCLK and must always be configured */ -#define PLL ( PLL_M | (PLL_N << 16) ) +#define PLL (PLL_M | (PLL_N << 16)) /* Memory Accelerator Module (MAM) initialization values * diff --git a/arch/arm/src/lpc2378/lpc23xx_timerisr.c b/arch/arm/src/lpc2378/lpc23xx_timerisr.c index 8bd6cd9841..e831b34459 100644 --- a/arch/arm/src/lpc2378/lpc23xx_timerisr.c +++ b/arch/arm/src/lpc2378/lpc23xx_timerisr.c @@ -62,23 +62,23 @@ /* T0_PCLKDIV valid values are 1,2,4 */ -#define T0_PCLK_DIV 1 +#define T0_PCLK_DIV 1 /* PCKLSEL0 bits 3:2, 00=CCLK/4, 01=CCLK/1 , 10=CCLK/2 */ #ifdef T0_PCLK_DIV # if T0_PCLK_DIV == 1 -# define TIMER0_PCLKSEL (0x00000004) +# define TIMER0_PCLKSEL (0x00000004) # elif T0_PCLK_DIV == 2 -# define TIMER0_PCLKSEL (0x00000008) +# define TIMER0_PCLKSEL (0x00000008) # elif T0_PCLK_DIV == 4 -# define TIMER0_PCLKSEL (0x00000000) +# define TIMER0_PCLKSEL (0x00000000) # endif #endif -#define T0_PCLKSEL_MASK (0x0000000C) +#define T0_PCLKSEL_MASK (0x0000000C) -#define T0_TICKS_COUNT ( (CCLK / T0_PCLK_DIV ) / TICK_PER_SEC ) +#define T0_TICKS_COUNT ((CCLK / T0_PCLK_DIV ) / TICK_PER_SEC) /**************************************************************************** * Private Types diff --git a/arch/arm/src/lpc31xx/lpc31_ehci.c b/arch/arm/src/lpc31xx/lpc31_ehci.c index adbf4dda20..3daa79210c 100644 --- a/arch/arm/src/lpc31xx/lpc31_ehci.c +++ b/arch/arm/src/lpc31xx/lpc31_ehci.c @@ -3849,7 +3849,7 @@ static int lpc31_enumerate(FAR struct usbhost_connection_s *conn, static int lpc31_ep0configure(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, uint8_t funcaddr, uint8_t speed, uint16_t maxpacketsize) - { +{ struct lpc31_epinfo_s *epinfo = (struct lpc31_epinfo_s *)ep0; DEBUGASSERT(drvr != NULL && epinfo != NULL && maxpacketsize < 2048); diff --git a/arch/arm/src/lpc43xx/lpc43_allocateheap.c b/arch/arm/src/lpc43xx/lpc43_allocateheap.c index 22ba4a9a3f..6201ff659a 100644 --- a/arch/arm/src/lpc43xx/lpc43_allocateheap.c +++ b/arch/arm/src/lpc43xx/lpc43_allocateheap.c @@ -266,31 +266,31 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) void up_addregion(void) { #if CONFIG_MM_REGIONS > 1 - /* Add the next SRAM region (which should exist) */ + /* Add the next SRAM region (which should exist) */ - kmm_addregion((FAR void*)MM_REGION2_BASE, MM_REGION2_SIZE); + kmm_addregion((FAR void*)MM_REGION2_BASE, MM_REGION2_SIZE); #ifdef MM_REGION3_BASE - /* Add the third SRAM region (which will not exist in configuration B) */ + /* Add the third SRAM region (which will not exist in configuration B) */ #if CONFIG_MM_REGIONS > 2 - /* Add the third SRAM region (which may not exist) */ + /* Add the third SRAM region (which may not exist) */ - kmm_addregion((FAR void*)MM_REGION3_BASE, MM_REGION3_SIZE); + kmm_addregion((FAR void*)MM_REGION3_BASE, MM_REGION3_SIZE); #if CONFIG_MM_REGIONS > 3 && defined(MM_DMAHEAP_BASE) - /* Add the DMA region (which may not be available) */ + /* Add the DMA region (which may not be available) */ - kmm_addregion((FAR void*)MM_DMAHEAP_BASE, MM_DMAHEAP_SIZE); + kmm_addregion((FAR void*)MM_DMAHEAP_BASE, MM_DMAHEAP_SIZE); #endif /* CONFIG_MM_REGIONS > 3 && defined(MM_DMAHEAP_BASE) */ #endif /* CONFIG_MM_REGIONS > 2 */ #else /* MM_REGION3_BASE */ #if CONFIG_MM_REGIONS > 2 && defined(MM_DMAHEAP_BASE) - /* Add the DMA region (which may not be available) */ + /* Add the DMA region (which may not be available) */ - kmm_addregion((FAR void*)MM_DMAHEAP_BASE, MM_DMAHEAP_SIZE); + kmm_addregion((FAR void*)MM_DMAHEAP_BASE, MM_DMAHEAP_SIZE); #endif /* CONFIG_MM_REGIONS > 3 && defined(MM_DMAHEAP_BASE) */ #endif /* MM_REGION3_BASE */ diff --git a/arch/arm/src/lpc43xx/lpc43_ehci.c b/arch/arm/src/lpc43xx/lpc43_ehci.c index f9673ab12a..868a26a498 100644 --- a/arch/arm/src/lpc43xx/lpc43_ehci.c +++ b/arch/arm/src/lpc43xx/lpc43_ehci.c @@ -3679,7 +3679,7 @@ static int lpc43_enumerate(FAR struct usbhost_connection_s *conn, static int lpc43_ep0configure(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, uint8_t funcaddr, uint8_t speed, uint16_t maxpacketsize) - { +{ struct lpc43_epinfo_s *epinfo = (struct lpc43_epinfo_s *)ep0; DEBUGASSERT(drvr != NULL && epinfo != NULL && maxpacketsize < 2048); diff --git a/arch/arm/src/lpc43xx/lpc43_ethernet.c b/arch/arm/src/lpc43xx/lpc43_ethernet.c index c77ed92b6f..d20ad7380c 100644 --- a/arch/arm/src/lpc43xx/lpc43_ethernet.c +++ b/arch/arm/src/lpc43xx/lpc43_ethernet.c @@ -438,7 +438,7 @@ #define DMABMR_CLEAR_MASK \ (ETH_DMABMODE_SWR | ETH_DMABMODE_DA | ETH_DMABMODE_DSL_MASK | ETH_DMABMODE_ATDS | \ ETH_DMABMODE_PBL_MASK | ETH_DMABMODE_PR_MASK | ETH_DMABMODE_FB | ETH_DMABMODE_RPBL_MASK | \ - ETH_DMABMODE_USP | ETH_DMABMODE_PBL8X | ETH_DMABMODE_AAL | ETH_DMABMODE_MB | ETH_DMABMODE_TXPR ) + ETH_DMABMODE_USP | ETH_DMABMODE_PBL8X | ETH_DMABMODE_AAL | ETH_DMABMODE_MB | ETH_DMABMODE_TXPR) /* The following bits are set or left zero unconditionally in all modes. @@ -2634,7 +2634,7 @@ static int lpc43_addmac(struct net_driver_s *dev, FAR const uint8_t *mac) /* Add the MAC address to the hardware multicast hash table */ - crc = lpc43_calcethcrc( mac, 6 ); + crc = lpc43_calcethcrc(mac, 6); hashindex = (crc >> 26) & 0x3F; @@ -2691,7 +2691,7 @@ static int lpc43_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac) /* Remove the MAC address to the hardware multicast hash table */ - crc = lpc43_calcethcrc( mac, 6 ); + crc = lpc43_calcethcrc(mac, 6); hashindex = (crc >> 26) & 0x3F; @@ -2711,7 +2711,7 @@ static int lpc43_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac) /* If there is no address registered any more, delete multicast filtering */ - if (lpc43_getreg(LPC43_ETH_MACHTHI ) == 0 && + if (lpc43_getreg(LPC43_ETH_MACHTHI) == 0 && lpc43_getreg(LPC43_ETH_MACHTLO) == 0) { temp = lpc43_getreg(LPC43_ETH_MACFFLT); diff --git a/arch/arm/src/lpc43xx/lpc43_spi.c b/arch/arm/src/lpc43xx/lpc43_spi.c index 92918bbdea..5974e9102c 100644 --- a/arch/arm/src/lpc43xx/lpc43_spi.c +++ b/arch/arm/src/lpc43xx/lpc43_spi.c @@ -418,11 +418,11 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) * data transfer. */ - while ((getreg32(LPC43_SPI_SR) & SPI_SR_SPIF) == 0); + while ((getreg32(LPC43_SPI_SR) & SPI_SR_SPIF) == 0); - /* Read the SPI Status Register again to clear the status bit */ + /* Read the SPI Status Register again to clear the status bit */ - (void)getreg32(LPC43_SPI_SR); + (void)getreg32(LPC43_SPI_SR); return (uint16_t)getreg32(LPC43_SPI_DR); } diff --git a/arch/arm/src/lpc43xx/lpc43_spifi.c b/arch/arm/src/lpc43xx/lpc43_spifi.c index 610c41f582..97294c1377 100644 --- a/arch/arm/src/lpc43xx/lpc43_spifi.c +++ b/arch/arm/src/lpc43xx/lpc43_spifi.c @@ -241,7 +241,7 @@ * Compute this from the SPIFI clock period and the minimum high time of CS * from the serial flash data sheet: * - * csHigh = ceiling( min CS high / SPIFI clock period ) - 1 + * csHigh = ceiling(min CS high / SPIFI clock period) - 1 * * where ceiling means round up to the next higher integer if the argument * isn’t an integer. diff --git a/arch/arm/src/lpc43xx/lpc43_uart.c b/arch/arm/src/lpc43xx/lpc43_uart.c index 948cac54b6..95c5aeb904 100644 --- a/arch/arm/src/lpc43xx/lpc43_uart.c +++ b/arch/arm/src/lpc43xx/lpc43_uart.c @@ -540,18 +540,18 @@ void lpc43_setbaud(uintptr_t uartbase, uint32_t basefreq, uint32_t baud) uint32_t cdivadd; /* Candidate FDR DIVADDVAL value */ uint32_t errval; /* Error value associated with the candidate */ - /* The U[S]ART buad is given by: - * - * Fbaud = Fbase * mul / (mul + divadd) / (16 * dl) - * dl = Fbase * mul / (mul + divadd) / Fbaud / 16 - * = Fbase * mul / ((mul + divadd) * Fbaud * 16) - * = ((Fbase * mul) >> 4) / ((mul + divadd) * Fbaud) - * - * Where the value of MULVAL and DIVADDVAL comply with: - * - * 0 < mul < 16 - * 0 <= divadd < mul - */ + /* The U[S]ART buad is given by: + * + * Fbaud = Fbase * mul / (mul + divadd) / (16 * dl) + * dl = Fbase * mul / (mul + divadd) / Fbaud / 16 + * = Fbase * mul / ((mul + divadd) * Fbaud * 16) + * = ((Fbase * mul) >> 4) / ((mul + divadd) * Fbaud) + * + * Where the value of MULVAL and DIVADDVAL comply with: + * + * 0 < mul < 16 + * 0 <= divadd < mul + */ best = UINT32_MAX; divadd = 0; diff --git a/arch/arm/src/nuc1xx/nuc_gpio.c b/arch/arm/src/nuc1xx/nuc_gpio.c index 9c4c79a90a..56c0e97c5f 100644 --- a/arch/arm/src/nuc1xx/nuc_gpio.c +++ b/arch/arm/src/nuc1xx/nuc_gpio.c @@ -304,6 +304,6 @@ bool nuc_gpioread(gpio_cfgset_t pinset) /* Return the state of the selected pin */ - return (getreg32(base + NUC_GPIO_PIN_OFFSET) & (1 << pin)) != 0; + return (getreg32(base + NUC_GPIO_PIN_OFFSET) & (1 << pin)) != 0; #endif } diff --git a/arch/arm/src/sam34/sam4l_gpio.c b/arch/arm/src/sam34/sam4l_gpio.c index f26b6dc0e5..3c09beb535 100644 --- a/arch/arm/src/sam34/sam4l_gpio.c +++ b/arch/arm/src/sam34/sam4l_gpio.c @@ -181,7 +181,7 @@ static int sam_configinput(uintptr_t base, uint32_t pin, gpio_pinset_t cfgset) putreg32(pin, base + SAM_GPIO_STERC_OFFSET); } - return OK; + return OK; } /**************************************************************************** @@ -412,7 +412,7 @@ static inline int sam_configperiph(uintptr_t base, uint32_t pin, putreg32(pin, base + SAM_GPIO_IMR1S_OFFSET); } - /* REVISIT: Should event generation be enabled now? I am assuming so */ + /* REVISIT: Should event generation be enabled now? I am assuming so */ if ((cfgset & GPIO_PERIPH_EVENTS) != 0) { @@ -421,7 +421,7 @@ static inline int sam_configperiph(uintptr_t base, uint32_t pin, putreg32(pin, base + SAM_GPIO_EVERS_OFFSET); } - /* Finally, drive the pen from the peripheral */ + /* Finally, drive the pen from the peripheral */ putreg32(pin, base + SAM_GPIO_GPERC_OFFSET); return OK; diff --git a/arch/arm/src/sam34/sam_allocateheap.c b/arch/arm/src/sam34/sam_allocateheap.c index 16a2a3d477..8c40a7d584 100644 --- a/arch/arm/src/sam34/sam_allocateheap.c +++ b/arch/arm/src/sam34/sam_allocateheap.c @@ -303,9 +303,9 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size) #if CONFIG_MM_REGIONS > 1 void up_addregion(void) { - /* The SAM3U also have SRAM1 and NFCSRAM, We will add these as regions - * the first two additional memory regions if we have them. - */ + /* The SAM3U also have SRAM1 and NFCSRAM, We will add these as regions + * the first two additional memory regions if we have them. + */ #ifdef HAVE_SRAM1_REGION /* Allow user access to the heap memory */ diff --git a/arch/arm/src/sam34/sam_gpio.c b/arch/arm/src/sam34/sam_gpio.c index 1dcb4a9811..5d3bad6f26 100644 --- a/arch/arm/src/sam34/sam_gpio.c +++ b/arch/arm/src/sam34/sam_gpio.c @@ -190,7 +190,7 @@ static inline int sam_configinput(uintptr_t base, uint32_t pin, * another, new API... perhaps sam_configfilter() */ - return OK; + return OK; } /**************************************************************************** diff --git a/arch/arm/src/sam34/sam_hsmci.c b/arch/arm/src/sam34/sam_hsmci.c index ba1aa09d9b..12c4625b01 100644 --- a/arch/arm/src/sam34/sam_hsmci.c +++ b/arch/arm/src/sam34/sam_hsmci.c @@ -1539,10 +1539,10 @@ static void sam_clock(FAR struct sdio_dev_s *dev, enum sdio_clock_e rate) regval &= ~(HSMCI_MR_CLKDIV_MASK | HSMCI_MR_PWSDIV_MASK); #endif - /* These clock devisor values that must be defined in the board-specific - * board.h header file: HSMCI_INIT_CLKDIV, HSMCI_MMCXFR_CLKDIV, - * HSMCI_SDXFR_CLKDIV, and HSMCI_SDWIDEXFR_CLKDIV. - */ + /* These clock devisor values that must be defined in the board-specific + * board.h header file: HSMCI_INIT_CLKDIV, HSMCI_MMCXFR_CLKDIV, + * HSMCI_SDXFR_CLKDIV, and HSMCI_SDWIDEXFR_CLKDIV. + */ switch (rate) { @@ -1780,7 +1780,7 @@ static void sam_blocksetup(FAR struct sdio_dev_s *dev, unsigned int blocklen, DEBUGASSERT(dev != NULL && nblocks > 0 && nblocks < 65535 && blocklen < 65535); - /* When TRTYP - Single or Multi, blocklen must be 1-511, 0-512 */ + /* When TRTYP - Single or Multi, blocklen must be 1-511, 0-512 */ DEBUGASSERT(blocklen <= 512); @@ -2082,14 +2082,14 @@ static int sam_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlong struct sam_dev_s *priv = (struct sam_dev_s*)dev; int ret = OK; - /* R2 CID, CSD register (136-bit) - * 135 0 Start bit - * 134 0 Transmission bit (0=from card) - * 133:128 bit5 - bit0 Reserved - * 127:1 bit127 - bit1 127-bit CID or CSD register - * (including internal CRC) - * 0 1 End bit - */ + /* R2 CID, CSD register (136-bit) + * 135 0 Start bit + * 134 0 Transmission bit (0=from card) + * 133:128 bit5 - bit0 Reserved + * 127:1 bit127 - bit1 127-bit CID or CSD register + * (including internal CRC) + * 0 1 End bit + */ #ifdef CONFIG_DEBUG /* Check that R1 is the correct response to this command */ diff --git a/arch/arm/src/sam34/sam_serial.c b/arch/arm/src/sam34/sam_serial.c index c9811419d7..1b2a00e56d 100644 --- a/arch/arm/src/sam34/sam_serial.c +++ b/arch/arm/src/sam34/sam_serial.c @@ -1346,7 +1346,7 @@ static bool up_txready(struct uart_dev_s *dev) { struct up_dev_s *priv = (struct up_dev_s*)dev->priv; return ((up_serialin(priv, SAM_UART_SR_OFFSET) & UART_INT_TXRDY) != 0); - } +} /**************************************************************************** * Name: up_txempty diff --git a/arch/arm/src/sam34/sam_spi.c b/arch/arm/src/sam34/sam_spi.c index 81956f3d51..414ce0c319 100644 --- a/arch/arm/src/sam34/sam_spi.c +++ b/arch/arm/src/sam34/sam_spi.c @@ -938,9 +938,9 @@ static int spi_lock(struct spi_dev_s *dev, bool lock) * ****************************************************************************/ - static void spi_select(struct spi_dev_s *dev, enum spi_dev_e devid, - bool selected) - { +static void spi_select(struct spi_dev_s *dev, enum spi_dev_e devid, + bool selected) +{ struct sam_spics_s *spics = (struct sam_spics_s *)dev; struct sam_spidev_s *spi = spi_device(spics); uint32_t regval; diff --git a/arch/arm/src/sam34/sam_udp.c b/arch/arm/src/sam34/sam_udp.c index 29e66e3cdf..b4728260c6 100644 --- a/arch/arm/src/sam34/sam_udp.c +++ b/arch/arm/src/sam34/sam_udp.c @@ -112,7 +112,7 @@ UDPEP_CSR_STALLSENT | UDPEP_CSR_RXSETUP | \ UDPEP_CSR_TXCOMP) -#define nop() __asm__ __volatile__ ( "nop" ) +#define nop() __asm__ __volatile__ ("nop") /* USB-related masks */ @@ -2351,7 +2351,7 @@ static void sam_csr_setbits(uint8_t epno, uint32_t setbits) * accessing DPR. */ - for (count = 0; count < 15; count++ ) + for (count = 0; count < 15; count++) { nop(); } @@ -2386,7 +2386,7 @@ static void sam_csr_clrbits(uint8_t epno, uint32_t clrbits) * accessing DPR. */ - for (count = 0; count < 15; count++ ) + for (count = 0; count < 15; count++) { nop(); } diff --git a/arch/arm/src/sam34/sam_wdt.c b/arch/arm/src/sam34/sam_wdt.c index f86eae889d..e90e3b2d7d 100644 --- a/arch/arm/src/sam34/sam_wdt.c +++ b/arch/arm/src/sam34/sam_wdt.c @@ -371,7 +371,7 @@ static int sam34_stop(FAR struct watchdog_lowerhalf_s *lower) * the watchdog timer or "petting the dog". * * The application program must write in the WDT_CR register at regular - * intervals during normal operation to prevent an MCU reset. + * intervals during normal operation to prevent an MCU reset. * * Input Parameters: * lower - A pointer the publicly visible representation of the "lower-half" @@ -385,7 +385,7 @@ static int sam34_stop(FAR struct watchdog_lowerhalf_s *lower) static int sam34_keepalive(FAR struct watchdog_lowerhalf_s *lower) { wdvdbg("Entry\n"); - + sam34_putreg((WDT_CR_KEY | WDT_CR_WDRSTT), SAM_WDT_CR); return OK; } @@ -422,7 +422,7 @@ static int sam34_getstatus(FAR struct watchdog_lowerhalf_s *lower, { status->flags |= WDFLAGS_ACTIVE; } - + if (priv->handler) { status->flags |= WDFLAGS_CAPTURE; @@ -480,7 +480,7 @@ static int sam34_settimeout(FAR struct watchdog_lowerhalf_s *lower, return -ERANGE; } - + reload = ((timeout * WDT_FCLK) / 1000) - 1; /* Make sure that the final reload value is within range */ @@ -503,7 +503,7 @@ static int sam34_settimeout(FAR struct watchdog_lowerhalf_s *lower, wdvdbg("fwdt=%d reload=%d timout=%d\n", WDT_FCLK, reload, priv->timeout); - + /* Don't commit to MR register until started! */ return OK; @@ -560,7 +560,7 @@ static xcpt_t sam34_capture(FAR struct watchdog_lowerhalf_s *lower, regval |= WWDG_CFR_EWI; sam34_putreg(regval, SAM_WDT_CFR); - + up_enable_irq(STM32_IRQ_WWDG); } else @@ -619,7 +619,7 @@ static int sam34_ioctl(FAR struct watchdog_lowerhalf_s *lower, int cmd, uint32_t mintime = (uint32_t)arg; ret = -EINVAL; - if (priv->started) + if (priv->started) { ret = -ENOSYS; /* can't write the MR more than once! */ } @@ -632,7 +632,7 @@ static int sam34_ioctl(FAR struct watchdog_lowerhalf_s *lower, int cmd, { uint32_t window = (((priv->timeout - mintime) * WDT_FCLK) / 1000) - 1; DEBUGASSERT(window <= priv->reload); - priv->window = window; + priv->window = window; ret = OK; } } @@ -649,7 +649,7 @@ static int sam34_ioctl(FAR struct watchdog_lowerhalf_s *lower, int cmd, * * Description: * Initialize the WDT watchdog timer. The watchdog timer is initialized and - * registers as 'devpath'. + * registers as 'devpath'. * * Input Parameters: * devpath - The full path to the watchdog. This should be of the form diff --git a/arch/arm/src/sama5/sam_dbgu.c b/arch/arm/src/sama5/sam_dbgu.c index cccad0e0b7..9b56d01871 100644 --- a/arch/arm/src/sama5/sam_dbgu.c +++ b/arch/arm/src/sama5/sam_dbgu.c @@ -547,7 +547,7 @@ static void dbgu_txint(struct uart_dev_s *dev, bool enable) static bool dbgu_txready(struct uart_dev_s *dev) { return ((getreg32(SAM_DBGU_SR) & DBGU_INT_TXRDY) != 0); - } +} /**************************************************************************** * Name: dbgu_txempty diff --git a/arch/arm/src/sama5/sam_emacb.c b/arch/arm/src/sama5/sam_emacb.c index 9e7163d70c..4624bf4936 100644 --- a/arch/arm/src/sama5/sam_emacb.c +++ b/arch/arm/src/sama5/sam_emacb.c @@ -3961,7 +3961,7 @@ static inline void sam_ethgpioconfig(struct sam_emac_s *priv) sam_configpio(PIO_EMAC0_COL); /* Collision Detect */ } } - else + else #endif #if defined(CONFIG_SAMA5_EMAC1) diff --git a/arch/arm/src/sama5/sam_flexcom_serial.c b/arch/arm/src/sama5/sam_flexcom_serial.c index 899d3473d7..14a235ba18 100644 --- a/arch/arm/src/sama5/sam_flexcom_serial.c +++ b/arch/arm/src/sama5/sam_flexcom_serial.c @@ -549,7 +549,7 @@ static void flexus_disableallints(struct flexus_dev_s *priv, uint32_t *imr) * ****************************************************************************/ -static int flexus_interrupt( struct uart_dev_s *dev) +static int flexus_interrupt(struct uart_dev_s *dev) { struct flexus_dev_s *priv; uint32_t pending; @@ -1166,7 +1166,7 @@ static bool flexus_txready(struct uart_dev_s *dev) { struct flexus_dev_s *priv = (struct flexus_dev_s*)dev->priv; return ((flexus_serialin(priv, SAM_FLEXUS_CSR_OFFSET) & FLEXUS_INT_TXRDY) != 0); - } +} /**************************************************************************** * Name: flexus_txempty diff --git a/arch/arm/src/sama5/sam_irq.c b/arch/arm/src/sama5/sam_irq.c index 3c8b032737..0cca64f8eb 100644 --- a/arch/arm/src/sama5/sam_irq.c +++ b/arch/arm/src/sama5/sam_irq.c @@ -590,35 +590,35 @@ static uint32_t *sam_decodeirq(uintptr_t base, uint32_t *regs) uint32_t irqid; uint32_t ivr; - /* Paragraph 17.8.5 Protect Mode: "The Protect Mode permits reading the - * Interrupt Vector Register without performing the associated automatic - * operations. ... Writing PROT in AIC_DCR (Debug Control Register) at 0x1 - * enables the Protect Mode. - * - * "When the Protect Mode is enabled, the AIC performs interrupt stacking - * only when a write access is performed on the AIC_IVR. Therefore, the - * Interrupt Service Routines must write (arbitrary data) to the AIC_IVR - * just after reading it. The new context of the AIC, including the value - * of the Interrupt Status Register (AIC_ISR), is updated with the current - * interrupt only when AIC_IVR is written. ..." - * - * "To summarize, in normal operating mode, the read of AIC_IVR performs the - * following operations within the AIC: - * - * 1. Calculates active interrupt (higher than current or spurious). - * 2. Determines and returns the vector of the active interrupt. - * 3. Memorizes the interrupt. - * 4. Pushes the current priority level onto the internal stack. - * 5. Acknowledges the interrupt. - * - * "However, while the Protect Mode is activated, only operations 1 to 3 are - * performed when AIC_IVR is read. Operations 4 and 5 are only performed by - * the AIC when AIC_IVR is written. - * - * "Software that has been written and debugged using the Protect Mode runs - * correctly in Normal Mode without modification. However, in Normal Mode the - * AIC_IVR write has no effect and can be removed to optimize the code. - */ + /* Paragraph 17.8.5 Protect Mode: "The Protect Mode permits reading the + * Interrupt Vector Register without performing the associated automatic + * operations. ... Writing PROT in AIC_DCR (Debug Control Register) at 0x1 + * enables the Protect Mode. + * + * "When the Protect Mode is enabled, the AIC performs interrupt stacking + * only when a write access is performed on the AIC_IVR. Therefore, the + * Interrupt Service Routines must write (arbitrary data) to the AIC_IVR + * just after reading it. The new context of the AIC, including the value + * of the Interrupt Status Register (AIC_ISR), is updated with the current + * interrupt only when AIC_IVR is written. ..." + * + * "To summarize, in normal operating mode, the read of AIC_IVR performs the + * following operations within the AIC: + * + * 1. Calculates active interrupt (higher than current or spurious). + * 2. Determines and returns the vector of the active interrupt. + * 3. Memorizes the interrupt. + * 4. Pushes the current priority level onto the internal stack. + * 5. Acknowledges the interrupt. + * + * "However, while the Protect Mode is activated, only operations 1 to 3 are + * performed when AIC_IVR is read. Operations 4 and 5 are only performed by + * the AIC when AIC_IVR is written. + * + * "Software that has been written and debugged using the Protect Mode runs + * correctly in Normal Mode without modification. However, in Normal Mode the + * AIC_IVR write has no effect and can be removed to optimize the code. + */ /* Write in the IVR to support Protect Mode */ diff --git a/arch/arm/src/sama5/sam_nand.c b/arch/arm/src/sama5/sam_nand.c index 3cd533852c..1b2a51d741 100644 --- a/arch/arm/src/sama5/sam_nand.c +++ b/arch/arm/src/sama5/sam_nand.c @@ -1024,11 +1024,11 @@ static uint32_t nand_nfc_poll(void) g_nand.cmddone = true; } - /* If set to one, the RBEDGE0 flag indicates that an edge has been detected - * on the Ready/Busy Line x. Depending on the EDGE CTRL field located in the - * SMC_CFG register, only rising or falling edge is detected. This flag is - * reset after the status read. - */ + /* If set to one, the RBEDGE0 flag indicates that an edge has been detected + * on the Ready/Busy Line x. Depending on the EDGE CTRL field located in the + * SMC_CFG register, only rising or falling edge is detected. This flag is + * reset after the status read. + */ if ((sr & HSMC_NFCINT_RBEDGE0) != 0) { @@ -1964,7 +1964,7 @@ static int nand_readpage_noecc(struct sam_nandcs_s *priv, off_t block, /* Configure the SMC */ regval |= (HSMC_CFG_RBEDGE | HSMC_CFG_DTOCYC(15) | HSMC_CFG_DTOMUL_1048576 | - HSMC_CFG_NFCSPARESIZE((sparesize -1 ) >> 2)); + HSMC_CFG_NFCSPARESIZE((sparesize - 1) >> 2)); nand_putreg(SAM_HSMC_CFG, regval); /* Calculate actual address of the page */ diff --git a/arch/arm/src/sama5/sam_ohci.c b/arch/arm/src/sama5/sam_ohci.c index 39db1a99ef..4a9a54cd47 100644 --- a/arch/arm/src/sama5/sam_ohci.c +++ b/arch/arm/src/sama5/sam_ohci.c @@ -3453,7 +3453,7 @@ static void sam_asynch_completion(struct sam_eplist_s *eplist) void *arg; ssize_t nbytes; - DEBUGASSERT(eplist->ed && eplist->tail && eplist->callback != NULL && + DEBUGASSERT(eplist->ed && eplist->tail && eplist->callback != NULL && eplist->buffer != NULL && eplist->buflen > 0); ed = eplist->ed; @@ -3603,7 +3603,7 @@ static int sam_asynch(struct usbhost_driver_s *drvr, usbhost_ep_t ep, sam_givesem(&g_ohci.exclsem); return OK; - + errout: /* Make sure that there is no outstanding request on this endpoint */ diff --git a/arch/arm/src/sama5/sam_pmc.c b/arch/arm/src/sama5/sam_pmc.c index 6f22e806c8..f6c6b555f6 100644 --- a/arch/arm/src/sama5/sam_pmc.c +++ b/arch/arm/src/sama5/sam_pmc.c @@ -126,12 +126,12 @@ uint32_t sam_pllack_frequency(uint32_t mainclk) } #endif - /* Get the PLLA multiplier (MULA) - * - * MULA = 0: PLLA is deactivated - * MULA > 0: The PLLA Clock frequency is the PLLA input frequency - * multiplied by MULA + 1. - */ + /* Get the PLLA multiplier (MULA) + * + * MULA = 0: PLLA is deactivated + * MULA > 0: The PLLA Clock frequency is the PLLA input frequency + * multiplied by MULA + 1. + */ mula = (regval & PMC_CKGR_PLLAR_MUL_MASK) >> PMC_CKGR_PLLAR_MUL_SHIFT; if (mula > 0) diff --git a/arch/arm/src/sama5/sam_serial.c b/arch/arm/src/sama5/sam_serial.c index 5963043d8d..9cf97cf1fa 100644 --- a/arch/arm/src/sama5/sam_serial.c +++ b/arch/arm/src/sama5/sam_serial.c @@ -1657,7 +1657,7 @@ static bool up_txready(struct uart_dev_s *dev) { struct up_dev_s *priv = (struct up_dev_s*)dev->priv; return ((up_serialin(priv, SAM_UART_SR_OFFSET) & UART_INT_TXRDY) != 0); - } +} /**************************************************************************** * Name: up_txempty diff --git a/arch/arm/src/sama5/sam_spi.c b/arch/arm/src/sama5/sam_spi.c index a5e2819a93..0cba1bf66d 100644 --- a/arch/arm/src/sama5/sam_spi.c +++ b/arch/arm/src/sama5/sam_spi.c @@ -928,9 +928,9 @@ static int spi_lock(struct spi_dev_s *dev, bool lock) * ****************************************************************************/ - static void spi_select(struct spi_dev_s *dev, enum spi_dev_e devid, - bool selected) - { +static void spi_select(struct spi_dev_s *dev, enum spi_dev_e devid, + bool selected) +{ struct sam_spics_s *spics = (struct sam_spics_s *)dev; struct sam_spidev_s *spi = spi_device(spics); uint32_t regval; @@ -1313,7 +1313,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, * Get word 1; * Send word 1; Now word 1 is "in flight" * nwords--; - * for ( ; nwords > 0; nwords--) + * for (; nwords > 0; nwords--) * { * Get word N. * Wait for TDRE meaning that word N-1 has moved to the shift @@ -1330,7 +1330,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, * Save the final word. */ - for ( ; nwords > 0; nwords--) + for (; nwords > 0; nwords--) { /* Get the data to send (0xff if there is no data source) */ diff --git a/arch/arm/src/samdl/sam_serial.c b/arch/arm/src/samdl/sam_serial.c index a5c5bccbe4..b21332eb60 100644 --- a/arch/arm/src/samdl/sam_serial.c +++ b/arch/arm/src/samdl/sam_serial.c @@ -562,9 +562,9 @@ static int sam_interrupt(struct uart_dev_s *dev) uint8_t intflag; uint8_t inten; - /* Get the set of pending USART interrupts (we are only interested in the - * unmasked interrupts). - */ + /* Get the set of pending USART interrupts (we are only interested in the + * unmasked interrupts). + */ intflag = sam_serialin8(priv, SAM_USART_INTFLAG_OFFSET); inten = sam_serialin8(priv, SAM_USART_INTENCLR_OFFSET); diff --git a/arch/arm/src/samdl/sam_spi.c b/arch/arm/src/samdl/sam_spi.c index e90d5782b5..8851da74a7 100644 --- a/arch/arm/src/samdl/sam_spi.c +++ b/arch/arm/src/samdl/sam_spi.c @@ -804,9 +804,9 @@ static int spi_interrupt(struct sam_spidev_s *dev) uint8_t intflag; uint8_t inten; - /* Get the set of pending SPI interrupts (we are only interested in the - * unmasked interrupts). - */ + /* Get the set of pending SPI interrupts (we are only interested in the + * unmasked interrupts). + */ intflag = sam_getreg8(priv, SAM_SPI_INTFLAG_OFFSET); inten = sam_getreg8(priv, SAM_SPI_INTENCLR_OFFSET); @@ -1263,7 +1263,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, * Get word 1; * Send word 1; Now word 1 is "in flight" * nwords--; - * for ( ; nwords > 0; nwords--) + * for (; nwords > 0; nwords--) * { * Get word N. * Wait for DRE:: meaning that word N-1 has moved to the shift @@ -1280,7 +1280,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, * Save the final word. */ - for ( ; nwords > 0; nwords--) + for (; nwords > 0; nwords--) { /* Get the data to send (0xff if there is no data source) */ diff --git a/arch/arm/src/samv7/sam_gpio.c b/arch/arm/src/samv7/sam_gpio.c index f5b6ed8776..dc352b2e5c 100644 --- a/arch/arm/src/samv7/sam_gpio.c +++ b/arch/arm/src/samv7/sam_gpio.c @@ -69,7 +69,7 @@ #ifdef CONFIG_DEBUG_GPIO static const char g_portchar[SAMV7_NPIO] = { - 'A' + 'A' #if SAMV7_NPIO > 1 , 'B' #endif @@ -91,7 +91,7 @@ static const char g_portchar[SAMV7_NPIO] = const uintptr_t g_portbase[SAMV7_NPIO] = { - SAM_PIOA_BASE + SAM_PIOA_BASE #if SAMV7_NPIO > 1 , SAM_PIOB_BASE #endif @@ -197,7 +197,7 @@ static inline int sam_configinput(uintptr_t base, uint32_t pin, * another, new API... perhaps sam_configfilter() */ - return OK; + return OK; } /**************************************************************************** diff --git a/arch/arm/src/samv7/sam_hsmci.c b/arch/arm/src/samv7/sam_hsmci.c index ef2cc348c1..713fc1c70b 100644 --- a/arch/arm/src/samv7/sam_hsmci.c +++ b/arch/arm/src/samv7/sam_hsmci.c @@ -162,9 +162,9 @@ */ #define HSMCI_STATUS_ERRORS \ - ( HSMCI_INT_UNRE | HSMCI_INT_OVRE | HSMCI_INT_BLKOVRE | HSMCI_INT_CSTOE | \ - HSMCI_INT_DTOE | HSMCI_INT_DCRCE | HSMCI_INT_RTOE | HSMCI_INT_RENDE | \ - HSMCI_INT_RCRCE | HSMCI_INT_RDIRE | HSMCI_INT_RINDE ) + (HSMCI_INT_UNRE | HSMCI_INT_OVRE | HSMCI_INT_BLKOVRE | HSMCI_INT_CSTOE | \ + HSMCI_INT_DTOE | HSMCI_INT_DCRCE | HSMCI_INT_RTOE | HSMCI_INT_RENDE | \ + HSMCI_INT_RCRCE | HSMCI_INT_RDIRE | HSMCI_INT_RINDE) /* Response errors: * @@ -177,13 +177,13 @@ */ #define HSMCI_RESPONSE_ERRORS \ - ( HSMCI_INT_CSTOE | HSMCI_INT_RTOE | HSMCI_INT_RENDE | HSMCI_INT_RCRCE | \ - HSMCI_INT_RDIRE | HSMCI_INT_RINDE ) + (HSMCI_INT_CSTOE | HSMCI_INT_RTOE | HSMCI_INT_RENDE | HSMCI_INT_RCRCE | \ + HSMCI_INT_RDIRE | HSMCI_INT_RINDE) #define HSMCI_RESPONSE_NOCRC_ERRORS \ - ( HSMCI_INT_CSTOE | HSMCI_INT_RTOE | HSMCI_INT_RENDE | HSMCI_INT_RDIRE | \ - HSMCI_INT_RINDE ) + (HSMCI_INT_CSTOE | HSMCI_INT_RTOE | HSMCI_INT_RENDE | HSMCI_INT_RDIRE | \ + HSMCI_INT_RINDE) #define HSMCI_RESPONSE_TIMEOUT_ERRORS \ - ( HSMCI_INT_CSTOE | HSMCI_INT_RTOE ) + (HSMCI_INT_CSTOE | HSMCI_INT_RTOE) /* Data transfer errors: * @@ -196,18 +196,18 @@ */ #define HSMCI_DATA_ERRORS \ - ( HSMCI_INT_UNRE | HSMCI_INT_OVRE | HSMCI_INT_BLKOVRE | HSMCI_INT_CSTOE | \ - HSMCI_INT_DTOE | HSMCI_INT_DCRCE ) + (HSMCI_INT_UNRE | HSMCI_INT_OVRE | HSMCI_INT_BLKOVRE | HSMCI_INT_CSTOE | \ + HSMCI_INT_DTOE | HSMCI_INT_DCRCE) #define HSMCI_DATA_TIMEOUT_ERRORS \ - ( HSMCI_INT_CSTOE | HSMCI_INT_DTOE ) + (HSMCI_INT_CSTOE | HSMCI_INT_DTOE) #define HSMCI_DATA_RECV_ERRORS \ - ( HSMCI_INT_OVRE | HSMCI_INT_BLKOVRE | HSMCI_INT_CSTOE | HSMCI_INT_DTOE | \ - HSMCI_INT_DCRCE ) + (HSMCI_INT_OVRE | HSMCI_INT_BLKOVRE | HSMCI_INT_CSTOE | HSMCI_INT_DTOE | \ + HSMCI_INT_DCRCE) #define HSMCI_DATA_DMASEND_ERRORS \ - ( HSMCI_INT_UNRE | HSMCI_INT_CSTOE | HSMCI_INT_DTOE | HSMCI_INT_DCRCE ) + (HSMCI_INT_UNRE | HSMCI_INT_CSTOE | HSMCI_INT_DTOE | HSMCI_INT_DCRCE) /* Data transfer status and interrupt mask bits. * @@ -224,11 +224,11 @@ */ #define HSMCI_RECV_INTS \ - ( HSMCI_DATA_RECV_ERRORS | HSMCI_INT_RXRDY) + (HSMCI_DATA_RECV_ERRORS | HSMCI_INT_RXRDY) #define HSMCI_DMARECV_INTS \ - ( HSMCI_DATA_RECV_ERRORS | HSMCI_INT_XFRDONE /* | HSMCI_INT_DMADONE */ ) + (HSMCI_DATA_RECV_ERRORS | HSMCI_INT_XFRDONE /* | HSMCI_INT_DMADONE */) #define HSMCI_DMASEND_INTS \ - ( HSMCI_DATA_DMASEND_ERRORS | HSMCI_INT_XFRDONE /* | HSMCI_INT_DMADONE */ ) + (HSMCI_DATA_DMASEND_ERRORS | HSMCI_INT_XFRDONE /* | HSMCI_INT_DMADONE */) /* Event waiting interrupt mask bits. * @@ -240,9 +240,9 @@ */ #define HSMCI_CMDRESP_INTS \ - ( HSMCI_RESPONSE_ERRORS | HSMCI_INT_CMDRDY ) + (HSMCI_RESPONSE_ERRORS | HSMCI_INT_CMDRDY) #define HSMCI_CMDRESP_NOCRC_INTS \ - ( HSMCI_RESPONSE_NOCRC_ERRORS | HSMCI_INT_CMDRDY ) + (HSMCI_RESPONSE_NOCRC_ERRORS | HSMCI_INT_CMDRDY) /* Register logging support */ @@ -1773,10 +1773,10 @@ static void sam_clock(FAR struct sdio_dev_s *dev, enum sdio_clock_e rate) regval = sam_getreg(priv, SAM_HSMCI_MR_OFFSET); regval &= ~(HSMCI_MR_CLKDIV_MASK | HSMCI_MR_PWSDIV_MASK | HSMCI_MR_CLKODD); - /* These clock devisor values that must be defined in the board-specific - * board.h header file: HSMCI_INIT_CLKDIV, HSMCI_MMCXFR_CLKDIV, - * HSMCI_SDXFR_CLKDIV, and HSMCI_SDWIDEXFR_CLKDIV. - */ + /* These clock devisor values that must be defined in the board-specific + * board.h header file: HSMCI_INIT_CLKDIV, HSMCI_MMCXFR_CLKDIV, + * HSMCI_SDXFR_CLKDIV, and HSMCI_SDWIDEXFR_CLKDIV. + */ switch (rate) { @@ -2455,14 +2455,14 @@ static int sam_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlong struct sam_dev_s *priv = (struct sam_dev_s*)dev; int ret = OK; - /* R2 CID, CSD register (136-bit) - * 135 0 Start bit - * 134 0 Transmission bit (0=from card) - * 133:128 bit5 - bit0 Reserved - * 127:1 bit127 - bit1 127-bit CID or CSD register - * (including internal CRC) - * 0 1 End bit - */ + /* R2 CID, CSD register (136-bit) + * 135 0 Start bit + * 134 0 Transmission bit (0=from card) + * 133:128 bit5 - bit0 Reserved + * 127:1 bit127 - bit1 127-bit CID or CSD register + * (including internal CRC) + * 0 1 End bit + */ #ifdef CONFIG_DEBUG /* Check that R1 is the correct response to this command */ diff --git a/arch/arm/src/samv7/sam_qspi.c b/arch/arm/src/samv7/sam_qspi.c index e8baf56184..ff57917a68 100644 --- a/arch/arm/src/samv7/sam_qspi.c +++ b/arch/arm/src/samv7/sam_qspi.c @@ -987,8 +987,8 @@ static int qspi_memory_dma(struct sam_qspidev_s *priv, static int qspi_memory_nodma(struct sam_qspidev_s *priv, struct qspi_meminfo_s *meminfo) { - uintptr_t qspimem = SAM_QSPIMEM_BASE + meminfo->addr; - size_t buflen; + uintptr_t qspimem = SAM_QSPIMEM_BASE + meminfo->addr; + size_t buflen; /* Get the length as an even multiple of 32-bit words. */ diff --git a/arch/arm/src/samv7/sam_serial.c b/arch/arm/src/samv7/sam_serial.c index 1ffa8539bc..6f542a97e7 100644 --- a/arch/arm/src/samv7/sam_serial.c +++ b/arch/arm/src/samv7/sam_serial.c @@ -1447,7 +1447,7 @@ static bool sam_txready(struct uart_dev_s *dev) { struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; return ((sam_serialin(priv, SAM_UART_SR_OFFSET) & UART_INT_TXRDY) != 0); - } +} /**************************************************************************** * Name: sam_txempty diff --git a/arch/arm/src/samv7/sam_spi.c b/arch/arm/src/samv7/sam_spi.c index 204e009e26..78e1c47522 100644 --- a/arch/arm/src/samv7/sam_spi.c +++ b/arch/arm/src/samv7/sam_spi.c @@ -923,9 +923,9 @@ static int spi_lock(struct spi_dev_s *dev, bool lock) * ****************************************************************************/ - static void spi_select(struct spi_dev_s *dev, enum spi_dev_e devid, - bool selected) - { +static void spi_select(struct spi_dev_s *dev, enum spi_dev_e devid, + bool selected) +{ struct sam_spics_s *spics = (struct sam_spics_s *)dev; struct sam_spidev_s *spi = spi_device(spics); uint32_t regval; diff --git a/arch/arm/src/samv7/sam_timerisr.c b/arch/arm/src/samv7/sam_timerisr.c index 925292fdc0..4bf1d95c7a 100644 --- a/arch/arm/src/samv7/sam_timerisr.c +++ b/arch/arm/src/samv7/sam_timerisr.c @@ -56,7 +56,7 @@ * Pre-processor Definitions ****************************************************************************/ - /* Select MCU-specific settings +/* Select MCU-specific settings * * The SysTick timer is driven by the output of the Mast Clock Controller * prescaler output (i.e., the MDIV output divider is not applied so that diff --git a/arch/arm/src/stm32/stm32_bbsram.c b/arch/arm/src/stm32/stm32_bbsram.c index 80fc2c8eac..78fe485e0d 100644 --- a/arch/arm/src/stm32/stm32_bbsram.c +++ b/arch/arm/src/stm32/stm32_bbsram.c @@ -499,14 +499,14 @@ static ssize_t stm32_bbsram_internal_write(FAR struct bbsramfh_s *bbf, static ssize_t stm32_bbsram_write(FAR struct file *filep, FAR const char *buffer, size_t len) { - FAR struct inode *inode = filep->f_inode; - FAR struct stm32_bbsram_s *bbr; - int ret = -EFBIG; + FAR struct inode *inode = filep->f_inode; + FAR struct stm32_bbsram_s *bbr; + int ret = -EFBIG; - DEBUGASSERT(inode && inode->i_private); - bbr = (FAR struct stm32_bbsram_s *)inode->i_private; + DEBUGASSERT(inode && inode->i_private); + bbr = (FAR struct stm32_bbsram_s *)inode->i_private; - /* Forbid writes past the end of the device */ + /* Forbid writes past the end of the device */ if (filep->f_pos < bbr->bbf->len) { @@ -529,8 +529,8 @@ static ssize_t stm32_bbsram_write(FAR struct file *filep, FAR const char *buffer stm32_bbsram_semgive(bbr); } - BBSRAM_DEBUG_READ(); - return ret; + BBSRAM_DEBUG_READ(); + return ret; } /**************************************************************************** diff --git a/arch/arm/src/stm32/stm32_can.c b/arch/arm/src/stm32/stm32_can.c index fd174ffaff..57eb65b0e3 100644 --- a/arch/arm/src/stm32/stm32_can.c +++ b/arch/arm/src/stm32/stm32_can.c @@ -1362,7 +1362,7 @@ static int can_bittiming(struct stm32_can_s *priv) canllvdbg("TS1: %d TS2: %d BRP: %d\n", ts1, ts2, brp); - /* Configure bit timing. This also does the following, less obvious + /* Configure bit timing. This also does the following, less obvious * things. Unless loopback mode is enabled, it: * * - Disables silent mode. @@ -1563,13 +1563,13 @@ static int can_filterinit(struct stm32_can_s *priv) can_putfreg(priv, STM32_CAN_FIR_OFFSET(priv->filter, 1), 0); can_putfreg(priv, STM32_CAN_FIR_OFFSET(priv->filter, 2), 0); - /* Set Id/Mask mode for the filter */ + /* Set Id/Mask mode for the filter */ regval = can_getfreg(priv, STM32_CAN_FM1R_OFFSET); regval &= ~bitmask; can_putfreg(priv, STM32_CAN_FM1R_OFFSET, regval); - /* Assign FIFO 0 for the filter */ + /* Assign FIFO 0 for the filter */ regval = can_getfreg(priv, STM32_CAN_FFA1R_OFFSET); regval &= ~bitmask; diff --git a/arch/arm/src/stm32/stm32_dac.c b/arch/arm/src/stm32/stm32_dac.c index c416ed9cf4..dfbb5239ee 100644 --- a/arch/arm/src/stm32/stm32_dac.c +++ b/arch/arm/src/stm32/stm32_dac.c @@ -845,7 +845,7 @@ static int dac_timinit(struct stm32_chan_s *chan) /* Enable the timer. */ - modifyreg32(regaddr, 0, setbits); + modifyreg32(regaddr, 0, setbits); /* Calculate the pre-scaler value */ diff --git a/arch/arm/src/stm32/stm32_exti_alarm.c b/arch/arm/src/stm32/stm32_exti_alarm.c index 07db26fd40..f38574f252 100644 --- a/arch/arm/src/stm32/stm32_exti_alarm.c +++ b/arch/arm/src/stm32/stm32_exti_alarm.c @@ -69,7 +69,7 @@ static xcpt_t stm32_exti_callback; * Public Data ****************************************************************************/ - /**************************************************************************** +/**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/arch/arm/src/stm32/stm32_exti_gpio.c b/arch/arm/src/stm32/stm32_exti_gpio.c index cee93c6924..6aa2cf4be2 100644 --- a/arch/arm/src/stm32/stm32_exti_gpio.c +++ b/arch/arm/src/stm32/stm32_exti_gpio.c @@ -63,7 +63,7 @@ static xcpt_t stm32_exti_callbacks[16]; - /**************************************************************************** +/**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/arch/arm/src/stm32/stm32_exti_pwr.c b/arch/arm/src/stm32/stm32_exti_pwr.c index f326f78fe2..f57e85e6ca 100644 --- a/arch/arm/src/stm32/stm32_exti_pwr.c +++ b/arch/arm/src/stm32/stm32_exti_pwr.c @@ -71,7 +71,7 @@ static xcpt_t stm32_exti_pvd_callback; * Public Data ****************************************************************************/ - /**************************************************************************** +/**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/arch/arm/src/stm32/stm32_sdio.c b/arch/arm/src/stm32/stm32_sdio.c index eb4ca0e0cb..83e02dad7f 100644 --- a/arch/arm/src/stm32/stm32_sdio.c +++ b/arch/arm/src/stm32/stm32_sdio.c @@ -2147,14 +2147,14 @@ static int stm32_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlo uint32_t regval; int ret = OK; - /* R2 CID, CSD register (136-bit) - * 135 0 Start bit - * 134 0 Transmission bit (0=from card) - * 133:128 bit5 - bit0 Reserved - * 127:1 bit127 - bit1 127-bit CID or CSD register - * (including internal CRC) - * 0 1 End bit - */ + /* R2 CID, CSD register (136-bit) + * 135 0 Start bit + * 134 0 Transmission bit (0=from card) + * 133:128 bit5 - bit0 Reserved + * 127:1 bit127 - bit1 127-bit CID or CSD register + * (including internal CRC) + * 0 1 End bit + */ #ifdef CONFIG_DEBUG /* Check that R1 is the correct response to this command */ diff --git a/arch/arm/src/stm32f7/stm32_exti_alarm.c b/arch/arm/src/stm32f7/stm32_exti_alarm.c index ee654c9eb2..ff53915178 100644 --- a/arch/arm/src/stm32f7/stm32_exti_alarm.c +++ b/arch/arm/src/stm32f7/stm32_exti_alarm.c @@ -73,7 +73,7 @@ static xcpt_t stm32_exti_callback; * Public Data ****************************************************************************/ - /**************************************************************************** +/**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/arch/arm/src/stm32f7/stm32_exti_pwr.c b/arch/arm/src/stm32f7/stm32_exti_pwr.c index 4c04c3b2fe..104dbff010 100644 --- a/arch/arm/src/stm32f7/stm32_exti_pwr.c +++ b/arch/arm/src/stm32f7/stm32_exti_pwr.c @@ -76,7 +76,7 @@ static xcpt_t stm32_exti_pvd_callback; * Public Data ****************************************************************************/ - /**************************************************************************** +/**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/arch/arm/src/str71x/str71x_timerisr.c b/arch/arm/src/str71x/str71x_timerisr.c index a255389774..335014d1dc 100644 --- a/arch/arm/src/str71x/str71x_timerisr.c +++ b/arch/arm/src/str71x/str71x_timerisr.c @@ -75,19 +75,19 @@ #define MAX_OCAR 65535 - /* In this case, the desired, maximum clocking would be MAX_TIM0CLK. For - * example if CLK_TCK is the default of 100Hz, then the ideal clocking for - * timer0 would be 6,553,500 */ +/* In this case, the desired, maximum clocking would be MAX_TIM0CLK. For + * example if CLK_TCK is the default of 100Hz, then the ideal clocking for + * timer0 would be 6,553,500 */ #define MAX_TIM0CLK (MAX_OCAR * CLK_TCK) - /* The best divider then would be the one that reduces PCLK2 to MAX_TIM0CLK. - * Note that the following calculation forces an integer divisor to the next - * integer above the optimal. So, for example, if MAX_TIM0CLK is 6,553,500 - * and PCLK2 is 32MHz, then ideal PCLK2_DIVIDER would be 4.88 but 5 is used - * instead. The value 5 would give an actual TIM0CLK of 6,400,000, less - * than the maximum. - */ +/* The best divider then would be the one that reduces PCLK2 to MAX_TIM0CLK. + * Note that the following calculation forces an integer divisor to the next + * integer above the optimal. So, for example, if MAX_TIM0CLK is 6,553,500 + * and PCLK2 is 32MHz, then ideal PCLK2_DIVIDER would be 4.88 but 5 is used + * instead. The value 5 would give an actual TIM0CLK of 6,400,000, less + * than the maximum. + */ #if STR71X_PCLK2 > MAX_TIM0CLK # define PCLK2_DIVIDER (((STR71X_PCLK2) + (MAX_TIM0CLK+1)) / MAX_TIM0CLK) @@ -99,10 +99,10 @@ # error "PCLK2 is too fast for any divisor" #endif - /* Then we can get the actual OCAR value from the selected divider value. - * For example, if PCLK2 is 32MHz and PCLK2_DIVIDER is 5, then the actual - * TIM0CLK would 6,4000,000 and the final OCAR_VALUE would be 64,000. - */ +/* Then we can get the actual OCAR value from the selected divider value. + * For example, if PCLK2 is 32MHz and PCLK2_DIVIDER is 5, then the actual + * TIM0CLK would 6,4000,000 and the final OCAR_VALUE would be 64,000. + */ #define ACTUAL_TIM0CLK (STR71X_PCLK2 / PCLK2_DIVIDER) #define OCAR_VALUE (ACTUAL_TIM0CLK / CLK_TCK) @@ -175,14 +175,14 @@ void up_timer_initialize(void) putreg16(0x0000, STR71X_TIMER0_CR2); putreg16(0x0000, STR71X_TIMER0_SR); - /* Configure TIM0 so that it is clocked by the internal APB2 frequency (PCLK2) - * divided by the above prescaler value (1) -- versus an external Clock. - * -- Nothing to do because STR71X_TIMERCR1_ECKEN is already cleared. - * - * Select a divisor to reduce the frequency of clocking. This must be - * done so that the entire timer interval can fit in the 16-bit OCAR register. - * (see the discussion above). - */ + /* Configure TIM0 so that it is clocked by the internal APB2 frequency (PCLK2) + * divided by the above prescaler value (1) -- versus an external Clock. + * -- Nothing to do because STR71X_TIMERCR1_ECKEN is already cleared. + * + * Select a divisor to reduce the frequency of clocking. This must be + * done so that the entire timer interval can fit in the 16-bit OCAR register. + * (see the discussion above). + */ putreg16(STR71X_TIMERCR2_OCAIE | (PCLK2_DIVIDER - 1), STR71X_TIMER0_CR2); diff --git a/arch/avr/src/at90usb/at90usb_usbdev.c b/arch/avr/src/at90usb/at90usb_usbdev.c index 336ec0751e..49dc0b0e3a 100644 --- a/arch/avr/src/at90usb/at90usb_usbdev.c +++ b/arch/avr/src/at90usb/at90usb_usbdev.c @@ -2958,7 +2958,7 @@ int usbdev_unregister(struct usbdevclass_driver_s *driver) ****************************************************************************/ #ifdef CONFIG_USB_NOISYVBUS - void avr_pollvbus(void) +void avr_pollvbus(void) { irqstate_t flags; diff --git a/arch/hc/src/m9s12/m9s12_dumpgpio.c b/arch/hc/src/m9s12/m9s12_dumpgpio.c index ab604a6fa1..57a577ccb4 100644 --- a/arch/hc/src/m9s12/m9s12_dumpgpio.c +++ b/arch/hc/src/m9s12/m9s12_dumpgpio.c @@ -128,12 +128,12 @@ struct gpio_mebiinfo_s static const struct gpio_piminfo_s piminfo[HCS12_PIM_NPORTS] = { - {HCS12_PIM_PORTT_BASE, 'T', PIMPORT_FORM1}, /* Port T */ - {HCS12_PIM_PORTS_BASE, 'S', PIMPORT_FORM2}, /* Port S */ - {HCS12_PIM_PORTG_BASE, 'G', PIMPORT_FORM3}, /* Port G */ - {HCS12_PIM_PORTH_BASE, 'H', PIMPORT_FORM3}, /* Port H */ - {HCS12_PIM_PORTJ_BASE, 'J', PIMPORT_FORM3}, /* Port J */ - {HCS12_PIM_PORTL_BASE, 'L', PIMPORT_FORM2} /* Port L */ + {HCS12_PIM_PORTT_BASE, 'T', PIMPORT_FORM1}, /* Port T */ + {HCS12_PIM_PORTS_BASE, 'S', PIMPORT_FORM2}, /* Port S */ + {HCS12_PIM_PORTG_BASE, 'G', PIMPORT_FORM3}, /* Port G */ + {HCS12_PIM_PORTH_BASE, 'H', PIMPORT_FORM3}, /* Port H */ + {HCS12_PIM_PORTJ_BASE, 'J', PIMPORT_FORM3}, /* Port J */ + {HCS12_PIM_PORTL_BASE, 'L', PIMPORT_FORM2} /* Port L */ }; static const struct gpio_mebiinfo_s mebiinfo[HCS12_MEBI_NPORTS] = diff --git a/arch/mips/src/mips32/up_vfork.c b/arch/mips/src/mips32/up_vfork.c index f31b7081da..f1b5c2a8fe 100644 --- a/arch/mips/src/mips32/up_vfork.c +++ b/arch/mips/src/mips32/up_vfork.c @@ -222,12 +222,12 @@ pid_t up_vfork(const struct vfork_s *context) child->cmn.adj_stack_ptr, newsp); #endif - /* Update the stack pointer, frame pointer, global pointer and saved - * registers. When the child TCB was initialized, all of the values - * were set to zero. up_initial_state() altered a few values, but the - * return value in v0 should be cleared to zero, providing the - * indication to the newly started child thread. - */ + /* Update the stack pointer, frame pointer, global pointer and saved + * registers. When the child TCB was initialized, all of the values + * were set to zero. up_initial_state() altered a few values, but the + * return value in v0 should be cleared to zero, providing the + * indication to the newly started child thread. + */ child->cmn.xcp.regs[REG_S0] = context->s0; /* Saved register s0 */ child->cmn.xcp.regs[REG_S1] = context->s1; /* Saved register s1 */ diff --git a/arch/mips/src/pic32mx/pic32mx-ethernet.c b/arch/mips/src/pic32mx/pic32mx-ethernet.c index 6da8b8e766..4ba2baef78 100644 --- a/arch/mips/src/pic32mx/pic32mx-ethernet.c +++ b/arch/mips/src/pic32mx/pic32mx-ethernet.c @@ -2752,10 +2752,10 @@ static inline int pic32mx_phyinit(struct pic32mx_driver_s *priv) */ #ifdef CONFIG_ETH0_PHY_DP83848C - /* The RMII/MII of operation can be selected by strap options or register - * control (using the RBR register). For RMII mode, it is required to use the - * strap option, since it requires a 50 MHz clock instead of the normal 25 MHz. - */ + /* The RMII/MII of operation can be selected by strap options or register + * control (using the RBR register). For RMII mode, it is required to use the + * strap option, since it requires a 50 MHz clock instead of the normal 25 MHz. + */ #endif #else diff --git a/arch/mips/src/pic32mx/pic32mx-spi.c b/arch/mips/src/pic32mx/pic32mx-spi.c index 5ae76f2d8b..cf8f7d0b38 100644 --- a/arch/mips/src/pic32mx/pic32mx-spi.c +++ b/arch/mips/src/pic32mx/pic32mx-spi.c @@ -746,18 +746,19 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) * receive buffer is not empty. */ - while ((spi_getreg(priv, PIC32MX_SPI_STAT_OFFSET) & SPI_STAT_SPIRBE) != 0); + while ((spi_getreg(priv, PIC32MX_SPI_STAT_OFFSET) & SPI_STAT_SPIRBE) != 0); + #else /* Wait for the SPIRBF bit in the SPI Status Register to be set to 1. In * normal mode, the SPIRBF bit will be set when receive data is available. */ - while ((spi_getreg(priv, PIC32MX_SPI_STAT_OFFSET) & SPI_STAT_SPIRBF) == 0); + while ((spi_getreg(priv, PIC32MX_SPI_STAT_OFFSET) & SPI_STAT_SPIRBF) == 0); #endif - /* Return the SPI data */ + /* Return the SPI data */ - return (uint16_t)spi_getreg(priv, PIC32MX_SPI_BUF_OFFSET); + return (uint16_t)spi_getreg(priv, PIC32MX_SPI_BUF_OFFSET); } /**************************************************************************** diff --git a/arch/mips/src/pic32mz/pic32mz-ethernet.c b/arch/mips/src/pic32mz/pic32mz-ethernet.c index 743cedf18a..c6942d7176 100644 --- a/arch/mips/src/pic32mz/pic32mz-ethernet.c +++ b/arch/mips/src/pic32mz/pic32mz-ethernet.c @@ -2776,10 +2776,10 @@ static inline int pic32mz_phyinit(struct pic32mz_driver_s *priv) */ #ifdef CONFIG_ETH0_PHY_DP83848C - /* The RMII/MII of operation can be selected by strap options or register - * control (using the RBR register). For RMII mode, it is required to use the - * strap option, since it requires a 50 MHz clock instead of the normal 25 MHz. - */ + /* The RMII/MII of operation can be selected by strap options or register + * control (using the RBR register). For RMII mode, it is required to use the + * strap option, since it requires a 50 MHz clock instead of the normal 25 MHz. + */ #endif #else diff --git a/arch/rgmp/src/x86/com.c b/arch/rgmp/src/x86/com.c index 28c5bc517b..7094320c47 100644 --- a/arch/rgmp/src/x86/com.c +++ b/arch/rgmp/src/x86/com.c @@ -171,40 +171,44 @@ static struct uart_ops_s g_com_ops = static uart_dev_t *up_alloc_com(unsigned int base, int irq) { - uart_dev_t *dev; - struct up_dev_s *priv; + uart_dev_t *dev; + struct up_dev_s *priv; - priv = kmm_zalloc(sizeof(struct up_dev_s)); - if (priv == NULL) - goto err0; + priv = kmm_zalloc(sizeof(struct up_dev_s)); + if (priv == NULL) + { + goto err0; + } - dev = kmm_zalloc(sizeof(uart_dev_t)); - if (dev == NULL) - goto err1; + dev = kmm_zalloc(sizeof(uart_dev_t)); + if (dev == NULL) + { + goto err1; + } - priv->base = base; - priv->irq = irq; - priv->baud = 115200; - priv->lcr.val = 0; - priv->lcr.sep.parity = 0; - priv->lcr.sep.bits = 3; - priv->lcr.sep.stopbits = 0; - priv->action.handler = up_com_int_handler; - priv->action.dev_id = dev; + priv->base = base; + priv->irq = irq; + priv->baud = 115200; + priv->lcr.val = 0; + priv->lcr.sep.parity = 0; + priv->lcr.sep.bits = 3; + priv->lcr.sep.stopbits = 0; + priv->action.handler = up_com_int_handler; + priv->action.dev_id = dev; - dev->recv.size = CONFIG_COM_RXBUFSIZE; - dev->recv.buffer = priv->rxbuff; - dev->xmit.size = CONFIG_COM_TXBUFSIZE; - dev->xmit.buffer = priv->txbuff; - dev->ops = &g_com_ops; - dev->priv = priv; + dev->recv.size = CONFIG_COM_RXBUFSIZE; + dev->recv.buffer = priv->rxbuff; + dev->xmit.size = CONFIG_COM_TXBUFSIZE; + dev->xmit.buffer = priv->txbuff; + dev->ops = &g_com_ops; + dev->priv = priv; - return dev; + return dev; - err1: - kmm_free(priv); - err0: - return NULL; +err1: + kmm_free(priv); +err0: + return NULL; } /**************************************************************************** diff --git a/arch/sim/src/up_netdriver.c b/arch/sim/src/up_netdriver.c index 43368f3fe6..304fb81859 100644 --- a/arch/sim/src/up_netdriver.c +++ b/arch/sim/src/up_netdriver.c @@ -99,7 +99,7 @@ static void timer_set(struct timer *t, unsigned int interval) t->start = up_getwalltime(); } -static bool timer_expired( struct timer *t ) +static bool timer_expired(struct timer *t) { return (up_getwalltime() - t->start) >= t->interval; } @@ -166,7 +166,7 @@ static int sim_txpoll(struct net_driver_s *dev) void netdriver_loop(void) { - struct eth_hdr_s *eth; + struct eth_hdr_s *eth; /* netdev_read will return 0 on a timeout event and >0 on a data received event */ diff --git a/arch/x86/src/qemu/qemu_lowputc.c b/arch/x86/src/qemu/qemu_lowputc.c index d4b01b2010..5f8ad49a07 100644 --- a/arch/x86/src/qemu/qemu_lowputc.c +++ b/arch/x86/src/qemu/qemu_lowputc.c @@ -45,7 +45,7 @@ * Pre-processor Definitions ****************************************************************************/ - /* COM1 port addresses */ +/* COM1 port addresses */ #define COM1_PORT 0x3f8 /* COM1: I/O port 0x3f8, IRQ 4 */ #define COM2_PORT 0x2f8 /* COM2: I/O port 0x2f8, IRQ 3 */ diff --git a/arch/z80/src/ez80/ez80_timerisr.c b/arch/z80/src/ez80/ez80_timerisr.c index 109fff7913..26a4fae447 100644 --- a/arch/z80/src/ez80/ez80_timerisr.c +++ b/arch/z80/src/ez80/ez80_timerisr.c @@ -90,7 +90,7 @@ int up_timerisr(int irq, chipreg_t *regs) sched_process_timer(); - /* Architecture specific hook into the timer interrupt handler */ + /* Architecture specific hook into the timer interrupt handler */ #ifdef CONFIG_ARCH_TIMERHOOK up_timerhook(); From aaa697ec8316afe7f2285efe6d14aaa3906d7cbb Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 4 Oct 2015 15:26:51 -0600 Subject: [PATCH 16/33] Remove dangling whitespace --- arch/arm/src/sama5/sam_hsmci.c | 38 ++++++++++++------------ arch/arm/src/samv7/sam_clockconfig.c | 2 +- arch/arm/src/stm32/stm32_procfs_ccm.c | 2 +- arch/arm/src/stm32f7/stm32_procfs_dtcm.c | 2 +- arch/sim/src/up_spiflash.c | 8 ++--- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/arch/arm/src/sama5/sam_hsmci.c b/arch/arm/src/sama5/sam_hsmci.c index 18d77d25a8..c82a9a77cf 100644 --- a/arch/arm/src/sama5/sam_hsmci.c +++ b/arch/arm/src/sama5/sam_hsmci.c @@ -229,9 +229,9 @@ */ #define HSMCI_STATUS_ERRORS \ - ( HSMCI_INT_UNRE | HSMCI_INT_OVRE | HSMCI_INT_BLKOVRE | HSMCI_INT_CSTOE | \ - HSMCI_INT_DTOE | HSMCI_INT_DCRCE | HSMCI_INT_RTOE | HSMCI_INT_RENDE | \ - HSMCI_INT_RCRCE | HSMCI_INT_RDIRE | HSMCI_INT_RINDE ) + (HSMCI_INT_UNRE | HSMCI_INT_OVRE | HSMCI_INT_BLKOVRE | HSMCI_INT_CSTOE | \ + HSMCI_INT_DTOE | HSMCI_INT_DCRCE | HSMCI_INT_RTOE | HSMCI_INT_RENDE | \ + HSMCI_INT_RCRCE | HSMCI_INT_RDIRE | HSMCI_INT_RINDE) /* Response errors: * @@ -244,13 +244,13 @@ */ #define HSMCI_RESPONSE_ERRORS \ - ( HSMCI_INT_CSTOE | HSMCI_INT_RTOE | HSMCI_INT_RENDE | HSMCI_INT_RCRCE | \ - HSMCI_INT_RDIRE | HSMCI_INT_RINDE ) + (HSMCI_INT_CSTOE | HSMCI_INT_RTOE | HSMCI_INT_RENDE | HSMCI_INT_RCRCE | \ + HSMCI_INT_RDIRE | HSMCI_INT_RINDE) #define HSMCI_RESPONSE_NOCRC_ERRORS \ - ( HSMCI_INT_CSTOE | HSMCI_INT_RTOE | HSMCI_INT_RENDE | HSMCI_INT_RDIRE | \ - HSMCI_INT_RINDE ) + (HSMCI_INT_CSTOE | HSMCI_INT_RTOE | HSMCI_INT_RENDE | HSMCI_INT_RDIRE | \ + HSMCI_INT_RINDE) #define HSMCI_RESPONSE_TIMEOUT_ERRORS \ - ( HSMCI_INT_CSTOE | HSMCI_INT_RTOE ) + (HSMCI_INT_CSTOE | HSMCI_INT_RTOE) /* Data transfer errors: * @@ -263,18 +263,18 @@ */ #define HSMCI_DATA_ERRORS \ - ( HSMCI_INT_UNRE | HSMCI_INT_OVRE | HSMCI_INT_BLKOVRE | HSMCI_INT_CSTOE | \ - HSMCI_INT_DTOE | HSMCI_INT_DCRCE ) + (HSMCI_INT_UNRE | HSMCI_INT_OVRE | HSMCI_INT_BLKOVRE | HSMCI_INT_CSTOE | \ + HSMCI_INT_DTOE | HSMCI_INT_DCRCE) #define HSMCI_DATA_TIMEOUT_ERRORS \ - ( HSMCI_INT_CSTOE | HSMCI_INT_DTOE ) + (HSMCI_INT_CSTOE | HSMCI_INT_DTOE) #define HSMCI_DATA_RECV_ERRORS \ - ( HSMCI_INT_OVRE | HSMCI_INT_BLKOVRE | HSMCI_INT_CSTOE | HSMCI_INT_DTOE | \ - HSMCI_INT_DCRCE ) + (HSMCI_INT_OVRE | HSMCI_INT_BLKOVRE | HSMCI_INT_CSTOE | HSMCI_INT_DTOE | \ + HSMCI_INT_DCRCE) #define HSMCI_DATA_DMASEND_ERRORS \ - ( HSMCI_INT_UNRE | HSMCI_INT_CSTOE | HSMCI_INT_DTOE | HSMCI_INT_DCRCE ) + (HSMCI_INT_UNRE | HSMCI_INT_CSTOE | HSMCI_INT_DTOE | HSMCI_INT_DCRCE) /* Data transfer status and interrupt mask bits. * @@ -291,11 +291,11 @@ */ #define HSMCI_RECV_INTS \ - ( HSMCI_DATA_RECV_ERRORS | HSMCI_INT_RXRDY) + (HSMCI_DATA_RECV_ERRORS | HSMCI_INT_RXRDY) #define HSMCI_DMARECV_INTS \ - ( HSMCI_DATA_RECV_ERRORS | HSMCI_INT_XFRDONE /* | HSMCI_INT_DMADONE */ ) + (HSMCI_DATA_RECV_ERRORS | HSMCI_INT_XFRDONE /* | HSMCI_INT_DMADONE */) #define HSMCI_DMASEND_INTS \ - ( HSMCI_DATA_DMASEND_ERRORS | HSMCI_INT_XFRDONE /* | HSMCI_INT_DMADONE */ ) + (HSMCI_DATA_DMASEND_ERRORS | HSMCI_INT_XFRDONE /* | HSMCI_INT_DMADONE */) /* Event waiting interrupt mask bits. * @@ -307,9 +307,9 @@ */ #define HSMCI_CMDRESP_INTS \ - ( HSMCI_RESPONSE_ERRORS | HSMCI_INT_CMDRDY ) + (HSMCI_RESPONSE_ERRORS | HSMCI_INT_CMDRDY) #define HSMCI_CMDRESP_NOCRC_INTS \ - ( HSMCI_RESPONSE_NOCRC_ERRORS | HSMCI_INT_CMDRDY ) + (HSMCI_RESPONSE_NOCRC_ERRORS | HSMCI_INT_CMDRDY) /* Register logging support */ diff --git a/arch/arm/src/samv7/sam_clockconfig.c b/arch/arm/src/samv7/sam_clockconfig.c index 82b834a53d..35afb26fff 100644 --- a/arch/arm/src/samv7/sam_clockconfig.c +++ b/arch/arm/src/samv7/sam_clockconfig.c @@ -68,7 +68,7 @@ BOARD_CKGR_MOR_MOSCXTST | PMC_CKGR_MOR_KEY) #define BOARD_CKGR_PLLAR (BOARD_CKGR_PLLAR_DIV | BOARD_CKGR_PLLAR_COUNT | \ BOARD_CKGR_PLLAR_MUL | PMC_CKGR_PLLAR_ONE) - + #define BOARD_PMC_MCKR_FAST (PMC_MCKR_CSS_MAIN | BOARD_PMC_MCKR_PRES | \ BOARD_PMC_MCKR_MDIV | BOARD_PMC_MCKR_UPLLDIV2) #define BOARD_PMC_MCKR (BOARD_PMC_MCKR_CSS | BOARD_PMC_MCKR_PRES | \ diff --git a/arch/arm/src/stm32/stm32_procfs_ccm.c b/arch/arm/src/stm32/stm32_procfs_ccm.c index a74c4c7686..927a102716 100644 --- a/arch/arm/src/stm32/stm32_procfs_ccm.c +++ b/arch/arm/src/stm32/stm32_procfs_ccm.c @@ -222,7 +222,7 @@ static ssize_t ccm_read(FAR struct file *filep, FAR char *buffer, mm_mallinfo(&g_ccm_heap, &mem); - + remaining = buflen; totalsize = 0; diff --git a/arch/arm/src/stm32f7/stm32_procfs_dtcm.c b/arch/arm/src/stm32f7/stm32_procfs_dtcm.c index 2ca6687783..12b1e91565 100644 --- a/arch/arm/src/stm32f7/stm32_procfs_dtcm.c +++ b/arch/arm/src/stm32f7/stm32_procfs_dtcm.c @@ -228,7 +228,7 @@ static ssize_t dtcm_read(FAR struct file *filep, FAR char *buffer, mm_mallinfo(&g_dtcm_heap, &mem); - + remaining = buflen; totalsize = 0; diff --git a/arch/sim/src/up_spiflash.c b/arch/sim/src/up_spiflash.c index 0118dd7638..69d80b0e72 100644 --- a/arch/sim/src/up_spiflash.c +++ b/arch/sim/src/up_spiflash.c @@ -586,7 +586,7 @@ static void spiflash_sectorerase(FAR struct sim_spiflashdev_s *priv) uint32_t len; /* Ensure the WREN bit is set before any erase operation */ - + if (priv->wren) { address = priv->address; @@ -645,7 +645,7 @@ static void spiflash_writeword(FAR struct sim_spiflashdev_s *priv, uint16_t data break; /* Sector / Subsector erase */ - + case SPIFLASH_SE: case SPIFLASH_SSE: priv->state = SPIFLASH_STATE_SE1; @@ -657,7 +657,7 @@ static void spiflash_writeword(FAR struct sim_spiflashdev_s *priv, uint16_t data priv->state = SPIFLASH_STATE_IDLE; if (priv->wren) { - memset(priv->data, 0xff, CONFIG_SPIFLASH_SIZE); + memset(priv->data, 0xff, CONFIG_SPIFLASH_SIZE); } break; @@ -755,7 +755,7 @@ static void spiflash_writeword(FAR struct sim_spiflashdev_s *priv, uint16_t data * the actual FLASH. */ - if ((priv->address & CONFIG_SIM_SPIFLASH_PAGESIZE_MASK) == + if ((priv->address & CONFIG_SIM_SPIFLASH_PAGESIZE_MASK) == CONFIG_SIM_SPIFLASH_PAGESIZE_MASK) { priv->address &= !CONFIG_SIM_SPIFLASH_PAGESIZE_MASK; From 7a63e976ad1b780eeca362ddd186ee70a404b86e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 4 Oct 2015 16:00:42 -0600 Subject: [PATCH 17/33] Remove TABs --- arch/arm/src/calypso/calypso_timer.c | 123 +++++++------- arch/arm/src/calypso/calypso_uwire.c | 155 +++++++++-------- arch/arm/src/calypso/clock.c | 220 +++++++++++++------------ arch/arm/src/dm320/dm320_serial.c | 16 +- arch/arm/src/kinetis/kinetis_wdog.c | 2 +- arch/arm/src/str71x/str71x_xti.c | 2 +- arch/avr/src/at32uc3/at32uc3_gpioirq.c | 8 +- arch/avr/src/at32uc3/at32uc3_irq.c | 4 +- arch/avr/src/at90usb/at90usb_serial.c | 2 +- arch/mips/src/mips32/up_dumpstate.c | 2 +- arch/rgmp/src/arm/arch_nuttx.c | 29 ++-- arch/rgmp/src/bridge.c | 89 +++++----- arch/rgmp/src/cxx.c | 6 +- arch/rgmp/src/rgmp.c | 92 ++++++----- arch/rgmp/src/x86/arch_nuttx.c | 31 ++-- arch/sh/src/m16c/m16c_lowputc.c | 4 +- arch/sh/src/m16c/m16c_serial.c | 2 +- arch/sh/src/m16c/m16c_timerisr.c | 6 +- arch/sim/src/up_devconsole.c | 8 +- arch/x86/src/i486/up_savestate.c | 4 +- arch/z80/src/z180/z180_io.c | 10 +- arch/z80/src/z180/z180_irq.c | 4 +- arch/z80/src/z8/z8_serial.c | 18 +- arch/z80/src/z80/z80_io.c | 10 +- 24 files changed, 442 insertions(+), 405 deletions(-) diff --git a/arch/arm/src/calypso/calypso_timer.c b/arch/arm/src/calypso/calypso_timer.c index 86c98b8aa6..548e224063 100644 --- a/arch/arm/src/calypso/calypso_timer.c +++ b/arch/arm/src/calypso/calypso_timer.c @@ -47,118 +47,128 @@ #include "up_arch.h" -#define BASE_ADDR_TIMER 0xfffe3800 -#define TIMER2_OFFSET 0x3000 +#define BASE_ADDR_TIMER 0xfffe3800 +#define TIMER2_OFFSET 0x3000 -#define TIMER_REG(n, m) (((n)-1) ? (BASE_ADDR_TIMER + TIMER2_OFFSET + (m)) : (BASE_ADDR_TIMER + (m))) +#define TIMER_REG(n, m) (((n)-1) ? (BASE_ADDR_TIMER + TIMER2_OFFSET + (m)) : (BASE_ADDR_TIMER + (m))) -enum timer_reg { - CNTL_TIMER = 0x00, - LOAD_TIMER = 0x02, - READ_TIMER = 0x04, +enum timer_reg +{ + CNTL_TIMER = 0x00, + LOAD_TIMER = 0x02, + READ_TIMER = 0x04, }; -enum timer_ctl { - CNTL_START = (1 << 0), - CNTL_AUTO_RELOAD = (1 << 1), - CNTL_CLOCK_ENABLE = (1 << 5), +enum timer_ctl +{ + CNTL_START = (1 << 0), + CNTL_AUTO_RELOAD = (1 << 1), + CNTL_CLOCK_ENABLE = (1 << 5), }; /* Regular Timers (1 and 2) */ void hwtimer_enable(int num, int on) { - uint8_t ctl; + uint8_t ctl; - if (num < 1 || num > 2) { - printf("Unknown timer %d\n", num); - return; - } + if (num < 1 || num > 2) + { + printf("Unknown timer %d\n", num); + return; + } - ctl = getreg8(TIMER_REG(num, CNTL_TIMER)); - if (on) - ctl |= CNTL_START|CNTL_CLOCK_ENABLE; - else - ctl &= ~CNTL_START; - putreg8(ctl, TIMER_REG(num, CNTL_TIMER)); + ctl = getreg8(TIMER_REG(num, CNTL_TIMER)); + if (on) + ctl |= CNTL_START|CNTL_CLOCK_ENABLE; + else + ctl &= ~CNTL_START; + + putreg8(ctl, TIMER_REG(num, CNTL_TIMER)); } void hwtimer_config(int num, uint8_t pre_scale, int auto_reload) { - uint8_t ctl; + uint8_t ctl; - ctl = (pre_scale & 0x7) << 2; - if (auto_reload) - ctl |= CNTL_AUTO_RELOAD; + ctl = (pre_scale & 0x7) << 2; + if (auto_reload) + ctl |= CNTL_AUTO_RELOAD; - putreg8(ctl, TIMER_REG(num, CNTL_TIMER)); + putreg8(ctl, TIMER_REG(num, CNTL_TIMER)); } void hwtimer_load(int num, uint16_t val) { - putreg16(val, TIMER_REG(num, LOAD_TIMER)); + putreg16(val, TIMER_REG(num, LOAD_TIMER)); } uint16_t hwtimer_read(int num) { - uint8_t ctl = getreg8(TIMER_REG(num, CNTL_TIMER)); + uint8_t ctl = getreg8(TIMER_REG(num, CNTL_TIMER)); - /* somehow a read results in an abort */ - if ((ctl & (CNTL_START|CNTL_CLOCK_ENABLE)) != (CNTL_START|CNTL_CLOCK_ENABLE)) - return 0xFFFF; - return getreg16(TIMER_REG(num, READ_TIMER)); + /* somehow a read results in an abort */ + + if ((ctl & (CNTL_START|CNTL_CLOCK_ENABLE)) != (CNTL_START|CNTL_CLOCK_ENABLE)) + return 0xFFFF; + + return getreg16(TIMER_REG(num, READ_TIMER)); } /**************************************************************************** * Watchdog Timer ****************************************************************************/ -#define BASE_ADDR_WDOG 0xfffff800 -#define WDOG_REG(m) (BASE_ADDR_WDOG + m) +#define BASE_ADDR_WDOG 0xfffff800 +#define WDOG_REG(m) (BASE_ADDR_WDOG + m) enum wdog_reg { - WD_CNTL_TIMER = CNTL_TIMER, - WD_LOAD_TIMER = LOAD_TIMER, - WD_READ_TIMER = 0x02, - WD_MODE = 0x04, + WD_CNTL_TIMER = CNTL_TIMER, + WD_LOAD_TIMER = LOAD_TIMER, + WD_READ_TIMER = 0x02, + WD_MODE = 0x04, }; enum wdog_ctl { - WD_CTL_START = (1 << 7), + WD_CTL_START = (1 << 7), WD_CTL_AUTO_RELOAD = (1 << 8) }; enum wdog_mode { - WD_MODE_DIS_ARM = 0xF5, + WD_MODE_DIS_ARM = 0xF5, WD_MODE_DIS_CONFIRM = 0xA0, - WD_MODE_ENABLE = (1 << 15) + WD_MODE_ENABLE = (1 << 15) }; #define WD_CTL_PRESCALE(value) (((value)&0x07) << 9) static void wdog_irq(__unused enum irq_nr nr) { - puts("=> WATCHDOG\n"); + puts("=> WATCHDOG\n"); } void wdog_enable(int on) { - if (!on) { - putreg16(WD_MODE_DIS_ARM, WDOG_REG(WD_MODE)); - putreg16(WD_MODE_DIS_CONFIRM, WDOG_REG(WD_MODE)); - } + if (!on) + { + putreg16(WD_MODE_DIS_ARM, WDOG_REG(WD_MODE)); + putreg16(WD_MODE_DIS_CONFIRM, WDOG_REG(WD_MODE)); + } } void wdog_reset(void) { - // enable watchdog - putreg16(WD_MODE_ENABLE, WDOG_REG(WD_MODE)); - // force expiration - putreg16(0x0000, WDOG_REG(WD_LOAD_TIMER)); - putreg16(0x0000, WDOG_REG(WD_LOAD_TIMER)); + // enable watchdog + + putreg16(WD_MODE_ENABLE, WDOG_REG(WD_MODE)); + + // force expiration + + putreg16(0x0000, WDOG_REG(WD_LOAD_TIMER)); + putreg16(0x0000, WDOG_REG(WD_LOAD_TIMER)); } /**************************************************************************** @@ -176,10 +186,10 @@ void wdog_reset(void) int up_timerisr(int irq, uint32_t *regs) { - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); - return 0; + sched_process_timer(); + return 0; } /**************************************************************************** @@ -199,12 +209,13 @@ void up_timer_initialize(void) /* The timer runs at 13MHz / 32, i.e. 406.25kHz */ /* 4062 ticks until expiry yields 100Hz interrupt */ + hwtimer_load(2, 4062); hwtimer_config(2, 0, 1); hwtimer_enable(2, 1); /* Attach and enable the timer interrupt */ + irq_attach(IRQ_SYSTIMER, (xcpt_t)up_timerisr); up_enable_irq(IRQ_SYSTIMER); } - diff --git a/arch/arm/src/calypso/calypso_uwire.c b/arch/arm/src/calypso/calypso_uwire.c index eaf62db986..d837a7abdc 100644 --- a/arch/arm/src/calypso/calypso_uwire.c +++ b/arch/arm/src/calypso/calypso_uwire.c @@ -46,107 +46,116 @@ #include "up_arch.h" -#define BASE_ADDR_UWIRE 0xfffe4000 -#define UWIRE_REG(n) (BASE_ADDR_UWIRE+(n)) +#define BASE_ADDR_UWIRE 0xfffe4000 +#define UWIRE_REG(n) (BASE_ADDR_UWIRE+(n)) -enum uwire_regs { - REG_DATA = 0x00, - REG_CSR = 0x02, - REG_SR1 = 0x04, - REG_SR2 = 0x06, - REG_SR3 = 0x08, +enum uwire_regs +{ + REG_DATA = 0x00, + REG_CSR = 0x02, + REG_SR1 = 0x04, + REG_SR2 = 0x06, + REG_SR3 = 0x08, }; -#define UWIRE_CSR_BITS_RD(n) (((n) & 0x1f) << 0) -#define UWIRE_CSR_BITS_WR(n) (((n) & 0x1f) << 5) -#define UWIRE_CSR_IDX(n) (((n) & 3) << 10) -#define UWIRE_CSR_CS_CMD (1 << 12) -#define UWIRE_CSR_START (1 << 13) -#define UWIRE_CSR_CSRB (1 << 14) -#define UWIRE_CSR_RDRB (1 << 15) +#define UWIRE_CSR_BITS_RD(n) (((n) & 0x1f) << 0) +#define UWIRE_CSR_BITS_WR(n) (((n) & 0x1f) << 5) +#define UWIRE_CSR_IDX(n) (((n) & 3) << 10) +#define UWIRE_CSR_CS_CMD (1 << 12) +#define UWIRE_CSR_START (1 << 13) +#define UWIRE_CSR_CSRB (1 << 14) +#define UWIRE_CSR_RDRB (1 << 15) -#define UWIRE_CSn_EDGE_RD (1 << 0) /* 1=falling 0=rising */ -#define UWIRE_CSn_EDGE_WR (1 << 1) /* 1=falling 0=rising */ -#define UWIRE_CSn_CS_LVL (1 << 2) -#define UWIRE_CSn_FRQ_DIV2 (0 << 3) -#define UWIRE_CSn_FRQ_DIV4 (1 << 3) -#define UWIRE_CSn_FRQ_DIV8 (2 << 3) +#define UWIRE_CSn_EDGE_RD (1 << 0) /* 1=falling 0=rising */ +#define UWIRE_CSn_EDGE_WR (1 << 1) /* 1=falling 0=rising */ +#define UWIRE_CSn_CS_LVL (1 << 2) +#define UWIRE_CSn_FRQ_DIV2 (0 << 3) +#define UWIRE_CSn_FRQ_DIV4 (1 << 3) +#define UWIRE_CSn_FRQ_DIV8 (2 << 3) #define UWIRE_CSn_CKH -#define UWIRE_CSn_SHIFT(n) (((n) & 1) ? 6 : 0) -#define UWIRE_CSn_REG(n) (((n) & 2) ? REG_SR2 : REG_SR1) +#define UWIRE_CSn_SHIFT(n) (((n) & 1) ? 6 : 0) +#define UWIRE_CSn_REG(n) (((n) & 2) ? REG_SR2 : REG_SR1) -#define UWIRE_SR3_CLK_EN (1 << 0) -#define UWIRE_SR3_CLK_DIV2 (0 << 1) -#define UWIRE_SR3_CLK_DIV4 (1 << 1) -#define UWIRE_SR3_CLK_DIV7 (2 << 1) -#define UWIRE_SR3_CLK_DIV10 (3 << 1) +#define UWIRE_SR3_CLK_EN (1 << 0) +#define UWIRE_SR3_CLK_DIV2 (0 << 1) +#define UWIRE_SR3_CLK_DIV4 (1 << 1) +#define UWIRE_SR3_CLK_DIV7 (2 << 1) +#define UWIRE_SR3_CLK_DIV10 (3 << 1) static inline void _uwire_wait(int mask, int val) { - while ((getreg16(UWIRE_REG(REG_CSR)) & mask) != val); + while ((getreg16(UWIRE_REG(REG_CSR)) & mask) != val); } void uwire_init(void) { - putreg16(UWIRE_SR3_CLK_EN | UWIRE_SR3_CLK_DIV2, UWIRE_REG(REG_SR3)); - /* FIXME only init CS0 for now */ - putreg16(((UWIRE_CSn_CS_LVL | UWIRE_CSn_FRQ_DIV2) << UWIRE_CSn_SHIFT(0)), - UWIRE_REG(UWIRE_CSn_REG(0))); - putreg16(UWIRE_CSR_IDX(0) | UWIRE_CSR_CS_CMD, UWIRE_REG(REG_CSR)); - _uwire_wait(UWIRE_CSR_CSRB, 0); + putreg16(UWIRE_SR3_CLK_EN | UWIRE_SR3_CLK_DIV2, UWIRE_REG(REG_SR3)); + + /* FIXME only init CS0 for now */ + + putreg16(((UWIRE_CSn_CS_LVL | UWIRE_CSn_FRQ_DIV2) << UWIRE_CSn_SHIFT(0)), + UWIRE_REG(UWIRE_CSn_REG(0))); + putreg16(UWIRE_CSR_IDX(0) | UWIRE_CSR_CS_CMD, UWIRE_REG(REG_CSR)); + _uwire_wait(UWIRE_CSR_CSRB, 0); } int uwire_xfer(int cs, int bitlen, const void *dout, void *din) { - uint16_t tmp = 0; + uint16_t tmp = 0; - if (bitlen <= 0 || bitlen > 16) - return -1; - if (cs < 0 || cs > 4) - return -1; + if (bitlen <= 0 || bitlen > 16) + return -1; - /* FIXME uwire_init always selects CS0 for now */ + if (cs < 0 || cs > 4) + return -1; - dbg("uwire_xfer(dev_idx=%u, bitlen=%u\n", cs, bitlen); + /* FIXME uwire_init always selects CS0 for now */ - /* select the chip */ - putreg16(UWIRE_CSR_IDX(0) | UWIRE_CSR_CS_CMD, UWIRE_REG(REG_CSR)); - _uwire_wait(UWIRE_CSR_CSRB, 0); + dbg("uwire_xfer(dev_idx=%u, bitlen=%u\n", cs, bitlen); - if (dout) { - if (bitlen <= 8) - tmp = *(uint8_t *)dout; - else if (bitlen <= 16) - tmp = *(uint16_t *)dout; - tmp <<= 16 - bitlen; /* align to MSB */ - putreg16(tmp, UWIRE_REG(REG_DATA)); - dbg(", data_out=0x%04hx", tmp); - } + /* select the chip */ - tmp = (dout ? UWIRE_CSR_BITS_WR(bitlen) : 0) | - (din ? UWIRE_CSR_BITS_RD(bitlen) : 0) | - UWIRE_CSR_START; - putreg16(tmp, UWIRE_REG(REG_CSR)); + putreg16(UWIRE_CSR_IDX(0) | UWIRE_CSR_CS_CMD, UWIRE_REG(REG_CSR)); + _uwire_wait(UWIRE_CSR_CSRB, 0); - _uwire_wait(UWIRE_CSR_CSRB, 0); + if (dout) + { + if (bitlen <= 8) + tmp = *(uint8_t *)dout; + else if (bitlen <= 16) + tmp = *(uint16_t *)dout; - if (din) { - _uwire_wait(UWIRE_CSR_RDRB, UWIRE_CSR_RDRB); + tmp <<= 16 - bitlen; /* align to MSB */ + putreg16(tmp, UWIRE_REG(REG_DATA)); + dbg(", data_out=0x%04hx", tmp); + } - tmp = getreg16(UWIRE_REG(REG_DATA)); - dbg(", data_in=0x%08x", tmp); + tmp = (dout ? UWIRE_CSR_BITS_WR(bitlen) : 0) | + (din ? UWIRE_CSR_BITS_RD(bitlen) : 0) | + UWIRE_CSR_START; + putreg16(tmp, UWIRE_REG(REG_CSR)); + _uwire_wait(UWIRE_CSR_CSRB, 0); - if (bitlen <= 8) - *(uint8_t *)din = tmp & 0xff; - else if (bitlen <= 16) - *(uint16_t *)din = tmp & 0xffff; - } - /* unselect the chip */ - putreg16(UWIRE_CSR_IDX(0) | 0, UWIRE_REG(REG_CSR)); - _uwire_wait(UWIRE_CSR_CSRB, 0); + if (din) + { + _uwire_wait(UWIRE_CSR_RDRB, UWIRE_CSR_RDRB); - dbg(")\n"); + tmp = getreg16(UWIRE_REG(REG_DATA)); + dbg(", data_in=0x%08x", tmp); - return 0; + if (bitlen <= 8) + *(uint8_t *)din = tmp & 0xff; + else if (bitlen <= 16) + *(uint16_t *)din = tmp & 0xffff; + } + + /* unselect the chip */ + + putreg16(UWIRE_CSR_IDX(0) | 0, UWIRE_REG(REG_CSR)); + _uwire_wait(UWIRE_CSR_CSRB, 0); + + dbg(")\n"); + + return 0; } diff --git a/arch/arm/src/calypso/clock.c b/arch/arm/src/calypso/clock.c index 497300e287..29dc2f8273 100644 --- a/arch/arm/src/calypso/clock.c +++ b/arch/arm/src/calypso/clock.c @@ -49,172 +49,182 @@ #include "up_arch.h" -#define REG_DPLL 0xffff9800 -#define DPLL_LOCK (1 << 0) -#define DPLL_BREAKLN (1 << 1) -#define DPLL_BYPASS_DIV_SHIFT 2 /* 2 bits */ -#define DPLL_PLL_ENABLE (1 << 4) -#define DPLL_PLL_DIV_SHIFT 5 /* 2 bits */ -#define DPLL_PLL_MULT_SHIFT 7 /* 5 bits */ -#define DPLL_TEST (1 << 12) -#define DPLL_IOB (1 << 13) /* Initialize on break */ -#define DPLL_IAI (1 << 14) /* Initialize after Idle */ +#define REG_DPLL 0xffff9800 +#define DPLL_LOCK (1 << 0) +#define DPLL_BREAKLN (1 << 1) +#define DPLL_BYPASS_DIV_SHIFT 2 /* 2 bits */ +#define DPLL_PLL_ENABLE (1 << 4) +#define DPLL_PLL_DIV_SHIFT 5 /* 2 bits */ +#define DPLL_PLL_MULT_SHIFT 7 /* 5 bits */ +#define DPLL_TEST (1 << 12) +#define DPLL_IOB (1 << 13) /* Initialize on break */ +#define DPLL_IAI (1 << 14) /* Initialize after Idle */ -#define BASE_ADDR_CLKM 0xfffffd00 -#define CLKM_REG(m) (BASE_ADDR_CLKM+(m)) +#define BASE_ADDR_CLKM 0xfffffd00 +#define CLKM_REG(m) (BASE_ADDR_CLKM+(m)) -enum clkm_reg { - CNTL_ARM_CLK = 0, - CNTL_CLK = 2, - CNTL_RST = 4, - CNTL_ARM_DIV = 8, +enum clkm_reg +{ + CNTL_ARM_CLK = 0, + CNTL_CLK = 2, + CNTL_RST = 4, + CNTL_ARM_DIV = 8, }; /* CNTL_ARM_CLK */ -#define ARM_CLK_BIG_SLEEP (1 << 0) /* MCU Master Clock enabled? */ -#define ARM_CLK_CLKIN_SEL0 (1 << 1) /* MCU source clock (0 = DPLL output, 1 = VTCXO or CLKIN */ -#define ARM_CLK_CLKIN_SEL (1 << 2) /* 0 = VTCXO or 1 = CLKIN */ -#define ARM_CLK_MCLK_DIV5 (1 << 3) /* enable 1.5 or 2.5 division factor */ -#define ARM_CLK_MCLK_DIV_SHIFT 4 /* 3 bits */ -#define ARM_CLK_DEEP_POWER_SHIFT 8 -#define ARM_CLK_DEEP_SLEEP 12 + +#define ARM_CLK_BIG_SLEEP (1 << 0) /* MCU Master Clock enabled? */ +#define ARM_CLK_CLKIN_SEL0 (1 << 1) /* MCU source clock (0 = DPLL output, 1 = VTCXO or CLKIN */ +#define ARM_CLK_CLKIN_SEL (1 << 2) /* 0 = VTCXO or 1 = CLKIN */ +#define ARM_CLK_MCLK_DIV5 (1 << 3) /* enable 1.5 or 2.5 division factor */ +#define ARM_CLK_MCLK_DIV_SHIFT 4 /* 3 bits */ +#define ARM_CLK_DEEP_POWER_SHIFT 8 +#define ARM_CLK_DEEP_SLEEP 12 /* CNTL_CLK */ -#define CLK_IRQ_CLK_DIS (1 << 0) /* IRQ clock control (0 always, 1 according ARM_MCLK_EN) */ -#define CLK_BRIDGE_CLK_DIS (1 << 1) -#define CLK_TIMER_CLK_DIS (1 << 2) -#define CLK_DPLL_DIS (1 << 3) /* 0: DPLL is not stopped during SLEEP */ -#define CLK_CLKOUT_EN (1 << 4) /* Enable CLKOUT output pins */ -#define CLK_EN_IDLE3_FLG (1 << 5) /* DSP idle flag control (1 = - * SAM/HOM register forced to HOM when DSP IDLE3) */ -#define CLK_VCLKOUT_DIV2 (1 << 6) /* 1: VCLKOUT-FR is divided by 2 */ -#define CLK_VTCXO_DIV2 (1 << 7) /* 1: VTCXO is dividied by 2 */ +#define CLK_IRQ_CLK_DIS (1 << 0) /* IRQ clock control (0 always, 1 according ARM_MCLK_EN) */ +#define CLK_BRIDGE_CLK_DIS (1 << 1) +#define CLK_TIMER_CLK_DIS (1 << 2) +#define CLK_DPLL_DIS (1 << 3) /* 0: DPLL is not stopped during SLEEP */ +#define CLK_CLKOUT_EN (1 << 4) /* Enable CLKOUT output pins */ +#define CLK_EN_IDLE3_FLG (1 << 5) /* DSP idle flag control (1 = + * SAM/HOM register forced to HOM when DSP IDLE3) */ +#define CLK_VCLKOUT_DIV2 (1 << 6) /* 1: VCLKOUT-FR is divided by 2 */ +#define CLK_VTCXO_DIV2 (1 << 7) /* 1: VTCXO is dividied by 2 */ -#define BASE_ADDR_MEMIF 0xfffffb00 -#define MEMIF_REG(x) (BASE_ADDR_MEMIF+(x)) +#define BASE_ADDR_MEMIF 0xfffffb00 +#define MEMIF_REG(x) (BASE_ADDR_MEMIF+(x)) -enum memif_reg { - API_RHEA_CTL = 0x0e, - EXTRA_CONF = 0x10, +enum memif_reg +{ + API_RHEA_CTL = 0x0e, + EXTRA_CONF = 0x10, }; static void dump_reg16(uint32_t addr, char *name) { - printf("%s=0x%04x\n", name, getreg16(addr)); + printf("%s=0x%04x\n", name, getreg16(addr)); } void calypso_clk_dump(void) { - dump_reg16(REG_DPLL, "REG_DPLL"); - dump_reg16(CLKM_REG(CNTL_ARM_CLK), "CNTL_ARM_CLK"); - dump_reg16(CLKM_REG(CNTL_CLK), "CNTL_CLK"); - dump_reg16(CLKM_REG(CNTL_RST), "CNTL_RST"); - dump_reg16(CLKM_REG(CNTL_ARM_DIV), "CNTL_ARM_DIV"); + dump_reg16(REG_DPLL, "REG_DPLL"); + dump_reg16(CLKM_REG(CNTL_ARM_CLK), "CNTL_ARM_CLK"); + dump_reg16(CLKM_REG(CNTL_CLK), "CNTL_CLK"); + dump_reg16(CLKM_REG(CNTL_RST), "CNTL_RST"); + dump_reg16(CLKM_REG(CNTL_ARM_DIV), "CNTL_ARM_DIV"); } void calypso_pll_set(uint16_t inp) { - uint8_t mult = inp >> 8; - uint8_t div = inp & 0xff; - uint16_t reg = getreg16(REG_DPLL); + uint8_t mult = inp >> 8; + uint8_t div = inp & 0xff; + uint16_t reg = getreg16(REG_DPLL); - reg &= ~0x0fe0; - reg |= (div & 0x3) << DPLL_PLL_DIV_SHIFT; - reg |= (mult & 0x1f) << DPLL_PLL_MULT_SHIFT; - reg |= DPLL_PLL_ENABLE; + reg &= ~0x0fe0; + reg |= (div & 0x3) << DPLL_PLL_DIV_SHIFT; + reg |= (mult & 0x1f) << DPLL_PLL_MULT_SHIFT; + reg |= DPLL_PLL_ENABLE; - putreg16(reg, REG_DPLL); + putreg16(reg, REG_DPLL); } void calypso_reset_set(enum calypso_rst calypso_rst, int active) { - uint8_t reg = getreg8(CLKM_REG(CNTL_RST)); + uint8_t reg = getreg8(CLKM_REG(CNTL_RST)); - if (active) - reg |= calypso_rst; - else - reg &= ~calypso_rst; + if (active) + reg |= calypso_rst; + else + reg &= ~calypso_rst; - putreg8(reg, CLKM_REG(CNTL_RST)); + putreg8(reg, CLKM_REG(CNTL_RST)); } int calypso_reset_get(enum calypso_rst calypso_rst) { - uint8_t reg = getreg8(CLKM_REG(CNTL_RST)); + uint8_t reg = getreg8(CLKM_REG(CNTL_RST)); - if (reg & calypso_rst) - return 1; - else - return 0; + if (reg & calypso_rst) + return 1; + else + return 0; } void calypso_clock_set(uint8_t vtcxo_div2, uint16_t inp, enum mclk_div mclk_div) { - uint16_t cntl_clock = getreg16(CLKM_REG(CNTL_CLK)); - uint16_t cntl_arm_clk = getreg16(CLKM_REG(CNTL_ARM_CLK)); + uint16_t cntl_clock = getreg16(CLKM_REG(CNTL_CLK)); + uint16_t cntl_arm_clk = getreg16(CLKM_REG(CNTL_ARM_CLK)); - /* First set the vtcxo_div2 */ - cntl_clock &= ~CLK_VCLKOUT_DIV2; - if (vtcxo_div2) - cntl_clock |= CLK_VTCXO_DIV2; - else - cntl_clock &= ~CLK_VTCXO_DIV2; - putreg16(cntl_clock, CLKM_REG(CNTL_CLK)); + /* First set the vtcxo_div2 */ - /* Then configure the MCLK divider */ - cntl_arm_clk &= ~ARM_CLK_CLKIN_SEL0; - if (mclk_div & 0x80) { - mclk_div &= ~0x80; - cntl_arm_clk |= ARM_CLK_MCLK_DIV5; - } else - cntl_arm_clk &= ~ARM_CLK_MCLK_DIV5; - cntl_arm_clk &= ~(0x7 << ARM_CLK_MCLK_DIV_SHIFT); - cntl_arm_clk |= (mclk_div << ARM_CLK_MCLK_DIV_SHIFT); - putreg16(cntl_arm_clk, CLKM_REG(CNTL_ARM_CLK)); + cntl_clock &= ~CLK_VCLKOUT_DIV2; + if (vtcxo_div2) + cntl_clock |= CLK_VTCXO_DIV2; + else + cntl_clock &= ~CLK_VTCXO_DIV2; - /* Then finally set the PLL */ - calypso_pll_set(inp); + putreg16(cntl_clock, CLKM_REG(CNTL_CLK)); + + /* Then configure the MCLK divider */ + + cntl_arm_clk &= ~ARM_CLK_CLKIN_SEL0; + if (mclk_div & 0x80) + { + mclk_div &= ~0x80; + cntl_arm_clk |= ARM_CLK_MCLK_DIV5; + } + else + cntl_arm_clk &= ~ARM_CLK_MCLK_DIV5; + + cntl_arm_clk &= ~(0x7 << ARM_CLK_MCLK_DIV_SHIFT); + cntl_arm_clk |= (mclk_div << ARM_CLK_MCLK_DIV_SHIFT); + putreg16(cntl_arm_clk, CLKM_REG(CNTL_ARM_CLK)); + + /* Then finally set the PLL */ + + calypso_pll_set(inp); } void calypso_mem_cfg(enum calypso_bank bank, uint8_t ws, - enum calypso_mem_width width, int we) + enum calypso_mem_width width, int we) { - putreg16((ws & 0x1f) | ((width & 3) << 5) | ((we & 1) << 7), - BASE_ADDR_MEMIF + bank); + putreg16((ws & 0x1f) | ((width & 3) << 5) | ((we & 1) << 7), + BASE_ADDR_MEMIF + bank); } void calypso_bootrom(int enable) { - uint16_t conf = getreg16(MEMIF_REG(EXTRA_CONF)); + uint16_t conf = getreg16(MEMIF_REG(EXTRA_CONF)); - conf |= (3 << 8); + conf |= (3 << 8); - if (enable) - conf &= ~(1 << 9); + if (enable) + conf &= ~(1 << 9); - putreg16(conf, MEMIF_REG(EXTRA_CONF)); + putreg16(conf, MEMIF_REG(EXTRA_CONF)); } void calypso_debugunit(int enable) { - uint16_t conf = getreg16(MEMIF_REG(EXTRA_CONF)); + uint16_t conf = getreg16(MEMIF_REG(EXTRA_CONF)); - if (enable) - conf &= ~(1 << 11); - else - conf |= (1 << 11); + if (enable) + conf &= ~(1 << 11); + else + conf |= (1 << 11); - putreg16(conf, MEMIF_REG(EXTRA_CONF)); + putreg16(conf, MEMIF_REG(EXTRA_CONF)); } -#define REG_RHEA_CNTL 0xfffff900 -#define REG_API_CNTL 0xfffff902 -#define REG_ARM_RHEA 0xfffff904 +#define REG_RHEA_CNTL 0xfffff900 +#define REG_API_CNTL 0xfffff902 +#define REG_ARM_RHEA 0xfffff904 void calypso_rhea_cfg(uint8_t fac0, uint8_t fac1, uint8_t timeout, - uint8_t ws_h, uint8_t ws_l, uint8_t w_en0, uint8_t w_en1) + uint8_t ws_h, uint8_t ws_l, uint8_t w_en0, uint8_t w_en1) { - putreg16(fac0 | (fac1 << 4) | (timeout << 8), REG_RHEA_CNTL); - putreg16(ws_h | (ws_l << 5), REG_API_CNTL); - putreg16(w_en0 | (w_en1 << 1), REG_ARM_RHEA); + putreg16(fac0 | (fac1 << 4) | (timeout << 8), REG_RHEA_CNTL); + putreg16(ws_h | (ws_l << 5), REG_API_CNTL); + putreg16(w_en0 | (w_en1 << 1), REG_ARM_RHEA); } diff --git a/arch/arm/src/dm320/dm320_serial.c b/arch/arm/src/dm320/dm320_serial.c index 27e7cbfc59..59dbecc179 100644 --- a/arch/arm/src/dm320/dm320_serial.c +++ b/arch/arm/src/dm320/dm320_serial.c @@ -71,14 +71,14 @@ struct up_dev_s { - uint32_t uartbase; /* Base address of UART registers */ - uint32_t baud; /* Configured baud */ - uint16_t msr; /* Saved MSR value */ - uint8_t irq; /* IRQ associated with this UART */ - uint8_t parity; /* 0=none, 1=odd, 2=even */ - uint8_t bits; /* Number of bits (7 or 8) */ - bool stopbits2; /* true: Configure with 2 - * stop bits instead of 1 */ + uint32_t uartbase; /* Base address of UART registers */ + uint32_t baud; /* Configured baud */ + uint16_t msr; /* Saved MSR value */ + uint8_t irq; /* IRQ associated with this UART */ + uint8_t parity; /* 0=none, 1=odd, 2=even */ + uint8_t bits; /* Number of bits (7 or 8) */ + bool stopbits2; /* true: Configure with 2 + * stop bits instead of 1 */ }; /**************************************************************************** diff --git a/arch/arm/src/kinetis/kinetis_wdog.c b/arch/arm/src/kinetis/kinetis_wdog.c index 3c48ebe7d1..f506db2802 100644 --- a/arch/arm/src/kinetis/kinetis_wdog.c +++ b/arch/arm/src/kinetis/kinetis_wdog.c @@ -108,7 +108,7 @@ void kinetis_wddisable(void) /* Unlock the watchdog so that we can write to registers */ kinetis_wdunlock(); - + /* Clear the WDOGEN bit to disable the watchdog */ regval = getreg16(KINETIS_WDOG_STCTRLH); diff --git a/arch/arm/src/str71x/str71x_xti.c b/arch/arm/src/str71x/str71x_xti.c index 17997b85e3..51d14e0866 100644 --- a/arch/arm/src/str71x/str71x_xti.c +++ b/arch/arm/src/str71x/str71x_xti.c @@ -119,7 +119,7 @@ static int str71x_xtiinterrupt(int irq, FAR void *context) if ((pending & mask) != 0) { - /* Deliver the IRQ */ + /* Deliver the IRQ */ irq_dispatch(irq, context); pending &= ~mask; diff --git a/arch/avr/src/at32uc3/at32uc3_gpioirq.c b/arch/avr/src/at32uc3/at32uc3_gpioirq.c index 16e6cb5f08..9a0b18075c 100644 --- a/arch/avr/src/at32uc3/at32uc3_gpioirq.c +++ b/arch/avr/src/at32uc3/at32uc3_gpioirq.c @@ -94,14 +94,14 @@ static inline uint32_t gpio_baseaddress(unsigned int irq) if (irq < __IRQ_GPIO_PB0) { return AVR32_GPIO0_BASE; - } + } else #endif #if CONFIG_AVR32_GPIOIRQSETB != 0 if (irq < NR_GPIO_IRQS) { return AVR32_GPIO1_BASE; - } + } else #endif { @@ -132,7 +132,7 @@ static inline int gpio_pin(unsigned int irq) { pinset = CONFIG_AVR32_GPIOIRQSETA; pinirq = __IRQ_GPIO_PA0; - } + } else #endif #if CONFIG_AVR32_GPIOIRQSETB != 0 @@ -140,7 +140,7 @@ static inline int gpio_pin(unsigned int irq) { pinset = CONFIG_AVR32_GPIOIRQSETB; pinirq = __IRQ_GPIO_PB0; - } + } else #endif { diff --git a/arch/avr/src/at32uc3/at32uc3_irq.c b/arch/avr/src/at32uc3/at32uc3_irq.c index f22c72821b..c5d7b8bc41 100644 --- a/arch/avr/src/at32uc3/at32uc3_irq.c +++ b/arch/avr/src/at32uc3/at32uc3_irq.c @@ -223,8 +223,8 @@ void up_irqinitialize(void) for (irq = 0; irq < AVR32_IRQ_NEVENTS; irq++) { - irq_attach(irq, avr32_xcptn); - } + irq_attach(irq, avr32_xcptn); + } /* Initialize GPIO interrupt facilities */ diff --git a/arch/avr/src/at90usb/at90usb_serial.c b/arch/avr/src/at90usb/at90usb_serial.c index 7732e42778..8af0aae45a 100644 --- a/arch/avr/src/at90usb/at90usb_serial.c +++ b/arch/avr/src/at90usb/at90usb_serial.c @@ -373,7 +373,7 @@ static int usart1_receive(struct uart_dev_s *dev, FAR unsigned int *status) if (status) { - *status = (FAR unsigned int)UCSR1A; + *status = (FAR unsigned int)UCSR1A; } /* Then return the actual received byte */ diff --git a/arch/mips/src/mips32/up_dumpstate.c b/arch/mips/src/mips32/up_dumpstate.c index 714e9a882b..0ed660cfa7 100644 --- a/arch/mips/src/mips32/up_dumpstate.c +++ b/arch/mips/src/mips32/up_dumpstate.c @@ -84,7 +84,7 @@ static inline uint32_t up_getsp(void) register uint32_t sp; __asm__ ( - "\tadd %0, $0, $29\n" + "\tadd %0, $0, $29\n" : "=r"(sp) ); return sp; diff --git a/arch/rgmp/src/arm/arch_nuttx.c b/arch/rgmp/src/arm/arch_nuttx.c index 0b6a638775..dd737946d9 100644 --- a/arch/rgmp/src/arm/arch_nuttx.c +++ b/arch/rgmp/src/arm/arch_nuttx.c @@ -43,38 +43,37 @@ #include #include - void nuttx_arch_init(void) { - } void nuttx_arch_exit(void) { - } void up_initial_state(struct tcb_s *tcb) { - struct Trapframe *tf; + struct Trapframe *tf; - if (tcb->pid != 0) { - tf = (struct Trapframe *)tcb->adj_stack_ptr-1; - memset(tf, 0, sizeof(struct Trapframe)); - tf->tf_cpsr = SVC_MOD; - tf->tf_pc = (uint32_t)tcb->start; - tcb->xcp.tf = tf; + if (tcb->pid != 0) + { + tf = (struct Trapframe *)tcb->adj_stack_ptr-1; + memset(tf, 0, sizeof(struct Trapframe)); + tf->tf_cpsr = SVC_MOD; + tf->tf_pc = (uint32_t)tcb->start; + tcb->xcp.tf = tf; } } void push_xcptcontext(struct xcptcontext *xcp) { - xcp->save_eip = xcp->tf->tf_pc; - xcp->save_eflags = xcp->tf->tf_cpsr; + xcp->save_eip = xcp->tf->tf_pc; + xcp->save_eflags = xcp->tf->tf_cpsr; - // set interrupts disabled - xcp->tf->tf_pc = (uint32_t)up_sigentry; - xcp->tf->tf_cpsr |= CPSR_IF; + // set interrupts disabled + + xcp->tf->tf_pc = (uint32_t)up_sigentry; + xcp->tf->tf_cpsr |= CPSR_IF; } void pop_xcptcontext(struct xcptcontext *xcp) diff --git a/arch/rgmp/src/bridge.c b/arch/rgmp/src/bridge.c index 19aa7ef688..46f45a8f59 100644 --- a/arch/rgmp/src/bridge.c +++ b/arch/rgmp/src/bridge.c @@ -51,81 +51,84 @@ struct bridge { - struct rgmp_bridge *b; - sem_t rd_lock; - sem_t wr_lock; + struct rgmp_bridge *b; + sem_t rd_lock; + sem_t wr_lock; }; static ssize_t up_bridge_read(struct file *filep, char *buffer, size_t len) { - ssize_t ret; - struct bridge *b = filep->f_inode->i_private; + ssize_t ret; + struct bridge *b = filep->f_inode->i_private; - sem_wait(&b->rd_lock); - ret = rgmp_bridge_read(b->b, buffer, len, 0); - sem_post(&b->rd_lock); - return ret; + sem_wait(&b->rd_lock); + ret = rgmp_bridge_read(b->b, buffer, len, 0); + sem_post(&b->rd_lock); + return ret; } static ssize_t up_bridge_write(struct file *filep, const char *buffer, size_t len) { - ssize_t ret; - struct bridge *b = filep->f_inode->i_private; + ssize_t ret; + struct bridge *b = filep->f_inode->i_private; - sem_wait(&b->wr_lock); - ret = rgmp_bridge_write(b->b, (char *)buffer, len, 0); - sem_post(&b->wr_lock); - return ret; + sem_wait(&b->wr_lock); + ret = rgmp_bridge_write(b->b, (char *)buffer, len, 0); + sem_post(&b->wr_lock); + return ret; } static int up_bridge_open(struct file *filep) { - return 0; + return 0; } static int up_bridge_close(struct file *filep) { - return 0; + return 0; } static const struct file_operations up_bridge_fops = { - .read = up_bridge_read, - .write = up_bridge_write, - .open = up_bridge_open, - .close = up_bridge_close, + .read = up_bridge_read, + .write = up_bridge_write, + .open = up_bridge_open, + .close = up_bridge_close, }; int rtos_bridge_init(struct rgmp_bridge *b) { - int err; - struct bridge *bridge; - char path[30] = {'/', 'd', 'e', 'v', '/'}; + int err; + struct bridge *bridge; + char path[30] = {'/', 'd', 'e', 'v', '/'}; - if ((bridge = kmm_malloc(sizeof(*bridge))) == NULL) - goto err0; + if ((bridge = kmm_malloc(sizeof(*bridge))) == NULL) + goto err0; - bridge->b = b; - if ((err = sem_init(&bridge->rd_lock, 0, 1)) == ERROR) - goto err1; - if ((err = sem_init(&bridge->wr_lock, 0, 1)) == ERROR) - goto err1; + bridge->b = b; + if ((err = sem_init(&bridge->rd_lock, 0, 1)) == ERROR) + goto err1; - // make rgmp_bridge0 to be the console - if (strcmp(b->vdev->name, "rgmp_bridge0") == 0) - strlcpy(path + 5, "console", 25); - else - strlcpy(path + 5, b->vdev->name, 25); + if ((err = sem_init(&bridge->wr_lock, 0, 1)) == ERROR) + goto err1; - if ((err = register_driver(path, &up_bridge_fops, 0666, bridge)) == ERROR) { - cprintf("NuttX: register bridge %s fail\n", b->vdev->name); - goto err1; - } + // make rgmp_bridge0 to be the console - return 0; + if (strcmp(b->vdev->name, "rgmp_bridge0") == 0) + strlcpy(path + 5, "console", 25); + else + strlcpy(path + 5, b->vdev->name, 25); + + if ((err = register_driver(path, &up_bridge_fops, 0666, bridge)) == ERROR) + { + cprintf("NuttX: register bridge %s fail\n", b->vdev->name); + goto err1; + } + + return 0; err1: - kmm_free(bridge); + kmm_free(bridge); err0: - return -1; + return -1; } diff --git a/arch/rgmp/src/cxx.c b/arch/rgmp/src/cxx.c index 99f42dfd27..8dfc6a697b 100644 --- a/arch/rgmp/src/cxx.c +++ b/arch/rgmp/src/cxx.c @@ -5,15 +5,15 @@ int stderr = 2; void __stack_chk_fail_local(void) { - panic("stack check fail\n"); + panic("stack check fail\n"); } int __sprintf_chk(char *str, int flag, size_t strlen, const char *format) { - return snprintf(str, strlen, format); + return snprintf(str, strlen, format); } int dl_iterate_phdr(void* arg1, void* arg2) { - return -1; + return -1; } diff --git a/arch/rgmp/src/rgmp.c b/arch/rgmp/src/rgmp.c index 32289f55d3..12830090d1 100644 --- a/arch/rgmp/src/rgmp.c +++ b/arch/rgmp/src/rgmp.c @@ -65,106 +65,108 @@ const unsigned int rtos_tick_time = 10; void rtos_entry(void) { - os_start(); + os_start(); } void *rtos_get_page(void) { - return memalign(PTMEMSIZE, PTMEMSIZE); + return memalign(PTMEMSIZE, PTMEMSIZE); } void rtos_free_page(void *page) { - free(page); + free(page); } void *rtos_kmalloc(int size) { - return kmm_malloc(size); + return kmm_malloc(size); } void rtos_kfree(void *addr) { - kmm_free(addr); + kmm_free(addr); } -/** - * The interrupt can be nested. The pair of rtos_enter_interrupt() +/* The interrupt can be nested. The pair of rtos_enter_interrupt() * and rtos_exit_interrupt() make sure the context switch is * performed only in the last IRQ exit. */ + void rtos_enter_interrupt(void) { - nest_irq++; + nest_irq++; } void rtos_exit_interrupt(void) { - local_irq_disable(); - nest_irq--; - if (!nest_irq) { - struct tcb_s *rtcb = current_task; - struct tcb_s *ntcb; + local_irq_disable(); + nest_irq--; + if (!nest_irq) + { + struct tcb_s *rtcb = current_task; + struct tcb_s *ntcb; - if (rtcb->xcp.sigdeliver) { - rtcb->xcp.ctx.tf = current_regs; - push_xcptcontext(&rtcb->xcp); - } - ntcb = (struct tcb_s*)g_readytorun.head; - // switch needed - if (rtcb != ntcb) { - rtcb->xcp.ctx.tf = current_regs; - current_task = ntcb; - rgmp_switch_to(&ntcb->xcp.ctx); - } + if (rtcb->xcp.sigdeliver) + { + rtcb->xcp.ctx.tf = current_regs; + push_xcptcontext(&rtcb->xcp); + } + + ntcb = (struct tcb_s*)g_readytorun.head; + + // switch needed + + if (rtcb != ntcb) + { + rtcb->xcp.ctx.tf = current_regs; + current_task = ntcb; + rgmp_switch_to(&ntcb->xcp.ctx); + } } } void rtos_timer_isr(void *data) { - sched_process_timer(); + sched_process_timer(); } -/** - * RTOS semaphore operation - */ +/* RTOS semaphore operation */ + int rtos_sem_init(struct semaphore *sem, int val) { - if ((sem->sem = kmm_malloc(sizeof(sem_t))) == NULL) - return -1; - return sem_init(sem->sem, 0, val); + if ((sem->sem = kmm_malloc(sizeof(sem_t))) == NULL) + return -1; + return sem_init(sem->sem, 0, val); } int rtos_sem_up(struct semaphore *sem) { - return sem_post(sem->sem); + return sem_post(sem->sem); } int rtos_sem_down(struct semaphore *sem) { - return sem_wait(sem->sem); + return sem_wait(sem->sem); } void rtos_stop_running(void) { - extern void nuttx_arch_exit(void); + extern void nuttx_arch_exit(void); - local_irq_disable(); + local_irq_disable(); - nuttx_arch_exit(); + nuttx_arch_exit(); - while (1) - { - arch_hlt(); - } + while (1) + { + arch_hlt(); + } } int rtos_vnet_init(struct rgmp_vnet *vnet) { - extern int vnet_init(struct rgmp_vnet *vnet); + extern int vnet_init(struct rgmp_vnet *vnet); - return vnet_init(vnet); + return vnet_init(vnet); } - - - diff --git a/arch/rgmp/src/x86/arch_nuttx.c b/arch/rgmp/src/x86/arch_nuttx.c index 2ca3d02e04..d5ae691686 100644 --- a/arch/rgmp/src/x86/arch_nuttx.c +++ b/arch/rgmp/src/x86/arch_nuttx.c @@ -62,34 +62,37 @@ void nuttx_arch_init(void) void nuttx_arch_exit(void) { - extern void e1000_mod_exit(void); + extern void e1000_mod_exit(void); #ifdef CONFIG_NET_E1000 - e1000_mod_exit(); + e1000_mod_exit(); #endif - } void up_initial_state(struct tcb_s *tcb) { - struct Trapframe *tf; + struct Trapframe *tf; - if (tcb->pid) { - tf = (struct Trapframe *)tcb->adj_stack_ptr - 1; - rgmp_setup_context(&tcb->xcp.ctx, tf, tcb->start, 1); + if (tcb->pid) + { + tf = (struct Trapframe *)tcb->adj_stack_ptr - 1; + rgmp_setup_context(&tcb->xcp.ctx, tf, tcb->start, 1); + } + else + { + rgmp_setup_context(&tcb->xcp.ctx, NULL, NULL, 0); } - else - rgmp_setup_context(&tcb->xcp.ctx, NULL, NULL, 0); } void push_xcptcontext(struct xcptcontext *xcp) { - xcp->save_eip = xcp->ctx.tf->tf_eip; - xcp->save_eflags = xcp->ctx.tf->tf_eflags; + xcp->save_eip = xcp->ctx.tf->tf_eip; + xcp->save_eflags = xcp->ctx.tf->tf_eflags; - // set up signal entry with interrupts disabled - xcp->ctx.tf->tf_eip = (uint32_t)up_sigentry; - xcp->ctx.tf->tf_eflags = 0; + // set up signal entry with interrupts disabled + + xcp->ctx.tf->tf_eip = (uint32_t)up_sigentry; + xcp->ctx.tf->tf_eflags = 0; } void pop_xcptcontext(struct xcptcontext *xcp) diff --git a/arch/sh/src/m16c/m16c_lowputc.c b/arch/sh/src/m16c/m16c_lowputc.c index 830a25427c..f38d75b06f 100644 --- a/arch/sh/src/m16c/m16c_lowputc.c +++ b/arch/sh/src/m16c/m16c_lowputc.c @@ -167,7 +167,7 @@ */ #define M16C_UART_BRG_VALUE \ - ((M16C_XIN_FREQ / (16 * M16C_XIN_PRESCALER * M16C_UART_BAUD)) - 1) + ((M16C_XIN_FREQ / (16 * M16C_XIN_PRESCALER * M16C_UART_BAUD)) - 1) #endif /* HAVE_SERIALCONSOLE */ @@ -256,7 +256,7 @@ static inline void up_lowserialsetup(void) /* Set UART transmit/receive control register 1 to enable transmit and receive */ putreg8(UART_C1_TE|UART_C1_RE, M16C_UART_BASE + M16C_UART_C1); - + /* Set UART transmit/receive mode register data bits, stop bits, parity */ putreg8(M16C_MR_VALUE, M16C_UART_BASE + M16C_UART_MR); diff --git a/arch/sh/src/m16c/m16c_serial.c b/arch/sh/src/m16c/m16c_serial.c index 69a33e626e..9fb7cc56d3 100644 --- a/arch/sh/src/m16c/m16c_serial.c +++ b/arch/sh/src/m16c/m16c_serial.c @@ -594,7 +594,7 @@ static int up_setup(struct uart_dev_s *dev) /* Set UART transmit/receive control register 1 to enable transmit and receive */ up_serialout(priv, M16C_UART_C1, UART_C1_TE|UART_C1_RE); - + /* Set UART transmit/receive mode register data bits, stop bits, parity */ regval = 0; diff --git a/arch/sh/src/m16c/m16c_timerisr.c b/arch/sh/src/m16c/m16c_timerisr.c index d26ff845e5..adaa18af02 100644 --- a/arch/sh/src/m16c/m16c_timerisr.c +++ b/arch/sh/src/m16c/m16c_timerisr.c @@ -81,7 +81,7 @@ #define M16C_DIVISOR (65535 * CLK_TCK) #define M16C_IDEAL_PRESCALER \ - ((M16C_XIN_FREQ + M16C_DIVISOR - 1) / M16C_DIVISOR) + ((M16C_XIN_FREQ + M16C_DIVISOR - 1) / M16C_DIVISOR) /* Now, given this idel prescaler value, pick between available choices: 1, 8, and 32 */ @@ -99,12 +99,12 @@ /* Timer 0 Mode Settings */ #define M16C_TA0MODE_CONFIG \ - (TAnMR_TMOD_TIMER|TAnMR_MR_TMNOOUT|TAnMR_MR_TMNOGATE|M16C_PRESCALE_BITS) + (TAnMR_TMOD_TIMER|TAnMR_MR_TMNOOUT|TAnMR_MR_TMNOGATE|M16C_PRESCALE_BITS) /* The actual reload value matching the selected prescaler value */ #define M16C_RELOAD_VALUE \ - ((M16C_XIN_FREQ / M16C_PRESCALE_VALUE / CLK_TCK) - 1) + ((M16C_XIN_FREQ / M16C_PRESCALE_VALUE / CLK_TCK) - 1) /**************************************************************************** * Private Type Definitions diff --git a/arch/sim/src/up_devconsole.c b/arch/sim/src/up_devconsole.c index f17945e776..6c4e519d0c 100644 --- a/arch/sim/src/up_devconsole.c +++ b/arch/sim/src/up_devconsole.c @@ -69,10 +69,10 @@ static int devconsole_poll(FAR struct file *filep, FAR struct pollfd *fds, static const struct file_operations devconsole_fops = { - .read = devconsole_read, - .write = devconsole_write, + .read = devconsole_read, + .write = devconsole_write, #ifndef CONFIG_DISABLE_POLL - .poll = devconsole_poll, + .poll = devconsole_poll, #endif }; @@ -108,7 +108,7 @@ static ssize_t devconsole_read(struct file *filep, char *buffer, size_t len) } *buffer++ = ch; - nread++; + nread++; /* We have at least one character. Return now if no further * characters are available without waiting. diff --git a/arch/x86/src/i486/up_savestate.c b/arch/x86/src/i486/up_savestate.c index ad280e4fd4..e8d1c6d612 100644 --- a/arch/x86/src/i486/up_savestate.c +++ b/arch/x86/src/i486/up_savestate.c @@ -108,6 +108,6 @@ void up_savestate(uint32_t *regs) } else { - DEBUGASSERT(regs[REG_SP] == current_regs[REG_ESP] + 4*BOTTOM_PRIO); - } + DEBUGASSERT(regs[REG_SP] == current_regs[REG_ESP] + 4*BOTTOM_PRIO); + } } diff --git a/arch/z80/src/z180/z180_io.c b/arch/z80/src/z180/z180_io.c index 7e738c953a..e5b13a7eb7 100644 --- a/arch/z80/src/z180/z180_io.c +++ b/arch/z80/src/z180/z180_io.c @@ -70,9 +70,9 @@ void outp(char p, char c) { __asm - ld c, 4(ix) ; port - ld a, 5(ix) ; value - out (c), a + ld c, 4(ix) ; port + ld a, 5(ix) ; value + out (c), a __endasm; } @@ -88,7 +88,7 @@ void outp(char p, char c) char inp(char p) __naked { __asm - ld c, 4(ix) ;port - in l, (c) + ld c, 4(ix) ;port + in l, (c) __endasm; } diff --git a/arch/z80/src/z180/z180_irq.c b/arch/z80/src/z180/z180_irq.c index 258be89528..d55bd34fc8 100644 --- a/arch/z80/src/z180/z180_irq.c +++ b/arch/z80/src/z180/z180_irq.c @@ -97,8 +97,8 @@ extern uintptr_t up_vectors[16]; static void z180_seti(uint8_t value) __naked { __asm - ld a, 4(ix) ;value - ld l, a + ld a, 4(ix) ; value + ld l, a __endasm; } diff --git a/arch/z80/src/z8/z8_serial.c b/arch/z80/src/z8/z8_serial.c index a821f1863e..1faacb808d 100644 --- a/arch/z80/src/z8/z8_serial.c +++ b/arch/z80/src/z8/z8_serial.c @@ -77,15 +77,15 @@ extern uint32_t get_freq(void); struct z8_uart_s { - uint8_t volatile far* uartbase; /* Base address of UART registers */ - uint32_t baud; /* Configured baud */ - bool rxenabled; /* RX interrupt enabled */ - bool txenabled; /* TX interrupt enabled */ - uint8_t rxirq; /* RX IRQ associated with this UART */ - uint8_t txirq; /* RX IRQ associated with this UART */ - uint8_t parity; /* 0=none, 1=odd, 2=even */ - bool stopbits2; /* true: Configure with 2 stop bits - * (instead of 1) */ + uint8_t volatile far* uartbase; /* Base address of UART registers */ + uint32_t baud; /* Configured baud */ + bool rxenabled; /* RX interrupt enabled */ + bool txenabled; /* TX interrupt enabled */ + uint8_t rxirq; /* RX IRQ associated with this UART */ + uint8_t txirq; /* RX IRQ associated with this UART */ + uint8_t parity; /* 0=none, 1=odd, 2=even */ + bool stopbits2; /* true: Configure with 2 stop bits + * (instead of 1) */ }; /**************************************************************************** diff --git a/arch/z80/src/z80/z80_io.c b/arch/z80/src/z80/z80_io.c index 1db636d30e..a44be35597 100644 --- a/arch/z80/src/z80/z80_io.c +++ b/arch/z80/src/z80/z80_io.c @@ -70,9 +70,9 @@ void outp(char p, char c) { __asm - ld c, 4(ix) ; port - ld a, 5(ix) ; value - out (c), a + ld c, 4(ix) ; port + ld a, 5(ix) ; value + out (c), a __endasm; } @@ -88,7 +88,7 @@ void outp(char p, char c) char inp(char p) __naked { __asm - ld c, 4(ix) ;port - in l, (c) + ld c, 4(ix) ;port + in l, (c) __endasm; } From 3fdd914203c06cd4aa1f2706c3458c7ba59c6c6a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 5 Oct 2015 17:13:53 -0600 Subject: [PATCH 18/33] Costmetic fixes to C coding style --- arch/arm/src/a1x/a1x_pio.c | 2 +- arch/arm/src/armv6-m/up_vectors.c | 16 ++--- arch/arm/src/armv7-a/arm_syscall.c | 2 +- arch/arm/src/armv7-a/arm_virtpgaddr.c | 2 +- arch/arm/src/armv7-m/arch_enable_dcache.c | 2 +- arch/arm/src/armv7-m/up_svcall.c | 2 +- arch/arm/src/armv7-m/up_vectors.c | 16 ++--- arch/arm/src/c5471/c5471_ethernet.c | 19 +++--- arch/arm/src/c5471/c5471_serial.c | 18 +++--- arch/arm/src/c5471/c5471_timerisr.c | 7 +-- arch/arm/src/c5471/c5471_watchdog.c | 2 +- arch/arm/src/calypso/calypso_heap.c | 2 +- arch/arm/src/calypso/calypso_keypad.c | 4 +- arch/arm/src/calypso/calypso_serial.c | 22 ++++--- arch/arm/src/calypso/calypso_spi.c | 24 +++---- arch/arm/src/calypso/calypso_timer.c | 10 +-- arch/arm/src/common/up_checkstack.c | 2 +- arch/arm/src/common/up_createstack.c | 2 +- arch/arm/src/common/up_interruptcontext.c | 2 +- arch/arm/src/common/up_vfork.c | 12 ++-- arch/arm/src/dm320/dm320_framebuffer.c | 18 +++--- arch/arm/src/dm320/dm320_irq.c | 6 +- arch/arm/src/dm320/dm320_timerisr.c | 6 +- arch/arm/src/dm320/dm320_usbdev.c | 22 ++++--- arch/arm/src/efm32/efm32_adc.c | 12 ++-- arch/arm/src/efm32/efm32_clockconfig.c | 4 +- arch/arm/src/efm32/efm32_flash.c | 8 ++- arch/arm/src/efm32/efm32_gpio.c | 2 +- arch/arm/src/efm32/efm32_i2c.c | 24 ++++--- arch/arm/src/efm32/efm32_irq.c | 4 +- arch/arm/src/efm32/efm32_leserial.c | 12 ++-- arch/arm/src/efm32/efm32_pwm.c | 14 ++--- arch/arm/src/efm32/efm32_rtc_burtc.c | 4 +- arch/arm/src/efm32/efm32_serial.c | 6 +- arch/arm/src/efm32/efm32_spi.c | 22 +++---- arch/arm/src/efm32/efm32_start.c | 2 +- arch/arm/src/efm32/efm32_timer.c | 20 +++--- arch/arm/src/efm32/efm32_usbdev.c | 9 +-- arch/arm/src/efm32/efm32_usbhost.c | 21 +++---- arch/arm/src/imx/imx_gpio.c | 4 +- arch/arm/src/imx/imx_serial.c | 20 +++--- arch/arm/src/imx/imx_spi.c | 8 +-- arch/arm/src/kinetis/kinetis_enet.c | 6 +- arch/arm/src/kinetis/kinetis_irq.c | 4 +- arch/arm/src/kinetis/kinetis_lowputc.c | 2 +- arch/arm/src/kinetis/kinetis_pinirq.c | 4 +- arch/arm/src/kinetis/kinetis_sdhc.c | 14 ++--- arch/arm/src/kinetis/kinetis_serial.c | 6 +- arch/arm/src/kinetis/kinetis_timerisr.c | 6 +- arch/arm/src/kl/kl_clockconfig.c | 1 - arch/arm/src/kl/kl_gpioirq.c | 4 +- arch/arm/src/kl/kl_lowgetc.c | 2 +- arch/arm/src/kl/kl_lowputc.c | 2 +- arch/arm/src/kl/kl_serial.c | 14 ++--- arch/arm/src/kl/kl_timerisr.c | 6 +- arch/arm/src/lpc11xx/lpc11_gpioint.c | 32 +++++----- arch/arm/src/lpc11xx/lpc11_i2c.c | 8 +-- arch/arm/src/lpc11xx/lpc11_serial.c | 4 +- arch/arm/src/lpc11xx/lpc11_spi.c | 2 +- arch/arm/src/lpc11xx/lpc11_timer.c | 10 +-- arch/arm/src/lpc11xx/lpc11_timerisr.c | 6 +- arch/arm/src/lpc17xx/lpc176x_rtc.c | 2 +- arch/arm/src/lpc17xx/lpc17_adc.c | 32 +++++----- arch/arm/src/lpc17xx/lpc17_can.c | 9 +-- arch/arm/src/lpc17xx/lpc17_ethernet.c | 16 ++--- arch/arm/src/lpc17xx/lpc17_gpdma.c | 12 ++-- arch/arm/src/lpc17xx/lpc17_i2c.c | 8 +-- arch/arm/src/lpc17xx/lpc17_irq.c | 4 +- arch/arm/src/lpc17xx/lpc17_mcpwm.c | 6 +- arch/arm/src/lpc17xx/lpc17_pwm.c | 2 +- arch/arm/src/lpc17xx/lpc17_sdcard.c | 39 ++++++------ arch/arm/src/lpc17xx/lpc17_serial.c | 12 ++-- arch/arm/src/lpc17xx/lpc17_spi.c | 8 +-- arch/arm/src/lpc17xx/lpc17_timer.c | 10 +-- arch/arm/src/lpc17xx/lpc17_timerisr.c | 6 +- arch/arm/src/lpc214x/lpc214x_timerisr.c | 14 ++--- arch/arm/src/lpc214x/lpc214x_usbdev.c | 9 +-- arch/arm/src/lpc2378/lpc23xx_i2c.c | 6 +- arch/arm/src/lpc2378/lpc23xx_timerisr.c | 2 +- arch/arm/src/lpc31xx/lpc31_clkfreq.c | 7 +-- arch/arm/src/lpc31xx/lpc31_clkinit.c | 6 +- arch/arm/src/lpc31xx/lpc31_fdcndx.c | 28 ++++----- arch/arm/src/lpc31xx/lpc31_irq.c | 2 +- arch/arm/src/lpc31xx/lpc31_resetclks.c | 65 +++++++++---------- arch/arm/src/lpc31xx/lpc31_spi.c | 15 +++-- arch/arm/src/lpc31xx/lpc31_timerisr.c | 14 ++--- arch/arm/src/lpc31xx/lpc31_usbdev.c | 61 +++++++++++------- arch/arm/src/lpc43xx/lpc43_ethernet.c | 9 +-- arch/arm/src/lpc43xx/lpc43_i2c.c | 23 ++++--- arch/arm/src/lpc43xx/lpc43_irq.c | 4 +- arch/arm/src/lpc43xx/lpc43_pinconfig.c | 6 +- arch/arm/src/lpc43xx/lpc43_rit.c | 2 +- arch/arm/src/lpc43xx/lpc43_serial.c | 20 +++--- arch/arm/src/lpc43xx/lpc43_spi.c | 8 +-- arch/arm/src/lpc43xx/lpc43_spifi.c | 8 +-- arch/arm/src/lpc43xx/lpc43_start.c | 5 +- arch/arm/src/lpc43xx/lpc43_usb0dev.c | 18 +++--- arch/arm/src/moxart/moxart_16550.c | 11 ++-- arch/arm/src/moxart/moxart_irq.c | 3 +- arch/arm/src/moxart/moxart_systemreset.c | 2 +- arch/arm/src/nuc1xx/nuc_serial.c | 4 +- arch/arm/src/nuc1xx/nuc_timerisr.c | 6 +- arch/arm/src/sam34/sam4cm_supc.c | 4 +- arch/arm/src/sam34/sam4l_periphclks.c | 2 +- arch/arm/src/sam34/sam_aes.c | 76 ++++++++++++----------- arch/arm/src/sam34/sam_emac.c | 14 ++--- arch/arm/src/sam34/sam_gpioirq.c | 56 ++++++++--------- arch/arm/src/sam34/sam_hsmci.c | 6 +- arch/arm/src/sam34/sam_irq.c | 4 +- arch/arm/src/sam34/sam_rtc.c | 21 ++++--- arch/arm/src/sam34/sam_rtt.c | 17 ++--- arch/arm/src/sam34/sam_spi.c | 2 +- arch/arm/src/sam34/sam_tc.c | 10 +-- arch/arm/src/sam34/sam_timerisr.c | 6 +- arch/arm/src/sam34/sam_twi.c | 12 ++-- arch/arm/src/sam34/sam_udp.c | 4 +- arch/arm/src/sam34/sam_wdt.c | 13 ++-- arch/arm/src/sama5/sam_can.c | 10 +-- arch/arm/src/sama5/sam_dbgu.c | 5 +- arch/arm/src/sama5/sam_dmac.c | 2 +- arch/arm/src/sama5/sam_emaca.c | 16 ++--- arch/arm/src/sama5/sam_emacb.c | 8 +-- arch/arm/src/sama5/sam_flexcom_serial.c | 7 ++- arch/arm/src/sama5/sam_gmac.c | 14 ++--- arch/arm/src/sama5/sam_hsmci.c | 26 ++++---- arch/arm/src/sama5/sam_lcd.c | 32 +++++----- arch/arm/src/sama5/sam_nand.c | 2 +- arch/arm/src/sama5/sam_ohci.c | 10 +-- arch/arm/src/sama5/sam_pioirq.c | 4 +- arch/arm/src/sama5/sam_pmecc.c | 26 ++++---- arch/arm/src/sama5/sam_rtc.c | 2 +- arch/arm/src/sama5/sam_sckc.c | 2 +- arch/arm/src/sama5/sam_serial.c | 7 ++- arch/arm/src/sama5/sam_ssc.c | 2 +- arch/arm/src/sama5/sam_timerisr.c | 2 +- arch/arm/src/sama5/sam_trng.c | 6 +- arch/arm/src/sama5/sam_tsd.c | 12 ++-- arch/arm/src/sama5/sam_twi.c | 6 +- arch/arm/src/sama5/sam_udphs.c | 6 +- arch/arm/src/sama5/sam_wdt.c | 9 +-- arch/arm/src/sama5/sama5d2x_pio.c | 3 +- arch/arm/src/samdl/sam_irq.c | 2 +- arch/arm/src/samdl/sam_serial.c | 24 +++---- arch/arm/src/samdl/sam_spi.c | 4 +- arch/arm/src/samdl/sam_timerisr.c | 6 +- arch/arm/src/samdl/sam_userspace.c | 10 +-- arch/arm/src/samv7/sam_allocateheap.c | 12 ++-- arch/arm/src/samv7/sam_clockconfig.c | 8 +-- arch/arm/src/samv7/sam_emac.c | 10 +-- arch/arm/src/samv7/sam_gpioirq.c | 54 ++++++++-------- arch/arm/src/samv7/sam_hsmci.c | 56 +++++++++-------- arch/arm/src/samv7/sam_irq.c | 10 +-- arch/arm/src/samv7/sam_mcan.c | 12 ++-- arch/arm/src/samv7/sam_serial.c | 26 ++++---- arch/arm/src/samv7/sam_spi.c | 10 +-- arch/arm/src/samv7/sam_ssc.c | 3 +- arch/arm/src/samv7/sam_start.c | 3 +- arch/arm/src/samv7/sam_timerisr.c | 6 +- arch/arm/src/samv7/sam_twihs.c | 6 +- arch/arm/src/samv7/sam_usbdevhs.c | 4 +- 160 files changed, 930 insertions(+), 875 deletions(-) diff --git a/arch/arm/src/a1x/a1x_pio.c b/arch/arm/src/a1x/a1x_pio.c index fbda960808..bc80416d87 100644 --- a/arch/arm/src/a1x/a1x_pio.c +++ b/arch/arm/src/a1x/a1x_pio.c @@ -67,7 +67,7 @@ ****************************************************************************/ /**************************************************************************** - * Private Function Prototypes + * Private Functions ****************************************************************************/ /**************************************************************************** * Name: a1x_pio_pin diff --git a/arch/arm/src/armv6-m/up_vectors.c b/arch/arm/src/armv6-m/up_vectors.c index a1cd64ff79..b40d6c2887 100644 --- a/arch/arm/src/armv6-m/up_vectors.c +++ b/arch/arm/src/armv6-m/up_vectors.c @@ -85,16 +85,16 @@ extern char _ebss; */ unsigned _vectors[] __attribute__((section(".vectors"))) = - { - /* Initial stack */ +{ + /* Initial stack */ - IDLE_STACK, + IDLE_STACK, - /* Reset exception handler */ + /* Reset exception handler */ - (unsigned)&__start, + (unsigned)&__start, - /* Vectors 2 - n point directly at the generic handler */ + /* Vectors 2 - n point directly at the generic handler */ - [2 ... (15 + ARMV6M_PERIPHERAL_INTERRUPTS)] = (unsigned)&exception_common - }; + [2 ... (15 + ARMV6M_PERIPHERAL_INTERRUPTS)] = (unsigned)&exception_common +}; diff --git a/arch/arm/src/armv7-a/arm_syscall.c b/arch/arm/src/armv7-a/arm_syscall.c index 9814b7e8ea..9a8fc6b05d 100644 --- a/arch/arm/src/armv7-a/arm_syscall.c +++ b/arch/arm/src/armv7-a/arm_syscall.c @@ -128,7 +128,7 @@ static void dispatch_syscall(void) " str lr, [sp, #12]\n" /* Save lr in the stack frame */ " ldr ip, =g_stublookup\n" /* R12=The base of the stub lookup table */ " ldr ip, [ip, r0, lsl #2]\n" /* R12=The address of the stub for this SYSCALL */ - " blx ip\n" /* Call the stub (modifies lr)*/ + " blx ip\n" /* Call the stub (modifies lr) */ " ldr lr, [sp, #12]\n" /* Restore lr */ " add sp, sp, #16\n" /* Destroy the stack frame */ " mov r2, r0\n" /* R2=Save return value in R2 */ diff --git a/arch/arm/src/armv7-a/arm_virtpgaddr.c b/arch/arm/src/armv7-a/arm_virtpgaddr.c index 71b5099b76..741bf8d122 100644 --- a/arch/arm/src/armv7-a/arm_virtpgaddr.c +++ b/arch/arm/src/armv7-a/arm_virtpgaddr.c @@ -85,4 +85,4 @@ uintptr_t arm_virtpgaddr(uintptr_t paddr) return 0; } -#endif /* CONFIG_MM_PGALLOC && CONFIG_ARCH_PGPOOL_MAPPING*/ +#endif /* CONFIG_MM_PGALLOC && CONFIG_ARCH_PGPOOL_MAPPING */ diff --git a/arch/arm/src/armv7-m/arch_enable_dcache.c b/arch/arm/src/armv7-m/arch_enable_dcache.c index ad0c82fef2..9c1abe47c6 100644 --- a/arch/arm/src/armv7-m/arch_enable_dcache.c +++ b/arch/arm/src/armv7-m/arch_enable_dcache.c @@ -114,7 +114,7 @@ void arch_enable_dcache(void) } while (tmpways--); } - while(sets--); + while (sets--); ARM_DSB(); diff --git a/arch/arm/src/armv7-m/up_svcall.c b/arch/arm/src/armv7-m/up_svcall.c index 103c5bd036..dafbbc4776 100644 --- a/arch/arm/src/armv7-m/up_svcall.c +++ b/arch/arm/src/armv7-m/up_svcall.c @@ -130,7 +130,7 @@ static void dispatch_syscall(void) " str lr, [sp, #12]\n" /* Save lr in the stack frame */ " ldr ip, =g_stublookup\n" /* R12=The base of the stub lookup table */ " ldr ip, [ip, r0, lsl #2]\n" /* R12=The address of the stub for this syscall */ - " blx ip\n" /* Call the stub (modifies lr)*/ + " blx ip\n" /* Call the stub (modifies lr) */ " ldr lr, [sp, #12]\n" /* Restore lr */ " add sp, sp, #16\n" /* Destroy the stack frame */ " mov r2, r0\n" /* R2=Save return value in R2 */ diff --git a/arch/arm/src/armv7-m/up_vectors.c b/arch/arm/src/armv7-m/up_vectors.c index ab24f901f0..ada819c331 100644 --- a/arch/arm/src/armv7-m/up_vectors.c +++ b/arch/arm/src/armv7-m/up_vectors.c @@ -80,16 +80,16 @@ extern char _ebss; */ unsigned _vectors[] __attribute__((section(".vectors"))) = - { - /* Initial stack */ +{ + /* Initial stack */ - IDLE_STACK, + IDLE_STACK, - /* Reset exception handler */ + /* Reset exception handler */ - (unsigned)&__start, + (unsigned)&__start, - /* Vectors 2 - n point directly at the generic handler */ + /* Vectors 2 - n point directly at the generic handler */ - [2 ... (15 + ARMV7M_PERIPHERAL_INTERRUPTS)] = (unsigned)&exception_common - }; + [2 ... (15 + ARMV7M_PERIPHERAL_INTERRUPTS)] = (unsigned)&exception_common +}; diff --git a/arch/arm/src/c5471/c5471_ethernet.c b/arch/arm/src/c5471/c5471_ethernet.c index 79c4adaa02..866e502f73 100644 --- a/arch/arm/src/c5471/c5471_ethernet.c +++ b/arch/arm/src/c5471/c5471_ethernet.c @@ -871,11 +871,11 @@ static int c5471_transmit(struct c5471_driver_s *c5471) /* Words #0 and #1 of descriptor */ while (EIM_TXDESC_OWN_HOST & getreg32(c5471->c_rxcpudesc)) - { - /* Loop until the SWITCH lets go of the descriptor giving us access - * rights to submit our new ether frame to it. - */ - } + { + /* Loop until the SWITCH lets go of the descriptor giving us access + * rights to submit our new ether frame to it. + */ + } if (bfirstframe) { @@ -1683,7 +1683,7 @@ static int c5471_ifup(struct net_driver_s *dev) ndbg("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, - (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24 ); + (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); /* Initilize Ethernet interface */ @@ -2244,12 +2244,12 @@ void up_netinitialize(void) g_c5471[0].c_dev.d_addmac = c5471_addmac; /* Add multicast MAC address */ g_c5471[0].c_dev.d_rmmac = c5471_rmmac; /* Remove multicast MAC address */ #endif - g_c5471[0].c_dev.d_private = (void*)g_c5471; /* Used to recover private state from dev */ + g_c5471[0].c_dev.d_private = (void*)g_c5471; /* Used to recover private state from dev */ /* Create a watchdog for timing polling for and timing of transmisstions */ - g_c5471[0].c_txpoll = wd_create(); /* Create periodic poll timer */ - g_c5471[0].c_txtimeout = wd_create(); /* Create TX timeout timer */ + g_c5471[0].c_txpoll = wd_create(); /* Create periodic poll timer */ + g_c5471[0].c_txtimeout = wd_create(); /* Create TX timeout timer */ /* Register the device with the OS so that socket IOCTLs can be performed */ @@ -2257,4 +2257,3 @@ void up_netinitialize(void) } #endif /* CONFIG_NET */ - diff --git a/arch/arm/src/c5471/c5471_serial.c b/arch/arm/src/c5471/c5471_serial.c index 4aa51ff6ad..6e616a787b 100644 --- a/arch/arm/src/c5471/c5471_serial.c +++ b/arch/arm/src/c5471/c5471_serial.c @@ -562,18 +562,18 @@ static int up_interrupt(int irq, void *context) /* Is this an interrupt from the IrDA UART? */ if (irq == C5471_IRQ_UART_IRDA) - { - /* Save the currently enabled IrDA UART interrupts - * so that we can restore the IrDA interrupt state - * below. - */ + { + /* Save the currently enabled IrDA UART interrupts + * so that we can restore the IrDA interrupt state + * below. + */ - ier_val = up_inserial(priv, UART_IER_OFFS); + ier_val = up_inserial(priv, UART_IER_OFFS); - /* Then disable all IrDA UART interrupts */ + /* Then disable all IrDA UART interrupts */ - up_serialout(priv, UART_IER_OFFS, 0); - } + up_serialout(priv, UART_IER_OFFS, 0); + } /* Receive characters from the RX fifo */ diff --git a/arch/arm/src/c5471/c5471_timerisr.c b/arch/arm/src/c5471/c5471_timerisr.c index 065a15728b..6f1ca3da87 100644 --- a/arch/arm/src/c5471/c5471_timerisr.c +++ b/arch/arm/src/c5471/c5471_timerisr.c @@ -92,10 +92,10 @@ int up_timerisr(int irq, uint32_t *regs) { - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); - return 0; + sched_process_timer(); + return 0; } /**************************************************************************** @@ -125,4 +125,3 @@ void up_timer_initialize(void) irq_attach(C5471_IRQ_SYSTIMER, (xcpt_t)up_timerisr); up_enable_irq(C5471_IRQ_SYSTIMER); } - diff --git a/arch/arm/src/c5471/c5471_watchdog.c b/arch/arm/src/c5471/c5471_watchdog.c index c76a0dd4a9..2143246d6e 100644 --- a/arch/arm/src/c5471/c5471_watchdog.c +++ b/arch/arm/src/c5471/c5471_watchdog.c @@ -296,7 +296,7 @@ static int wdt_ioctl(FAR struct file *filep, int cmd, unsigned long arg) /* Process the IOCTL command (see arch/watchdog.h) */ - switch(cmd) + switch (cmd) { case WDIOC_KEEPALIVE: wdt_setusec(MAX_WDT_USEC); diff --git a/arch/arm/src/calypso/calypso_heap.c b/arch/arm/src/calypso/calypso_heap.c index 7193fa1a7c..14d73b11ce 100644 --- a/arch/arm/src/calypso/calypso_heap.c +++ b/arch/arm/src/calypso/calypso_heap.c @@ -80,7 +80,7 @@ void up_addregion(void) /* Disable watchdog in first non-common function */ wdog_enable(0); #endif - // XXX: change to initialization of extern memory with save defaults + /* XXX: change to initialization of extern memory with save defaults */ /* Configure memory interface */ calypso_mem_cfg(CALYPSO_nCS0, 3, CALYPSO_MEM_16bit, 1); calypso_mem_cfg(CALYPSO_nCS1, 3, CALYPSO_MEM_16bit, 1); diff --git a/arch/arm/src/calypso/calypso_keypad.c b/arch/arm/src/calypso/calypso_keypad.c index 4ff6a52069..e32bcc9a12 100644 --- a/arch/arm/src/calypso/calypso_keypad.c +++ b/arch/arm/src/calypso/calypso_keypad.c @@ -143,7 +143,7 @@ static int pwr_btn_dec(uint32_t * state, uint8_t reg, char *buf, size_t * len) *state |= 0x80000000; } - return 1; // break loop in caller + return 1; /* break loop in caller */ } else { @@ -164,7 +164,7 @@ static int pwr_btn_dec(uint32_t * state, uint8_t reg, char *buf, size_t * len) } } - return 0; // continue with other columns + return 0; /* Continue with other columns */ } /**************************************************************************** diff --git a/arch/arm/src/calypso/calypso_serial.c b/arch/arm/src/calypso/calypso_serial.c index fa5587a2e8..8a7c181505 100644 --- a/arch/arm/src/calypso/calypso_serial.c +++ b/arch/arm/src/calypso/calypso_serial.c @@ -73,7 +73,9 @@ #if UART_FCR_OFFS == UART_EFR_OFFS # define UART_MULTIPLEX_REGS -// HW flow control not supported yet + +/* HW flow control not supported yet */ + # undef CONFIG_UART_HWFLOWCONTROL #endif @@ -622,18 +624,18 @@ static int up_interrupt(int irq, void *context) /* Is this an interrupt from the IrDA UART? */ if (irq == UART_IRQ_IRDA) - { - /* Save the currently enabled IrDA UART interrupts - * so that we can restore the IrDA interrupt state - * below. - */ + { + /* Save the currently enabled IrDA UART interrupts + * so that we can restore the IrDA interrupt state + * below. + */ - ier_val = up_inserial(priv, UART_IER_OFFS); + ier_val = up_inserial(priv, UART_IER_OFFS); - /* Then disable all IrDA UART interrupts */ + /* Then disable all IrDA UART interrupts */ - up_serialout(priv, UART_IER_OFFS, 0); - } + up_serialout(priv, UART_IER_OFFS, 0); + } /* Receive characters from the RX fifo */ diff --git a/arch/arm/src/calypso/calypso_spi.c b/arch/arm/src/calypso/calypso_spi.c index 7357ccd67a..b33b08b133 100644 --- a/arch/arm/src/calypso/calypso_spi.c +++ b/arch/arm/src/calypso/calypso_spi.c @@ -223,18 +223,18 @@ int spi_xfer(uint8_t dev_idx, uint8_t bitlen, const void *dout, void *din) /* wait until the transfer is complete */ while (1) - { - reg_status = getreg16(SPI_REG(REG_STATUS)); - dbg("status=0x%04x ", reg_status); - if (din && (reg_status & SPI_STATUS_RE)) - { - break; - } - else if (reg_status & SPI_STATUS_WE) - { - break; - } - } + { + reg_status = getreg16(SPI_REG(REG_STATUS)); + dbg("status=0x%04x ", reg_status); + if (din && (reg_status & SPI_STATUS_RE)) + { + break; + } + else if (reg_status & SPI_STATUS_WE) + { + break; + } + } /* FIXME: calibrate how much delay we really need (seven 13MHz cycles) */ diff --git a/arch/arm/src/calypso/calypso_timer.c b/arch/arm/src/calypso/calypso_timer.c index 548e224063..7b98041670 100644 --- a/arch/arm/src/calypso/calypso_timer.c +++ b/arch/arm/src/calypso/calypso_timer.c @@ -161,11 +161,11 @@ void wdog_enable(int on) void wdog_reset(void) { - // enable watchdog + /* Enable watchdog */ putreg16(WD_MODE_ENABLE, WDOG_REG(WD_MODE)); - // force expiration + /* Force expiration */ putreg16(0x0000, WDOG_REG(WD_LOAD_TIMER)); putreg16(0x0000, WDOG_REG(WD_LOAD_TIMER)); @@ -186,10 +186,10 @@ void wdog_reset(void) int up_timerisr(int irq, uint32_t *regs) { - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); - return 0; + sched_process_timer(); + return 0; } /**************************************************************************** diff --git a/arch/arm/src/common/up_checkstack.c b/arch/arm/src/common/up_checkstack.c index 03cea836d3..dbf08f2ecc 100644 --- a/arch/arm/src/common/up_checkstack.c +++ b/arch/arm/src/common/up_checkstack.c @@ -136,7 +136,7 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size) } up_putc(ch); - } + } up_putc('\n'); } diff --git a/arch/arm/src/common/up_createstack.c b/arch/arm/src/common/up_createstack.c index 0903269f8d..d7b010054d 100644 --- a/arch/arm/src/common/up_createstack.c +++ b/arch/arm/src/common/up_createstack.c @@ -231,7 +231,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) return OK; } - return ERROR; + return ERROR; } /**************************************************************************** diff --git a/arch/arm/src/common/up_interruptcontext.c b/arch/arm/src/common/up_interruptcontext.c index c7c7b20490..ec40db4017 100644 --- a/arch/arm/src/common/up_interruptcontext.c +++ b/arch/arm/src/common/up_interruptcontext.c @@ -66,5 +66,5 @@ bool up_interrupt_context(void) { - return current_regs != NULL; + return current_regs != NULL; } diff --git a/arch/arm/src/common/up_vfork.c b/arch/arm/src/common/up_vfork.c index 2c7f183f95..655619d8de 100644 --- a/arch/arm/src/common/up_vfork.c +++ b/arch/arm/src/common/up_vfork.c @@ -210,12 +210,12 @@ pid_t up_vfork(const struct vfork_s *context) svdbg("Child: stack base:%08x SP:%08x FP:%08x\n", child->cmn.adj_stack_ptr, newsp, newfp); - /* Update the stack pointer, frame pointer, and volatile registers. When - * the child TCB was initialized, all of the values were set to zero. - * up_initial_state() altered a few values, but the return value in R0 - * should be cleared to zero, providing the indication to the newly started - * child thread. - */ + /* Update the stack pointer, frame pointer, and volatile registers. When + * the child TCB was initialized, all of the values were set to zero. + * up_initial_state() altered a few values, but the return value in R0 + * should be cleared to zero, providing the indication to the newly started + * child thread. + */ child->cmn.xcp.regs[REG_R4] = context->r4; /* Volatile register r4 */ child->cmn.xcp.regs[REG_R5] = context->r5; /* Volatile register r5 */ diff --git a/arch/arm/src/dm320/dm320_framebuffer.c b/arch/arm/src/dm320/dm320_framebuffer.c index 9e8c9dc752..e3471c3b39 100644 --- a/arch/arm/src/dm320/dm320_framebuffer.c +++ b/arch/arm/src/dm320/dm320_framebuffer.c @@ -1201,15 +1201,15 @@ static int dm320_putcmap(FAR struct fb_vtable_s *vtable, FAR struct fb_cmap_s *c flags = irqsave(); for (i = cmap.first, len = 0; i < 256 && len < cmap.len, i++, len++) { - /* Convert the RGB to YUV */ + /* Convert the RGB to YUV */ - nxgl_rgb2yuv(cmap->red[i], cmap->green[i], cmap->blue[i], &y, &u, &v); + nxgl_rgb2yuv(cmap->red[i], cmap->green[i], cmap->blue[i], &y, &u, &v); - /* Program the CLUT */ + /* Program the CLUT */ - while (getreg16(DM320_OSD_MISCCTL) & 0x8); - putreg16(((uint16_t)y) << 8 | uint16_t(u)), DM320_OSD_CLUTRAMYCB); - putreg16(((uint16_t)v << 8 | i), DM320_OSD_CLUTRAMCR); + while (getreg16(DM320_OSD_MISCCTL) & 0x8); + putreg16(((uint16_t)y) << 8 | uint16_t(u)), DM320_OSD_CLUTRAMYCB); + putreg16(((uint16_t)v << 8 | i), DM320_OSD_CLUTRAMCR); } /* Select RAM clut */ @@ -1296,10 +1296,10 @@ static int dm320_setcursor(FAR struct fb_vtable_s *vtable, FAR struct fb_setcurs { gvdbg("x=%d y=%d\n", settings->pos.x, settings->pos.y); - if (settings->pos.x > MAX_YRES) - { + if (settings->pos.x > MAX_YRES) + { settings->pos.x = MAX_YRES; - } + } if (settings->pos.y > MAX_YRES) { diff --git a/arch/arm/src/dm320/dm320_irq.c b/arch/arm/src/dm320/dm320_irq.c index e1ce9c420c..99274c3fbf 100644 --- a/arch/arm/src/dm320/dm320_irq.c +++ b/arch/arm/src/dm320/dm320_irq.c @@ -102,9 +102,9 @@ void up_irqinitialize(void) putreg16(0xffff, DM320_INTC_IRQ1); putreg16(0xffff, DM320_INTC_IRQ2); - /* Make sure that the base addresses are zero and that - * the table increment is 4 bytes. - */ + /* Make sure that the base addresses are zero and that + * the table increment is 4 bytes. + */ putreg16(0, DM320_INTC_EABASE0); putreg16(0, DM320_INTC_EABASE1); diff --git a/arch/arm/src/dm320/dm320_timerisr.c b/arch/arm/src/dm320/dm320_timerisr.c index aaa365387b..e88cac0630 100644 --- a/arch/arm/src/dm320/dm320_timerisr.c +++ b/arch/arm/src/dm320/dm320_timerisr.c @@ -119,10 +119,10 @@ int up_timerisr(int irq, uint32_t *regs) { - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); - return 0; + sched_process_timer(); + return 0; } /**************************************************************************** diff --git a/arch/arm/src/dm320/dm320_usbdev.c b/arch/arm/src/dm320/dm320_usbdev.c index 612af87271..389fc845b0 100644 --- a/arch/arm/src/dm320/dm320_usbdev.c +++ b/arch/arm/src/dm320/dm320_usbdev.c @@ -441,10 +441,11 @@ static uint8_t dm320_getreg8(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return val; } } @@ -727,7 +728,7 @@ static int dm320_ep0write(uint8_t *buf, uint16_t nbytes) uint16_t bytesleft; uint16_t nwritten; - if ( nbytes <= DM320_EP0MAXPACKET) + if (nbytes <= DM320_EP0MAXPACKET) { bytesleft = nbytes; csr0 |= USB_PERCSR0_DATAEND; /* Transaction end bit */ @@ -762,13 +763,13 @@ static int dm320_epwrite(uint8_t epphy, uint8_t *buf, uint16_t nbytes) uint16_t bytesleft; int ret = ERROR; - if (/*epphy < USB_EP0_SELECT || */ epphy >= DM320_NENDPOINTS) + if (/* epphy < USB_EP0_SELECT || */ epphy >= DM320_NENDPOINTS) { return ret; } dm320_putreg8(epphy, DM320_USB_INDEX); - if (epphy == USB_EP0_SELECT ) + if (epphy == USB_EP0_SELECT) { return dm320_ep0write(buf, nbytes); } @@ -813,7 +814,7 @@ static int dm320_epread(uint8_t epphy, uint8_t *buf, uint16_t nbytes) int bytesleft; int ret = ERROR; - if (/*epphy < USB_EP0_SELECT || */ epphy >= DM320_NENDPOINTS) + if (/* epphy < USB_EP0_SELECT || */ epphy >= DM320_NENDPOINTS) { return ret; } @@ -1848,7 +1849,7 @@ static void dm320_ctrlinitialize(FAR struct dm320_usbdev_s *priv) priv->paddr = 0; dm320_putreg8(0, DM320_USB_FADDR); - /* Finished -- set default endpoint as EP0*/ + /* Finished -- set default endpoint as EP0 */ dm320_putreg8(USB_EP0_SELECT, DM320_USB_INDEX); } @@ -2133,6 +2134,7 @@ static int dm320_epcancel(struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req) return -EINVAL; } #endif + usbtrace(TRACE_EPCANCEL, privep->epphy); priv = privep->dev; @@ -2516,7 +2518,7 @@ int usbdev_register(FAR struct usbdevclass_driver_s *driver) /* Hook up the driver */ - g_usbdev.driver = driver; + g_usbdev.driver = driver; /* Then bind the class driver */ diff --git a/arch/arm/src/efm32/efm32_adc.c b/arch/arm/src/efm32/efm32_adc.c index c23654c66f..c841597018 100644 --- a/arch/arm/src/efm32/efm32_adc.c +++ b/arch/arm/src/efm32/efm32_adc.c @@ -113,8 +113,8 @@ struct efm32_dev_s /* ADC Register access */ -static uint32_t adc_getreg( struct efm32_dev_s *priv, int offset); -static void adc_putreg( struct efm32_dev_s *priv, int offset, uint32_t value); +static uint32_t adc_getreg(struct efm32_dev_s *priv, int offset); +static void adc_putreg(struct efm32_dev_s *priv, int offset, uint32_t value); static void adc_hw_reset(struct efm32_dev_s *priv, bool reset); /* ADC Interrupt Handler */ @@ -662,9 +662,9 @@ uint8_t ADC_TimebaseCalc(uint32_t hfperFreq) /* Just in case, make sure we get non-zero freq for below calculation */ if (!hfperFreq) - { - hfperFreq = 1; - } + { + hfperFreq = 1; + } } #if defined(_EFM32_GIANT_FAMILY) || defined(_EFM32_WONDER_FAMILY) @@ -675,7 +675,7 @@ uint8_t ADC_TimebaseCalc(uint32_t hfperFreq) * See reference manual for details. */ - if (hfperFreq > 32000000 ) + if (hfperFreq > 32000000) { hfperFreq = 32000000; } diff --git a/arch/arm/src/efm32/efm32_clockconfig.c b/arch/arm/src/efm32/efm32_clockconfig.c index 75af2d7589..40e1739084 100644 --- a/arch/arm/src/efm32/efm32_clockconfig.c +++ b/arch/arm/src/efm32/efm32_clockconfig.c @@ -154,7 +154,7 @@ static inline void efm32_statuswait(uint32_t bitset) { /* Wait for clock to stabilize if requested */ - while ((getreg32(EFM32_CMU_STATUS) & bitset) == 0); + while ((getreg32(EFM32_CMU_STATUS) & bitset) == 0); } /**************************************************************************** @@ -502,7 +502,7 @@ static inline uint32_t efm32_hfclk_config(uint32_t hfclksel, uint32_t hfclkdiv) ****************************************************************************/ #ifdef CONFIG_EFM32_LECLOCK -uint32_t efm32_coreleclk_config( int frequency ) +uint32_t efm32_coreleclk_config(int frequency) { #ifdef CMU_CTRL_HFLE uint32_t regval; diff --git a/arch/arm/src/efm32/efm32_flash.c b/arch/arm/src/efm32/efm32_flash.c index 231612b0e8..014f3f8cae 100644 --- a/arch/arm/src/efm32/efm32_flash.c +++ b/arch/arm/src/efm32/efm32_flash.c @@ -240,7 +240,9 @@ int __ramfunc__ msc_load_verify_address(uint32_t* address) /* Check for invalid address */ if (status & MSC_STATUS_INVADDR) - return -EINVAL; + { + return -EINVAL; + } /* Check for write protected page */ @@ -374,7 +376,7 @@ int __ramfunc__ msc_load_write_data(uint32_t* data, uint32_t num_words, DEBUGASSERT(BOARD_SYSTEM_FREQUENCY >= 1000000); word_index = 0; - while(word_index < num_words) + while (word_index < num_words) { putreg32(*data++,EFM32_MSC_WDATA); word_index++; @@ -431,7 +433,7 @@ int __ramfunc__ msc_load_write_data(uint32_t* data, uint32_t num_words, word_index = 0; - while(word_index < num_words) + while (word_index < num_words) { /* Wait for the MSC to be ready for the next word. */ diff --git a/arch/arm/src/efm32/efm32_gpio.c b/arch/arm/src/efm32/efm32_gpio.c index 6a818c93c9..77bc980481 100644 --- a/arch/arm/src/efm32/efm32_gpio.c +++ b/arch/arm/src/efm32/efm32_gpio.c @@ -57,7 +57,7 @@ #define __GPIO_DOUT (1 << 2) /* Bit 2: An input modified with DOUT setting */ #define __GPIO_DRIVE (1 << 3) /* Bit 3: An output with drive selection */ - /************************************************************************************ +/************************************************************************************ * Private Data ************************************************************************************/ diff --git a/arch/arm/src/efm32/efm32_i2c.c b/arch/arm/src/efm32/efm32_i2c.c index b1cf913246..495b920cd9 100644 --- a/arch/arm/src/efm32/efm32_i2c.c +++ b/arch/arm/src/efm32/efm32_i2c.c @@ -126,7 +126,7 @@ /* Macros to convert a I2C pin to a GPIO output */ -#define I2C_OUTPUT (GPIO_OUTPUT | GPIO_OUTPUT_SET | GPIO_CNF_OUTOD ) +#define I2C_OUTPUT (GPIO_OUTPUT | GPIO_OUTPUT_SET | GPIO_CNF_OUTOD) #define MKI2C_OUTPUT(p) (((p) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | I2C_OUTPUT) @@ -873,8 +873,8 @@ static void efm32_i2c_setclock(FAR struct efm32_i2c_priv_s *priv, #if defined(CONFIG_EFM32_I2C_CLHR_FAST) # define n (11 + 6) /* Ratio is 11:3 */ #elif defined(CONFIG_EFM32_I2C_CLHR_ASYMMETRIC) -# define n ( 6 + 3) /* Ratio is 6:3 */ -#else /* CLHR STANDARD */ +# define n (6 + 3) /* Ratio is 6:3 */ +#else /* CLHR STANDARD */ # define n ( 4 + 4) /* Ratio is 4:4 */ #endif @@ -1284,7 +1284,6 @@ static int efm32_i2c_isr(struct efm32_i2c_priv_s *priv) } done: - if (priv->i2c_state == I2CSTATE_DONE) { #ifndef CONFIG_I2C_POLLED @@ -1607,35 +1606,35 @@ static int efm32_i2c_process(FAR struct i2c_dev_s *dev, { /* Check for error status conditions */ - switch(priv->result) + switch (priv->result) { - /* Arbitration lost during transfer. */ + /* Arbitration lost during transfer. */ case I2CRESULT_ARBLOST: errval = EAGAIN; break; - /* NACK received during transfer. */ + /* NACK received during transfer. */ case I2CRESULT_NACK: errval = ENXIO; break; - /* SW fault. */ + /* SW fault. */ case I2CRESULT_SWFAULT: errval = EIO; break; - /* Usage fault. */ + /* Usage fault. */ case I2CRESULT_USAGEFAULT: errval = EINTR; break; - /* Bus error during transfer (misplaced START/STOP). - * I2C Bus is for some reason busy - */ + /* Bus error during transfer (misplaced START/STOP). + * I2C Bus is for some reason busy + */ case I2CRESULT_BUSERR: errval = EBUSY; @@ -1975,7 +1974,6 @@ int up_i2creset(FAR struct i2c_dev_s *dev) ret = OK; out: - /* Release the port for re-use by other clients */ efm32_i2c_sem_post(dev); diff --git a/arch/arm/src/efm32/efm32_irq.c b/arch/arm/src/efm32/efm32_irq.c index 9923bcdf25..1b6bb18790 100644 --- a/arch/arm/src/efm32/efm32_irq.c +++ b/arch/arm/src/efm32/efm32_irq.c @@ -313,8 +313,8 @@ static int efm32_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit, else { - *regaddr = NVIC_SYSHCON; - if (irq == EFM32_IRQ_MEMFAULT) + *regaddr = NVIC_SYSHCON; + if (irq == EFM32_IRQ_MEMFAULT) { *bit = NVIC_SYSHCON_MEMFAULTENA; } diff --git a/arch/arm/src/efm32/efm32_leserial.c b/arch/arm/src/efm32/efm32_leserial.c index d0e0e80cb8..9ae4fd8341 100644 --- a/arch/arm/src/efm32/efm32_leserial.c +++ b/arch/arm/src/efm32/efm32_leserial.c @@ -343,9 +343,9 @@ static void efm32_disableuartint(struct efm32_leuart_s *priv, uint32_t *ien) flags = irqsave(); if (ien) - { - *ien = priv->ien; - } + { + *ien = priv->ien; + } efm32_restoreuartint(priv, 0); irqrestore(flags); @@ -362,12 +362,12 @@ static void efm32_disableuartint(struct efm32_leuart_s *priv, uint32_t *ien) static int efm32_setup(struct uart_dev_s *dev) { - struct efm32_leuart_s *priv = (struct efm32_leuart_s*)dev->priv; + struct efm32_leuart_s *priv = (struct efm32_leuart_s*)dev->priv; #ifndef CONFIG_SUPPRESS_LEUART_CONFIG - const struct efm32_config_s *config = priv->config; + const struct efm32_config_s *config = priv->config; - /* Configure the UART as an RS-232 UART */ + /* Configure the UART as an RS-232 UART */ efm32_leuartconfigure(config->uartbase, config->baud, config->parity, config->bits, config->stop2); diff --git a/arch/arm/src/efm32/efm32_pwm.c b/arch/arm/src/efm32/efm32_pwm.c index 20c2d44f5a..d0240c8b4d 100644 --- a/arch/arm/src/efm32/efm32_pwm.c +++ b/arch/arm/src/efm32/efm32_pwm.c @@ -410,7 +410,7 @@ static int pwm_timer(FAR struct efm32_pwmtimer_s *priv, #error "Not implemented ! Sorry" #endif - if ( efm32_timer_set_freq(priv->base,priv->pclk,info->frequency) < 0 ) + if (efm32_timer_set_freq(priv->base,priv->pclk,info->frequency) < 0) { pwmdbg("Cannot set TIMER frequency %dHz from clock %dHz\n", info->frequency, @@ -421,7 +421,7 @@ static int pwm_timer(FAR struct efm32_pwmtimer_s *priv, regval = ((uint32_t)(priv->pinloc)) << _TIMER_ROUTE_LOCATION_SHIFT; - switch(priv->channel) + switch (priv->channel) { case 0: regval |= _TIMER_ROUTE_CC0PEN_MASK; @@ -439,7 +439,7 @@ static int pwm_timer(FAR struct efm32_pwmtimer_s *priv, ASSERT(false); } - pwm_putreg( priv, EFM32_TIMER_ROUTE_OFFSET, regval ); + pwm_putreg(priv, EFM32_TIMER_ROUTE_OFFSET, regval); regval = (info->duty * pwm_getreg(priv, EFM32_TIMER_TOP_OFFSET)) >> 16; pwm_putreg(priv, cc_offet + EFM32_TIMER_CC_CCV_OFFSET , regval); @@ -449,11 +449,11 @@ static int pwm_timer(FAR struct efm32_pwmtimer_s *priv, (_TIMER_CC_CTRL_CMOA_CLEAR << _TIMER_CC_CTRL_CMOA_SHIFT) | \ (_TIMER_CC_CTRL_COFOA_SET << _TIMER_CC_CTRL_COFOA_SHIFT) ; - pwm_putreg(priv, cc_offet + EFM32_TIMER_CC_CTRL_OFFSET, regval ); + pwm_putreg(priv, cc_offet + EFM32_TIMER_CC_CTRL_OFFSET, regval); /* Start Timer */ - pwm_putreg(priv, EFM32_TIMER_CMD_OFFSET, TIMER_CMD_START ); + pwm_putreg(priv, EFM32_TIMER_CMD_OFFSET, TIMER_CMD_START); pwm_dumpregs(priv, "After starting"); return OK; } @@ -676,7 +676,7 @@ static int pwm_setup(FAR struct pwm_lowerhalf_s *dev) /* Dnable TIMER clock */ - switch(priv->timid) + switch (priv->timid) { case 0: modifyreg32(EFM32_CMU_HFPERCLKEN0,0,CMU_HFPERCLKEN0_TIMER0); @@ -819,7 +819,7 @@ static int pwm_stop(FAR struct pwm_lowerhalf_s *dev) pwm_putreg(priv, EFM32_TIMER_CMD_OFFSET, TIMER_CMD_STOP); - irqrestore( flags); + irqrestore(flags); pwm_dumpregs(priv, "After stop"); return OK; diff --git a/arch/arm/src/efm32/efm32_rtc_burtc.c b/arch/arm/src/efm32/efm32_rtc_burtc.c index e31df78013..d14383f60f 100644 --- a/arch/arm/src/efm32/efm32_rtc_burtc.c +++ b/arch/arm/src/efm32/efm32_rtc_burtc.c @@ -189,9 +189,9 @@ static int efm32_rtc_burtc_interrupt(int irq, void *context) uint32_t source = getreg32(EFM32_BURTC_IF); if (source & BURTC_IF_LFXOFAIL) - { + { burtcdbg("BURTC_IF_LFXOFAIL"); - } + } #ifdef CONFIG_RTC_HIRES if (source & BURTC_IF_OF) diff --git a/arch/arm/src/efm32/efm32_serial.c b/arch/arm/src/efm32/efm32_serial.c index 92a2be9c18..8a970fc39e 100644 --- a/arch/arm/src/efm32/efm32_serial.c +++ b/arch/arm/src/efm32/efm32_serial.c @@ -593,9 +593,9 @@ static void efm32_disableuartint(struct efm32_usart_s *priv, uint32_t *ien) flags = irqsave(); if (ien) - { - *ien = priv->ien; - } + { + *ien = priv->ien; + } efm32_restoreuartint(priv, 0); irqrestore(flags); diff --git a/arch/arm/src/efm32/efm32_spi.c b/arch/arm/src/efm32/efm32_spi.c index 8d0a05e288..a042517e59 100644 --- a/arch/arm/src/efm32/efm32_spi.c +++ b/arch/arm/src/efm32/efm32_spi.c @@ -903,7 +903,7 @@ static uint32_t spi_setfrequency(struct spi_dev_s *dev, uint32_t frequency) * = 128 * fHFPERCLK / (256 + CLKDIV) */ - actual = (BOARD_HFPERCLK_FREQUENCY << 7) / ( 256 + clkdiv); + actual = (BOARD_HFPERCLK_FREQUENCY << 7) / (256 + clkdiv); spivdbg("frequency=%u actual=%u\n", frequency, actual); #ifndef CONFIG_SPI_OWNBUS @@ -1745,18 +1745,18 @@ struct spi_dev_s *efm32_spi_initialize(int port) /* Initialize the SPI device */ - ret = spi_portinitialize(priv); - if (ret < 0) - { - spidbg("ERROR: Failed to initialize SPI port %d\n", port); - irqrestore(flags); - return NULL; - } + ret = spi_portinitialize(priv); + if (ret < 0) + { + spidbg("ERROR: Failed to initialize SPI port %d\n", port); + irqrestore(flags); + return NULL; + } - /* Now we are initialized */ + /* Now we are initialized */ - priv->initialized = true; - irqrestore(flags); + priv->initialized = true; + irqrestore(flags); } return (struct spi_dev_s *)priv; diff --git a/arch/arm/src/efm32/efm32_start.c b/arch/arm/src/efm32/efm32_start.c index 0364c3adb2..9326700d59 100644 --- a/arch/arm/src/efm32/efm32_start.c +++ b/arch/arm/src/efm32/efm32_start.c @@ -312,6 +312,6 @@ void __start(void) /* Shouldn't get here */ - for(;;); + for (;;); #endif } diff --git a/arch/arm/src/efm32/efm32_timer.c b/arch/arm/src/efm32/efm32_timer.c index 407a2a8397..d8047521ab 100644 --- a/arch/arm/src/efm32/efm32_timer.c +++ b/arch/arm/src/efm32/efm32_timer.c @@ -191,11 +191,13 @@ void efm32_timer_reset(uintptr_t base) putreg32(_TIMER_IEN_RESETVALUE, base + EFM32_TIMER_STATUS_OFFSET ); putreg32(_TIMER_IFC_MASK, base + EFM32_TIMER_IEN_OFFSET ); putreg32(_TIMER_TOP_RESETVALUE, base + EFM32_TIMER_IF_OFFSET ); - putreg32(_TIMER_TOPB_RESETVALUE, base + EFM32_TIMER_CTRL_OFFSET ); - putreg32(_TIMER_CNT_RESETVALUE, base + EFM32_TIMER_CMD_OFFSET ); + putreg32(_TIMER_TOPB_RESETVALUE, base + EFM32_TIMER_CTRL_OFFSET ); + putreg32(_TIMER_CNT_RESETVALUE, base + EFM32_TIMER_CMD_OFFSET ); + + /* Do not reset route register, setting should be done independently + * (Note: ROUTE register may be locked by DTLOCK register.) + */ - /* Do not reset route register, setting should be done independently */ - /* (Note: ROUTE register may be locked by DTLOCK register.) */ //putreg32(_TIMER_ROUTE_RESETVALUE, base + EFM32_TIMER_ROUTE_OFFSET ); for(i = 0; i < EFM32_TIMER_NCC; i++) @@ -219,13 +221,13 @@ void efm32_timer_reset(uintptr_t base) putreg32(_TIMER_DTOGEN_RESETVALUE,base + EFM32_TIMER_DTOGEN_OFFSET ); putreg32(_TIMER_DTFAULTC_MASK, base + EFM32_TIMER_DTFAULTC_OFFSET ); #endif -} +} /**************************************************************************** * Name: efm32_timer_set_freq * * Description: - * set prescaler and top timer with best value to have "freq" + * set prescaler and top timer with best value to have "freq" * * Input parameters: * base - A base address of timer @@ -239,14 +241,14 @@ void efm32_timer_reset(uintptr_t base) int efm32_timer_set_freq(uintptr_t base, uint32_t clk_freq, uint32_t freq) { int prescaler = 0; - int cnt_freq = clk_freq>>16; + int cnt_freq = clk_freq >> 16; int reload; - while ( cnt_freq > freq ) + while (cnt_freq > freq) { prescaler++; cnt_freq>>=1; - if ( prescaler > (_TIMER_CTRL_PRESC_MASK>>_TIMER_CTRL_PRESC_SHIFT)) + if (prescaler > (_TIMER_CTRL_PRESC_MASK>>_TIMER_CTRL_PRESC_SHIFT)) { return -1; } diff --git a/arch/arm/src/efm32/efm32_usbdev.c b/arch/arm/src/efm32/efm32_usbdev.c index 18fcb3c776..9406fc163b 100644 --- a/arch/arm/src/efm32/efm32_usbdev.c +++ b/arch/arm/src/efm32/efm32_usbdev.c @@ -813,10 +813,11 @@ static uint32_t efm32_getreg(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return val; } } diff --git a/arch/arm/src/efm32/efm32_usbhost.c b/arch/arm/src/efm32/efm32_usbhost.c index f9681d293b..17ac5ea423 100644 --- a/arch/arm/src/efm32/efm32_usbhost.c +++ b/arch/arm/src/efm32/efm32_usbhost.c @@ -73,8 +73,7 @@ * Pre-processor Definitions ****************************************************************************/ /* Configuration ***************************************************************/ -/* - * EFM32 USB OTG FS Host Driver Support +/* EFM32 USB OTG FS Host Driver Support * * Pre-requisites * @@ -806,14 +805,14 @@ static void efm32_chan_free(FAR struct efm32_usbhost_s *priv, int chidx) static inline void efm32_chan_freeall(FAR struct efm32_usbhost_s *priv) { - uint8_t chidx; + uint8_t chidx; - /* Free all host channels */ + /* Free all host channels */ - for (chidx = 2; chidx < EFM32_NHOST_CHANNELS; chidx ++) - { - efm32_chan_free(priv, chidx); - } + for (chidx = 2; chidx < EFM32_NHOST_CHANNELS; chidx ++) + { + efm32_chan_free(priv, chidx); + } } /**************************************************************************** @@ -2282,7 +2281,7 @@ static void efm32_out_next(FAR struct efm32_usbhost_s *priv, int result; int ret; - /* Is the full transfer complete? Did the last chunk transfer complete OK?*/ + /* Is the full transfer complete? Did the last chunk transfer complete OK? */ result = -(int)chan->result; if (chan->xfrd < chan->buflen && result == OK) @@ -2936,11 +2935,11 @@ static void efm32_gint_disconnected(FAR struct efm32_usbhost_s *priv) /* Are we bound to a class driver? */ - if ( priv->rhport.hport.devclass) + if (priv->rhport.hport.devclass) { /* Yes.. Disconnect the class driver */ - CLASS_DISCONNECTED( priv->rhport.hport.devclass); + CLASS_DISCONNECTED(priv->rhport.hport.devclass); priv->rhport.hport.devclass = NULL; } diff --git a/arch/arm/src/imx/imx_gpio.c b/arch/arm/src/imx/imx_gpio.c index 94e87fdfef..17ac2c8327 100644 --- a/arch/arm/src/imx/imx_gpio.c +++ b/arch/arm/src/imx/imx_gpio.c @@ -106,7 +106,7 @@ void imxgpio_configpfoutput(int port, int bit) { imxgpio_configinput(port, bit); /* Same as input except: */ imxgpio_peripheralfunc(port, bit); /* Use as peripheral */ - imxgpio_primaryperipheralfunc(port, bit); /* Primary function*/ + imxgpio_primaryperipheralfunc(port, bit); /* Primary function */ imxgpio_dirout(port, bit); /* Make output */ } @@ -118,5 +118,5 @@ void imxgpio_configpfinput(int port, int bit) { imxgpio_configinput(port, bit); /* Same as input except: */ imxgpio_peripheralfunc(port, bit); /* Use as peripheral */ - imxgpio_primaryperipheralfunc(port, bit); /* Primary function*/ + imxgpio_primaryperipheralfunc(port, bit); /* Primary function */ } diff --git a/arch/arm/src/imx/imx_serial.c b/arch/arm/src/imx/imx_serial.c index 96289cf896..f17321acf3 100644 --- a/arch/arm/src/imx/imx_serial.c +++ b/arch/arm/src/imx/imx_serial.c @@ -524,7 +524,7 @@ static int up_setup(struct uart_dev_s *dev) /* Set CTS trigger level */ regval |= 30 << UART_UCR4_CTSTL_SHIFT; - } + } #endif /* i.MX reference clock (PERCLK1) is configured for 16MHz */ @@ -546,15 +546,15 @@ static int up_setup(struct uart_dev_s *dev) * First, select a closest value we can for the divider */ - div = (IMX_PERCLK1_FREQ >> 4) / priv->baud; - if (div > 7) - { - div = 7; - } - else if (div < 1) - { - div = 1; - } + div = (IMX_PERCLK1_FREQ >> 4) / priv->baud; + if (div > 7) + { + div = 7; + } + else if (div < 1) + { + div = 1; + } /* Now find the numerator and denominator. These must have * the ratio baud/(PERCLK / div / 16), but the values cannot diff --git a/arch/arm/src/imx/imx_spi.c b/arch/arm/src/imx/imx_spi.c index 934763827e..ca65011796 100644 --- a/arch/arm/src/imx/imx_spi.c +++ b/arch/arm/src/imx/imx_spi.c @@ -139,7 +139,7 @@ struct imx_spidev_s * Private Function Prototypes ****************************************************************************/ - /* SPI register access */ +/* SPI register access */ static inline uint32_t spi_getreg(struct imx_spidev_s *priv, unsigned int offset); static inline void spi_putreg(struct imx_spidev_s *priv, unsigned int offset, uint32_t value); @@ -468,11 +468,11 @@ static void spi_startxfr(struct imx_spidev_s *priv, int ntxd) */ if (ntxd > 0) - { + { regval = spi_getreg(priv, CSPI_CTRL_OFFSET); regval |= CSPI_CTRL_XCH; spi_putreg(priv, CSPI_CTRL_OFFSET, regval); - } + } } /**************************************************************************** @@ -773,7 +773,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) freqbits = CSPI_CTRL_DIV256; actual = IMX_PERCLK2_FREQ / 256; } - else /*if (frequency >= IMX_PERCLK2_FREQ / 512) */ + else /* if (frequency >= IMX_PERCLK2_FREQ / 512) */ { freqbits = CSPI_CTRL_DIV512; actual = IMX_PERCLK2_FREQ / 512; diff --git a/arch/arm/src/kinetis/kinetis_enet.c b/arch/arm/src/kinetis/kinetis_enet.c index 57c877213a..80636a35f1 100644 --- a/arch/arm/src/kinetis/kinetis_enet.c +++ b/arch/arm/src/kinetis/kinetis_enet.c @@ -394,7 +394,7 @@ static int kinetis_transmit(FAR struct kinetis_driver_s *priv) txdesc->length = kinesis_swap16(priv->dev.d_len); #ifdef CONFIG_ENET_ENHANCEDBD txdesc->bdu = 0x00000000; - txdesc->status2 = TXDESC_INT | TXDESC_TS; // | TXDESC_IINS | TXDESC_PINS; + txdesc->status2 = TXDESC_INT | TXDESC_TS; /* | TXDESC_IINS | TXDESC_PINS; */ #endif txdesc->status1 = (TXDESC_R | TXDESC_L | TXDESC_TC | TXDESC_W); @@ -480,7 +480,7 @@ static int kinetis_txpoll(struct net_driver_s *dev) if (kinetics_txringfull(priv)) { - return -EBUSY; + return -EBUSY; } } @@ -603,7 +603,7 @@ static void kinetis_receive(FAR struct kinetis_driver_s *priv) */ if (priv->dev.d_len > 0) - { + { /* Update the Ethernet header with the correct MAC address */ #ifdef CONFIG_NET_IPv4 diff --git a/arch/arm/src/kinetis/kinetis_irq.c b/arch/arm/src/kinetis/kinetis_irq.c index cded69a62a..368a5ecc74 100644 --- a/arch/arm/src/kinetis/kinetis_irq.c +++ b/arch/arm/src/kinetis/kinetis_irq.c @@ -287,8 +287,8 @@ static int kinetis_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit, else { - *regaddr = NVIC_SYSHCON; - if (irq == KINETIS_IRQ_MEMFAULT) + *regaddr = NVIC_SYSHCON; + if (irq == KINETIS_IRQ_MEMFAULT) { *bit = NVIC_SYSHCON_MEMFAULTENA; } diff --git a/arch/arm/src/kinetis/kinetis_lowputc.c b/arch/arm/src/kinetis/kinetis_lowputc.c index a7b693ccca..c01ceec5b9 100644 --- a/arch/arm/src/kinetis/kinetis_lowputc.c +++ b/arch/arm/src/kinetis/kinetis_lowputc.c @@ -169,7 +169,7 @@ void up_lowputc(char ch) while ((getreg8(CONSOLE_BASE+KINETIS_UART_S1_OFFSET) & UART_S1_TDRE) == 0); #endif - /* Then write the character to the UART data register */ + /* Then write the character to the UART data register */ putreg8((uint8_t)ch, CONSOLE_BASE+KINETIS_UART_D_OFFSET); #endif diff --git a/arch/arm/src/kinetis/kinetis_pinirq.c b/arch/arm/src/kinetis/kinetis_pinirq.c index 6535ac3a20..45b8136e5a 100644 --- a/arch/arm/src/kinetis/kinetis_pinirq.c +++ b/arch/arm/src/kinetis/kinetis_pinirq.c @@ -128,7 +128,7 @@ static int kinetis_portinterrupt(int irq, FAR void *context, */ uint32_t bit = (1 << i); - if ((isfr & bit ) != 0) + if ((isfr & bit) != 0) { /* I think that bits may be set in the ISFR for DMA activities * well. So, no error is declared if there is no registered @@ -372,7 +372,7 @@ void kinetis_pinirqenable(uint32_t pinset) regval |= PORT_PCR_IRQC_ZERO; break; - case PIN_INT_RISING : /* Interrupt on rising edge*/ + case PIN_INT_RISING : /* Interrupt on rising edge */ regval |= PORT_PCR_IRQC_RISING; break; diff --git a/arch/arm/src/kinetis/kinetis_sdhc.c b/arch/arm/src/kinetis/kinetis_sdhc.c index bfda25be61..93529f8e6b 100644 --- a/arch/arm/src/kinetis/kinetis_sdhc.c +++ b/arch/arm/src/kinetis/kinetis_sdhc.c @@ -1047,7 +1047,7 @@ static void kinetis_endtransfer(struct kinetis_dev_s *priv, sdio_eventset_t wkup /* If this was a DMA transfer, make sure that DMA is stopped */ #ifdef CONFIG_SDIO_DMA - /* Stop the DMA by resetting the data path*/ + /* Stop the DMA by resetting the data path */ regval = getreg32(KINETIS_SDHC_SYSCTL); regval |= SDHC_SYSCTL_RSTD; @@ -1420,8 +1420,8 @@ static void kinetis_frequency(FAR struct sdio_dev_s *dev, uint32_t frequency) * 96MHz / 16 <= 400KHz <= 96MHz / 16 / 16 -- YES, prescaler == 16 */ - if (/*frequency >= (BOARD_CORECLK_FREQ / 2) && */ - frequency <= (BOARD_CORECLK_FREQ / 2 / 16)) + if (/* frequency >= (BOARD_CORECLK_FREQ / 2) && */ + frequency <= (BOARD_CORECLK_FREQ / 2 / 16)) { sdclkfs = SDHC_SYSCTL_SDCLKFS_DIV2; prescaler = 2; @@ -1791,7 +1791,7 @@ static int kinetis_sendcmd(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t ar regval |= SDHC_XFERTYP_RSPTYP_NONE; break; - case MMCSD_R1B_RESPONSE: /* Response length 48, check busy & cmdindex*/ + case MMCSD_R1B_RESPONSE: /* Response length 48, check busy & cmdindex */ regval |= (SDHC_XFERTYP_RSPTYP_LEN48BSY|SDHC_XFERTYP_CICEN|SDHC_XFERTYP_CCCEN); break; @@ -2002,7 +2002,7 @@ static int kinetis_cancel(FAR struct sdio_dev_s *dev) /* If this was a DMA transfer, make sure that DMA is stopped */ #ifdef CONFIG_SDIO_DMA - /* Stop the DMA by resetting the data path*/ + /* Stop the DMA by resetting the data path */ regval = getreg32(KINETIS_SDHC_SYSCTL); regval |= SDHC_SYSCTL_RSTD; @@ -2233,7 +2233,7 @@ static int kinetis_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t r } } - /* Return the long response in CMDRSP3..0*/ + /* Return the long response in CMDRSP3..0 */ if (rlong) { @@ -2404,7 +2404,7 @@ static sdio_eventset_t kinetis_eventwait(FAR struct sdio_dev_s *dev, if (!timeout) { - return SDIOWAIT_TIMEOUT; + return SDIOWAIT_TIMEOUT; } /* Start the watchdog timer */ diff --git a/arch/arm/src/kinetis/kinetis_serial.c b/arch/arm/src/kinetis/kinetis_serial.c index 6bbf899e70..ec0085a4e0 100644 --- a/arch/arm/src/kinetis/kinetis_serial.c +++ b/arch/arm/src/kinetis/kinetis_serial.c @@ -590,9 +590,9 @@ static void up_disableuartint(struct up_dev_s *priv, uint8_t *ie) flags = irqsave(); if (ie) - { - *ie = priv->ie; - } + { + *ie = priv->ie; + } up_restoreuartint(priv, 0); irqrestore(flags); diff --git a/arch/arm/src/kinetis/kinetis_timerisr.c b/arch/arm/src/kinetis/kinetis_timerisr.c index c3818cb8e8..659da3e7cb 100644 --- a/arch/arm/src/kinetis/kinetis_timerisr.c +++ b/arch/arm/src/kinetis/kinetis_timerisr.c @@ -100,10 +100,10 @@ int up_timerisr(int irq, uint32_t *regs) { - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); - return 0; + sched_process_timer(); + return 0; } /**************************************************************************** diff --git a/arch/arm/src/kl/kl_clockconfig.c b/arch/arm/src/kl/kl_clockconfig.c index 700e87aa60..b414500f2c 100644 --- a/arch/arm/src/kl/kl_clockconfig.c +++ b/arch/arm/src/kl/kl_clockconfig.c @@ -243,4 +243,3 @@ void kl_clockconfig(void) //kl_traceconfig(); //kl_fbconfig(); } - diff --git a/arch/arm/src/kl/kl_gpioirq.c b/arch/arm/src/kl/kl_gpioirq.c index 7d831a6f4b..8aed262431 100644 --- a/arch/arm/src/kl/kl_gpioirq.c +++ b/arch/arm/src/kl/kl_gpioirq.c @@ -123,7 +123,7 @@ static int kl_portinterrupt(int irq, FAR void *context, */ uint32_t bit = (1 << i); - if ((isfr & bit ) != 0) + if ((isfr & bit) != 0) { /* I think that bits may be set in the ISFR for DMA activities * well. So, no error is declared if there is no registered @@ -322,7 +322,7 @@ void kl_gpioirqenable(uint32_t pinset) regval |= PORT_PCR_IRQC_ZERO; break; - case PIN_INT_RISING : /* Interrupt on rising edge*/ + case PIN_INT_RISING : /* Interrupt on rising edge */ regval |= PORT_PCR_IRQC_RISING; break; diff --git a/arch/arm/src/kl/kl_lowgetc.c b/arch/arm/src/kl/kl_lowgetc.c index d0714b6753..cd830093b9 100644 --- a/arch/arm/src/kl/kl_lowgetc.c +++ b/arch/arm/src/kl/kl_lowgetc.c @@ -120,7 +120,7 @@ int kl_lowgetc(void) while ((getreg8(CONSOLE_BASE+KL_UART_S1_OFFSET) & UART_S1_RDRF) == 0); - /* Then read a character from the UART data register */ + /* Then read a character from the UART data register */ ch = getreg8(CONSOLE_BASE+KL_UART_D_OFFSET); #endif diff --git a/arch/arm/src/kl/kl_lowputc.c b/arch/arm/src/kl/kl_lowputc.c index 01288ef874..4fbb884b9f 100644 --- a/arch/arm/src/kl/kl_lowputc.c +++ b/arch/arm/src/kl/kl_lowputc.c @@ -136,7 +136,7 @@ void kl_lowputc(uint32_t ch) while ((getreg8(CONSOLE_BASE+KL_UART_S1_OFFSET) & UART_S1_TDRE) == 0); - /* Then write the character to the UART data register */ + /* Then write the character to the UART data register */ putreg8((uint8_t)ch, CONSOLE_BASE+KL_UART_D_OFFSET); diff --git a/arch/arm/src/kl/kl_serial.c b/arch/arm/src/kl/kl_serial.c index 5311daecc0..04df0f470b 100644 --- a/arch/arm/src/kl/kl_serial.c +++ b/arch/arm/src/kl/kl_serial.c @@ -376,9 +376,9 @@ static void up_disableuartint(struct up_dev_s *priv, uint8_t *ie) flags = irqsave(); if (ie) - { - *ie = priv->ie; - } + { + *ie = priv->ie; + } up_restoreuartint(priv, 0); irqrestore(flags); @@ -595,10 +595,10 @@ static int up_interrupts(int irq, void *context) * OR: Receiver Overrun Flag. To clear OR, write a logic 1 to the OR flag. */ - if ((s1 & UART_S1_ERRORS) != 0) - { - up_serialout(priv, KL_UART_S1_OFFSET, (s1 & UART_S1_ERRORS)); - } + if ((s1 & UART_S1_ERRORS) != 0) + { + up_serialout(priv, KL_UART_S1_OFFSET, (s1 & UART_S1_ERRORS)); + } } return OK; diff --git a/arch/arm/src/kl/kl_timerisr.c b/arch/arm/src/kl/kl_timerisr.c index 005c3d17f3..bcd17b0648 100644 --- a/arch/arm/src/kl/kl_timerisr.c +++ b/arch/arm/src/kl/kl_timerisr.c @@ -115,10 +115,10 @@ int up_timerisr(int irq, uint32_t *regs) { - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); - return 0; + sched_process_timer(); + return 0; } /**************************************************************************** diff --git a/arch/arm/src/lpc11xx/lpc11_gpioint.c b/arch/arm/src/lpc11xx/lpc11_gpioint.c index b5b8fdc067..71075d5275 100644 --- a/arch/arm/src/lpc11xx/lpc11_gpioint.c +++ b/arch/arm/src/lpc11xx/lpc11_gpioint.c @@ -163,10 +163,10 @@ static void lpc11_setintedge(uint32_t intbase, unsigned int pin, static int lpc11_irq2port(int irq) { - /* Set 1: - * LPC176x: 12 interrupts p0.0-p0.11 - * LPC178x: 16 interrupts p0.0-p0.15 - */ + /* Set 1: + * LPC176x: 12 interrupts p0.0-p0.11 + * LPC178x: 16 interrupts p0.0-p0.15 + */ if (irq >= LPC17_VALID_FIRST0L && irq < (LPC17_VALID_FIRST0L + LPC17_VALID_NIRQS0L)) @@ -364,24 +364,24 @@ static void lpc11_gpiodemux(uint32_t intbase, uint32_t intmask, if ((intmask & bit) != 0) { - /* This pin can support an interrupt. Is there an interrupt pending - * and enabled? - */ + /* This pin can support an interrupt. Is there an interrupt pending + * and enabled? + */ - if ((intstatus & bit) != 0) - { - /* Clear the interrupt status */ + if ((intstatus & bit) != 0) + { + /* Clear the interrupt status */ - putreg32(bit, intbase + LPC17_GPIOINT_INTCLR_OFFSET); + putreg32(bit, intbase + LPC17_GPIOINT_INTCLR_OFFSET); - /* And dispatch the interrupt */ + /* And dispatch the interrupt */ - irq_dispatch(irq, context); - } + irq_dispatch(irq, context); + } - /* Increment the IRQ number on each interrupt pin */ + /* Increment the IRQ number on each interrupt pin */ - irq++; + irq++; } /* Next bit */ diff --git a/arch/arm/src/lpc11xx/lpc11_i2c.c b/arch/arm/src/lpc11xx/lpc11_i2c.c index 8af2c0b25a..881a0d8ca3 100644 --- a/arch/arm/src/lpc11xx/lpc11_i2c.c +++ b/arch/arm/src/lpc11xx/lpc11_i2c.c @@ -198,7 +198,7 @@ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) struct lpc11_i2cdev_s *priv = (struct lpc11_i2cdev_s *) dev; DEBUGASSERT(dev != NULL); - DEBUGASSERT(nbits == 7 ); + DEBUGASSERT(nbits == 7); priv->msg.addr = addr << 1; priv->msg.flags = 0 ; @@ -378,7 +378,7 @@ static int i2c_interrupt(int irq, FAR void *context) switch (state) { - case 0x00: // Bus Error + case 0x00: /* Bus Error */ case 0x20: case 0x30: case 0x38: @@ -386,8 +386,8 @@ static int i2c_interrupt(int irq, FAR void *context) i2c_stop(priv); break; - case 0x08: // START - case 0x10: // Repeat START + case 0x08: /* START */ + case 0x10: /* Repeat START */ putreg32(priv->msg.addr, priv->base + LPC11_I2C_DAT_OFFSET); putreg32(I2C_CONCLR_STAC, priv->base + LPC11_I2C_CONCLR_OFFSET); break; diff --git a/arch/arm/src/lpc11xx/lpc11_serial.c b/arch/arm/src/lpc11xx/lpc11_serial.c index 3a9809588c..47d68aae08 100644 --- a/arch/arm/src/lpc11xx/lpc11_serial.c +++ b/arch/arm/src/lpc11xx/lpc11_serial.c @@ -313,7 +313,7 @@ static inline uint32_t lpc11_uartcclkdiv(uint32_t baud) * BAUD <= CCLK / 16 / MinDL */ - return 1; + return 1; } #endif /* LPC111x */ @@ -378,8 +378,8 @@ static inline void lpc11_uart0config(void) #ifdef LPC111x static inline uint32_t lpc11_uartdl(uint32_t baud, uint8_t divcode) { + /* TODO: Calculate DL automatically */ - /*TODO: Calculate DL automatically */ uint32_t num = 312; return num; diff --git a/arch/arm/src/lpc11xx/lpc11_spi.c b/arch/arm/src/lpc11xx/lpc11_spi.c index 80a179c39c..f65f8386ff 100644 --- a/arch/arm/src/lpc11xx/lpc11_spi.c +++ b/arch/arm/src/lpc11xx/lpc11_spi.c @@ -483,7 +483,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, * the SPI data transfer. */ - while ((getreg32(LPC11_SPI_SR) & SPI_SR_SPIF) == 0); + while ((getreg32(LPC11_SPI_SR) & SPI_SR_SPIF) == 0); /* Read the SPI Status Register again to clear the status bit */ diff --git a/arch/arm/src/lpc11xx/lpc11_timer.c b/arch/arm/src/lpc11xx/lpc11_timer.c index 2401529cb7..c9ab200682 100644 --- a/arch/arm/src/lpc11xx/lpc11_timer.c +++ b/arch/arm/src/lpc11xx/lpc11_timer.c @@ -387,7 +387,7 @@ static int timer_setup(FAR struct pwm_lowerhalf_s *dev) flags = irqsave(); - /* Power on the timer peripherals*/ + /* Power on the timer peripherals */ regval = getreg32(LPC17_SYSCON_PCONP); regval |= SYSCON_PCONP_PCTIM0; @@ -396,7 +396,7 @@ static int timer_setup(FAR struct pwm_lowerhalf_s *dev) regval |= SYSCON_PCONP_PCTIM3; putreg32(regval, LPC17_SYSCON_PCONP); - /* Select clock for the timer peripheral*/ + /* Select clock for the timer peripheral */ regval = getreg32(LPC17_SYSCON_PCLKSEL0); regval &= ~(0x3 << 2); @@ -424,7 +424,7 @@ static int timer_setup(FAR struct pwm_lowerhalf_s *dev) */ putreg32(((1 << 1)|(3 << 6)), LPC17_TMR0_EMR); - putreg32((1 << 0), LPC17_TMR0_TCR); /* Start timer0*/ + putreg32((1 << 0), LPC17_TMR0_TCR); /* Start timer0 */ /* Configure the output pins GPIO3.26 */ @@ -436,8 +436,8 @@ static int timer_setup(FAR struct pwm_lowerhalf_s *dev) putreg32(~(0x3 << 0), LPC17_TMR1_CCR); /* Prescaler count frequency:Fpclk/1 */ putreg32(~(0x3 << 0), LPC17_TMR1_CTCR);/* Prescaler count frequency:Fpclk/1 */ putreg32((2 << 0), LPC17_TMR1_MCR); /* Reset on match register MR0 */ -// putreg32(((1 << 0)|(3 << 4)), LPC17_TMR1_EMR); /* Output bit toggle on external match event MAT0*/ - putreg32((1 << 0), LPC17_TMR1_TCR); /* Start timer1*/ +// putreg32(((1 << 0)|(3 << 4)), LPC17_TMR1_EMR); /* Output bit toggle on external match event MAT0 */ + putreg32((1 << 0), LPC17_TMR1_TCR); /* Start timer1 */ /* configure the output pins GPIO3.26 */ // lpc11_configgpio(GPIO_MAT0p1_2); diff --git a/arch/arm/src/lpc11xx/lpc11_timerisr.c b/arch/arm/src/lpc11xx/lpc11_timerisr.c index 8248052d19..6bbd6e0878 100644 --- a/arch/arm/src/lpc11xx/lpc11_timerisr.c +++ b/arch/arm/src/lpc11xx/lpc11_timerisr.c @@ -115,10 +115,10 @@ int up_timerisr(int irq, uint32_t *regs) { - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); - return 0; + sched_process_timer(); + return 0; } /**************************************************************************** diff --git a/arch/arm/src/lpc17xx/lpc176x_rtc.c b/arch/arm/src/lpc17xx/lpc176x_rtc.c index 7e471feb8b..be288db0e4 100644 --- a/arch/arm/src/lpc17xx/lpc176x_rtc.c +++ b/arch/arm/src/lpc17xx/lpc176x_rtc.c @@ -291,7 +291,7 @@ int up_rtcinitialize(void) { up_enable_irq(LPC17_IRQ_RTC); } -#endif /*CONFIG_RTC_ALARM*/ +#endif /* CONFIG_RTC_ALARM */ /* Perform the one-time setup of the RTC */ diff --git a/arch/arm/src/lpc17xx/lpc17_adc.c b/arch/arm/src/lpc17xx/lpc17_adc.c index 2a4d6e4d1c..0587e3085b 100644 --- a/arch/arm/src/lpc17xx/lpc17_adc.c +++ b/arch/arm/src/lpc17xx/lpc17_adc.c @@ -174,7 +174,7 @@ static void adc_reset(FAR struct adc_dev_s *dev) putreg32(0x100, LPC17_ADC_INTEN); /* Enable only global interrupt */ putreg32((priv->mask) | /* Select channels 0 to 7 on ADC0 */ -// (clkdiv) << 8) | /* CLKDIV = divisor to make the samples +// (clkdiv) << 8) | /* CLKDIV = divisor to make the samples // * per second conversion rate */ ((32) << 8) | /* CLKDIV = divisor to make the faster * conversion rate */ @@ -187,14 +187,14 @@ static void adc_reset(FAR struct adc_dev_s *dev) * trigger A/D conversion) */ LPC17_ADC_CR); -#else /*CONFIG_ADC_BURSTMODE*/ +#else /* CONFIG_ADC_BURSTMODE */ clkdiv = LPC17_CCLK / 8 / 65 / priv->sps; clkdiv <<= 8; clkdiv &= 0xff00; putreg32(ADC_CR_PDN | ADC_CR_BURST | clkdiv | priv->mask, LPC17_ADC_CR); -#endif /*CONFIG_ADC_BURSTMODE*/ +#endif /* CONFIG_ADC_BURSTMODE */ if ((priv->mask & 0x01) != 0) { @@ -322,11 +322,11 @@ static void adc_rxint(FAR struct adc_dev_s *dev, bool enable) putreg32(ADC_INTEN_GLOBAL, LPC17_ADC_INTEN); #endif -#else /*CONFIG_ADC_BURSTMODE*/ +#else /* CONFIG_ADC_BURSTMODE */ /* Enable only global interrupt */ putreg32(0x100, LPC17_ADC_INTEN); -#endif /*CONFIG_ADC_BURSTMODE*/ +#endif /* CONFIG_ADC_BURSTMODE */ } else { @@ -416,7 +416,7 @@ static int adc_interrupt(int irq, void *context) return OK; #endif -#else /*CONFIG_ADC_BURSTMODE*/ +#else /* CONFIG_ADC_BURSTMODE */ FAR struct up_dev_s *priv = (FAR struct up_dev_s *)g_adcdev.ad_priv; volatile uint32_t regVal, regVal2, regVal3; @@ -462,21 +462,21 @@ static int adc_interrupt(int irq, void *context) ADC1Buffer0[0] = regVal; ADC0IntDone = 1; -#else /*CONFIG_ADC_DIRECT_ACCESS*/ +#else /* CONFIG_ADC_DIRECT_ACCESS */ #ifdef CONFIG_ADC_WORKER_THREAD /* Store the data value plus the status bits */ ADC1Buffer0[0] = regVal; ADC0IntDone = 1; -#else /*CONFIG_ADC_WORKER_THREAD*/ +#else /* CONFIG_ADC_WORKER_THREAD */ if ((regVal) & (1 << 31)) { adc_receive(&g_adcdev, 1, (regVal >> 4) & 0xFFF); } -#endif /*CONFIG_ADC_WORKER_THREAD*/ -#endif /*CONFIG_ADC_DIRECT_ACCESS*/ +#endif /* CONFIG_ADC_WORKER_THREAD */ +#endif /* CONFIG_ADC_DIRECT_ACCESS */ } if ((priv->mask & 0x04) != 0) @@ -489,21 +489,21 @@ static int adc_interrupt(int irq, void *context) ADC2Buffer0[0] = regVal; ADC0IntDone = 1; -#else /*CONFIG_ADC_DIRECT_ACCESS*/ +#else /* CONFIG_ADC_DIRECT_ACCESS */ #ifdef CONFIG_ADC_WORKER_THREAD /* Store the data value plus the status bits */ ADC2Buffer0[0] = regVal; ADC0IntDone = 1; -#else /*CONFIG_ADC_WORKER_THREAD*/ +#else /* CONFIG_ADC_WORKER_THREAD */ if ((regVal) & (1 << 31)) { adc_receive(&g_adcdev, 2, (regVal >> 4) & 0xFFF); } -#endif /*CONFIG_ADC_WORKER_THREAD*/ -#endif /*CONFIG_ADC_DIRECT_ACCESS*/ +#endif /* CONFIG_ADC_WORKER_THREAD */ +#endif /* CONFIG_ADC_DIRECT_ACCESS */ } if ((priv->mask & 0x08) != 0) @@ -558,7 +558,7 @@ static int adc_interrupt(int irq, void *context) (FAR void *)priv, 0); } -#endif /*CONFIG_ADC_WORKER_THREAD*/ +#endif /* CONFIG_ADC_WORKER_THREAD */ } regVal3 = getreg32(LPC17_ADC_GDR); /* Read ADGDR clear the DONE and OVERRUN bits */ @@ -575,7 +575,7 @@ static int adc_interrupt(int irq, void *context) //lpc17_gpiowrite(LPCXPRESSO_GPIO0_21, 0); /* Reset pin P0.21 */ //irqrestore(saved_state); return OK; -#endif /*CONFIG_ADC_BURSTMODE*/ +#endif /* CONFIG_ADC_BURSTMODE */ } /**************************************************************************** diff --git a/arch/arm/src/lpc17xx/lpc17_can.c b/arch/arm/src/lpc17xx/lpc17_can.c index a4f357bdcb..f1e8209deb 100644 --- a/arch/arm/src/lpc17xx/lpc17_can.c +++ b/arch/arm/src/lpc17xx/lpc17_can.c @@ -322,10 +322,11 @@ static void can_printreg(uint32_t addr, uint32_t value) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return; } } diff --git a/arch/arm/src/lpc17xx/lpc17_ethernet.c b/arch/arm/src/lpc17xx/lpc17_ethernet.c index 9957c13e2c..0e1e34253e 100644 --- a/arch/arm/src/lpc17xx/lpc17_ethernet.c +++ b/arch/arm/src/lpc17xx/lpc17_ethernet.c @@ -1006,7 +1006,7 @@ static void lpc17_rxdone_process(struct lpc17_driver_s *priv) */ if (priv->lp_dev.d_len > 0) - { + { /* Update the Ethernet header with the correct MAC address */ #ifdef CONFIG_NET_IPv4 @@ -2681,16 +2681,16 @@ static inline int lpc17_phyinit(struct lpc17_driver_s *priv) for (phyaddr = 1; phyaddr < 32; phyaddr++) { - /* Check if we can see the selected device ID at this - * PHY address. - */ + /* Check if we can see the selected device ID at this + * PHY address. + */ - phyreg = (unsigned int)lpc17_phyread(phyaddr, MII_PHYID1); - nvdbg("Addr: %d PHY ID1: %04x\n", phyaddr, phyreg); + phyreg = (unsigned int)lpc17_phyread(phyaddr, MII_PHYID1); + nvdbg("Addr: %d PHY ID1: %04x\n", phyaddr, phyreg); - /* Compare OUI bits 3-18 */ + /* Compare OUI bits 3-18 */ - if (phyreg == LPC17_PHYID1) + if (phyreg == LPC17_PHYID1) { phyreg = lpc17_phyread(phyaddr, MII_PHYID2); nvdbg("Addr: %d PHY ID2: %04x\n", phyaddr, phyreg); diff --git a/arch/arm/src/lpc17xx/lpc17_gpdma.c b/arch/arm/src/lpc17xx/lpc17_gpdma.c index 530f9bd049..a8c77281b0 100644 --- a/arch/arm/src/lpc17xx/lpc17_gpdma.c +++ b/arch/arm/src/lpc17xx/lpc17_gpdma.c @@ -481,13 +481,13 @@ int lpc17_dmasetup(DMA_HANDLE handle, uint32_t control, uint32_t config, * has the highest priority and DMA channel 7 the lowest priority. */ - regval = getreg32(LPC17_DMA_ENBLDCHNS); - if ((regval & chbit) != 0) - { - /* There is an active DMA on this channel! */ + regval = getreg32(LPC17_DMA_ENBLDCHNS); + if ((regval & chbit) != 0) + { + /* There is an active DMA on this channel! */ - return -EBUSY; - } + return -EBUSY; + } /* 2. "Clear any pending interrupts on the channel to be used by writing * to the DMACIntTCClear and DMACIntErrClear register. The previous diff --git a/arch/arm/src/lpc17xx/lpc17_i2c.c b/arch/arm/src/lpc17xx/lpc17_i2c.c index 8d55944a24..fc566876cf 100644 --- a/arch/arm/src/lpc17xx/lpc17_i2c.c +++ b/arch/arm/src/lpc17xx/lpc17_i2c.c @@ -196,7 +196,7 @@ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) struct lpc17_i2cdev_s *priv = (struct lpc17_i2cdev_s *) dev; DEBUGASSERT(dev != NULL); - DEBUGASSERT(nbits == 7 ); + DEBUGASSERT(nbits == 7); priv->msg.addr = addr << 1; priv->msg.flags = 0 ; @@ -375,7 +375,7 @@ static int i2c_interrupt(int irq, FAR void *context) switch (state) { - case 0x00: // Bus Error + case 0x00: /* Bus Error */ case 0x20: case 0x30: case 0x38: @@ -383,8 +383,8 @@ static int i2c_interrupt(int irq, FAR void *context) i2c_stop(priv); break; - case 0x08: // START - case 0x10: // Repeat START + case 0x08: /* START */ + case 0x10: /* Repeat START */ putreg32(priv->msg.addr, priv->base + LPC17_I2C_DAT_OFFSET); putreg32(I2C_CONCLR_STAC, priv->base + LPC17_I2C_CONCLR_OFFSET); break; diff --git a/arch/arm/src/lpc17xx/lpc17_irq.c b/arch/arm/src/lpc17xx/lpc17_irq.c index 7a6005c71f..fcf816f802 100644 --- a/arch/arm/src/lpc17xx/lpc17_irq.c +++ b/arch/arm/src/lpc17xx/lpc17_irq.c @@ -255,8 +255,8 @@ static int lpc17_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit, else { - *regaddr = NVIC_SYSHCON; - if (irq == LPC17_IRQ_MEMFAULT) + *regaddr = NVIC_SYSHCON; + if (irq == LPC17_IRQ_MEMFAULT) { *bit = NVIC_SYSHCON_MEMFAULTENA; } diff --git a/arch/arm/src/lpc17xx/lpc17_mcpwm.c b/arch/arm/src/lpc17xx/lpc17_mcpwm.c index 13876a1556..7afe861079 100644 --- a/arch/arm/src/lpc17xx/lpc17_mcpwm.c +++ b/arch/arm/src/lpc17xx/lpc17_mcpwm.c @@ -395,7 +395,7 @@ static void mcpwm_set_apb_clock(FAR struct lpc17_mcpwmtimer_s *priv, bool on) modifyreg32(regaddr, en_bit, 0); } } -#endif /*XXXXX*/ +#endif /**************************************************************************** * Name: mcpwm_setup @@ -452,7 +452,7 @@ static int mcpwm_setup(FAR struct pwm_lowerhalf_s *dev) putreg32((0xFFFFFFFF), LPC17_MCPWM_CAPCLR);/* Clear all event capture */ - /* Configure the output pins*/ + /* Configure the output pins */ lpc17_configgpio(GPIO_MCPWM_MCOA0); lpc17_configgpio(GPIO_MCPWM_MCOB0); @@ -469,7 +469,7 @@ static int mcpwm_setup(FAR struct pwm_lowerhalf_s *dev) putreg32(400, LPC17_MCPWM_LIM0); /* Set the starting duty cycle to 0.25 */ putreg32(0, LPC17_MCPWM_MAT0); /* Reset the timer */ - putreg32(100000, LPC17_MCPWM_TC1); /* Count frequency:Fpclk/100000 = 50 MHz/100000 = 500 Hz*/ + putreg32(100000, LPC17_MCPWM_TC1); /* Count frequency:Fpclk/100000 = 50 MHz/100000 = 500 Hz */ putreg32(50000, LPC17_MCPWM_LIM1); /* Set the starting duty cycle to 0.5 */ putreg32(0, LPC17_MCPWM_MAT1); /* Reset the timer */ diff --git a/arch/arm/src/lpc17xx/lpc17_pwm.c b/arch/arm/src/lpc17xx/lpc17_pwm.c index d983b71a5d..273f3ed313 100644 --- a/arch/arm/src/lpc17xx/lpc17_pwm.c +++ b/arch/arm/src/lpc17xx/lpc17_pwm.c @@ -413,7 +413,7 @@ static void pwm_set_apb_clock(FAR struct lpc17_pwmtimer_s *priv, bool on) modifyreg32(regaddr, en_bit, 0); } } -#endif /*XXXXX*/ +#endif /**************************************************************************** * Name: pwm_setup diff --git a/arch/arm/src/lpc17xx/lpc17_sdcard.c b/arch/arm/src/lpc17xx/lpc17_sdcard.c index 1e61d471c4..b020d901b8 100644 --- a/arch/arm/src/lpc17xx/lpc17_sdcard.c +++ b/arch/arm/src/lpc17xx/lpc17_sdcard.c @@ -860,10 +860,11 @@ static uint8_t lpc17_log2(uint16_t value) DEBUGASSERT(value > 0); while (value != 1) - { - value >>= 1; - log2++; - } + { + value >>= 1; + log2++; + } + return log2; } @@ -959,27 +960,27 @@ static void lpc17_sendfifo(struct lpc17_dev_s *priv) } else { - /* No.. transfer just the bytes remaining in the user buffer, - * padding with zero as necessary to extend to a full word. - */ + /* No.. transfer just the bytes remaining in the user buffer, + * padding with zero as necessary to extend to a full word. + */ - uint8_t *ptr = (uint8_t *)priv->remaining; - int i; + uint8_t *ptr = (uint8_t *)priv->remaining; + int i; - data.w = 0; - for (i = 0; i < priv->remaining; i++) - { - data.b[i] = *ptr++; - } + data.w = 0; + for (i = 0; i < priv->remaining; i++) + { + data.b[i] = *ptr++; + } - /* Now the transfer is finished */ + /* Now the transfer is finished */ - priv->remaining = 0; - } + priv->remaining = 0; + } - /* Put the word in the FIFO */ + /* Put the word in the FIFO */ - putreg32(data.w, LPC17_SDCARD_FIFO); + putreg32(data.w, LPC17_SDCARD_FIFO); } } diff --git a/arch/arm/src/lpc17xx/lpc17_serial.c b/arch/arm/src/lpc17xx/lpc17_serial.c index 55d85849c1..4ffa10cc97 100644 --- a/arch/arm/src/lpc17xx/lpc17_serial.c +++ b/arch/arm/src/lpc17xx/lpc17_serial.c @@ -478,7 +478,7 @@ static uart_dev_t g_uart3port = # undef TTYS3_DEV /* No ttyS3 */ # endif # endif -#endif /*HAVE_CONSOLE*/ +#endif /* HAVE_CONSOLE */ /************************************************************************************ * Inline Functions @@ -609,7 +609,7 @@ static inline uint32_t lpc17_uartcclkdiv(uint32_t baud) * BAUD <= CCLK / 16 / MinDL */ - if (baud < (LPC17_CCLK / 16 / UART_MINDL )) + if (baud < (LPC17_CCLK / 16 / UART_MINDL)) { return SYSCON_PCLKSEL_CCLK; } @@ -625,7 +625,7 @@ static inline uint32_t lpc17_uartcclkdiv(uint32_t baud) * BAUD <= CCLK / 8 / MinDL */ - else if (baud < (LPC17_CCLK / 8 / UART_MINDL )) + else if (baud < (LPC17_CCLK / 8 / UART_MINDL)) { return SYSCON_PCLKSEL_CCLK2; } @@ -641,7 +641,7 @@ static inline uint32_t lpc17_uartcclkdiv(uint32_t baud) * BAUD <= CCLK / 4 / MinDL */ - else if (baud < (LPC17_CCLK / 4 / UART_MINDL )) + else if (baud < (LPC17_CCLK / 4 / UART_MINDL)) { return SYSCON_PCLKSEL_CCLK4; } @@ -657,7 +657,7 @@ static inline uint32_t lpc17_uartcclkdiv(uint32_t baud) * BAUD <= CCLK / 2 / MinDL */ - else /* if (baud < (LPC17_CCLK / 2 / UART_MINDL )) */ + else /* if (baud < (LPC17_CCLK / 2 / UART_MINDL)) */ { return SYSCON_PCLKSEL_CCLK8; } @@ -1256,7 +1256,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) * and reset the divider in the CLKSEL0/1 register. */ -#if 0 // ifdef LPC176x +#if 0 /* ifdef LPC176x */ priv->cclkdiv = lpc17_uartcclkdiv(priv->baud); #endif /* DLAB open latch */ diff --git a/arch/arm/src/lpc17xx/lpc17_spi.c b/arch/arm/src/lpc17xx/lpc17_spi.c index bbdd568c39..58fbb7de9b 100644 --- a/arch/arm/src/lpc17xx/lpc17_spi.c +++ b/arch/arm/src/lpc17xx/lpc17_spi.c @@ -474,12 +474,12 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size * data transfer. */ - while ((getreg32(LPC17_SPI_SR) & SPI_SR_SPIF) == 0); + while ((getreg32(LPC17_SPI_SR) & SPI_SR_SPIF) == 0); - /* Read the SPI Status Register again to clear the status bit */ + /* Read the SPI Status Register again to clear the status bit */ - (void)getreg32(LPC17_SPI_SR); - nwords--; + (void)getreg32(LPC17_SPI_SR); + nwords--; } } diff --git a/arch/arm/src/lpc17xx/lpc17_timer.c b/arch/arm/src/lpc17xx/lpc17_timer.c index 747137fb36..bc177f1685 100644 --- a/arch/arm/src/lpc17xx/lpc17_timer.c +++ b/arch/arm/src/lpc17xx/lpc17_timer.c @@ -387,7 +387,7 @@ static int timer_setup(FAR struct pwm_lowerhalf_s *dev) flags = irqsave(); - /* Power on the timer peripherals*/ + /* Power on the timer peripherals */ regval = getreg32(LPC17_SYSCON_PCONP); regval |= SYSCON_PCONP_PCTIM0; @@ -396,7 +396,7 @@ static int timer_setup(FAR struct pwm_lowerhalf_s *dev) regval |= SYSCON_PCONP_PCTIM3; putreg32(regval, LPC17_SYSCON_PCONP); - /* Select clock for the timer peripheral*/ + /* Select clock for the timer peripheral */ regval = getreg32(LPC17_SYSCON_PCLKSEL0); regval &= ~(0x3 << 2); @@ -424,7 +424,7 @@ static int timer_setup(FAR struct pwm_lowerhalf_s *dev) */ putreg32(((1 << 1)|(3 << 6)), LPC17_TMR0_EMR); - putreg32((1 << 0), LPC17_TMR0_TCR); /* Start timer0*/ + putreg32((1 << 0), LPC17_TMR0_TCR); /* Start timer0 */ /* Configure the output pins GPIO3.26 */ @@ -436,8 +436,8 @@ static int timer_setup(FAR struct pwm_lowerhalf_s *dev) putreg32(~(0x3 << 0), LPC17_TMR1_CCR); /* Prescaler count frequency:Fpclk/1 */ putreg32(~(0x3 << 0), LPC17_TMR1_CTCR);/* Prescaler count frequency:Fpclk/1 */ putreg32((2 << 0), LPC17_TMR1_MCR); /* Reset on match register MR0 */ -// putreg32(((1 << 0)|(3 << 4)), LPC17_TMR1_EMR); /* Output bit toggle on external match event MAT0*/ - putreg32((1 << 0), LPC17_TMR1_TCR); /* Start timer1*/ +// putreg32(((1 << 0)|(3 << 4)), LPC17_TMR1_EMR); /* Output bit toggle on external match event MAT0 */ + putreg32((1 << 0), LPC17_TMR1_TCR); /* Start timer1 */ /* configure the output pins GPIO3.26 */ // lpc17_configgpio(GPIO_MAT0p1_2); diff --git a/arch/arm/src/lpc17xx/lpc17_timerisr.c b/arch/arm/src/lpc17xx/lpc17_timerisr.c index 1b4a6a3794..f61cf58073 100644 --- a/arch/arm/src/lpc17xx/lpc17_timerisr.c +++ b/arch/arm/src/lpc17xx/lpc17_timerisr.c @@ -101,10 +101,10 @@ int up_timerisr(int irq, uint32_t *regs) { - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); - return 0; + sched_process_timer(); + return 0; } /**************************************************************************** diff --git a/arch/arm/src/lpc214x/lpc214x_timerisr.c b/arch/arm/src/lpc214x/lpc214x_timerisr.c index ecb280f24f..24defd5a52 100644 --- a/arch/arm/src/lpc214x/lpc214x_timerisr.c +++ b/arch/arm/src/lpc214x/lpc214x_timerisr.c @@ -98,20 +98,20 @@ int up_timerisr(uint32_t *regs) int up_timerisr(int irq, uint32_t *regs) #endif { - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); + sched_process_timer(); - /* Clear the MR0 match interrupt */ + /* Clear the MR0 match interrupt */ - tmr_putreg8(LPC214X_TMR_IR_MR0I, LPC214X_TMR_IR_OFFSET); + tmr_putreg8(LPC214X_TMR_IR_MR0I, LPC214X_TMR_IR_OFFSET); - /* Reset the VIC as well */ + /* Reset the VIC as well */ #ifdef CONFIG_VECTORED_INTERRUPTS - vic_putreg(0, LPC214X_VIC_VECTADDR_OFFSET); + vic_putreg(0, LPC214X_VIC_VECTADDR_OFFSET); #endif - return 0; + return 0; } /**************************************************************************** diff --git a/arch/arm/src/lpc214x/lpc214x_usbdev.c b/arch/arm/src/lpc214x/lpc214x_usbdev.c index e9eef2cc9b..6320ac9ec1 100644 --- a/arch/arm/src/lpc214x/lpc214x_usbdev.c +++ b/arch/arm/src/lpc214x/lpc214x_usbdev.c @@ -537,10 +537,11 @@ static uint32_t lpc214x_getreg(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return val; } } diff --git a/arch/arm/src/lpc2378/lpc23xx_i2c.c b/arch/arm/src/lpc2378/lpc23xx_i2c.c index af014e2da8..35567fdd52 100644 --- a/arch/arm/src/lpc2378/lpc23xx_i2c.c +++ b/arch/arm/src/lpc2378/lpc23xx_i2c.c @@ -311,9 +311,9 @@ static int i2c_start (struct lpc23xx_i2cdev_s *priv) static void i2c_stop (struct lpc23xx_i2cdev_s *priv) { if (priv->state != 0x38) - { - putreg32(I2C_CONSET_STO | I2C_CONSET_AA, priv->base + I2C_CONSET_OFFSET); - } + { + putreg32(I2C_CONSET_STO | I2C_CONSET_AA, priv->base + I2C_CONSET_OFFSET); + } sem_post (&priv->wait); } diff --git a/arch/arm/src/lpc2378/lpc23xx_timerisr.c b/arch/arm/src/lpc2378/lpc23xx_timerisr.c index e831b34459..55a29b25e2 100644 --- a/arch/arm/src/lpc2378/lpc23xx_timerisr.c +++ b/arch/arm/src/lpc2378/lpc23xx_timerisr.c @@ -78,7 +78,7 @@ #define T0_PCLKSEL_MASK (0x0000000C) -#define T0_TICKS_COUNT ((CCLK / T0_PCLK_DIV ) / TICK_PER_SEC) +#define T0_TICKS_COUNT ((CCLK / T0_PCLK_DIV) / TICK_PER_SEC) /**************************************************************************** * Private Types diff --git a/arch/arm/src/lpc31xx/lpc31_clkfreq.c b/arch/arm/src/lpc31xx/lpc31_clkfreq.c index aba8384bce..1151f42df5 100644 --- a/arch/arm/src/lpc31xx/lpc31_clkfreq.c +++ b/arch/arm/src/lpc31xx/lpc31_clkfreq.c @@ -167,11 +167,10 @@ uint32_t lpc31_clkfreq(enum lpc31_clockid_e clkid, return 0; } - /* Finally, calculate the frequency based on m and n values */ + /* Finally, calculate the frequency based on m and n values */ - freq = (freq * n) / m ; - } + freq = (freq * n) / m ; + } return freq; } - diff --git a/arch/arm/src/lpc31xx/lpc31_clkinit.c b/arch/arm/src/lpc31xx/lpc31_clkinit.c index 0f2c1141fd..f0cdd44103 100644 --- a/arch/arm/src/lpc31xx/lpc31_clkinit.c +++ b/arch/arm/src/lpc31xx/lpc31_clkinit.c @@ -138,8 +138,8 @@ static void lpc31_domaininit(struct lpc31_domainconfig_s* dmn) regaddr = LPC31_CGU_ESR(esrndx); putreg32((fdndx << CGU_ESR_ESRSEL_SHIFT) | CGU_ESR_ESREN, regaddr); } - } - } + } + } /* Enable the fractional divider */ @@ -158,7 +158,7 @@ static void lpc31_domaininit(struct lpc31_domainconfig_s* dmn) putreg32(CGU_BCR_FDRUN, regaddr); } - /* Select input base clock for domain*/ + /* Select input base clock for domain */ lpc31_selectfreqin(dmn->dmnid, dmn->finsel); } diff --git a/arch/arm/src/lpc31xx/lpc31_fdcndx.c b/arch/arm/src/lpc31xx/lpc31_fdcndx.c index 6297d65fb2..0bc9c3a556 100644 --- a/arch/arm/src/lpc31xx/lpc31_fdcndx.c +++ b/arch/arm/src/lpc31xx/lpc31_fdcndx.c @@ -106,22 +106,22 @@ int lpc31_fdcndx(enum lpc31_clockid_e clkid, enum lpc31_domainid_e dmnid) esrndx = lpc31_esrndx(clkid); if (esrndx != ESRNDX_INVALID) - { - /* Read the clock's ESR to get the fractional divider */ - - uint32_t regval = getreg32(LPC31_CGU_ESR(esrndx)); - - /* Check if any fractional divider is enabled for this clock. */ - - if ((regval & CGU_ESR_ESREN) != 0) { - /* Yes.. The FDC index is an offset from this fractional - * divider base for this domain. - */ + /* Read the clock's ESR to get the fractional divider */ - fdcndx = CGU_ESRSEL(regval) + (int)g_fdcbase[dmnid]; + uint32_t regval = getreg32(LPC31_CGU_ESR(esrndx)); + + /* Check if any fractional divider is enabled for this clock. */ + + if ((regval & CGU_ESR_ESREN) != 0) + { + /* Yes.. The FDC index is an offset from this fractional + * divider base for this domain. + */ + + fdcndx = CGU_ESRSEL(regval) + (int)g_fdcbase[dmnid]; + } } - } + return fdcndx; } - diff --git a/arch/arm/src/lpc31xx/lpc31_irq.c b/arch/arm/src/lpc31xx/lpc31_irq.c index 86796d4fb9..05108d78bb 100644 --- a/arch/arm/src/lpc31xx/lpc31_irq.c +++ b/arch/arm/src/lpc31xx/lpc31_irq.c @@ -102,7 +102,7 @@ void up_irqinitialize(void) putreg32(0, LPC31_INTC_PRIORITYMASK0); /* Proc interrupt request 0: IRQ */ putreg32(0, LPC31_INTC_PRIORITYMASK1); /* Proc interrupt request 1: FIQ */ - /* Disable all interrupts. Start from index 1 since 0 is unused.*/ + /* Disable all interrupts. Start from index 1 since 0 is unused. */ for (irq = 0; irq < NR_IRQS; irq++) { diff --git a/arch/arm/src/lpc31xx/lpc31_resetclks.c b/arch/arm/src/lpc31xx/lpc31_resetclks.c index fe32879409..4631f14748 100644 --- a/arch/arm/src/lpc31xx/lpc31_resetclks.c +++ b/arch/arm/src/lpc31xx/lpc31_resetclks.c @@ -103,42 +103,43 @@ void lpc31_resetclks(void) /* Disable all clocks except those that are necessary */ for (i = CLKID_FIRST; i <= CLKID_LAST; i++) - { - /* Check if this clock has an ESR register */ - - esrndx = lpc31_esrndx((enum lpc31_clockid_e)i); - if (esrndx != ESRNDX_INVALID) { - /* Yes.. Clear the clocks ESR to deselect fractional divider */ + /* Check if this clock has an ESR register */ - putreg32(0, LPC31_CGU_ESR(esrndx)); + esrndx = lpc31_esrndx((enum lpc31_clockid_e)i); + if (esrndx != ESRNDX_INVALID) + { + /* Yes.. Clear the clocks ESR to deselect fractional divider */ + + putreg32(0, LPC31_CGU_ESR(esrndx)); + } + + /* Enable external enabling for all possible clocks to conserve power */ + + lpc31_enableexten((enum lpc31_clockid_e)i); + + /* Set enable-out's for only the following clocks */ + + regaddr = LPC31_CGU_PCR(i); + regval = getreg32(regaddr); + if (i == (int)CLKID_ARM926BUSIFCLK || i == (int)CLKID_MPMCCFGCLK) + { + regval |= CGU_PCR_ENOUTEN; + } + else + { + regval &= ~CGU_PCR_ENOUTEN; + } + + putreg32(regval, regaddr); + + /* Set/clear the RUN bit in the PCR regiser of all clocks, depending + * upon if the clock is needed by the board logic or not + */ + + (void)lpc31_defclk((enum lpc31_clockid_e)i); } - /* Enable external enabling for all possible clocks to conserve power */ - - lpc31_enableexten((enum lpc31_clockid_e)i); - - /* Set enable-out's for only the following clocks */ - - regaddr = LPC31_CGU_PCR(i); - regval = getreg32(regaddr); - if (i == (int)CLKID_ARM926BUSIFCLK || i == (int)CLKID_MPMCCFGCLK) - { - regval |= CGU_PCR_ENOUTEN; - } - else - { - regval &= ~CGU_PCR_ENOUTEN; - } - putreg32(regval, regaddr); - - /* Set/clear the RUN bit in the PCR regiser of all clocks, depending - * upon if the clock is needed by the board logic or not - */ - - (void)lpc31_defclk((enum lpc31_clockid_e)i); - } - /* Disable all fractional dividers */ for (i = 0; i < CGU_NFRACDIV; i++) diff --git a/arch/arm/src/lpc31xx/lpc31_spi.c b/arch/arm/src/lpc31xx/lpc31_spi.c index 5d0524f718..cf282088f7 100644 --- a/arch/arm/src/lpc31xx/lpc31_spi.c +++ b/arch/arm/src/lpc31xx/lpc31_spi.c @@ -504,8 +504,7 @@ static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel return; } - /* - * Since we don't use sequential multi-slave mode, but rather + /* Since we don't use sequential multi-slave mode, but rather * perform the transfer piecemeal by consecutive calls to * SPI_SEND, then we must manually assert the chip select * across the whole transfer @@ -555,7 +554,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) uint32_t spi_clk, div, div1, div2; if (priv->frequency != frequency) - { + { /* The SPI clock is derived from the (main system oscillator / 2), * so compute the best divider from that clock */ @@ -580,8 +579,8 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) priv->slv1 = (priv->slv1 & ~(SPI_SLV_1_CLKDIV2_MASK | SPI_SLV_1_CLKDIV1_MASK)) | (div2 << SPI_SLV_1_CLKDIV2_SHIFT) | (div1 << SPI_SLV_1_CLKDIV1_SHIFT); priv->frequency = frequency; - priv->actual = frequency; // FIXME - } + priv->actual = frequency; /* FIXME */ + } return priv->actual; } @@ -689,10 +688,10 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits) static uint8_t spi_status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - /* FIXME: is there anyway to determine this - * it should probably be board dependant anyway */ + /* FIXME: is there anyway to determine this + * it should probably be board dependant anyway */ - return SPI_STATUS_PRESENT; + return SPI_STATUS_PRESENT; } /************************************************************************************ diff --git a/arch/arm/src/lpc31xx/lpc31_timerisr.c b/arch/arm/src/lpc31xx/lpc31_timerisr.c index e9a6bc2715..a6ec418605 100644 --- a/arch/arm/src/lpc31xx/lpc31_timerisr.c +++ b/arch/arm/src/lpc31xx/lpc31_timerisr.c @@ -125,13 +125,13 @@ void up_timer_initialize(void) regval = getreg32(LPC31_TIMER0_CTRL); if (freq > 1000000) - { - /* Use the divide by 16 pre-divider */ + { + /* Use the divide by 16 pre-divider */ - regval &= ~TIMER_CTRL_PRESCALE_MASK; - regval |= TIMER_CTRL_PRESCALE_DIV16; - freq >>= 4; - } + regval &= ~TIMER_CTRL_PRESCALE_MASK; + regval |= TIMER_CTRL_PRESCALE_DIV16; + freq >>= 4; + } load =((freq * (uint64_t)10000) / 1000000); putreg32((uint32_t)load, LPC31_TIMER0_LOAD); @@ -145,7 +145,7 @@ void up_timer_initialize(void) (void)irq_attach(LPC31_IRQ_TMR0, (xcpt_t)up_timerisr); - /* Clear any latched timer interrupt (Writing any value to the CLEAR register + /* Clear any latched timer interrupt (Writing any value to the CLEAR register * clears the latched interrupt generated by the counter timer) */ diff --git a/arch/arm/src/lpc31xx/lpc31_usbdev.c b/arch/arm/src/lpc31xx/lpc31_usbdev.c index a2e4386169..6c2c110d01 100644 --- a/arch/arm/src/lpc31xx/lpc31_usbdev.c +++ b/arch/arm/src/lpc31xx/lpc31_usbdev.c @@ -167,7 +167,10 @@ /* Hardware interface **********************************************************/ -/* This represents a Endpoint Transfer Descriptor - note these must be 32 byte aligned */ +/* This represents a Endpoint Transfer Descriptor - note these must be 32 byte + * aligned + */ + struct lpc31_dtd_s { volatile uint32_t nextdesc; /* Address of the next DMA descripto in RAM */ @@ -180,7 +183,8 @@ struct lpc31_dtd_s uint32_t xfer_len; /* Software only - transfer len that was queued */ }; -/* DTD nextdesc field*/ +/* DTD nextdesc field */ + #define DTD_NEXTDESC_INVALID (1 << 0) /* Bit 0 : Next Descriptor Invalid */ /* DTD config field */ @@ -495,10 +499,11 @@ static uint32_t lpc31_getreg(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return val; } } @@ -718,26 +723,34 @@ static inline void lpc31_ep0xfer(uint8_t epphy, uint8_t *buf, uint32_t nbytes) * Read a Setup packet from the DTD. * ****************************************************************************/ + static void lpc31_readsetup(uint8_t epphy, struct usb_ctrlreq_s *ctrl) { - struct lpc31_dqh_s *dqh = &g_qh[epphy]; - int i; + struct lpc31_dqh_s *dqh = &g_qh[epphy]; + int i; - do { - /* Set the trip wire */ - lpc31_setbits(USBDEV_USBCMD_SUTW, LPC31_USBDEV_USBCMD); + do + { + /* Set the trip wire */ - /* copy the request... */ - for (i = 0; i < 8; i++) - ((uint8_t *) ctrl)[i] = ((uint8_t *) dqh->setup)[i]; + lpc31_setbits(USBDEV_USBCMD_SUTW, LPC31_USBDEV_USBCMD); - } while (!(lpc31_getreg(LPC31_USBDEV_USBCMD) & USBDEV_USBCMD_SUTW)); + /* copy the request... */ - /* Clear the trip wire */ - lpc31_clrbits(USBDEV_USBCMD_SUTW, LPC31_USBDEV_USBCMD); + for (i = 0; i < 8; i++) + { + ((uint8_t *) ctrl)[i] = ((uint8_t *) dqh->setup)[i]; + } + } + while (!(lpc31_getreg(LPC31_USBDEV_USBCMD) & USBDEV_USBCMD_SUTW)); - /* Clear the Setup Interrupt */ - lpc31_putreg (LPC31_ENDPTMASK(LPC31_EP0_OUT), LPC31_USBDEV_ENDPTSETUPSTAT); + /* Clear the trip wire */ + + lpc31_clrbits(USBDEV_USBCMD_SUTW, LPC31_USBDEV_USBCMD); + + /* Clear the Setup Interrupt */ + + lpc31_putreg (LPC31_ENDPTMASK(LPC31_EP0_OUT), LPC31_USBDEV_ENDPTSETUPSTAT); } /**************************************************************************** @@ -909,12 +922,16 @@ static void lpc31_reqcomplete(struct lpc31_ep_s *privep, static void lpc31_cancelrequests(struct lpc31_ep_s *privep, int16_t status) { if (!lpc31_rqempty(privep)) + { lpc31_flushep(privep); + } while (!lpc31_rqempty(privep)) { - // FIXME: the entry at the head should be sync'd with the DTD - // FIXME: only report the error status if the transfer hasn't completed + /* FIXME: the entry at the head should be sync'd with the DTD + * FIXME: only report the error status if the transfer hasn't completed + */ + usbtrace(TRACE_COMPLETE(privep->epphy), (lpc31_rqpeek(privep))->req.xfrd); lpc31_reqcomplete(privep, lpc31_rqdequeue(privep), status); @@ -2193,7 +2210,7 @@ static int lpc31_epstall(FAR struct usbdev_ep_s *ep, bool resume) ****************************************************************************/ static FAR struct usbdev_ep_s *lpc31_allocep(FAR struct usbdev_s *dev, uint8_t eplog, - bool in, uint8_t eptype) + bool in, uint8_t eptype) { FAR struct lpc31_usbdev_s *priv = (FAR struct lpc31_usbdev_s *)dev; uint32_t epset = LPC31_EPALLSET & ~LPC31_EPCTRLSET; diff --git a/arch/arm/src/lpc43xx/lpc43_ethernet.c b/arch/arm/src/lpc43xx/lpc43_ethernet.c index d20ad7380c..18310a2701 100644 --- a/arch/arm/src/lpc43xx/lpc43_ethernet.c +++ b/arch/arm/src/lpc43xx/lpc43_ethernet.c @@ -700,10 +700,11 @@ static uint32_t lpc43_getreg(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return val; } } diff --git a/arch/arm/src/lpc43xx/lpc43_i2c.c b/arch/arm/src/lpc43xx/lpc43_i2c.c index 5211102490..040f1744cb 100644 --- a/arch/arm/src/lpc43xx/lpc43_i2c.c +++ b/arch/arm/src/lpc43xx/lpc43_i2c.c @@ -373,7 +373,7 @@ void startStopNextMessage(struct lpc43_i2cdev_s *priv) { priv->nmsg--; - if(priv->nmsg > 0) + if (priv->nmsg > 0) { priv->msgs++; putreg32(I2C_CONSET_STA,priv->base+LPC43_I2C_CONSET_OFFSET); @@ -442,22 +442,28 @@ static int i2c_interrupt(int irq, FAR void *context) case 0x28: /* Data byte in DAT has been transmitted; ACK has been received. */ priv->wrcnt++; - if (priv->wrcnt < msg->length) { + if (priv->wrcnt < msg->length) + { putreg32(msg->buffer[priv->wrcnt],priv->base+LPC43_I2C_DAT_OFFSET); /* Put next byte */ - } else { + } + else + { startStopNextMessage(priv); - } + } break; /* Read cases */ case 0x40: /* SLA+R has been transmitted; ACK has been received */ priv->rdcnt = 0; - if (msg->length > 1) { + if (msg->length > 1) + { putreg32(I2C_CONSET_AA, priv->base + LPC43_I2C_CONSET_OFFSET); /* Set ACK next read */ - } else { + } + else + { putreg32(I2C_CONCLR_AAC,priv->base + LPC43_I2C_CONCLR_OFFSET); /* Do not ACK because only one byte */ - } + } break; case 0x50: /* Data byte has been received; ACK has been returned. */ @@ -567,12 +573,11 @@ struct i2c_dev_s *up_i2cinitialize(int port) lpc43_pin_config(PINCONF_I2C1_SDA); i2c_setfrequency(priv, I2C1_DEFAULT_FREQUENCY); - } else #endif { - return NULL; + return NULL; } irqrestore(flags); diff --git a/arch/arm/src/lpc43xx/lpc43_irq.c b/arch/arm/src/lpc43xx/lpc43_irq.c index ee82f24fb3..a5961a7d56 100644 --- a/arch/arm/src/lpc43xx/lpc43_irq.c +++ b/arch/arm/src/lpc43xx/lpc43_irq.c @@ -264,8 +264,8 @@ static int lpc43_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit, else { - *regaddr = NVIC_SYSHCON; - if (irq == LPC43_IRQ_MEMFAULT) + *regaddr = NVIC_SYSHCON; + if (irq == LPC43_IRQ_MEMFAULT) { *bit = NVIC_SYSHCON_MEMFAULTENA; } diff --git a/arch/arm/src/lpc43xx/lpc43_pinconfig.c b/arch/arm/src/lpc43xx/lpc43_pinconfig.c index 77b979607f..bde44b3f3c 100644 --- a/arch/arm/src/lpc43xx/lpc43_pinconfig.c +++ b/arch/arm/src/lpc43xx/lpc43_pinconfig.c @@ -103,9 +103,9 @@ int lpc43_pin_config(uint32_t pinconf) /* Enable/disable input buffering */ if (PINCONF_INBUFFER_ENABLED(pinconf)) - { - regval |= SCU_PIN_EZI; /* Set bit to enable */ - } + { + regval |= SCU_PIN_EZI; /* Set bit to enable */ + } /* Enable/disable glitch filtering */ diff --git a/arch/arm/src/lpc43xx/lpc43_rit.c b/arch/arm/src/lpc43xx/lpc43_rit.c index 380de90a1e..eb051c1046 100644 --- a/arch/arm/src/lpc43xx/lpc43_rit.c +++ b/arch/arm/src/lpc43xx/lpc43_rit.c @@ -195,7 +195,7 @@ void up_timer_initialize(void) * complicated. When I have a better idea, I'll change this. */ - while(!((mask_test >> mask_bits) & ticks_per_int)) mask_bits++; + while (!((mask_test >> mask_bits) & ticks_per_int)) mask_bits++; lldbg("mask_bits = %d, mask = %X, ticks_per_int = %d\r\n", mask_bits, (0xFFFFFFFF<<(32 - mask_bits)), ticks_per_int); diff --git a/arch/arm/src/lpc43xx/lpc43_serial.c b/arch/arm/src/lpc43xx/lpc43_serial.c index 7aa4295d62..d4d84a4acd 100644 --- a/arch/arm/src/lpc43xx/lpc43_serial.c +++ b/arch/arm/src/lpc43xx/lpc43_serial.c @@ -480,7 +480,7 @@ static uart_dev_t g_uart3port = # undef TTYS3_DEV /* No ttyS3 */ # endif # endif -#endif /*HAVE_CONSOLE*/ +#endif /* HAVE_CONSOLE */ /**************************************************************************** * Inline Functions @@ -984,15 +984,15 @@ static inline int up_set_rs485_mode(struct up_dev_s *priv, } else { - tmp = ((priv->baud << 4) * mode->delay_rts_after_send) / 1000; - if (tmp > 255) - { - regval = 255; - } - else - { - regval = (uint32_t)tmp; - } + tmp = ((priv->baud << 4) * mode->delay_rts_after_send) / 1000; + if (tmp > 255) + { + regval = 255; + } + else + { + regval = (uint32_t)tmp; + } } diff --git a/arch/arm/src/lpc43xx/lpc43_spi.c b/arch/arm/src/lpc43xx/lpc43_spi.c index 5974e9102c..fe71636cfe 100644 --- a/arch/arm/src/lpc43xx/lpc43_spi.c +++ b/arch/arm/src/lpc43xx/lpc43_spi.c @@ -463,12 +463,12 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size * data transfer. */ - while ((getreg32(LPC43_SPI_SR) & SPI_SR_SPIF) == 0); + while ((getreg32(LPC43_SPI_SR) & SPI_SR_SPIF) == 0); - /* Read the SPI Status Register again to clear the status bit */ + /* Read the SPI Status Register again to clear the status bit */ - (void)getreg32(LPC43_SPI_SR); - nwords--; + (void)getreg32(LPC43_SPI_SR); + nwords--; } } diff --git a/arch/arm/src/lpc43xx/lpc43_spifi.c b/arch/arm/src/lpc43xx/lpc43_spifi.c index 97294c1377..69ce27f26b 100644 --- a/arch/arm/src/lpc43xx/lpc43_spifi.c +++ b/arch/arm/src/lpc43xx/lpc43_spifi.c @@ -1182,10 +1182,10 @@ FAR struct mtd_dev_s *lpc43_spifi_initialize(void) /* Initialize the SPIFI ROM driver */ ret = lpc43_rominit(priv); - if (ret != OK) - { - return NULL; - } + if (ret != OK) + { + return NULL; + } /* Check if we need to emulator a 512 byte sector */ diff --git a/arch/arm/src/lpc43xx/lpc43_start.c b/arch/arm/src/lpc43xx/lpc43_start.c index 092271e185..0f3163881e 100644 --- a/arch/arm/src/lpc43xx/lpc43_start.c +++ b/arch/arm/src/lpc43xx/lpc43_start.c @@ -33,8 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ -/* - * Power-Up Reset Overview +/* Power-Up Reset Overview * ----------------------- * * The ARM core starts executing code on reset with the program counter set @@ -81,7 +80,7 @@ * Pre-processor Definitions ****************************************************************************/ - /**************************************************************************** +/**************************************************************************** * Name: showprogress * * Description: diff --git a/arch/arm/src/lpc43xx/lpc43_usb0dev.c b/arch/arm/src/lpc43xx/lpc43_usb0dev.c index 45371bb6a1..90344a4898 100644 --- a/arch/arm/src/lpc43xx/lpc43_usb0dev.c +++ b/arch/arm/src/lpc43xx/lpc43_usb0dev.c @@ -514,10 +514,11 @@ static uint32_t lpc43_getreg(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return val; } } @@ -956,8 +957,10 @@ static void lpc43_cancelrequests(struct lpc43_ep_s *privep, int16_t status) while (!lpc43_rqempty(privep)) { - // FIXME: the entry at the head should be sync'd with the DTD - // FIXME: only report the error status if the transfer hasn't completed + /* FIXME: the entry at the head should be sync'd with the DTD + * FIXME: only report the error status if the transfer hasn't completed + */ + usbtrace(TRACE_COMPLETE(privep->epphy), (lpc43_rqpeek(privep))->req.xfrd); lpc43_reqcomplete(privep, lpc43_rqdequeue(privep), status); @@ -2646,7 +2649,6 @@ void up_usbinitialize(void) } } - /* Clock */ regval = getreg32(LPC43_BASE_USB0_CLK); @@ -2660,7 +2662,7 @@ void up_usbinitialize(void) regval |= CCU_CLK_CFG_RUN; putreg32(regval, LPC43_CCU1_M4_USB0_CFG); - /* Enable PLL0 clock*/ + /* Enable PLL0 clock */ lpc43_pll0usbconfig(); lpc43_pll0usbenable(); diff --git a/arch/arm/src/moxart/moxart_16550.c b/arch/arm/src/moxart/moxart_16550.c index ce24cf7312..d2008f945c 100644 --- a/arch/arm/src/moxart/moxart_16550.c +++ b/arch/arm/src/moxart/moxart_16550.c @@ -83,9 +83,11 @@ void uart_decodeirq(int irq, FAR void *context) i = 0; do { - if (!(status & 0x1)) { - irq_dispatch(VIRQ_START + i, context); - } + if (!(status & 0x1)) + { + irq_dispatch(VIRQ_START + i, context); + } + status >>= 1; } while (++i <= 4); @@ -102,8 +104,7 @@ int uart_ioctl(struct file *filep, int cmd, unsigned long arg) unsigned int opmode; int bitm_off; - /* - * TODO: calculate bit offset from UART_BASE address. + /* TODO: calculate bit offset from UART_BASE address. * E.g.: * 0x9820_0000 -> 0 * 0x9820_0020 -> 1 diff --git a/arch/arm/src/moxart/moxart_irq.c b/arch/arm/src/moxart/moxart_irq.c index b0475495ca..4a5ec2e13f 100644 --- a/arch/arm/src/moxart/moxart_irq.c +++ b/arch/arm/src/moxart/moxart_irq.c @@ -101,7 +101,8 @@ void up_irqinitialize(void) (*(volatile uint32_t *)0x98100008) &= ~0x9; - while (!((*(volatile uint32_t *)0x98100008) & 0x2)) { ; } + while (!((*(volatile uint32_t *)0x98100008) & 0x2)) + ; (*(volatile uint32_t *)0x98100008) |= 0x4; diff --git a/arch/arm/src/moxart/moxart_systemreset.c b/arch/arm/src/moxart/moxart_systemreset.c index eeee5456c9..de671edb23 100644 --- a/arch/arm/src/moxart/moxart_systemreset.c +++ b/arch/arm/src/moxart/moxart_systemreset.c @@ -69,7 +69,7 @@ void up_systemreset(void) { putreg32(0, FTWDT010_CR); putreg32(0, FTWDT010_LOAD); - putreg32(0x5ab9, FTWDT010_RESTART); // Magic + putreg32(0x5ab9, FTWDT010_RESTART); /* Magic */ putreg32(0x11, FTWDT010_CR); putreg32(0x13, FTWDT010_CR); diff --git a/arch/arm/src/nuc1xx/nuc_serial.c b/arch/arm/src/nuc1xx/nuc_serial.c index f068573a34..8fe9c6f14e 100644 --- a/arch/arm/src/nuc1xx/nuc_serial.c +++ b/arch/arm/src/nuc1xx/nuc_serial.c @@ -730,7 +730,7 @@ static int up_interrupt(int irq, void *context) up_serialout(priv, NUC_UART_MCR_OFFSET, regval | UART_MSR_DCTSF); } - /* Check for line status or buffer errors*/ + /* Check for line status or buffer errors */ if ((isr & UART_ISR_RLS_INT) != 0 || (isr & UART_ISR_BUF_ERR_INT) != 0) @@ -739,7 +739,7 @@ static int up_interrupt(int irq, void *context) regval = up_serialin(priv, NUC_UART_FCR_OFFSET); up_serialout(priv, NUC_UART_FCR_OFFSET, regval | UART_FCR_RFR); - } + } } return OK; diff --git a/arch/arm/src/nuc1xx/nuc_timerisr.c b/arch/arm/src/nuc1xx/nuc_timerisr.c index fa64efdfa8..d30e81b85c 100644 --- a/arch/arm/src/nuc1xx/nuc_timerisr.c +++ b/arch/arm/src/nuc1xx/nuc_timerisr.c @@ -166,10 +166,10 @@ static inline void nuc_lock(void) int up_timerisr(int irq, uint32_t *regs) { - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); - return 0; + sched_process_timer(); + return 0; } /**************************************************************************** diff --git a/arch/arm/src/sam34/sam4cm_supc.c b/arch/arm/src/sam34/sam4cm_supc.c index 73058cda4d..468466b80f 100644 --- a/arch/arm/src/sam34/sam4cm_supc.c +++ b/arch/arm/src/sam34/sam4cm_supc.c @@ -85,11 +85,11 @@ void supc_set_slcd_power_mode(uint32_t mode) if (mode == SUPC_MR_LCDMODE_LCDOFF) { - while(getreg32(SAM_SUPC_SR) & SUPC_SR_LCDS); + while (getreg32(SAM_SUPC_SR) & SUPC_SR_LCDS); } else { - while(!(getreg32(SAM_SUPC_SR) & SUPC_SR_LCDS)); + while (!(getreg32(SAM_SUPC_SR) & SUPC_SR_LCDS)); } } diff --git a/arch/arm/src/sam34/sam4l_periphclks.c b/arch/arm/src/sam34/sam4l_periphclks.c index 0deaa097cd..b344992f33 100644 --- a/arch/arm/src/sam34/sam4l_periphclks.c +++ b/arch/arm/src/sam34/sam4l_periphclks.c @@ -256,7 +256,7 @@ static inline void sam_init_pbamask(void) mask |= PM_PBAMASK_TWIM3; /* TWIM3 */ #endif #ifdef CONFIG_SAM34_LCDCA - mask |= PM_PBAMASK_LCDCA; /* LCDCA*/ + mask |= PM_PBAMASK_LCDCA; /* LCDCA */ #endif #endif diff --git a/arch/arm/src/sam34/sam_aes.c b/arch/arm/src/sam34/sam_aes.c index c83ef8e3b0..b39c8f45aa 100644 --- a/arch/arm/src/sam34/sam_aes.c +++ b/arch/arm/src/sam34/sam_aes.c @@ -112,7 +112,7 @@ static void aes_encryptblock(void *out, const void *in) putreg32(AES_CR_START, SAM_AES_CR); - while(!(getreg32(SAM_AES_ISR) & AES_ISR_DATRDY)) {} + while (!(getreg32(SAM_AES_ISR) & AES_ISR_DATRDY)); if (out) { @@ -125,42 +125,46 @@ static int aes_setup_mr(uint32_t keysize, int mode, int encrypt) uint32_t regval = AES_MR_SMOD_MANUAL_START | AES_MR_CKEY; if (encrypt) - regval |= AES_MR_CIPHER_ENCRYPT; + { + regval |= AES_MR_CIPHER_ENCRYPT; + } else - regval |= AES_MR_CIPHER_DECRYPT; + { + regval |= AES_MR_CIPHER_DECRYPT; + } - switch(keysize) - { - case 16: - regval |= AES_MR_KEYSIZE_AES128; - break; - case 24: - regval |= AES_MR_KEYSIZE_AES192; - break; - case 32: - regval |= AES_MR_KEYSIZE_AES256; - break; - default: - return -EINVAL; - } + switch (keysize) + { + case 16: + regval |= AES_MR_KEYSIZE_AES128; + break; + case 24: + regval |= AES_MR_KEYSIZE_AES192; + break; + case 32: + regval |= AES_MR_KEYSIZE_AES256; + break; + default: + return -EINVAL; + } - switch(mode) - { - case AES_MODE_ECB: - regval |= AES_MR_OPMOD_ECB; - break; - case AES_MODE_CBC: - regval |= AES_MR_OPMOD_CBC; - break; - case AES_MODE_CTR: - regval |= AES_MR_OPMOD_CTR; - break; - case AES_MODE_CFB: - regval |= AES_MR_OPMOD_CFB; - break; - default: - return -EINVAL; - } + switch (mode) + { + case AES_MODE_ECB: + regval |= AES_MR_OPMOD_ECB; + break; + case AES_MODE_CBC: + regval |= AES_MR_OPMOD_CBC; + break; + case AES_MODE_CTR: + regval |= AES_MR_OPMOD_CTR; + break; + case AES_MODE_CFB: + regval |= AES_MR_OPMOD_CFB; + break; + default: + return -EINVAL; + } putreg32(regval, SAM_AES_MR); return OK; @@ -176,7 +180,9 @@ int aes_cypher(void *out, const void *in, uint32_t size, const void *iv, int res = OK; if (size % 16) - return -EINVAL; + { + return -EINVAL; + } aes_lock(); diff --git a/arch/arm/src/sam34/sam_emac.c b/arch/arm/src/sam34/sam_emac.c index 002971f4ab..abb2f4a8f1 100644 --- a/arch/arm/src/sam34/sam_emac.c +++ b/arch/arm/src/sam34/sam_emac.c @@ -1149,15 +1149,15 @@ static int sam_recvframe(struct sam_emac_s *priv) priv->rxndx = rxndx; } - /* Process the next buffer */ + /* Process the next buffer */ - rxdesc = &priv->rxdesc[rxndx]; + rxdesc = &priv->rxdesc[rxndx]; - /* Invalidate the RX descriptor to force re-fetching from RAM */ + /* Invalidate the RX descriptor to force re-fetching from RAM */ - sam_cmcc_invalidate((uintptr_t)rxdesc, - (uintptr_t)rxdesc + sizeof(struct emac_rxdesc_s)); - } + sam_cmcc_invalidate((uintptr_t)rxdesc, + (uintptr_t)rxdesc + sizeof(struct emac_rxdesc_s)); + } /* No packet was found */ @@ -3371,7 +3371,7 @@ static int sam_phyinit(struct sam_emac_s *priv) static inline void sam_ethgpioconfig(struct sam_emac_s *priv) { - /* Configure PIO pins to support EMAC in MII mode*/ + /* Configure PIO pins to support EMAC in MII mode */ sam_configgpio(GPIO_EMAC_TXCK); /* Transmit Clock (or Reference Clock) */ sam_configgpio(GPIO_EMAC_TXEN); /* Transmit Enable */ diff --git a/arch/arm/src/sam34/sam_gpioirq.c b/arch/arm/src/sam34/sam_gpioirq.c index cfd3722bd8..ef6df44985 100644 --- a/arch/arm/src/sam34/sam_gpioirq.c +++ b/arch/arm/src/sam34/sam_gpioirq.c @@ -388,42 +388,42 @@ void sam_gpioirq(gpio_pinset_t pinset) uint32_t base = sam_gpiobase(pinset); int pin = sam_gpiopin(pinset); - /* Are any additional interrupt modes selected? */ + /* Are any additional interrupt modes selected? */ - if ((pinset & _GIO_INT_AIM) != 0) - { - /* Yes.. Enable additional interrupt mode */ + if ((pinset & _GIO_INT_AIM) != 0) + { + /* Yes.. Enable additional interrupt mode */ - putreg32(pin, base + SAM_PIO_AIMER_OFFSET); + putreg32(pin, base + SAM_PIO_AIMER_OFFSET); - /* Level or edge detected interrupt? */ + /* Level or edge detected interrupt? */ - if ((pinset & _GPIO_INT_LEVEL) != 0) - { - putreg32(pin, base + SAM_PIO_LSR_OFFSET); /* Level */ - } - else - { - putreg32(pin, base + SAM_PIO_ESR_OFFSET); /* Edge */ - } + if ((pinset & _GPIO_INT_LEVEL) != 0) + { + putreg32(pin, base + SAM_PIO_LSR_OFFSET); /* Level */ + } + else + { + putreg32(pin, base + SAM_PIO_ESR_OFFSET); /* Edge */ + } /* High level/rising edge or low level /falling edge? */ - if ((pinset & _GPIO_INT_RH) != 0) - { - putreg32(pin, base + SAM_PIO_REHLSR_OFFSET); /* High level/Rising edge */ - } - else - { - putreg32(pin, base + SAM_PIO_FELLSR_OFFSET); /* Low level/Falling edge */ - } - } - else - { - /* No.. Disable additional interrupt mode */ + if ((pinset & _GPIO_INT_RH) != 0) + { + putreg32(pin, base + SAM_PIO_REHLSR_OFFSET); /* High level/Rising edge */ + } + else + { + putreg32(pin, base + SAM_PIO_FELLSR_OFFSET); /* Low level/Falling edge */ + } + } + else + { + /* No.. Disable additional interrupt mode */ - putreg32(pin, base + SAM_PIO_AIMDR_OFFSET); - } + putreg32(pin, base + SAM_PIO_AIMDR_OFFSET); + } } /************************************************************************************ diff --git a/arch/arm/src/sam34/sam_hsmci.c b/arch/arm/src/sam34/sam_hsmci.c index 12c4625b01..4e7db3cf75 100644 --- a/arch/arm/src/sam34/sam_hsmci.c +++ b/arch/arm/src/sam34/sam_hsmci.c @@ -1337,10 +1337,10 @@ static int sam_interrupt(int irq, void *context) } } else - { + { /* The Command-Response sequence ended with no error */ - wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE; + wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE; } /* Yes.. Is there a thread waiting for this event set? */ @@ -2268,7 +2268,7 @@ static sdio_eventset_t sam_eventwait(FAR struct sdio_dev_s *dev, if (!timeout) { - return SDIOWAIT_TIMEOUT; + return SDIOWAIT_TIMEOUT; } /* Start the watchdog timer */ diff --git a/arch/arm/src/sam34/sam_irq.c b/arch/arm/src/sam34/sam_irq.c index 0c33e75f13..6624c0378a 100644 --- a/arch/arm/src/sam34/sam_irq.c +++ b/arch/arm/src/sam34/sam_irq.c @@ -310,8 +310,8 @@ static int sam_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit, else { - *regaddr = NVIC_SYSHCON; - if (irq == SAM_IRQ_MEMFAULT) + *regaddr = NVIC_SYSHCON; + if (irq == SAM_IRQ_MEMFAULT) { *bit = NVIC_SYSHCON_MEMFAULTENA; } diff --git a/arch/arm/src/sam34/sam_rtc.c b/arch/arm/src/sam34/sam_rtc.c index 614bcb5fc1..bc12247694 100644 --- a/arch/arm/src/sam34/sam_rtc.c +++ b/arch/arm/src/sam34/sam_rtc.c @@ -301,7 +301,7 @@ static int rtc_interrupt(int irq, void *context) rtclldbg("ERRPR: work_queue failed: %d\n", ret); } - /* Disable any further alarm interrupts*/ + /* Disable any further alarm interrupts */ putreg32(RTC_IDR_ALRDIS, SAM_RTC_IDR); @@ -437,7 +437,7 @@ int up_rtcinitialize(void) { g_rtt_offset = getreg32(SAM_RTT_VR); } - while(getreg32(SAM_RTT_VR) != g_rtt_offset); + while (getreg32(SAM_RTT_VR) != g_rtt_offset); #endif rtc_dumpregs("After Initialization"); @@ -769,7 +769,6 @@ int sam_rtc_setalarm(FAR const struct timespec *tp, alarmcb_t callback) ************************************************************************************/ #if defined(CONFIG_RTC_HIRES) && defined (CONFIG_SAM34_RTT) - int up_rtc_gettime(FAR struct timespec *tp) { /* This is a hack to emulate a high resolution rtc using the rtt */ @@ -777,13 +776,15 @@ int up_rtc_gettime(FAR struct timespec *tp) struct tm t; do - { - rtc_cal = getreg32(SAM_RTC_CALR); - rtc_tim = getreg32(SAM_RTC_TIMR); - rtt_val = getreg32(SAM_RTT_VR); - } while((rtc_cal != getreg32(SAM_RTC_CALR)) || - (rtc_tim != getreg32(SAM_RTC_TIMR)) || - (rtt_val != getreg32(SAM_RTT_VR))); + { + rtc_cal = getreg32(SAM_RTC_CALR); + rtc_tim = getreg32(SAM_RTC_TIMR); + rtt_val = getreg32(SAM_RTT_VR); + } + while (rtc_cal != getreg32(SAM_RTC_CALR) || + rtc_tim != getreg32(SAM_RTC_TIMR)); + + (rtt_val != getreg32(SAM_RTT_VR))); t.tm_sec = rtc_bcd2bin((rtc_tim & RTC_TIMR_SEC_MASK) >> RTC_TIMR_SEC_SHIFT); t.tm_min = rtc_bcd2bin((rtc_tim & RTC_TIMR_MIN_MASK) >> RTC_TIMR_MIN_SHIFT); diff --git a/arch/arm/src/sam34/sam_rtt.c b/arch/arm/src/sam34/sam_rtt.c index 133ecf99b3..577f15ea9a 100644 --- a/arch/arm/src/sam34/sam_rtt.c +++ b/arch/arm/src/sam34/sam_rtt.c @@ -178,7 +178,7 @@ static inline uint32_t sam34_readvr(void) { v = getreg32(SAM_RTT_VR); } - while(v != getreg32(SAM_RTT_VR)); + while (v != getreg32(SAM_RTT_VR)); return v; } @@ -210,10 +210,10 @@ static uint32_t sam34_getreg(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } return val; } @@ -434,7 +434,7 @@ static int sam34_stop(FAR struct timer_lowerhalf_s *lower) rttvdbg("Entry\n"); DEBUGASSERT(priv); - if(!priv->started) + if (!priv->started) { return -EINVAL; } @@ -526,7 +526,10 @@ static int sam34_settimeout(FAR struct timer_lowerhalf_s *lower, DEBUGASSERT(priv); rttvdbg("Entry: timeout=%d\n", timeout); - if(priv->started) return -EPERM; + if (priv->started) + { + return -EPERM; + } /* Can this timeout be represented? */ diff --git a/arch/arm/src/sam34/sam_spi.c b/arch/arm/src/sam34/sam_spi.c index 414ce0c319..709330e7ff 100644 --- a/arch/arm/src/sam34/sam_spi.c +++ b/arch/arm/src/sam34/sam_spi.c @@ -1347,7 +1347,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, * Save the final word. */ - for ( ; nwords > 0; nwords--) + for (; nwords > 0; nwords--) { /* Get the data to send (0xff if there is no data source). */ diff --git a/arch/arm/src/sam34/sam_tc.c b/arch/arm/src/sam34/sam_tc.c index d8c3bda76c..881dff0c0e 100644 --- a/arch/arm/src/sam34/sam_tc.c +++ b/arch/arm/src/sam34/sam_tc.c @@ -192,10 +192,10 @@ static uint32_t sam34_getreg(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } return val; } @@ -609,7 +609,7 @@ void sam_tcinitialize(FAR const char *devpath, int irq) * is only called once so it is never necessary to re-zero the structure. */ - switch(irq) + switch (irq) { #if defined(CONFIG_SAM34_TC0) case SAM_IRQ_TC0: diff --git a/arch/arm/src/sam34/sam_timerisr.c b/arch/arm/src/sam34/sam_timerisr.c index 29d3f5613f..9efd73a6ad 100644 --- a/arch/arm/src/sam34/sam_timerisr.c +++ b/arch/arm/src/sam34/sam_timerisr.c @@ -122,10 +122,10 @@ int up_timerisr(int irq, uint32_t *regs) { - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); - return 0; + sched_process_timer(); + return 0; } /**************************************************************************** diff --git a/arch/arm/src/sam34/sam_twi.c b/arch/arm/src/sam34/sam_twi.c index d9e6f6ceb2..1d8c0461e8 100644 --- a/arch/arm/src/sam34/sam_twi.c +++ b/arch/arm/src/sam34/sam_twi.c @@ -530,7 +530,7 @@ static int twi_interrupt(struct twi_dev_s *priv) } } - /* Byte sent*/ + /* Byte sent */ else if ((pending & TWI_INT_TXRDY) != 0) { @@ -639,7 +639,7 @@ static void twi_startread(struct twi_dev_s *priv, struct i2c_msg_s *msg) priv->result = -EBUSY; priv->xfrd = 0; - /* Set STOP signal if only one byte is sent*/ + /* Set STOP signal if only one byte is sent */ if (msg->length == 1) { @@ -685,7 +685,7 @@ static void twi_startwrite(struct twi_dev_s *priv, struct i2c_msg_s *msg) twi_putrel(priv, SAM_TWI_IADR_OFFSET, 0); - /* Write first byte to send.*/ + /* Write first byte to send. */ twi_putrel(priv, SAM_TWI_THR_OFFSET, msg->buffer[priv->xfrd++]); @@ -1126,8 +1126,10 @@ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency) static void twi_hw_initialize(struct twi_dev_s *priv, unsigned int pid, uint32_t frequency) { - //uint32_t regval; - //uint32_t mck; +#if 0 + uint32_t regval; + uint32_t mck; +#endif i2cvdbg("TWI%d Initializing\n", priv->twi); diff --git a/arch/arm/src/sam34/sam_udp.c b/arch/arm/src/sam34/sam_udp.c index b4728260c6..2ff77f237c 100644 --- a/arch/arm/src/sam34/sam_udp.c +++ b/arch/arm/src/sam34/sam_udp.c @@ -2224,7 +2224,7 @@ static int sam_udp_interrupt(int irq, void *context) sam_suspend(priv); } - /* SOF interrupt*/ + /* SOF interrupt */ else if ((pending & UDP_INT_SOF) != 0) { @@ -3971,7 +3971,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) sam_pullup(&priv->usbdev, true); priv->usbdev.speed = USB_SPEED_FULL; - } + } return ret; } diff --git a/arch/arm/src/sam34/sam_wdt.c b/arch/arm/src/sam34/sam_wdt.c index e90e3b2d7d..f34289af4f 100644 --- a/arch/arm/src/sam34/sam_wdt.c +++ b/arch/arm/src/sam34/sam_wdt.c @@ -194,10 +194,11 @@ static uint32_t sam34_getreg(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return val; } } @@ -328,7 +329,7 @@ static int sam34_start(FAR struct watchdog_lowerhalf_s *lower) } #endif - /* TODO: WDT_MR_WDFIEN if handler available? WDT_MR_WDRPROC? */ + /* TODO: WDT_MR_WDFIEN if handler available? WDT_MR_WDRPROC? */ mr_val |= (WDT_MR_WDD(priv->window) | WDT_MR_WDV(priv->reload) | WDT_MR_WDRSTEN); sam34_putreg(mr_val, SAM_WDT_MR); @@ -534,7 +535,7 @@ static int sam34_settimeout(FAR struct watchdog_lowerhalf_s *lower, static xcpt_t sam34_capture(FAR struct watchdog_lowerhalf_s *lower, xcpt_t handler) { -#if 0 // TODO +#if 0 /* TODO */ FAR struct sam34_lowerhalf_s *priv = (FAR struct sam34_lowerhalf_s *)lower; irqstate_t flags; xcpt_t oldhandler; diff --git a/arch/arm/src/sama5/sam_can.c b/arch/arm/src/sama5/sam_can.c index b201d88a55..9c242e123c 100644 --- a/arch/arm/src/sama5/sam_can.c +++ b/arch/arm/src/sama5/sam_can.c @@ -384,10 +384,10 @@ static uint32_t can_getreg(FAR struct sam_can_s *priv, int offset) { if (priv->count == 0xffffffff || ++priv->count > 3) { - if (priv->count == 4) - { - lldbg("...\n"); - } + if (priv->count == 4) + { + lldbg("...\n"); + } return regval; } @@ -1820,7 +1820,7 @@ static int can_autobaud(struct sam_can_s *priv) #warning Missing logic } - while ( no errors reported ); + while (no errors reported); /* Once no error has been detected, the application disables the Autobaud * Mode, clearing the ABM field in the CAN_MR register. To go back to the diff --git a/arch/arm/src/sama5/sam_dbgu.c b/arch/arm/src/sama5/sam_dbgu.c index 9b56d01871..2474cc11a8 100644 --- a/arch/arm/src/sama5/sam_dbgu.c +++ b/arch/arm/src/sama5/sam_dbgu.c @@ -201,7 +201,7 @@ static void dbgu_configure(void) /* Enable receiver & transmitter */ - putreg32((DBGU_CR_RXEN|DBGU_CR_TXEN), SAM_DBGU_CR); + putreg32((DBGU_CR_RXEN | DBGU_CR_TXEN), SAM_DBGU_CR); } #else @@ -256,7 +256,8 @@ static void dbgu_shutdown(struct uart_dev_s *dev) /* Reset and disable receiver and transmitter */ - putreg32((DBGU_CR_RSTRX|DBGU_CR_RSTTX|DBGU_CR_RXDIS|DBGU_CR_TXDIS), SAM_DBGU_CR); + putreg32((DBGU_CR_RSTRX | DBGU_CR_RSTTX | DBGU_CR_RXDIS | DBGU_CR_TXDIS), + SAM_DBGU_CR); /* Disable all interrupts */ diff --git a/arch/arm/src/sama5/sam_dmac.c b/arch/arm/src/sama5/sam_dmac.c index 300c4e11f4..5230ba3ff6 100644 --- a/arch/arm/src/sama5/sam_dmac.c +++ b/arch/arm/src/sama5/sam_dmac.c @@ -1826,7 +1826,7 @@ static int sam_dmac_interrupt(struct sam_dmac_s *dmac) /* Is the transfer complete? */ else if ((regval & DMAC_EBC_CBTC(chndx)) != 0) - { + { /* Yes.. Terminate the transfer with success */ sam_dmaterminate(dmach, OK); diff --git a/arch/arm/src/sama5/sam_emaca.c b/arch/arm/src/sama5/sam_emaca.c index fafbeb90ae..bb4af13a93 100644 --- a/arch/arm/src/sama5/sam_emaca.c +++ b/arch/arm/src/sama5/sam_emaca.c @@ -1155,15 +1155,15 @@ static int sam_recvframe(struct sam_emac_s *priv) priv->rxndx = rxndx; } - /* Process the next buffer */ + /* Process the next buffer */ - rxdesc = &priv->rxdesc[rxndx]; + rxdesc = &priv->rxdesc[rxndx]; - /* Invalidate the RX descriptor to force re-fetching from RAM */ + /* Invalidate the RX descriptor to force re-fetching from RAM */ - arch_invalidate_dcache((uintptr_t)rxdesc, - (uintptr_t)rxdesc + sizeof(struct emac_rxdesc_s)); - } + arch_invalidate_dcache((uintptr_t)rxdesc, + (uintptr_t)rxdesc + sizeof(struct emac_rxdesc_s)); + } /* No packet was found */ @@ -1274,7 +1274,7 @@ static void sam_receive(struct sam_emac_s *priv) */ if (priv->dev.d_len > 0) - { + { /* Update the Ethernet header with the correct MAC address */ #ifdef CONFIG_NET_IPv4 @@ -2624,7 +2624,7 @@ static int sam_phywrite(struct sam_emac_s *priv, uint8_t phyaddr, /* Write the PHY Maintenance register */ regval = EMAC_MAN_DATA(phyval) | EMAC_MAN_CODE | EMAC_MAN_REGA(regaddr) | - EMAC_MAN_PHYA(phyaddr) | EMAC_MAN_WRITE| EMAC_MAN_SOF; + EMAC_MAN_PHYA(phyaddr) | EMAC_MAN_WRITE | EMAC_MAN_SOF; sam_putreg(priv, SAM_EMAC_MAN, regval); /* Wait until the PHY is again IDLE */ diff --git a/arch/arm/src/sama5/sam_emacb.c b/arch/arm/src/sama5/sam_emacb.c index 4624bf4936..a8ae8b0b49 100644 --- a/arch/arm/src/sama5/sam_emacb.c +++ b/arch/arm/src/sama5/sam_emacb.c @@ -3934,7 +3934,7 @@ static inline void sam_ethgpioconfig(struct sam_emac_s *priv) if (priv->attr->emac == EMAC0_INTF) { - /* Configure PIO pins common to RMII and MII mode*/ + /* Configure PIO pins common to RMII and MII mode */ sam_configpio(PIO_EMAC0_TXCK); /* Transmit Clock (or Reference Clock) */ sam_configpio(PIO_EMAC0_TXEN); /* Transmit Enable */ @@ -3947,7 +3947,7 @@ static inline void sam_ethgpioconfig(struct sam_emac_s *priv) sam_configpio(PIO_EMAC0_MDC); /* Management Data Clock */ sam_configpio(PIO_EMAC0_MDIO); /* Management Data Input/Output */ - /* Configure additional PIO pins to support EMAC in MII mode*/ + /* Configure additional PIO pins to support EMAC in MII mode */ if (!priv->attr->rmii) { @@ -3969,7 +3969,7 @@ static inline void sam_ethgpioconfig(struct sam_emac_s *priv) if (priv->attr->emac == EMAC1_INTF) { - /* Configure PIO pins common to RMII and MII mode*/ + /* Configure PIO pins common to RMII and MII mode */ sam_configpio(PIO_EMAC1_TXCK); /* Transmit Clock (or Reference Clock) */ sam_configpio(PIO_EMAC1_TXEN); /* Transmit Enable */ @@ -3982,7 +3982,7 @@ static inline void sam_ethgpioconfig(struct sam_emac_s *priv) sam_configpio(PIO_EMAC1_MDC); /* Management Data Clock */ sam_configpio(PIO_EMAC1_MDIO); /* Management Data Input/Output */ - /* Configure additional PIO pins to support EMAC in MII mode*/ + /* Configure additional PIO pins to support EMAC in MII mode */ if (!priv->attr->rmii) { diff --git a/arch/arm/src/sama5/sam_flexcom_serial.c b/arch/arm/src/sama5/sam_flexcom_serial.c index 14a235ba18..97d11e0dbf 100644 --- a/arch/arm/src/sama5/sam_flexcom_serial.c +++ b/arch/arm/src/sama5/sam_flexcom_serial.c @@ -747,12 +747,12 @@ static int flexus_setup(struct uart_dev_s *dev) * This may limit BAUD rates for lower USART clocks. */ - regval = (SAM_USART_CLOCK + (priv->baud << 3))/(priv->baud << 4); + regval = (SAM_USART_CLOCK + (priv->baud << 3)) / (priv->baud << 4); flexus_serialout(priv, SAM_FLEXUS_BRGR_OFFSET, regval); /* Enable receiver & transmitter */ - flexus_serialout(priv, SAM_FLEXUS_CR_OFFSET, (FLEXUS_CR_RXEN|FLEXUS_CR_TXEN)); + flexus_serialout(priv, SAM_FLEXUS_CR_OFFSET, (FLEXUS_CR_RXEN | FLEXUS_CR_TXEN)); #endif return OK; } @@ -773,7 +773,8 @@ static void flexus_shutdown(struct uart_dev_s *dev) /* Reset and disable receiver and transmitter */ flexus_serialout(priv, SAM_FLEXUS_CR_OFFSET, - (FLEXUS_CR_RSTRX|FLEXUS_CR_RSTTX|FLEXUS_CR_RXDIS|FLEXUS_CR_TXDIS)); + (FLEXUS_CR_RSTRX | FLEXUS_CR_RSTTX | FLEXUS_CR_RXDIS | + FLEXUS_CR_TXDIS)); /* Disable all interrupts */ diff --git a/arch/arm/src/sama5/sam_gmac.c b/arch/arm/src/sama5/sam_gmac.c index 5bd7896bc9..ce6eaeb69b 100644 --- a/arch/arm/src/sama5/sam_gmac.c +++ b/arch/arm/src/sama5/sam_gmac.c @@ -1085,15 +1085,15 @@ static int sam_recvframe(struct sam_gmac_s *priv) priv->rxndx = rxndx; } - /* Process the next buffer */ + /* Process the next buffer */ - rxdesc = &priv->rxdesc[rxndx]; + rxdesc = &priv->rxdesc[rxndx]; - /* Invalidate the RX descriptor to force re-fetching from RAM */ + /* Invalidate the RX descriptor to force re-fetching from RAM */ - arch_invalidate_dcache((uintptr_t)rxdesc, - (uintptr_t)rxdesc + sizeof(struct gmac_rxdesc_s)); - } + arch_invalidate_dcache((uintptr_t)rxdesc, + (uintptr_t)rxdesc + sizeof(struct gmac_rxdesc_s)); + } /* No packet was found */ @@ -1507,7 +1507,7 @@ static int sam_gmac_interrupt(int irq, void *context) clrbits |= GMAC_RSR_BNA; } - /* Check for HRESP not OK (HNO)*/ + /* Check for HRESP not OK (HNO) */ if ((rsr & GMAC_RSR_HNO) != 0) { diff --git a/arch/arm/src/sama5/sam_hsmci.c b/arch/arm/src/sama5/sam_hsmci.c index c82a9a77cf..d90176cb8a 100644 --- a/arch/arm/src/sama5/sam_hsmci.c +++ b/arch/arm/src/sama5/sam_hsmci.c @@ -1542,13 +1542,13 @@ static int sam_hsmci_interrupt(struct sam_dev_s *priv) { /* Yes.. Terminate with a timeout. */ - sam_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_TIMEOUT); + sam_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_TIMEOUT); } else { /* No.. Terminate with an I/O error. */ - sam_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_ERROR); + sam_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_ERROR); } } @@ -1616,20 +1616,22 @@ static int sam_hsmci_interrupt(struct sam_dev_s *priv) { /* Yes.. signal a timeout error */ - wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE|SDIOWAIT_TIMEOUT; + wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE | + SDIOWAIT_TIMEOUT; } else { /* No.. signal some generic I/O error */ - wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE|SDIOWAIT_ERROR; + wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE | + SDIOWAIT_ERROR; } } else - { + { /* The Command-Response sequence ended with no error */ - wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE; + wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE; } /* Yes.. Is there a thread waiting for this event set? */ @@ -2393,14 +2395,16 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) { /* Yes.. return a timeout error */ - priv->wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE|SDIOWAIT_TIMEOUT; + priv->wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE | + SDIOWAIT_TIMEOUT; return -ETIMEDOUT; } else { /* No.. return some generic I/O error */ - priv->wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE|SDIOWAIT_ERROR; + priv->wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE | + SDIOWAIT_ERROR; return -EIO; } } @@ -2408,7 +2412,7 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) { /* The Command-Response sequence ended with no error */ - priv->wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE; + priv->wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE; return OK; } } @@ -2647,7 +2651,7 @@ static void sam_waitenable(FAR struct sdio_dev_s *dev, */ waitmask = 0; - if ((eventset & (SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE)) != 0) + if ((eventset & (SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE)) != 0) { waitmask |= priv->cmdrmask; } @@ -2723,7 +2727,7 @@ static sdio_eventset_t sam_eventwait(FAR struct sdio_dev_s *dev, if (!timeout) { - return SDIOWAIT_TIMEOUT; + return SDIOWAIT_TIMEOUT; } /* Start the watchdog timer. I am not sure why this is, but I am diff --git a/arch/arm/src/sama5/sam_lcd.c b/arch/arm/src/sama5/sam_lcd.c index 72b2271622..9ea92e0451 100644 --- a/arch/arm/src/sama5/sam_lcd.c +++ b/arch/arm/src/sama5/sam_lcd.c @@ -1091,7 +1091,7 @@ static void sam_putreg(uintptr_t address, uint32_t regval) static void sam_wait_lcdstatus(uint32_t mask, uint32_t value) { - while ((sam_getreg(SAM_LCDC_LCDSR) & mask) != value); + while ((sam_getreg(SAM_LCDC_LCDSR) & mask) != value); } /**************************************************************************** @@ -2451,7 +2451,7 @@ static void sam_show_layer(struct sam_layer_s *layer, imgh = 1; } - /* Set display buffer and mode setup*/ + /* Set display buffer and mode setup */ bytespp = (uint32_t)layer->bpp >> 3; bprow = imgw * (uint32_t)layer->bpp; @@ -2547,7 +2547,7 @@ static void sam_show_layer(struct sam_layer_s *layer, /* Pointer to Right,Top (x1,y0) */ buffer = (uint8_t *) - ((uint32_t)layer->framebuffer + bytespp*(imgw - 1)); + ((uint32_t)layer->framebuffer + bytespp * (imgw - 1)); } /* Y mirror: Left,Down -> Right,Top */ @@ -2579,7 +2579,7 @@ static void sam_show_layer(struct sam_layer_s *layer, /* Pointer to Left,Down (x0,y1) */ buffer = (uint8_t *) - ((uintptr_t)layer->framebuffer + (bytesprow+padding)*(imgh-1)); + ((uintptr_t)layer->framebuffer + (bytesprow + padding) * (imgh - 1)); } /* X,Y mirror: Right,Top -> Left,Down */ @@ -2612,8 +2612,8 @@ static void sam_show_layer(struct sam_layer_s *layer, buffer = (uint8_t *) ((uint32_t)layer->framebuffer + - (bytesprow + padding)*(imgh - 1) + - bytespp*(imgw -1 )); + (bytesprow + padding) * (imgh - 1) + + bytespp * (imgw - 1)); } /* Rotate 90: Down,Left -> Top,Right (with w,h swap) */ @@ -2640,13 +2640,13 @@ static void sam_show_layer(struct sam_layer_s *layer, /* X ++ as rows */ regaddr = g_layerstride[lid]; - sam_putreg(regaddr, (bytesprow + padding)*(imgh - 1)); + sam_putreg(regaddr, (bytesprow + padding) * (imgh - 1)); /* Pointer to Bottom,Left */ buffer = (uint8_t *) ((uint32_t)layer->framebuffer + - (bytesprow + padding)*(imgh - 1)); + (bytesprow + padding) * (imgh - 1)); } /* Rotate 270: Top,Right -> Down,Left (with w,h swap) */ @@ -2673,12 +2673,12 @@ static void sam_show_layer(struct sam_layer_s *layer, /* X -- as rows */ regaddr = g_layerstride[lid]; - sam_putreg(regaddr, 0 - 2*bytespp - (bytesprow + padding)*(imgh - 1)); + sam_putreg(regaddr, 0 - 2*bytespp - (bytesprow + padding) * (imgh - 1)); /* Pointer to top right */ buffer = (uint8_t *) - ((uintptr_t)layer->framebuffer + bytespp*(imgw - 1)); + ((uintptr_t)layer->framebuffer + bytespp * (imgw - 1)); } /* Mirror X then Rotate 90: Down,Right -> Top,Left */ @@ -2705,20 +2705,20 @@ static void sam_show_layer(struct sam_layer_s *layer, /* X -- as rows */ regaddr = g_layerstride[lid]; - sam_putreg(regaddr, 0 - 2*bytespp + (bytesprow + padding)*(imgh - 1)); + sam_putreg(regaddr, 0 - 2 * bytespp + (bytesprow + padding) * (imgh - 1)); /* Pointer to down right (x1,y1) */ buffer = (uint8_t *) ((uintptr_t)layer->framebuffer + - (bytesprow+padding)*(imgh - 1) + - (bytespp)*(imgw - 1)); + (bytesprow + padding) * (imgh - 1) + + (bytespp) * (imgw - 1)); } /* Mirror Y then Rotate 90: Top,Left -> Down,Right */ - else if ((!rightleft && bottomup && layer->rotation == 90) - ||(rightleft && !bottomup && layer->rotation == LCDC_ROT_270)) + else if ((!rightleft && bottomup && layer->rotation == 90) || + ( rightleft && !bottomup && layer->rotation == LCDC_ROT_270)) { /* No rotation optimization */ @@ -2739,7 +2739,7 @@ static void sam_show_layer(struct sam_layer_s *layer, /* X ++ as rows */ regaddr = g_layerstride[lid]; - sam_putreg(regaddr, 0 - (bytesprow + padding)*(imgh - 1)); + sam_putreg(regaddr, 0 - (bytesprow + padding) * (imgh - 1)); /* Pointer to top left (x0,y0) */ } diff --git a/arch/arm/src/sama5/sam_nand.c b/arch/arm/src/sama5/sam_nand.c index 1b2a51d741..c6d5e8e1d3 100644 --- a/arch/arm/src/sama5/sam_nand.c +++ b/arch/arm/src/sama5/sam_nand.c @@ -574,7 +574,7 @@ static int nand_translate_address(struct sam_nandcs_s *priv, static uint32_t nand_get_acycle(int ncycles) { - switch(ncycles) + switch (ncycles) { case 1: return NFCADDR_CMD_ACYCLE_ONE; diff --git a/arch/arm/src/sama5/sam_ohci.c b/arch/arm/src/sama5/sam_ohci.c index 4a9a54cd47..acb5492519 100644 --- a/arch/arm/src/sama5/sam_ohci.c +++ b/arch/arm/src/sama5/sam_ohci.c @@ -1665,7 +1665,7 @@ static void sam_ep0dequeue(struct sam_eplist_s *ep0) preved = NULL; curred && curred != edctrl; preved = curred, - curred =(struct sam_ed_s *)sam_virtramaddr(physcurr)) + curred = (struct sam_ed_s *)sam_virtramaddr(physcurr)) { physcurr = curred->hw.nexted; } @@ -1712,7 +1712,7 @@ static void sam_ep0dequeue(struct sam_eplist_s *ep0) for (currtd = (struct sam_gtd_s *)sam_virtramaddr(physcurr); currtd && currtd != tdtail; - currtd =(struct sam_gtd_s *)sam_virtramaddr(physcurr)) + currtd = (struct sam_gtd_s *)sam_virtramaddr(physcurr)) { physcurr = currtd->hw.nexttd; sam_tdfree(currtd); @@ -2125,7 +2125,7 @@ static void sam_wdh_bottomhalf(void) */ arch_invalidate_dcache((uintptr_t)td, - (uintptr_t)td + sizeof( struct ohci_gtd_s)); + (uintptr_t)td + sizeof(struct ohci_gtd_s)); /* Get the ED in which this TD was enqueued */ @@ -2152,7 +2152,7 @@ static void sam_wdh_bottomhalf(void) */ arch_invalidate_dcache((uintptr_t)ed, - (uintptr_t)ed + sizeof( struct ohci_ed_s)); + (uintptr_t)ed + sizeof(struct ohci_ed_s)); /* Save the condition code from the (single) TD status/control * word. @@ -3393,7 +3393,7 @@ static ssize_t sam_transfer(struct usbhost_driver_s *drvr, usbhost_ep_t ep, } nbytes = eplist->xfrd; - DEBUGASSERT(nbytes >=0 && nbytes <= buflen); + DEBUGASSERT(nbytes >= 0 && nbytes <= buflen); sam_givesem(&g_ohci.exclsem); return nbytes; diff --git a/arch/arm/src/sama5/sam_pioirq.c b/arch/arm/src/sama5/sam_pioirq.c index 9167cc057c..de4eec38ad 100644 --- a/arch/arm/src/sama5/sam_pioirq.c +++ b/arch/arm/src/sama5/sam_pioirq.c @@ -404,8 +404,8 @@ void sam_pioirq(pio_pinset_t pinset) /* Is the interrupt secure? */ - regval = getreg32(base + SAM_PIO_ISLR_OFFSET); - if ((pinset & PIO_INT_SECURE) != 0) + regval = getreg32(base + SAM_PIO_ISLR_OFFSET); + if ((pinset & PIO_INT_SECURE) != 0) { /* Yes.. make sure that the corresponding bit in ISLR is cleared */ diff --git a/arch/arm/src/sama5/sam_pmecc.c b/arch/arm/src/sama5/sam_pmecc.c index a964292006..b1f24333ab 100644 --- a/arch/arm/src/sama5/sam_pmecc.c +++ b/arch/arm/src/sama5/sam_pmecc.c @@ -98,7 +98,7 @@ struct pmecc_desc_s { uint32_t pagesize; /* 0-3: See HSMC_PMECCFG_PAGESIZE_* definitions */ uint32_t sparesize; /* 4-7: The spare area size is equal to (SPARESIZE+1) bytes */ - uint32_t sectorsz; /* 8-11: See HSMC_PMECCFG_SECTORSZ_* definitions*/ + uint32_t sectorsz; /* 8-11: See HSMC_PMECCFG_SECTORSZ_* definitions */ uint32_t bcherr; /* 12-15: See HSMC_PMECCFG_BCHERR_* definitions */ uint32_t eccsize; /* 16-19: Real size in bytes of ECC in spare */ uint32_t eccstart; /* 20-23: The first byte address of the ECC area */ @@ -440,13 +440,13 @@ static uint32_t pmecc_getsigma(void) /* Compute degree of the new smu polynomial */ - if ((lmu[i]>>1) > ((lmu[ro]>>1) + diff)) + if ((lmu[i] >> 1) > ((lmu[ro] >> 1) + diff)) { lmu[i + 1] = lmu[i]; } else { - lmu[i + 1] = ((lmu[ro]>>1) + diff) * 2; + lmu[i + 1] = ((lmu[ro] >> 1) + diff) * 2; } /* Init smu[i+1] with 0 */ @@ -458,7 +458,7 @@ static uint32_t pmecc_getsigma(void) /* Compute smu[i+1] */ - for (k = 0; k <= lmu[ro]>>1; k ++) + for (k = 0; k <= lmu[ro] >> 1; k++) { if (g_pmecc.desc.smu[ro][k] && dmu[i]) { @@ -469,7 +469,7 @@ static uint32_t pmecc_getsigma(void) } } - for (k = 0; k <= lmu[i]>>1; k ++) + for (k = 0; k <= lmu[i] >> 1; k++) { g_pmecc.desc.smu[i+1][k] ^= g_pmecc.desc.smu[i][k]; } @@ -646,7 +646,7 @@ static uint32_t pmecc_errorcorrection(uintptr_t sectorbase, } else { - if (*(uint8_t*)(sectorbase + bytepos + eccsize)& (1 << bitpos)) + if (*(uint8_t*)(sectorbase + bytepos + eccsize) & (1 << bitpos)) { *(uint8_t*)(sectorbase + bytepos + eccsize) &= (0xff ^ (1 << bitpos)); } @@ -775,14 +775,14 @@ static int pmecc_bcherr512(uint8_t nsectors, uint16_t eccsize) /* 7-bytes per 512 byte sector are required correctability of 4 errors */ - else if (eccsize >= (7 *(unsigned int) nsectors)) + else if (eccsize >= (7 * (unsigned int) nsectors)) { return BCH_ERR4; } /* 4-bytes per 512 byte sector are required correctability of 2 errors */ - else if (eccsize >= (4 *(unsigned int) nsectors)) + else if (eccsize >= (4 * (unsigned int) nsectors)) { return BCH_ERR2; } @@ -823,14 +823,14 @@ static int pmecc_bcherr1k(uint8_t nsectors, uint16_t eccsize) /* 7-bytes per 1024 byte sector are required correctability of 4 errors */ - else if (eccsize >= (7 *(unsigned int) nsectors)) + else if (eccsize >= (7 * (unsigned int) nsectors)) { return BCH_ERR4; } /* 4-bytes per 1024 byte sector are required correctability of 2 errors */ - else if (eccsize >= (4 *(unsigned int) nsectors)) + else if (eccsize >= (4 * (unsigned int) nsectors)) { return BCH_ERR2; } @@ -934,7 +934,9 @@ static int pmecc_pagelayout(uint16_t datasize, uint16_t eccsize) DEBUGASSERT(bcherr512 >= 0); break; } - } /* Otherwise, fall through for the 1KB sectors */ + } + + /* Otherwise, fall through for the 1KB sectors */ case 2: /* 512B sectors not possible; 1KB sectors possible */ { @@ -1347,7 +1349,7 @@ uint32_t pmecc_get_pagesize(void) ****************************************************************************/ #ifdef CONFIG_SAMA5_PMECC_GALOIS_CUSTOM -void pmecc_buildgf(uint32_t mm, int16_t* indexof, int16_t* alphato) +void pmecc_buildgf(uint32_t mm, int16_t *indexof, int16_t *alphato) { uint32_t i; uint32_t mask; diff --git a/arch/arm/src/sama5/sam_rtc.c b/arch/arm/src/sama5/sam_rtc.c index 01539235a6..51eafdcb67 100644 --- a/arch/arm/src/sama5/sam_rtc.c +++ b/arch/arm/src/sama5/sam_rtc.c @@ -292,7 +292,7 @@ static int rtc_interrupt(int irq, void *context) rtclldbg("ERRPR: work_queue failed: %d\n", ret); } - /* Disable any further alarm interrupts*/ + /* Disable any further alarm interrupts */ putreg32(RTC_IDR_ALRDIS, SAM_RTC_IDR); diff --git a/arch/arm/src/sama5/sam_sckc.c b/arch/arm/src/sama5/sam_sckc.c index adc9656179..e416aebd8d 100644 --- a/arch/arm/src/sama5/sam_sckc.c +++ b/arch/arm/src/sama5/sam_sckc.c @@ -109,7 +109,7 @@ void sam_sckc_enable(bool enable) regval &= ~SCKC_CR_OSC32BYP; putreg32(regval, SAM_SCKC_CR); - /* Switch slow clock source to external OSC 32 kHz (*/ + /* Switch slow clock source to external OSC 32 kHz */ regval |= SCKC_CR_OSCSEL; putreg32(regval, SAM_SCKC_CR); diff --git a/arch/arm/src/sama5/sam_serial.c b/arch/arm/src/sama5/sam_serial.c index 9cf97cf1fa..f007e69810 100644 --- a/arch/arm/src/sama5/sam_serial.c +++ b/arch/arm/src/sama5/sam_serial.c @@ -1238,12 +1238,12 @@ static int up_setup(struct uart_dev_s *dev) * This may limit BAUD rates for lower USART clocks. */ - regval = (SAM_USART_CLOCK + (priv->baud << 3))/(priv->baud << 4); + regval = (SAM_USART_CLOCK + (priv->baud << 3)) / (priv->baud << 4); up_serialout(priv, SAM_UART_BRGR_OFFSET, regval); /* Enable receiver & transmitter */ - up_serialout(priv, SAM_UART_CR_OFFSET, (UART_CR_RXEN|UART_CR_TXEN)); + up_serialout(priv, SAM_UART_CR_OFFSET, (UART_CR_RXEN | UART_CR_TXEN)); #endif return OK; } @@ -1264,7 +1264,8 @@ static void up_shutdown(struct uart_dev_s *dev) /* Reset and disable receiver and transmitter */ up_serialout(priv, SAM_UART_CR_OFFSET, - (UART_CR_RSTRX|UART_CR_RSTTX|UART_CR_RXDIS|UART_CR_TXDIS)); + (UART_CR_RSTRX | UART_CR_RSTTX | UART_CR_RXDIS | + UART_CR_TXDIS)); /* Disable all interrupts */ diff --git a/arch/arm/src/sama5/sam_ssc.c b/arch/arm/src/sama5/sam_ssc.c index a1681e54c8..bc5fa8fe4e 100644 --- a/arch/arm/src/sama5/sam_ssc.c +++ b/arch/arm/src/sama5/sam_ssc.c @@ -365,7 +365,7 @@ DMACH_FLAG_PERIPHISPERIPH | DMACH_FLAG_PERIPHWIDTH_8BITS | \ DMACH_FLAG_PERIPHCHUNKSIZE_1 | DMACH_FLAG_MEMPID_MAX | \ DMACH_FLAG_MEM_IF | DMACH_FLAG_MEMWIDTH_16BITS | \ - DMACH_FLAG_MEMINCREMENT | DMACH_FLAG_MEMCHUNKSIZE_1| \ + DMACH_FLAG_MEMINCREMENT | DMACH_FLAG_MEMCHUNKSIZE_1 | \ DMACH_FLAG_MEMBURST_4) #define DMA16_FLAGS \ diff --git a/arch/arm/src/sama5/sam_timerisr.c b/arch/arm/src/sama5/sam_timerisr.c index 4814bf445e..3861b1217a 100644 --- a/arch/arm/src/sama5/sam_timerisr.c +++ b/arch/arm/src/sama5/sam_timerisr.c @@ -102,7 +102,7 @@ int up_timerisr(int irq, uint32_t *regs) * Interval Value Register (PIT_PIVR), the overflow counter (PICNT) is * reset and the PITS is cleared, thus acknowledging the interrupt. The * value of PICNT gives the number of periodic intervals elapsed since the - * last read of PIT_PIVR. + * last read of PIT_PIVR." */ uint32_t picnt = getreg32(SAM_PIT_PIVR) >> PIT_PICNT_SHIFT; diff --git a/arch/arm/src/sama5/sam_trng.c b/arch/arm/src/sama5/sam_trng.c index 3f0d701fdb..0480d2e6e4 100644 --- a/arch/arm/src/sama5/sam_trng.c +++ b/arch/arm/src/sama5/sam_trng.c @@ -144,9 +144,9 @@ static int sam_interrupt(int irq, void *context) if ((getreg32(SAM_TRNG_ISR) & TRNG_INT_DATRDY) == 0) { - /* No? Then return and continue processing on the next interrupt. */ + /* No? Then return and continue processing on the next interrupt. */ - return OK; + return OK; } /* As required by the FIPS PUB (Federal Information Processing Standard @@ -258,7 +258,7 @@ static ssize_t sam_read(struct file *filep, char *buffer, size_t buflen) DEBUGASSERT(((uintptr_t)buffer & 3) == 0); - g_trngdev.samples = (uint32_t*)buffer; + g_trngdev.samples = (uint32_t *)buffer; g_trngdev.maxsamples = buflen >> 2; g_trngdev.nsamples = 0; g_trngdev.first = true; diff --git a/arch/arm/src/sama5/sam_tsd.c b/arch/arm/src/sama5/sam_tsd.c index 9c44bdd370..2f930effe6 100644 --- a/arch/arm/src/sama5/sam_tsd.c +++ b/arch/arm/src/sama5/sam_tsd.c @@ -315,7 +315,7 @@ static int sam_tsd_sample(struct sam_tsd_s *priv, struct sam_sample_s *sample) * sampled data. */ - memcpy(sample, &priv->sample, sizeof(struct sam_sample_s )); + memcpy(sample, &priv->sample, sizeof(struct sam_sample_s)); /* Now manage state transitions */ @@ -330,10 +330,10 @@ static int sam_tsd_sample(struct sam_tsd_s *priv, struct sam_sample_s *sample) priv->id++; } else if (sample->contact == CONTACT_DOWN) - { + { /* First report -- next report will be a movement */ - priv->sample.contact = CONTACT_MOVE; + priv->sample.contact = CONTACT_MOVE; } priv->penchange = false; @@ -596,9 +596,9 @@ static void sam_tsd_bottomhalf(void *arg) * this case; we rely on the timer expiry to get us going again. */ - wd_start(priv->wdog, TSD_WDOG_DELAY, sam_tsd_expiry, 1, (uint32_t)priv); - ier = 0; - goto ignored; + wd_start(priv->wdog, TSD_WDOG_DELAY, sam_tsd_expiry, 1, (uint32_t)priv); + ier = 0; + goto ignored; } else { diff --git a/arch/arm/src/sama5/sam_twi.c b/arch/arm/src/sama5/sam_twi.c index 99764c8c81..ed6bca63e1 100644 --- a/arch/arm/src/sama5/sam_twi.c +++ b/arch/arm/src/sama5/sam_twi.c @@ -635,7 +635,7 @@ static int twi_interrupt(struct twi_dev_s *priv) } } - /* Byte sent*/ + /* Byte sent */ else if ((pending & TWI_INT_TXRDY) != 0) { @@ -768,7 +768,7 @@ static void twi_startread(struct twi_dev_s *priv, struct i2c_msg_s *msg) priv->result = -EBUSY; priv->xfrd = 0; - /* Set STOP signal if only one byte is sent*/ + /* Set STOP signal if only one byte is sent */ if (msg->length == 1) { @@ -815,7 +815,7 @@ static void twi_startwrite(struct twi_dev_s *priv, struct i2c_msg_s *msg) twi_putrel(priv, SAM_TWI_IADR_OFFSET, 0); - /* Write first byte to send.*/ + /* Write first byte to send. */ twi_putrel(priv, SAM_TWI_THR_OFFSET, msg->buffer[priv->xfrd++]); diff --git a/arch/arm/src/sama5/sam_udphs.c b/arch/arm/src/sama5/sam_udphs.c index 0c31311f88..6394c389b3 100644 --- a/arch/arm/src/sama5/sam_udphs.c +++ b/arch/arm/src/sama5/sam_udphs.c @@ -2816,7 +2816,7 @@ static int sam_udphs_interrupt(int irq, void *context) sam_suspend(priv); } - /* SOF interrupt*/ + /* SOF interrupt */ else if ((pending & UDPHS_INT_INTSOF) != 0) { @@ -3497,7 +3497,7 @@ static struct usbdev_req_s *sam_ep_allocreq(struct usbdev_ep_s *ep) static void sam_ep_freereq(struct usbdev_ep_s *ep, struct usbdev_req_s *req) { - struct sam_req_s *privreq = (struct sam_req_s*)req; + struct sam_req_s *privreq = (struct sam_req_s *)req; #ifdef CONFIG_DEBUG if (!ep || !req) @@ -4293,7 +4293,7 @@ static void sam_sw_setup(struct sam_usbdev_s *priv) priv->dtdpool = (struct sam_dtd_s *) kmm_memalign(16, CONFIG_SAMA5_UDPHS_NDTDS * sizeof(struct sam_dtd_s)); if (!priv->dtdpool) - { + { udbg("ERROR: Failed to allocate the DMA transfer descriptor pool\n"); return NULL; } diff --git a/arch/arm/src/sama5/sam_wdt.c b/arch/arm/src/sama5/sam_wdt.c index 58724d12a1..cf4cda8110 100644 --- a/arch/arm/src/sama5/sam_wdt.c +++ b/arch/arm/src/sama5/sam_wdt.c @@ -196,10 +196,11 @@ static uint32_t sam_getreg(uintptr_t regaddr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return regval; } } diff --git a/arch/arm/src/sama5/sama5d2x_pio.c b/arch/arm/src/sama5/sama5d2x_pio.c index 7c54fece09..a96c50331a 100644 --- a/arch/arm/src/sama5/sama5d2x_pio.c +++ b/arch/arm/src/sama5/sama5d2x_pio.c @@ -649,8 +649,7 @@ int sam_dumppio(uint32_t pinset, const char *msg) { lldbg(" SCDR: %08x WPMR: %08x WPSR: %08x IOSSR: %08x\n", getreg32(SAM_SPIO_SCDR), getreg32(SAM_SPIO_WPMR), - getreg32(SAM_SPIO_WPSR), getreg32(base + SAM_SPIO_IOSSR_OFFSET), - ); + getreg32(SAM_SPIO_WPSR), getreg32(base + SAM_SPIO_IOSSR_OFFSET)); } else { diff --git a/arch/arm/src/samdl/sam_irq.c b/arch/arm/src/samdl/sam_irq.c index 224c6b062f..8ef2a6361b 100644 --- a/arch/arm/src/samdl/sam_irq.c +++ b/arch/arm/src/samdl/sam_irq.c @@ -59,7 +59,7 @@ /* Get a 32-bit version of the default priority */ #define DEFPRIORITY32 \ - (NVIC_SYSH_PRIORITY_DEFAULT << 24 | NVIC_SYSH_PRIORITY_DEFAULT << 16 |\ + (NVIC_SYSH_PRIORITY_DEFAULT << 24 | NVIC_SYSH_PRIORITY_DEFAULT << 16 | \ NVIC_SYSH_PRIORITY_DEFAULT << 8 | NVIC_SYSH_PRIORITY_DEFAULT) /**************************************************************************** diff --git a/arch/arm/src/samdl/sam_serial.c b/arch/arm/src/samdl/sam_serial.c index b21332eb60..ea8e9affc6 100644 --- a/arch/arm/src/samdl/sam_serial.c +++ b/arch/arm/src/samdl/sam_serial.c @@ -557,7 +557,7 @@ static void sam_disableallints(struct sam_dev_s *priv) static int sam_interrupt(struct uart_dev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv;; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv;; uint8_t pending; uint8_t intflag; uint8_t inten; @@ -663,7 +663,7 @@ static int sam_setup(struct uart_dev_s *dev) { int ret = 0; #ifndef CONFIG_SUPPRESS_UART_CONFIG - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; /* Configure the SERCOM as a USART. Don't reconfigure the console UART; * that was already done in sam_lowputc.c. @@ -689,7 +689,7 @@ static int sam_setup(struct uart_dev_s *dev) static void sam_shutdown(struct uart_dev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; /* Resetting the SERCOM restores all registers to the reget state and * disables the SERCOM. Ignore any requests to shutown the console @@ -720,7 +720,7 @@ static void sam_shutdown(struct uart_dev_s *dev) static int sam_attach(struct uart_dev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; const struct sam_usart_config_s * const config = priv->config; int ret; @@ -751,7 +751,7 @@ static int sam_attach(struct uart_dev_s *dev) static void sam_detach(struct uart_dev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; const struct sam_usart_config_s * const config = priv->config; /* Disable interrupts at the SERCOM device and at the NVIC */ @@ -785,7 +785,7 @@ static int sam_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct sam_dev_s *user = (struct sam_dev_s*)arg; + struct sam_dev_s *user = (struct sam_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -818,7 +818,7 @@ static int sam_ioctl(struct file *filep, int cmd, unsigned long arg) static int sam_receive(struct uart_dev_s *dev, uint32_t *status) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; /* Return read status */ @@ -839,7 +839,7 @@ static int sam_receive(struct uart_dev_s *dev, uint32_t *status) static void sam_rxint(struct uart_dev_s *dev, bool enable) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; if (enable) { @@ -865,7 +865,7 @@ static void sam_rxint(struct uart_dev_s *dev, bool enable) static bool sam_rxavailable(struct uart_dev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; return ((sam_serialin8(priv, SAM_USART_INTFLAG_OFFSET) & USART_INT_RXC) != 0); } @@ -879,7 +879,7 @@ static bool sam_rxavailable(struct uart_dev_s *dev) static void sam_send(struct uart_dev_s *dev, int ch) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; sam_serialout16(priv, SAM_USART_DATA_OFFSET, (uint16_t)ch); } @@ -893,7 +893,7 @@ static void sam_send(struct uart_dev_s *dev, int ch) static void sam_txint(struct uart_dev_s *dev, bool enable) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -934,7 +934,7 @@ static void sam_txint(struct uart_dev_s *dev, bool enable) static bool sam_txempty(struct uart_dev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; return ((sam_serialin8(priv, SAM_USART_INTFLAG_OFFSET) & USART_INT_DRE) != 0); } diff --git a/arch/arm/src/samdl/sam_spi.c b/arch/arm/src/samdl/sam_spi.c index 8851da74a7..afd51e98c4 100644 --- a/arch/arm/src/samdl/sam_spi.c +++ b/arch/arm/src/samdl/sam_spi.c @@ -799,7 +799,7 @@ static void spi_dumpregs(struct sam_spidev_s *priv, const char *msg) #if 0 /* Not used */ static int spi_interrupt(struct sam_spidev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv;; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv;; uint8_t pending; uint8_t intflag; uint8_t inten; @@ -959,7 +959,7 @@ static int spi_lock(struct spi_dev_s *dev, bool lock) static uint32_t spi_setfrequency(struct spi_dev_s *dev, uint32_t frequency) { - struct sam_spidev_s *priv =(struct sam_spidev_s *)dev; + struct sam_spidev_s *priv = (struct sam_spidev_s *)dev; uint32_t maxfreq; uint32_t actual; uint32_t baud; diff --git a/arch/arm/src/samdl/sam_timerisr.c b/arch/arm/src/samdl/sam_timerisr.c index 7350694572..327e8b72b0 100644 --- a/arch/arm/src/samdl/sam_timerisr.c +++ b/arch/arm/src/samdl/sam_timerisr.c @@ -105,10 +105,10 @@ int up_timerisr(int irq, uint32_t *regs) { - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); - return 0; + sched_process_timer(); + return 0; } /**************************************************************************** diff --git a/arch/arm/src/samdl/sam_userspace.c b/arch/arm/src/samdl/sam_userspace.c index 8a55c7c9ea..613aa33b3c 100644 --- a/arch/arm/src/samdl/sam_userspace.c +++ b/arch/arm/src/samdl/sam_userspace.c @@ -86,8 +86,8 @@ void sam_userspace(void) DEBUGASSERT(USERSPACE->us_bssstart != 0 && USERSPACE->us_bssend != 0 && USERSPACE->us_bssstart <= USERSPACE->us_bssend); - dest = (uint8_t*)USERSPACE->us_bssstart; - end = (uint8_t*)USERSPACE->us_bssend; + dest = (uint8_t *)USERSPACE->us_bssstart; + end = (uint8_t *)USERSPACE->us_bssend; while (dest != end) { @@ -100,9 +100,9 @@ void sam_userspace(void) USERSPACE->us_datastart != 0 && USERSPACE->us_dataend != 0 && USERSPACE->us_datastart <= USERSPACE->us_dataend); - src = (uint8_t*)USERSPACE->us_datasource; - dest = (uint8_t*)USERSPACE->us_datastart; - end = (uint8_t*)USERSPACE->us_dataend; + src = (uint8_t *)USERSPACE->us_datasource; + dest = (uint8_t *)USERSPACE->us_datastart; + end = (uint8_t *)USERSPACE->us_dataend; while (dest != end) { diff --git a/arch/arm/src/samv7/sam_allocateheap.c b/arch/arm/src/samv7/sam_allocateheap.c index 35a335f9ee..f092d0767f 100644 --- a/arch/arm/src/samv7/sam_allocateheap.c +++ b/arch/arm/src/samv7/sam_allocateheap.c @@ -238,7 +238,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) /* Return the user-space heap settings */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)ubase; + *heap_start = (FAR void *)ubase; *heap_size = usize; /* Allow user-mode access to the user heap memory */ @@ -249,7 +249,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) /* Return the heap settings */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)g_idle_topstack; + *heap_start = (FAR void *)g_idle_topstack; *heap_size = CONFIG_RAM_END - g_idle_topstack; #endif } @@ -328,7 +328,7 @@ void up_addregion(void) /* Add the region */ - kumm_addregion((FAR void*)SAM_EXTCS0_BASE, CONFIG_SAMV7_EXTSRAM0SIZE); + kumm_addregion((FAR void *)SAM_EXTCS0_BASE, CONFIG_SAMV7_EXTSRAM0SIZE); #endif /* HAVE_EXTSRAM0_REGION */ @@ -339,7 +339,7 @@ void up_addregion(void) /* Add the region */ - kumm_addregion((FAR void*)SAM_EXTCS1_BASE, CONFIG_SAMV7_EXTSRAM1SIZE); + kumm_addregion((FAR void *)SAM_EXTCS1_BASE, CONFIG_SAMV7_EXTSRAM1SIZE); #endif /* HAVE_EXTSRAM0_REGION */ @@ -350,7 +350,7 @@ void up_addregion(void) /* Add the region */ - kumm_addregion((FAR void*)SAM_EXTCS2_BASE, CONFIG_SAMV7_EXTSRAM2SIZE); + kumm_addregion((FAR void *)SAM_EXTCS2_BASE, CONFIG_SAMV7_EXTSRAM2SIZE); #endif /* HAVE_EXTSRAM0_REGION */ @@ -361,7 +361,7 @@ void up_addregion(void) /* Add the region */ - kumm_addregion((FAR void*)SAM_EXTCS3_BASE, CONFIG_SAMV7_EXTSRAM3SIZE); + kumm_addregion((FAR void *)SAM_EXTCS3_BASE, CONFIG_SAMV7_EXTSRAM3SIZE); #endif /* HAVE_EXTSRAM0_REGION */ } diff --git a/arch/arm/src/samv7/sam_clockconfig.c b/arch/arm/src/samv7/sam_clockconfig.c index 35afb26fff..a15f06933e 100644 --- a/arch/arm/src/samv7/sam_clockconfig.c +++ b/arch/arm/src/samv7/sam_clockconfig.c @@ -137,7 +137,7 @@ static inline void sam_supcsetup(void) { uint32_t delay; - putreg32((SUPC_CR_XTALSEL|SUPR_CR_KEY), SAM_SUPC_CR); + putreg32((SUPC_CR_XTALSEL | SUPR_CR_KEY), SAM_SUPC_CR); for (delay = 0; (getreg32(SAM_SUPC_SR) & SUPC_SR_OSCSEL) == 0 && delay < UINT32_MAX; delay++); @@ -312,19 +312,19 @@ static inline void sam_enabledefaultmaster(void) /* Set default master: SRAM0 -> Cortex-M7 System */ regval = getreg32(SAM_MATRIX_SCFG0); - regval |= (MATRIX_SCFG0_FIXEDDEFMSTR_ARMS|MATRIX_SCFG_DEFMSTRTYPE_FIXED); + regval |= (MATRIX_SCFG0_FIXEDDEFMSTR_ARMS | MATRIX_SCFG_DEFMSTRTYPE_FIXED); putreg32(regval, SAM_MATRIX_SCFG0); /* Set default master: SRAM1 -> Cortex-M7 System */ regval = getreg32(SAM_MATRIX_SCFG1); - regval |= (MATRIX_SCFG1_FIXEDDEFMSTR_ARMS|MATRIX_SCFG_DEFMSTRTYPE_FIXED); + regval |= (MATRIX_SCFG1_FIXEDDEFMSTR_ARMS | MATRIX_SCFG_DEFMSTRTYPE_FIXED); putreg32(regval, SAM_MATRIX_SCFG1); /* Set default master: Internal flash0 -> Cortex-M7 Instruction/Data */ regval = getreg32(SAM_MATRIX_SCFG3); - regval |= (MATRIX_SCFG3_FIXEDDEFMSTR_ARMC|MATRIX_SCFG_DEFMSTRTYPE_FIXED); + regval |= (MATRIX_SCFG3_FIXEDDEFMSTR_ARMC | MATRIX_SCFG_DEFMSTRTYPE_FIXED); putreg32(regval, SAM_MATRIX_SCFG3); #endif } diff --git a/arch/arm/src/samv7/sam_emac.c b/arch/arm/src/samv7/sam_emac.c index af0065d551..2807714af4 100644 --- a/arch/arm/src/samv7/sam_emac.c +++ b/arch/arm/src/samv7/sam_emac.c @@ -4382,7 +4382,7 @@ static inline void sam_ethgpioconfig(struct sam_emac_s *priv) if (priv->attr->emac == EMAC0_INTF) { - /* Configure PIO pins common to RMII and MII mode*/ + /* Configure PIO pins common to RMII and MII mode */ sam_configgpio(GPIO_EMAC0_TXCK); /* Transmit Clock (or Reference Clock) */ sam_configgpio(GPIO_EMAC0_TXEN); /* Transmit Enable */ @@ -4395,7 +4395,7 @@ static inline void sam_ethgpioconfig(struct sam_emac_s *priv) sam_configgpio(GPIO_EMAC0_MDC); /* Management Data Clock */ sam_configgpio(GPIO_EMAC0_MDIO); /* Management Data Input/Output */ - /* Configure additional PIO pins to support EMAC in MII mode*/ + /* Configure additional PIO pins to support EMAC in MII mode */ if (!priv->attr->rmii) { @@ -4409,7 +4409,7 @@ static inline void sam_ethgpioconfig(struct sam_emac_s *priv) sam_configgpio(GPIO_EMAC0_COL); /* Collision Detect */ } } - else + else #endif #if defined(CONFIG_SAMV7_EMAC1) @@ -4417,7 +4417,7 @@ static inline void sam_ethgpioconfig(struct sam_emac_s *priv) if (priv->attr->emac == EMAC1_INTF) { - /* Configure PIO pins common to RMII and MII mode*/ + /* Configure PIO pins common to RMII and MII mode */ sam_configgpio(GPIO_EMAC1_TXCK); /* Transmit Clock (or Reference Clock) */ sam_configgpio(GPIO_EMAC1_TXEN); /* Transmit Enable */ @@ -4430,7 +4430,7 @@ static inline void sam_ethgpioconfig(struct sam_emac_s *priv) sam_configgpio(GPIO_EMAC1_MDC); /* Management Data Clock */ sam_configgpio(GPIO_EMAC1_MDIO); /* Management Data Input/Output */ - /* Configure additional PIO pins to support EMAC in MII mode*/ + /* Configure additional PIO pins to support EMAC in MII mode */ if (!priv->attr->rmii) { diff --git a/arch/arm/src/samv7/sam_gpioirq.c b/arch/arm/src/samv7/sam_gpioirq.c index 9db13c088e..d7e235c58b 100644 --- a/arch/arm/src/samv7/sam_gpioirq.c +++ b/arch/arm/src/samv7/sam_gpioirq.c @@ -345,42 +345,42 @@ void sam_gpioirq(gpio_pinset_t pinset) uint32_t base = sam_gpiobase(pinset); int pin = sam_gpiopin(pinset); - /* Are any additional interrupt modes selected? */ + /* Are any additional interrupt modes selected? */ - if ((pinset & _GIO_INT_AIM) != 0) - { - /* Yes.. Enable additional interrupt mode */ + if ((pinset & _GIO_INT_AIM) != 0) + { + /* Yes.. Enable additional interrupt mode */ - putreg32(pin, base + SAM_PIO_AIMER_OFFSET); + putreg32(pin, base + SAM_PIO_AIMER_OFFSET); - /* Level or edge detected interrupt? */ + /* Level or edge detected interrupt? */ - if ((pinset & _GPIO_INT_LEVEL) != 0) - { - putreg32(pin, base + SAM_PIO_LSR_OFFSET); /* Level */ - } - else - { - putreg32(pin, base + SAM_PIO_ESR_OFFSET); /* Edge */ - } + if ((pinset & _GPIO_INT_LEVEL) != 0) + { + putreg32(pin, base + SAM_PIO_LSR_OFFSET); /* Level */ + } + else + { + putreg32(pin, base + SAM_PIO_ESR_OFFSET); /* Edge */ + } /* High level/rising edge or low level /falling edge? */ - if ((pinset & _GPIO_INT_RH) != 0) - { - putreg32(pin, base + SAM_PIO_REHLSR_OFFSET); /* High level/Rising edge */ - } - else - { - putreg32(pin, base + SAM_PIO_FELLSR_OFFSET); /* Low level/Falling edge */ - } - } + if ((pinset & _GPIO_INT_RH) != 0) + { + putreg32(pin, base + SAM_PIO_REHLSR_OFFSET); /* High level/Rising edge */ + } + else + { + putreg32(pin, base + SAM_PIO_FELLSR_OFFSET); /* Low level/Falling edge */ + } + } else - { - /* No.. Disable additional interrupt mode */ + { + /* No.. Disable additional interrupt mode */ - putreg32(pin, base + SAM_PIO_AIMDR_OFFSET); - } + putreg32(pin, base + SAM_PIO_AIMDR_OFFSET); + } } /************************************************************************************ diff --git a/arch/arm/src/samv7/sam_hsmci.c b/arch/arm/src/samv7/sam_hsmci.c index 713fc1c70b..20db5da509 100644 --- a/arch/arm/src/samv7/sam_hsmci.c +++ b/arch/arm/src/samv7/sam_hsmci.c @@ -63,7 +63,6 @@ #include "sam_gpio.h" #include "sam_xdmac.h" #include "sam_periphclks.h" -//#include "sam_memories.h" #include "sam_hsmci.h" #include "chip/sam_xdmac.h" #include "chip/sam_pmc.h" @@ -1475,13 +1474,13 @@ static int sam_hsmci_interrupt(struct sam_dev_s *priv) { /* Yes.. Terminate with a timeout. */ - sam_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_TIMEOUT); + sam_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_TIMEOUT); } else { /* No.. Terminate with an I/O error. */ - sam_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_ERROR); + sam_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_ERROR); } } @@ -1549,25 +1548,27 @@ static int sam_hsmci_interrupt(struct sam_dev_s *priv) { /* Yes.. signal a timeout error */ - wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE|SDIOWAIT_TIMEOUT; + wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE | + SDIOWAIT_TIMEOUT; } else { /* No.. signal some generic I/O error */ - wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE|SDIOWAIT_ERROR; + wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE | + SDIOWAIT_ERROR; } } else - { + { /* The Command-Response sequence ended with no error */ - wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE; + wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE; } - /* Yes.. Is there a thread waiting for this event set? */ + /* Yes.. Is there a thread waiting for this event set? */ - wkupevent &= priv->waitevents; + wkupevent &= priv->waitevents; if (wkupevent != 0) { /* Yes.. wake the thread up */ @@ -1904,7 +1905,7 @@ static int sam_attach(FAR struct sdio_dev_s *dev) static int sam_sendcmd(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t arg) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; uint32_t regval; uint32_t cmdidx; @@ -2098,7 +2099,7 @@ static int sam_recvsetup(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, /* Save the destination buffer information for use by the interrupt handler */ - priv->buffer = (uint32_t*)buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = buflen; /* And enable interrupts */ @@ -2203,7 +2204,7 @@ static int sam_sendsetup(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer, static int sam_cancel(FAR struct sdio_dev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; /* Disable all transfer- and event- related interrupts */ @@ -2256,7 +2257,7 @@ static int sam_cancel(FAR struct sdio_dev_s *dev) static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; uint32_t sr; uint32_t pending; int32_t timeout; @@ -2311,14 +2312,16 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) { /* Yes.. return a timeout error */ - priv->wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE|SDIOWAIT_TIMEOUT; + priv->wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE | + SDIOWAIT_TIMEOUT; return -ETIMEDOUT; } else { /* No.. return some generic I/O error */ - priv->wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE|SDIOWAIT_ERROR; + priv->wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE | + SDIOWAIT_ERROR; return -EIO; } } @@ -2326,7 +2329,7 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) { /* The Command-Response sequence ended with no error */ - priv->wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE; + priv->wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE; return OK; } } @@ -2366,7 +2369,7 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) static int sam_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *rshort) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; int ret = OK; /* These responses could have CRC errors: @@ -2450,9 +2453,10 @@ static int sam_recvshort(FAR struct sdio_dev_s *dev, return ret; } -static int sam_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlong[4]) +static int sam_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, + uint32_t rlong[4]) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; int ret = OK; /* R2 CID, CSD register (136-bit) @@ -2510,7 +2514,7 @@ static int sam_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlong static int sam_recvnotimpl(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *rnotimpl) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; priv->wkupevent = 0; return -ENOSYS; } @@ -2553,7 +2557,7 @@ static int sam_recvnotimpl(FAR struct sdio_dev_s *dev, static void sam_waitenable(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; uint32_t waitmask; DEBUGASSERT(priv != NULL); @@ -2567,7 +2571,7 @@ static void sam_waitenable(FAR struct sdio_dev_s *dev, */ waitmask = 0; - if ((eventset & (SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE)) != 0) + if ((eventset & (SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE)) != 0) { waitmask |= priv->cmdrmask; } @@ -2612,7 +2616,7 @@ static void sam_waitenable(FAR struct sdio_dev_s *dev, static sdio_eventset_t sam_eventwait(FAR struct sdio_dev_s *dev, uint32_t timeout) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; sdio_eventset_t wkupevent = 0; int ret; @@ -2727,7 +2731,7 @@ static sdio_eventset_t sam_eventwait(FAR struct sdio_dev_s *dev, static void sam_callbackenable(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; fvdbg("eventset: %02x\n", eventset); DEBUGASSERT(priv != NULL); @@ -2761,7 +2765,7 @@ static void sam_callbackenable(FAR struct sdio_dev_s *dev, static int sam_registercallback(FAR struct sdio_dev_s *dev, worker_t callback, void *arg) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; /* Disable callbacks and register this callback and is argument */ @@ -3005,7 +3009,7 @@ static int sam_dmasendsetup(FAR struct sdio_dev_s *dev, static void sam_callback(void *arg) { - struct sam_dev_s *priv = (struct sam_dev_s*)arg; + struct sam_dev_s *priv = (struct sam_dev_s *)arg; irqstate_t flags; int ret; diff --git a/arch/arm/src/samv7/sam_irq.c b/arch/arm/src/samv7/sam_irq.c index ec6fcee54e..772a2b2550 100644 --- a/arch/arm/src/samv7/sam_irq.c +++ b/arch/arm/src/samv7/sam_irq.c @@ -62,9 +62,9 @@ /* Get a 32-bit version of the default priority */ #define DEFPRIORITY32 \ - (NVIC_SYSH_PRIORITY_DEFAULT << 24 |\ - NVIC_SYSH_PRIORITY_DEFAULT << 16 |\ - NVIC_SYSH_PRIORITY_DEFAULT << 8 |\ + (NVIC_SYSH_PRIORITY_DEFAULT << 24 | \ + NVIC_SYSH_PRIORITY_DEFAULT << 16 | \ + NVIC_SYSH_PRIORITY_DEFAULT << 8 | \ NVIC_SYSH_PRIORITY_DEFAULT) /* Given the address of a NVIC ENABLE register, this is the offset to @@ -310,8 +310,8 @@ static int sam_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit, else { - *regaddr = NVIC_SYSHCON; - if (irq == SAM_IRQ_MEMFAULT) + *regaddr = NVIC_SYSHCON; + if (irq == SAM_IRQ_MEMFAULT) { *bit = NVIC_SYSHCON_MEMFAULTENA; } diff --git a/arch/arm/src/samv7/sam_mcan.c b/arch/arm/src/samv7/sam_mcan.c index c64921301c..5f729cbdb8 100644 --- a/arch/arm/src/samv7/sam_mcan.c +++ b/arch/arm/src/samv7/sam_mcan.c @@ -1189,10 +1189,10 @@ static uint32_t mcan_getreg(FAR struct sam_mcan_s *priv, int offset) { if (priv->count == 0xffffffff || ++priv->count > 3) { - if (priv->count == 4) - { - lldbg("...\n"); - } + if (priv->count == 4) + { + lldbg("...\n"); + } return regval; } @@ -1440,7 +1440,7 @@ static void mcan_buffer_reserve(FAR struct sam_mcan_s *priv) * be incremented and, hence, to be too low. */ - for(;;) + for (;;) { /* Get the current queue status and semaphore count. */ @@ -2716,7 +2716,7 @@ static int mcan_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg) /* Followed by the amount of data corresponding to the DLC (T2..) */ - dest = (FAR uint8_t*)&txbuffer[2]; + dest = (FAR uint8_t *)&txbuffer[2]; src = msg->cm_data; nbytes = mcan_dlc2bytes(priv, msg->cm_hdr.ch_dlc); diff --git a/arch/arm/src/samv7/sam_serial.c b/arch/arm/src/samv7/sam_serial.c index 6f542a97e7..352501a7d1 100644 --- a/arch/arm/src/samv7/sam_serial.c +++ b/arch/arm/src/samv7/sam_serial.c @@ -750,7 +750,7 @@ static void sam_disableallints(struct sam_dev_s *priv, uint32_t *imr) static int sam_setup(struct uart_dev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; #ifndef CONFIG_SUPPRESS_UART_CONFIG uint32_t divb3; uint32_t intpart; @@ -918,7 +918,7 @@ static int sam_setup(struct uart_dev_s *dev) static void sam_shutdown(struct uart_dev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; /* Reset and disable receiver and transmitter */ @@ -947,7 +947,7 @@ static void sam_shutdown(struct uart_dev_s *dev) static int sam_attach(struct uart_dev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ */ @@ -977,7 +977,7 @@ static int sam_attach(struct uart_dev_s *dev) static void sam_detach(struct uart_dev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; up_disable_irq(priv->irq); irq_detach(priv->irq); } @@ -1002,7 +1002,7 @@ static int sam_interrupt(struct uart_dev_s *dev) bool handled; DEBUGASSERT(dev && dev->priv); - priv = (struct sam_dev_s*)dev->priv; + priv = (struct sam_dev_s *)dev->priv; /* Loop until there are no characters to be transferred or, until we have * been looping for a long time. @@ -1134,7 +1134,7 @@ static int sam_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct sam_dev_s *user = (struct sam_dev_s*)arg; + struct sam_dev_s *user = (struct sam_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -1326,7 +1326,7 @@ static int sam_ioctl(struct file *filep, int cmd, unsigned long arg) static int sam_receive(struct uart_dev_s *dev, uint32_t *status) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; /* Return the error information in the saved status */ @@ -1348,7 +1348,7 @@ static int sam_receive(struct uart_dev_s *dev, uint32_t *status) static void sam_rxint(struct uart_dev_s *dev, bool enable) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; if (enable) { @@ -1376,7 +1376,7 @@ static void sam_rxint(struct uart_dev_s *dev, bool enable) static bool sam_rxavailable(struct uart_dev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; return ((sam_serialin(priv, SAM_UART_SR_OFFSET) & UART_INT_RXRDY) != 0); } @@ -1390,7 +1390,7 @@ static bool sam_rxavailable(struct uart_dev_s *dev) static void sam_send(struct uart_dev_s *dev, int ch) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; sam_serialout(priv, SAM_UART_THR_OFFSET, (uint32_t)ch); } @@ -1404,7 +1404,7 @@ static void sam_send(struct uart_dev_s *dev, int ch) static void sam_txint(struct uart_dev_s *dev, bool enable) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -1445,7 +1445,7 @@ static void sam_txint(struct uart_dev_s *dev, bool enable) static bool sam_txready(struct uart_dev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; return ((sam_serialin(priv, SAM_UART_SR_OFFSET) & UART_INT_TXRDY) != 0); } @@ -1459,7 +1459,7 @@ static bool sam_txready(struct uart_dev_s *dev) static bool sam_txempty(struct uart_dev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev->priv; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; return ((sam_serialin(priv, SAM_UART_SR_OFFSET) & UART_INT_TXEMPTY) != 0); } diff --git a/arch/arm/src/samv7/sam_spi.c b/arch/arm/src/samv7/sam_spi.c index 78e1c47522..7ab71ec3c4 100644 --- a/arch/arm/src/samv7/sam_spi.c +++ b/arch/arm/src/samv7/sam_spi.c @@ -1287,8 +1287,8 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, if (spics->nbits > 8) { - rxptr16 = (uint16_t*)rxbuffer; - txptr16 = (uint16_t*)txbuffer; + rxptr16 = (uint16_t *)rxbuffer; + txptr16 = (uint16_t *)txbuffer; rxptr8 = NULL; txptr8 = NULL; } @@ -1296,8 +1296,8 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, { rxptr16 = NULL; txptr16 = NULL; - rxptr8 = (uint8_t*)rxbuffer; - txptr8 = (uint8_t*)txbuffer; + rxptr8 = (uint8_t *)rxbuffer; + txptr8 = (uint8_t *)txbuffer; } /* Make sure that any previous transfer is flushed from the hardware */ @@ -1332,7 +1332,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, * Save the final word. */ - for ( ; nwords > 0; nwords--) + for (; nwords > 0; nwords--) { /* Get the data to send (0xff if there is no data source). */ diff --git a/arch/arm/src/samv7/sam_ssc.c b/arch/arm/src/samv7/sam_ssc.c index f3381b007a..fb9fed1773 100644 --- a/arch/arm/src/samv7/sam_ssc.c +++ b/arch/arm/src/samv7/sam_ssc.c @@ -65,7 +65,6 @@ #include "sam_gpio.h" #include "sam_xdmac.h" -//#include "sam_memories.h" #include "sam_periphclks.h" #include "sam_ssc.h" #include "chip/sam_pmc.h" @@ -339,7 +338,7 @@ DMACH_FLAG_PERIPHISPERIPH | DMACH_FLAG_PERIPHWIDTH_8BITS | \ DMACH_FLAG_PERIPHCHUNKSIZE_1 | DMACH_FLAG_MEMPID_MAX | \ DMACH_FLAG_MEM_IF | DMACH_FLAG_MEMWIDTH_16BITS | \ - DMACH_FLAG_MEMINCREMENT | DMACH_FLAG_MEMCHUNKSIZE_1| \ + DMACH_FLAG_MEMINCREMENT | DMACH_FLAG_MEMCHUNKSIZE_1 | \ DMACH_FLAG_MEMBURST_4) #define DMA16_FLAGS \ diff --git a/arch/arm/src/samv7/sam_start.c b/arch/arm/src/samv7/sam_start.c index 9e7ebaa5f5..c587db5e75 100644 --- a/arch/arm/src/samv7/sam_start.c +++ b/arch/arm/src/samv7/sam_start.c @@ -62,8 +62,7 @@ * Pre-processor Definitions ****************************************************************************/ /* Memory Map ***************************************************************/ -/* - * 0x0400:0000 - Beginning of the internal FLASH. Address of vectors. +/* 0x0400:0000 - Beginning of the internal FLASH. Address of vectors. * Mapped as boot memory address 0x0000:0000 at reset. * 0x041f:ffff - End of flash region (assuming the max of 2MiB of FLASH). * 0x2000:0000 - Start of internal SRAM and start of .data (_sdata) diff --git a/arch/arm/src/samv7/sam_timerisr.c b/arch/arm/src/samv7/sam_timerisr.c index 4bf1d95c7a..9e167aeae7 100644 --- a/arch/arm/src/samv7/sam_timerisr.c +++ b/arch/arm/src/samv7/sam_timerisr.c @@ -108,10 +108,10 @@ int up_timerisr(int irq, uint32_t *regs) { - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); - return 0; + sched_process_timer(); + return 0; } /**************************************************************************** diff --git a/arch/arm/src/samv7/sam_twihs.c b/arch/arm/src/samv7/sam_twihs.c index 9b6957767e..ef6d8d1669 100644 --- a/arch/arm/src/samv7/sam_twihs.c +++ b/arch/arm/src/samv7/sam_twihs.c @@ -647,7 +647,7 @@ static int twi_interrupt(struct twi_dev_s *priv) } } - /* Byte sent*/ + /* Byte sent */ else if ((pending & TWIHS_INT_TXRDY) != 0) { @@ -795,7 +795,7 @@ static void twi_startread(struct twi_dev_s *priv, struct i2c_msg_s *msg) priv->result = -EBUSY; priv->xfrd = 0; - /* Set STOP signal if only one byte is sent*/ + /* Set STOP signal if only one byte is sent */ if (msg->length == 1) { @@ -842,7 +842,7 @@ static void twi_startwrite(struct twi_dev_s *priv, struct i2c_msg_s *msg) twi_putrel(priv, SAM_TWIHS_IADR_OFFSET, 0); - /* Write first byte to send.*/ + /* Write first byte to send. */ twi_putrel(priv, SAM_TWIHS_THR_OFFSET, msg->buffer[priv->xfrd++]); diff --git a/arch/arm/src/samv7/sam_usbdevhs.c b/arch/arm/src/samv7/sam_usbdevhs.c index ac95a43795..e1fe56298d 100644 --- a/arch/arm/src/samv7/sam_usbdevhs.c +++ b/arch/arm/src/samv7/sam_usbdevhs.c @@ -3717,7 +3717,7 @@ static struct usbdev_req_s *sam_ep_allocreq(struct usbdev_ep_s *ep) static void sam_ep_freereq(struct usbdev_ep_s *ep, struct usbdev_req_s *req) { - struct sam_req_s *privreq = (struct sam_req_s*)req; + struct sam_req_s *privreq = (struct sam_req_s *)req; DEBUGASSERT(ep != NULL && req != NULL); usbtrace(TRACE_EPFREEREQ, USB_EPNO(ep->eplog)); @@ -4555,7 +4555,7 @@ static void sam_hw_setup(struct sam_usbdev_s *priv) /* Clear endpoint status */ sam_putreg(USBHS_DEVEPTICR_ALLINTS, SAM_USBHS_DEVEPTICR(i)); - } + } /* Disable all interrupts */ From 2ab66a015bd8674cba0a1e19fcca409354a88e63 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 5 Oct 2015 17:28:26 -0600 Subject: [PATCH 19/33] Cosmetic fixes to C coding style --- arch/arm/src/lpc43xx/lpc43_rit.c | 5 ++++- arch/arm/src/sam34/sam_rtc.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/lpc43xx/lpc43_rit.c b/arch/arm/src/lpc43xx/lpc43_rit.c index eb051c1046..42e76dbd63 100644 --- a/arch/arm/src/lpc43xx/lpc43_rit.c +++ b/arch/arm/src/lpc43xx/lpc43_rit.c @@ -195,7 +195,10 @@ void up_timer_initialize(void) * complicated. When I have a better idea, I'll change this. */ - while (!((mask_test >> mask_bits) & ticks_per_int)) mask_bits++; + while (!((mask_test >> mask_bits) & ticks_per_int)) + { + mask_bits++; + } lldbg("mask_bits = %d, mask = %X, ticks_per_int = %d\r\n", mask_bits, (0xFFFFFFFF<<(32 - mask_bits)), ticks_per_int); diff --git a/arch/arm/src/sam34/sam_rtc.c b/arch/arm/src/sam34/sam_rtc.c index bc12247694..405a3d40ca 100644 --- a/arch/arm/src/sam34/sam_rtc.c +++ b/arch/arm/src/sam34/sam_rtc.c @@ -772,6 +772,7 @@ int sam_rtc_setalarm(FAR const struct timespec *tp, alarmcb_t callback) int up_rtc_gettime(FAR struct timespec *tp) { /* This is a hack to emulate a high resolution rtc using the rtt */ + uint32_t rtc_cal, rtc_tim, rtt_val; struct tm t; From a9c8458458207ddd6941705128e95cdf73db8f22 Mon Sep 17 00:00:00 2001 From: Lederhilger Martin Date: Tue, 6 Oct 2015 07:29:00 -0600 Subject: [PATCH 20/33] STM32 PWM: Add logic to handle writes to 32-bit registers properly --- arch/arm/src/stm32/stm32_pwm.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/stm32/stm32_pwm.c b/arch/arm/src/stm32/stm32_pwm.c index 5a4267ea5f..622a87081b 100644 --- a/arch/arm/src/stm32/stm32_pwm.c +++ b/arch/arm/src/stm32/stm32_pwm.c @@ -454,7 +454,26 @@ static uint16_t pwm_getreg(struct stm32_pwmtimer_s *priv, int offset) static void pwm_putreg(struct stm32_pwmtimer_s *priv, int offset, uint16_t value) { - putreg16(value, priv->base + offset); + if (priv->timtype == TIMTYPE_GENERAL32 && + (offset == STM32_GTIM_CNT_OFFSET || + offset == STM32_GTIM_ARR_OFFSET || + offset == STM32_GTIM_CCR1_OFFSET || + offset == STM32_GTIM_CCR2_OFFSET || + offset == STM32_GTIM_CCR3_OFFSET || + offset == STM32_GTIM_CCR4_OFFSET)) + { + /* a 32 bit access is required for a 32 bit register: + * if only a 16 bit write would be performed, then the + * upper 16 bits of the 32 bit register will be a copy of + * the lower 16 bits. + */ + + putreg32(value, priv->base + offset); + } + else + { + putreg16(value, priv->base + offset); + } } /**************************************************************************** From 0ca999e1191347a094d534a835e57c2381cf4078 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 6 Oct 2015 16:23:32 -0600 Subject: [PATCH 21/33] Make some spacing comply better with coding standard --- arch/arm/src/armv7-a/arm_addrenv_shm.c | 20 +++---- arch/arm/src/armv7-a/arm_allocpage.c | 2 +- arch/arm/src/armv7-a/arm_assert.c | 10 ++-- arch/arm/src/armv7-a/arm_blocktask.c | 18 +++--- arch/arm/src/armv7-a/arm_dataabort.c | 2 +- arch/arm/src/armv7-a/arm_doirq.c | 2 +- arch/arm/src/armv7-a/arm_elf.c | 32 +++++------ arch/arm/src/armv7-a/arm_l2cc_pl310.c | 12 ++-- arch/arm/src/armv7-a/arm_mmu.c | 6 +- arch/arm/src/armv7-a/arm_prefetchabort.c | 2 +- arch/arm/src/armv7-a/arm_releasepending.c | 6 +- arch/arm/src/armv7-a/arm_reprioritizertr.c | 6 +- arch/arm/src/armv7-a/arm_schedulesigaction.c | 2 +- arch/arm/src/armv7-a/arm_sigdeliver.c | 2 +- arch/arm/src/armv7-a/arm_syscall.c | 2 +- arch/arm/src/armv7-a/arm_unblocktask.c | 18 +++--- arch/arm/src/armv7-a/arm_va2pte.c | 4 +- arch/arm/src/armv7-m/up_assert.c | 6 +- arch/arm/src/armv7-m/up_blocktask.c | 6 +- arch/arm/src/armv7-m/up_doirq.c | 4 +- arch/arm/src/armv7-m/up_elf.c | 58 ++++++++++---------- arch/arm/src/armv7-m/up_hardfault.c | 4 +- arch/arm/src/armv7-m/up_initialstate.c | 2 +- arch/arm/src/armv7-m/up_releasepending.c | 6 +- arch/arm/src/armv7-m/up_reprioritizertr.c | 6 +- arch/arm/src/armv7-m/up_schedulesigaction.c | 2 +- arch/arm/src/armv7-m/up_sigdeliver.c | 2 +- arch/arm/src/armv7-m/up_svcall.c | 16 +++--- arch/arm/src/armv7-m/up_unblocktask.c | 6 +- arch/arm/src/c5471/c5471_ethernet.c | 20 ++++--- 30 files changed, 144 insertions(+), 140 deletions(-) diff --git a/arch/arm/src/armv7-a/arm_addrenv_shm.c b/arch/arm/src/armv7-a/arm_addrenv_shm.c index a11d285ed5..ef5905cc0f 100644 --- a/arch/arm/src/armv7-a/arm_addrenv_shm.c +++ b/arch/arm/src/armv7-a/arm_addrenv_shm.c @@ -285,19 +285,19 @@ int up_shmdt(uintptr_t vaddr, unsigned int npages) flags = irqsave(); #ifdef CONFIG_ARCH_PGPOOL_MAPPING - /* Get the virtual address corresponding to the physical page\ - * address. - */ + /* Get the virtual address corresponding to the physical page + * address. + */ - l2table = (FAR uint32_t *)arm_pgvaddr(paddr); + l2table = (FAR uint32_t *)arm_pgvaddr(paddr); #else - /* Temporarily map the page into the virtual address space */ + /* Temporarily map the page into the virtual address space */ - l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE); - mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE, - MMU_MEMFLAGS); - l2table = (FAR uint32_t *) - (ARCH_SCRATCH_VBASE | (paddr & SECTION_MASK)); + l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE); + mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE, + MMU_MEMFLAGS); + l2table = (FAR uint32_t *) + (ARCH_SCRATCH_VBASE | (paddr & SECTION_MASK)); #endif /* Unmap this virtual page address. diff --git a/arch/arm/src/armv7-a/arm_allocpage.c b/arch/arm/src/armv7-a/arm_allocpage.c index baf2ca111c..39ffea6e21 100644 --- a/arch/arm/src/armv7-a/arm_allocpage.c +++ b/arch/arm/src/armv7-a/arm_allocpage.c @@ -236,7 +236,7 @@ int arm_allocpage(FAR struct tcb_s *tcb, FAR void **vpage) /* Finally, return the virtual address of allocated page */ - *vpage = (void*)(vaddr & ~PAGEMASK); + *vpage = (void *)(vaddr & ~PAGEMASK); return OK; } diff --git a/arch/arm/src/armv7-a/arm_assert.c b/arch/arm/src/armv7-a/arm_assert.c index eaac377db0..3c66d64c1d 100644 --- a/arch/arm/src/armv7-a/arm_assert.c +++ b/arch/arm/src/armv7-a/arm_assert.c @@ -124,7 +124,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base) for (stack = sp & ~0x1f; stack < stack_base; stack += 32) { - uint32_t *ptr = (uint32_t*)stack; + uint32_t *ptr = (uint32_t *)stack; lldbg("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); @@ -187,7 +187,7 @@ static inline void up_registerdump(void) for (regs = REG_R0; regs <= REG_R15; regs += 8) { - uint32_t *ptr = (uint32_t*)¤t_regs[regs]; + uint32_t *ptr = (uint32_t *)¤t_regs[regs]; lldbg("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); @@ -232,7 +232,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) #ifdef CONFIG_ARCH_STACKDUMP static void up_dumpstate(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; uint32_t sp = up_getsp(); uint32_t ustackbase; uint32_t ustacksize; @@ -365,7 +365,7 @@ static void _up_assert(int errorcode) { /* Are we in an interrupt handler or the idle task? */ - if (current_regs || ((struct tcb_s*)g_readytorun.head)->pid == 0) + if (current_regs || ((struct tcb_s *)g_readytorun.head)->pid == 0) { (void)irqsave(); for (;;) @@ -395,7 +395,7 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { #ifdef CONFIG_PRINT_TASKNAME - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; #endif board_led_on(LED_ASSERTION); diff --git a/arch/arm/src/armv7-a/arm_blocktask.c b/arch/arm/src/armv7-a/arm_blocktask.c index c5c8cecbaa..79c69fedac 100644 --- a/arch/arm/src/armv7-a/arm_blocktask.c +++ b/arch/arm/src/armv7-a/arm_blocktask.c @@ -76,7 +76,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; bool switch_needed; /* Verify that the context switch can be performed */ @@ -128,7 +128,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Reset scheduler parameters */ @@ -152,16 +152,16 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; #ifdef CONFIG_ARCH_ADDRENV - /* Make sure that the address environment for the previously - * running task is closed down gracefully (data caches dump, - * MMU flushed) and set up the address environment for the new - * thread at the head of the ready-to-run list. - */ + /* Make sure that the address environment for the previously + * running task is closed down gracefully (data caches dump, + * MMU flushed) and set up the address environment for the new + * thread at the head of the ready-to-run list. + */ - (void)group_addrenv(rtcb); + (void)group_addrenv(rtcb); #endif /* Reset scheduler parameters */ diff --git a/arch/arm/src/armv7-a/arm_dataabort.c b/arch/arm/src/armv7-a/arm_dataabort.c index 1066a8d214..23d54f2312 100644 --- a/arch/arm/src/armv7-a/arm_dataabort.c +++ b/arch/arm/src/armv7-a/arm_dataabort.c @@ -112,7 +112,7 @@ uint32_t *arm_dataabort(uint32_t *regs, uint32_t dfar, uint32_t dfsr) * for register dumps and possibly context switching. */ - savestate = (uint32_t*)current_regs; + savestate = (uint32_t *)current_regs; current_regs = regs; /* In the NuttX on-demand paging implementation, only the read-only, .text diff --git a/arch/arm/src/armv7-a/arm_doirq.c b/arch/arm/src/armv7-a/arm_doirq.c index 896a375bf5..d126f565db 100644 --- a/arch/arm/src/armv7-a/arm_doirq.c +++ b/arch/arm/src/armv7-a/arm_doirq.c @@ -105,7 +105,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs) #ifdef CONFIG_ARCH_FPU /* Restore floating point registers */ - up_restorefpu((uint32_t*)current_regs); + up_restorefpu((uint32_t *)current_regs); #endif #ifdef CONFIG_ARCH_ADDRENV diff --git a/arch/arm/src/armv7-a/arm_elf.c b/arch/arm/src/armv7-a/arm_elf.c index 97b85620f2..3f076908c4 100644 --- a/arch/arm/src/armv7-a/arm_elf.c +++ b/arch/arm/src/armv7-a/arm_elf.c @@ -175,10 +175,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, case R_ARM_JUMP24: { bvdbg("Performing PC24 [%d] link at addr %08lx [%08lx] to sym '%s' st_value=%08lx\n", - ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t*)addr), + ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value); - offset = (*(uint32_t*)addr & 0x00ffffff) << 2; + offset = (*(uint32_t *)addr & 0x00ffffff) << 2; if (offset & 0x02000000) { offset -= 0x04000000; @@ -195,8 +195,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, offset >>= 2; - *(uint32_t*)addr &= 0xff000000; - *(uint32_t*)addr |= offset & 0x00ffffff; + *(uint32_t *)addr &= 0xff000000; + *(uint32_t *)addr |= offset & 0x00ffffff; } break; @@ -204,34 +204,34 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, case R_ARM_TARGET1: /* New ABI: TARGET1 always treated as ABS32 */ { bvdbg("Performing ABS32 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n", - (long)addr, (long)(*(uint32_t*)addr), sym, (long)sym->st_value); + (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value); - *(uint32_t*)addr += sym->st_value; + *(uint32_t *)addr += sym->st_value; } break; case R_ARM_V4BX: { bvdbg("Performing V4BX link at addr=%08lx [%08lx]\n", - (long)addr, (long)(*(uint32_t*)addr)); + (long)addr, (long)(*(uint32_t *)addr)); /* Preserve only Rm and the condition code */ - *(uint32_t*)addr &= 0xf000000f; + *(uint32_t *)addr &= 0xf000000f; /* Change instruction to 'mov pc, Rm' */ - *(uint32_t*)addr |= 0x01a0f000; + *(uint32_t *)addr |= 0x01a0f000; } break; case R_ARM_PREL31: { bvdbg("Performing PREL31 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n", - (long)addr, (long)(*(uint32_t*)addr), sym, (long)sym->st_value); + (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value); - offset = *(uint32_t*)addr + sym->st_value - addr; - *(uint32_t*)addr = offset & 0x7fffffff; + offset = *(uint32_t *)addr + sym->st_value - addr; + *(uint32_t *)addr = offset & 0x7fffffff; } break; @@ -239,10 +239,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, case R_ARM_MOVT_ABS: { bvdbg("Performing MOVx_ABS [%d] link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n", - ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t*)addr), + ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value); - offset = *(uint32_t*)addr; + offset = *(uint32_t *)addr; offset = ((offset & 0xf0000) >> 4) | (offset & 0xfff); offset = (offset ^ 0x8000) - 0x8000; @@ -252,8 +252,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, offset >>= 16; } - *(uint32_t*)addr &= 0xfff0f000; - *(uint32_t*)addr |= ((offset & 0xf000) << 4) | (offset & 0x0fff); + *(uint32_t *)addr &= 0xfff0f000; + *(uint32_t *)addr |= ((offset & 0xf000) << 4) | (offset & 0x0fff); } break; diff --git a/arch/arm/src/armv7-a/arm_l2cc_pl310.c b/arch/arm/src/armv7-a/arm_l2cc_pl310.c index 960a49ac0e..7935dd5076 100644 --- a/arch/arm/src/armv7-a/arm_l2cc_pl310.c +++ b/arch/arm/src/armv7-a/arm_l2cc_pl310.c @@ -75,17 +75,17 @@ /* The size of one depends on ARM configuration */ #if defined(CONFIG_ARMV7A_WAYSIZE_16KB) -# define PL310_WAYSIZE (16*1024) +# define PL310_WAYSIZE (16 * 1024) #elif defined(CONFIG_ARMV7A_WAYSIZE_32KB) -# define PL310_WAYSIZE (32*1024) +# define PL310_WAYSIZE (32 * 1024) #elif defined(CONFIG_ARMV7A_WAYSIZE_64KB) -# define PL310_WAYSIZE (64*1024) +# define PL310_WAYSIZE (64 * 1024) #elif defined(CONFIG_ARMV7A_WAYSIZE_128KB) -# define PL310_WAYSIZE (128*1024) +# define PL310_WAYSIZE (128 * 1024) #elif defined(CONFIG_ARMV7A_WAYSIZE_256KB) -# define PL310_WAYSIZE (256*1024) +# define PL310_WAYSIZE (256 * 1024) #elif defined(CONFIG_ARMV7A_WAYSIZE_512KB) -# define PL310_WAYSIZE (512*1024) +# define PL310_WAYSIZE (512 * 1024) #else # error "Way size not selected" #endif diff --git a/arch/arm/src/armv7-a/arm_mmu.c b/arch/arm/src/armv7-a/arm_mmu.c index 8fb7c1a0ee..19c609e5b0 100644 --- a/arch/arm/src/armv7-a/arm_mmu.c +++ b/arch/arm/src/armv7-a/arm_mmu.c @@ -79,7 +79,7 @@ #ifndef CONFIG_ARCH_ROMPGTABLE void mmu_l1_setentry(uint32_t paddr, uint32_t vaddr, uint32_t mmuflags) { - uint32_t *l1table = (uint32_t*)PGTABLE_BASE_VADDR; + uint32_t *l1table = (uint32_t *)PGTABLE_BASE_VADDR; uint32_t index = vaddr >> 20; /* Save the page table entry */ @@ -114,7 +114,7 @@ void mmu_l1_setentry(uint32_t paddr, uint32_t vaddr, uint32_t mmuflags) #if !defined(CONFIG_ARCH_ROMPGTABLE) && defined(CONFIG_ARCH_ADDRENV) void mmu_l1_restore(uintptr_t vaddr, uint32_t l1entry) { - uint32_t *l1table = (uint32_t*)PGTABLE_BASE_VADDR; + uint32_t *l1table = (uint32_t *)PGTABLE_BASE_VADDR; uint32_t index = vaddr >> 20; /* Set the encoded page table entry */ @@ -154,7 +154,7 @@ void mmu_l1_restore(uintptr_t vaddr, uint32_t l1entry) void mmu_l2_setentry(uint32_t l2vaddr, uint32_t paddr, uint32_t vaddr, uint32_t mmuflags) { - uint32_t *l2table = (uint32_t*)l2vaddr; + uint32_t *l2table = (uint32_t *)l2vaddr; uint32_t index; /* The table divides a 1Mb address space up into 256 entries, each diff --git a/arch/arm/src/armv7-a/arm_prefetchabort.c b/arch/arm/src/armv7-a/arm_prefetchabort.c index 1b4bd6dcf2..038a8e7592 100644 --- a/arch/arm/src/armv7-a/arm_prefetchabort.c +++ b/arch/arm/src/armv7-a/arm_prefetchabort.c @@ -97,7 +97,7 @@ uint32_t *arm_prefetchabort(uint32_t *regs, uint32_t ifar, uint32_t ifsr) * for register dumps and possibly context switching. */ - savestate = (uint32_t*)current_regs; + savestate = (uint32_t *)current_regs; current_regs = regs; /* Get the (virtual) address of instruction that caused the prefetch abort. diff --git a/arch/arm/src/armv7-a/arm_releasepending.c b/arch/arm/src/armv7-a/arm_releasepending.c index 8ac2328a4c..944b194b1b 100644 --- a/arch/arm/src/armv7-a/arm_releasepending.c +++ b/arch/arm/src/armv7-a/arm_releasepending.c @@ -65,7 +65,7 @@ void up_release_pending(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; slldbg("From TCB=%p\n", rtcb); @@ -96,7 +96,7 @@ void up_release_pending(void) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -121,7 +121,7 @@ void up_release_pending(void) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; #ifdef CONFIG_ARCH_ADDRENV /* Make sure that the address environment for the previously diff --git a/arch/arm/src/armv7-a/arm_reprioritizertr.c b/arch/arm/src/armv7-a/arm_reprioritizertr.c index a8caf30257..a799329f44 100644 --- a/arch/arm/src/armv7-a/arm_reprioritizertr.c +++ b/arch/arm/src/armv7-a/arm_reprioritizertr.c @@ -92,7 +92,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) } else { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; bool switch_needed; slldbg("TCB=%p PRI=%d\n", tcb, priority); @@ -150,7 +150,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -174,7 +174,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; #ifdef CONFIG_ARCH_ADDRENV /* Make sure that the address environment for the previously diff --git a/arch/arm/src/armv7-a/arm_schedulesigaction.c b/arch/arm/src/armv7-a/arm_schedulesigaction.c index 866ebb36a5..abf811bc1f 100644 --- a/arch/arm/src/armv7-a/arm_schedulesigaction.c +++ b/arch/arm/src/armv7-a/arm_schedulesigaction.c @@ -121,7 +121,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs); - if (tcb == (struct tcb_s*)g_readytorun.head) + if (tcb == (struct tcb_s *)g_readytorun.head) { /* CASE 1: We are not in an interrupt handler and a task is * signalling itself for some reason. diff --git a/arch/arm/src/armv7-a/arm_sigdeliver.c b/arch/arm/src/armv7-a/arm_sigdeliver.c index f6053e1d0b..0ea2b4c13e 100644 --- a/arch/arm/src/armv7-a/arm_sigdeliver.c +++ b/arch/arm/src/armv7-a/arm_sigdeliver.c @@ -82,7 +82,7 @@ void up_sigdeliver(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; uint32_t regs[XCPTCONTEXT_REGS]; sig_deliver_t sigdeliver; diff --git a/arch/arm/src/armv7-a/arm_syscall.c b/arch/arm/src/armv7-a/arm_syscall.c index 9a8fc6b05d..56dc38ea4d 100644 --- a/arch/arm/src/armv7-a/arm_syscall.c +++ b/arch/arm/src/armv7-a/arm_syscall.c @@ -379,7 +379,7 @@ uint32_t *arm_syscall(uint32_t *regs) * parameter will reside at an offset of 4 from the stack pointer. */ - regs[REG_R3] = *(uint32_t*)(regs[REG_SP]+4); + regs[REG_R3] = *(uint32_t *)(regs[REG_SP]+4); #ifdef CONFIG_ARCH_KERNEL_STACK /* If we are signalling a user process, then we must be operating diff --git a/arch/arm/src/armv7-a/arm_unblocktask.c b/arch/arm/src/armv7-a/arm_unblocktask.c index aecc823f8e..ec536c63f8 100644 --- a/arch/arm/src/armv7-a/arm_unblocktask.c +++ b/arch/arm/src/armv7-a/arm_unblocktask.c @@ -83,7 +83,7 @@ void up_unblock_task(struct tcb_s *tcb) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; /* Verify that the context switch can be performed */ @@ -122,7 +122,7 @@ void up_unblock_task(struct tcb_s *tcb) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -148,16 +148,16 @@ void up_unblock_task(struct tcb_s *tcb) * g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; #ifdef CONFIG_ARCH_ADDRENV - /* Make sure that the address environment for the previously - * running task is closed down gracefully (data caches dump, - * MMU flushed) and set up the address environment for the new - * thread at the head of the ready-to-run list. - */ + /* Make sure that the address environment for the previously + * running task is closed down gracefully (data caches dump, + * MMU flushed) and set up the address environment for the new + * thread at the head of the ready-to-run list. + */ - (void)group_addrenv(rtcb); + (void)group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/arm/src/armv7-a/arm_va2pte.c b/arch/arm/src/armv7-a/arm_va2pte.c index 6b3decbca0..ded054187e 100644 --- a/arch/arm/src/armv7-a/arm_va2pte.c +++ b/arch/arm/src/armv7-a/arm_va2pte.c @@ -101,11 +101,11 @@ uint32_t *arm_va2pte(uintptr_t vaddr) /* Get the L1 table entry associated with this virtual address */ - L1 = *(uint32_t*)PG_POOL_VA2L1VADDR(vaddr); + L1 = *(uint32_t *)PG_POOL_VA2L1VADDR(vaddr); /* Get the address of the L2 page table from the L1 entry */ - L2 = (uint32_t*)PG_POOL_L12VPTABLE(L1); + L2 = (uint32_t *)PG_POOL_L12VPTABLE(L1); /* Get the index into the L2 page table. Each L1 entry maps * 256 x 4Kb or 1024 x 1Kb pages. diff --git a/arch/arm/src/armv7-m/up_assert.c b/arch/arm/src/armv7-m/up_assert.c index 01fcc2fc5f..cd9ba9c353 100644 --- a/arch/arm/src/armv7-m/up_assert.c +++ b/arch/arm/src/armv7-m/up_assert.c @@ -124,7 +124,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base) for (stack = sp & ~0x1f; stack < stack_base; stack += 32) { - uint32_t *ptr = (uint32_t*)stack; + uint32_t *ptr = (uint32_t *)stack; lldbg("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); @@ -374,7 +374,7 @@ static void _up_assert(int errorcode) { /* Are we in an interrupt handler or the idle task? */ - if (current_regs || ((struct tcb_s*)g_readytorun.head)->pid == 0) + if (current_regs || ((struct tcb_s *)g_readytorun.head)->pid == 0) { (void)irqsave(); for (;;) @@ -404,7 +404,7 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { #ifdef CONFIG_PRINT_TASKNAME - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; #endif board_led_on(LED_ASSERTION); diff --git a/arch/arm/src/armv7-m/up_blocktask.c b/arch/arm/src/armv7-m/up_blocktask.c index eba62c77b1..7e6ab9f02e 100644 --- a/arch/arm/src/armv7-m/up_blocktask.c +++ b/arch/arm/src/armv7-m/up_blocktask.c @@ -75,7 +75,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; bool switch_needed; /* Verify that the context switch can be performed */ @@ -127,7 +127,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Reset scheduler parameters */ @@ -142,7 +142,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) else { - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head; /* Reset scheduler parameters */ diff --git a/arch/arm/src/armv7-m/up_doirq.c b/arch/arm/src/armv7-m/up_doirq.c index 95019f4726..0582000c58 100644 --- a/arch/arm/src/armv7-m/up_doirq.c +++ b/arch/arm/src/armv7-m/up_doirq.c @@ -90,7 +90,7 @@ uint32_t *up_doirq(int irq, uint32_t *regs) * current_regs is also used to manage interrupt level context switches. */ - savestate = (uint32_t*)current_regs; + savestate = (uint32_t *)current_regs; current_regs = regs; /* Acknowledge the interrupt */ @@ -107,7 +107,7 @@ uint32_t *up_doirq(int irq, uint32_t *regs) * switch occurred during interrupt processing. */ - regs = (uint32_t*)current_regs; + regs = (uint32_t *)current_regs; /* Restore the previous value of current_regs. NULL would indicate that * we are no longer in an interrupt handler. It will be non-NULL if we diff --git a/arch/arm/src/armv7-m/up_elf.c b/arch/arm/src/armv7-m/up_elf.c index 4c5155f665..abefae88b5 100644 --- a/arch/arm/src/armv7-m/up_elf.c +++ b/arch/arm/src/armv7-m/up_elf.c @@ -179,10 +179,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, case R_ARM_JUMP24: { bvdbg("Performing PC24 [%d] link at addr %08lx [%08lx] to sym '%s' st_value=%08lx\n", - ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t*)addr), + ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value); - offset = (*(uint32_t*)addr & 0x00ffffff) << 2; + offset = (*(uint32_t *)addr & 0x00ffffff) << 2; if (offset & 0x02000000) { offset -= 0x04000000; @@ -199,8 +199,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, offset >>= 2; - *(uint32_t*)addr &= 0xff000000; - *(uint32_t*)addr |= offset & 0x00ffffff; + *(uint32_t *)addr &= 0xff000000; + *(uint32_t *)addr |= offset & 0x00ffffff; } break; @@ -208,9 +208,9 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, case R_ARM_TARGET1: /* New ABI: TARGET1 always treated as ABS32 */ { bvdbg("Performing ABS32 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n", - (long)addr, (long)(*(uint32_t*)addr), sym, (long)sym->st_value); + (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value); - *(uint32_t*)addr += sym->st_value; + *(uint32_t *)addr += sym->st_value; } break; @@ -219,9 +219,9 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, * performs a self relocation */ { bvdbg("Performing TARGET2 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n", - (long)addr, (long)(*(uint32_t*)addr), sym, (long)sym->st_value); + (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value); - *(uint32_t*)addr += sym->st_value - addr; + *(uint32_t *)addr += sym->st_value - addr; } break; #endif @@ -264,8 +264,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, * J2 = lower_insn[11] */ - upper_insn = (uint32_t)(*(uint16_t*)addr); - lower_insn = (uint32_t)(*(uint16_t*)(addr + 2)); + upper_insn = (uint32_t)(*(uint16_t *)addr); + lower_insn = (uint32_t)(*(uint16_t *)(addr + 2)); bvdbg("Performing THM_JUMP24 [%d] link at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n", ELF32_R_TYPE(rel->r_info), (long)addr, (int)upper_insn, (int)lower_insn, @@ -337,10 +337,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, J2 = S ^ (~(offset >> 22) & 1); upper_insn = ((upper_insn & 0xf800) | (S << 10) | ((offset >> 12) & 0x03ff)); - *(uint16_t*)addr = (uint16_t)upper_insn; + *(uint16_t *)addr = (uint16_t)upper_insn; lower_insn = ((lower_insn & 0xd000) | (J1 << 13) | (J2 << 11) | ((offset >> 1) & 0x07ff)); - *(uint16_t*)(addr + 2) = (uint16_t)lower_insn; + *(uint16_t *)(addr + 2) = (uint16_t)lower_insn; bvdbg(" S=%d J1=%d J2=%d insn [%04x %04x]\n", S, J1, J2, (int)upper_insn, (int)lower_insn); @@ -350,25 +350,25 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, case R_ARM_V4BX: { bvdbg("Performing V4BX link at addr=%08lx [%08lx]\n", - (long)addr, (long)(*(uint32_t*)addr)); + (long)addr, (long)(*(uint32_t *)addr)); /* Preserve only Rm and the condition code */ - *(uint32_t*)addr &= 0xf000000f; + *(uint32_t *)addr &= 0xf000000f; /* Change instruction to 'mov pc, Rm' */ - *(uint32_t*)addr |= 0x01a0f000; + *(uint32_t *)addr |= 0x01a0f000; } break; case R_ARM_PREL31: { bvdbg("Performing PREL31 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n", - (long)addr, (long)(*(uint32_t*)addr), sym, (long)sym->st_value); + (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value); - offset = *(uint32_t*)addr + sym->st_value - addr; - *(uint32_t*)addr = offset & 0x7fffffff; + offset = *(uint32_t *)addr + sym->st_value - addr; + *(uint32_t *)addr = offset & 0x7fffffff; } break; @@ -376,10 +376,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, case R_ARM_MOVT_ABS: { bvdbg("Performing MOVx_ABS [%d] link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n", - ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t*)addr), + ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value); - offset = *(uint32_t*)addr; + offset = *(uint32_t *)addr; offset = ((offset & 0xf0000) >> 4) | (offset & 0xfff); offset = (offset ^ 0x8000) - 0x8000; @@ -389,8 +389,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, offset >>= 16; } - *(uint32_t*)addr &= 0xfff0f000; - *(uint32_t*)addr |= ((offset & 0xf000) << 4) | (offset & 0x0fff); + *(uint32_t *)addr &= 0xfff0f000; + *(uint32_t *)addr |= ((offset & 0xf000) << 4) | (offset & 0x0fff); } break; @@ -427,8 +427,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, * imm8 = imm16[0:7] = lower_insn[7:0] */ - upper_insn = (uint32_t)(*(uint16_t*)addr); - lower_insn = (uint32_t)(*(uint16_t*)(addr + 2)); + upper_insn = (uint32_t)(*(uint16_t *)addr); + lower_insn = (uint32_t)(*(uint16_t *)(addr + 2)); bvdbg("Performing THM_MOVx [%d] link at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n", ELF32_R_TYPE(rel->r_info), (long)addr, (int)upper_insn, (int)lower_insn, @@ -461,11 +461,13 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, offset >>= 16; } - upper_insn = ((upper_insn & 0xfbf0) | ((offset & 0xf000) >> 12) | ((offset & 0x0800) >> 1)); - *(uint16_t*)addr = (uint16_t)upper_insn; + upper_insn = ((upper_insn & 0xfbf0) | ((offset & 0xf000) >> 12) | + ((offset & 0x0800) >> 1)); + *(uint16_t *)addr = (uint16_t)upper_insn; - lower_insn = ((lower_insn & 0x8f00) | ((offset & 0x0700) << 4) | (offset & 0x00ff)); - *(uint16_t*)(addr + 2) = (uint16_t)lower_insn; + lower_insn = ((lower_insn & 0x8f00) | ((offset & 0x0700) << 4) | + (offset & 0x00ff)); + *(uint16_t *)(addr + 2) = (uint16_t)lower_insn; bvdbg(" insn [%04x %04x]\n", (int)upper_insn, (int)lower_insn); diff --git a/arch/arm/src/armv7-m/up_hardfault.c b/arch/arm/src/armv7-m/up_hardfault.c index 7af0fe551e..31ab3d9b14 100644 --- a/arch/arm/src/armv7-m/up_hardfault.c +++ b/arch/arm/src/armv7-m/up_hardfault.c @@ -95,13 +95,13 @@ int up_hardfault(int irq, FAR void *context) { #if defined(CONFIG_DEBUG_HARDFAULT) || !defined(CONFIG_ARMV7M_USEBASEPRI) - uint32_t *regs = (uint32_t*)context; + uint32_t *regs = (uint32_t *)context; #endif /* Get the value of the program counter where the fault occurred */ #ifndef CONFIG_ARMV7M_USEBASEPRI - uint16_t *pc = (uint16_t*)regs[REG_PC] - 1; + uint16_t *pc = (uint16_t *)regs[REG_PC] - 1; /* Check if the pc lies in known FLASH memory. * REVISIT: What if the PC lies in "unknown" external memory? Best diff --git a/arch/arm/src/armv7-m/up_initialstate.c b/arch/arm/src/armv7-m/up_initialstate.c index c6ba227243..7cf6816c21 100644 --- a/arch/arm/src/armv7-m/up_initialstate.c +++ b/arch/arm/src/armv7-m/up_initialstate.c @@ -147,7 +147,7 @@ void up_initial_state(struct tcb_s *tcb) #if defined(CONFIG_ARMV7M_CMNVECTOR) && !defined(CONFIG_ARMV7M_LAZYFPU) && \ defined(CONFIG_ARCH_FPU) - xcp->regs[REG_FPSCR] = 0; // XXX initial FPSCR should be configurable + xcp->regs[REG_FPSCR] = 0; /* REVISIT: Initial FPSCR should be configurable */ xcp->regs[REG_FPReserved] = 0; #endif /* CONFIG_ARMV7M_CMNVECTOR && !CONFIG_ARMV7M_LAZYFPU && CONFIG_ARCH_FPU */ diff --git a/arch/arm/src/armv7-m/up_releasepending.c b/arch/arm/src/armv7-m/up_releasepending.c index 240410384c..eb0ca7c881 100644 --- a/arch/arm/src/armv7-m/up_releasepending.c +++ b/arch/arm/src/armv7-m/up_releasepending.c @@ -64,7 +64,7 @@ void up_release_pending(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; slldbg("From TCB=%p\n", rtcb); @@ -95,7 +95,7 @@ void up_release_pending(void) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -110,7 +110,7 @@ void up_release_pending(void) else { - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ diff --git a/arch/arm/src/armv7-m/up_reprioritizertr.c b/arch/arm/src/armv7-m/up_reprioritizertr.c index e22133d00e..1024565701 100644 --- a/arch/arm/src/armv7-m/up_reprioritizertr.c +++ b/arch/arm/src/armv7-m/up_reprioritizertr.c @@ -91,7 +91,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) } else { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; bool switch_needed; slldbg("TCB=%p PRI=%d\n", tcb, priority); @@ -150,7 +150,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -165,7 +165,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) else { - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ diff --git a/arch/arm/src/armv7-m/up_schedulesigaction.c b/arch/arm/src/armv7-m/up_schedulesigaction.c index 1b5cc41db7..14dcc87ab4 100644 --- a/arch/arm/src/armv7-m/up_schedulesigaction.c +++ b/arch/arm/src/armv7-m/up_schedulesigaction.c @@ -123,7 +123,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs); - if (tcb == (struct tcb_s*)g_readytorun.head) + if (tcb == (struct tcb_s *)g_readytorun.head) { /* CASE 1: We are not in an interrupt handler and a task is * signalling itself for some reason. diff --git a/arch/arm/src/armv7-m/up_sigdeliver.c b/arch/arm/src/armv7-m/up_sigdeliver.c index 4d2f81ea72..df5c17fbcf 100644 --- a/arch/arm/src/armv7-m/up_sigdeliver.c +++ b/arch/arm/src/armv7-m/up_sigdeliver.c @@ -82,7 +82,7 @@ void up_sigdeliver(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; uint32_t regs[XCPTCONTEXT_REGS]; sig_deliver_t sigdeliver; diff --git a/arch/arm/src/armv7-m/up_svcall.c b/arch/arm/src/armv7-m/up_svcall.c index dafbbc4776..048f58e86a 100644 --- a/arch/arm/src/armv7-m/up_svcall.c +++ b/arch/arm/src/armv7-m/up_svcall.c @@ -154,7 +154,7 @@ static void dispatch_syscall(void) int up_svcall(int irq, FAR void *context) { - uint32_t *regs = (uint32_t*)context; + uint32_t *regs = (uint32_t *)context; uint32_t cmd; DEBUGASSERT(regs && regs == current_regs); @@ -205,10 +205,10 @@ int up_svcall(int irq, FAR void *context) case SYS_save_context: { DEBUGASSERT(regs[REG_R1] != 0); - memcpy((uint32_t*)regs[REG_R1], regs, XCPTCONTEXT_SIZE); + memcpy((uint32_t *)regs[REG_R1], regs, XCPTCONTEXT_SIZE); #if defined(CONFIG_ARCH_FPU) && \ (!defined(CONFIG_ARMV7M_CMNVECTOR) || defined(CONFIG_ARMV7M_LAZYFPU)) - up_savefpu((uint32_t*)regs[REG_R1]); + up_savefpu((uint32_t *)regs[REG_R1]); #endif } break; @@ -231,7 +231,7 @@ int up_svcall(int irq, FAR void *context) case SYS_restore_context: { DEBUGASSERT(regs[REG_R1] != 0); - current_regs = (uint32_t*)regs[REG_R1]; + current_regs = (uint32_t *)regs[REG_R1]; } break; @@ -254,12 +254,12 @@ int up_svcall(int irq, FAR void *context) case SYS_switch_context: { DEBUGASSERT(regs[REG_R1] != 0 && regs[REG_R2] != 0); - memcpy((uint32_t*)regs[REG_R1], regs, XCPTCONTEXT_SIZE); + memcpy((uint32_t *)regs[REG_R1], regs, XCPTCONTEXT_SIZE); #if defined(CONFIG_ARCH_FPU) && \ (!defined(CONFIG_ARMV7M_CMNVECTOR) || defined(CONFIG_ARMV7M_LAZYFPU)) - up_savefpu((uint32_t*)regs[REG_R1]); + up_savefpu((uint32_t *)regs[REG_R1]); #endif - current_regs = (uint32_t*)regs[REG_R2]; + current_regs = (uint32_t *)regs[REG_R2]; } break; @@ -409,7 +409,7 @@ int up_svcall(int irq, FAR void *context) * parameter will reside at an offset of 4 from the stack pointer. */ - regs[REG_R3] = *(uint32_t*)(regs[REG_SP]+4); + regs[REG_R3] = *(uint32_t *)(regs[REG_SP]+4); } break; #endif diff --git a/arch/arm/src/armv7-m/up_unblocktask.c b/arch/arm/src/armv7-m/up_unblocktask.c index 485362e208..2e2c581a26 100644 --- a/arch/arm/src/armv7-m/up_unblocktask.c +++ b/arch/arm/src/armv7-m/up_unblocktask.c @@ -70,7 +70,7 @@ void up_unblock_task(struct tcb_s *tcb) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; /* Verify that the context switch can be performed */ @@ -109,7 +109,7 @@ void up_unblock_task(struct tcb_s *tcb) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -124,7 +124,7 @@ void up_unblock_task(struct tcb_s *tcb) else { - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ diff --git a/arch/arm/src/c5471/c5471_ethernet.c b/arch/arm/src/c5471/c5471_ethernet.c index 866e502f73..aea787afe1 100644 --- a/arch/arm/src/c5471/c5471_ethernet.c +++ b/arch/arm/src/c5471/c5471_ethernet.c @@ -541,7 +541,7 @@ static int c5471_mdrxbit (void) /* MDCLK falling edge. */ - putreg32((getreg32(GPIO_IO)&~GPIO_IO_MDCLK), GPIO_IO); /* MDCLK falling edge */ + putreg32((getreg32(GPIO_IO) & ~GPIO_IO_MDCLK), GPIO_IO); /* MDCLK falling edge */ if (bit_state) { return 1; @@ -909,12 +909,12 @@ static int c5471_transmit(struct c5471_driver_s *c5471) /* Words #2 and #3 of descriptor */ - packetmem = (uint16_t*)getreg32(c5471->c_rxcpudesc + sizeof(uint32_t)); + packetmem = (uint16_t *)getreg32(c5471->c_rxcpudesc + sizeof(uint32_t)); for (i = 0; i < nshorts; i++, j++) { /* 16-bits at a time. */ - packetmem[i] = htons(((uint16_t*)dev->d_buf)[j]); + packetmem[i] = htons(((uint16_t *)dev->d_buf)[j]); } putreg32(((getreg32(c5471->c_rxcpudesc) & ~EIM_RXDESC_BYTEMASK) | framelen), c5471->c_rxcpudesc); @@ -1192,7 +1192,7 @@ static void c5471_receive(struct c5471_driver_s *c5471) { /* Get the packet memory from words #2 and #3 of descriptor */ - packetmem = (uint16_t*)getreg32(c5471->c_txcpudesc + sizeof(uint32_t)); + packetmem = (uint16_t *)getreg32(c5471->c_txcpudesc + sizeof(uint32_t)); /* Divide by 2 with round up to get the number of 16-bit words. */ @@ -1206,7 +1206,7 @@ static void c5471_receive(struct c5471_driver_s *c5471) * a time. */ - ((uint16_t*)dev->d_buf)[j] = htons(packetmem[i]); + ((uint16_t *)dev->d_buf)[j] = htons(packetmem[i]); } } else @@ -1223,7 +1223,7 @@ static void c5471_receive(struct c5471_driver_s *c5471) * the settings of a select few. Can leave descriptor words 2/3 alone. */ - putreg32((getreg32(c5471->c_txcpudesc) & (EIM_TXDESC_WRAP_NEXT|EIM_TXDESC_INTRE)), + putreg32((getreg32(c5471->c_txcpudesc) & (EIM_TXDESC_WRAP_NEXT | EIM_TXDESC_INTRE)), c5471->c_txcpudesc); /* Next, Give ownership of now emptied descriptor back to the Ether Module's SWITCH */ @@ -1700,7 +1700,8 @@ static int c5471_ifup(struct net_driver_s *dev) /* Enable interrupts going from EIM Module to Interrupt Module. */ - putreg32(((getreg32(EIM_INTEN) | EIM_INTEN_CPU_TX|EIM_INTEN_CPU_RX)), EIM_INTEN); + putreg32(((getreg32(EIM_INTEN) | EIM_INTEN_CPU_TX | EIM_INTEN_CPU_RX)), + EIM_INTEN); /* Next, go on-line. According to the C547X documentation the enables have to * occur in this order to insure proper operation; ESM first then the ENET. @@ -1751,7 +1752,8 @@ static int c5471_ifdown(struct net_driver_s *dev) /* Disable interrupts going from EIM Module to Interrupt Module. */ - putreg32((getreg32(EIM_INTEN) & ~(EIM_INTEN_CPU_TX|EIM_INTEN_CPU_RX)), EIM_INTEN); + putreg32((getreg32(EIM_INTEN) & ~(EIM_INTEN_CPU_TX | EIM_INTEN_CPU_RX)), + EIM_INTEN); /* Disable ENET */ @@ -1809,7 +1811,7 @@ static int c5471_txavail(struct net_driver_s *dev) */ if ((EIM_TXDESC_OWN_HOST & getreg32(c5471->c_rxcpudesc)) == 0) - { + { /* If so, then poll uIP for new XMIT data */ (void)devif_poll(&c5471->c_dev, c5471_txpoll); From 281c6cc704f141272b9ede6732b04b7c4722c35f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 6 Oct 2015 16:23:47 -0600 Subject: [PATCH 22/33] Make some spacing comply better with coding standard --- arch/arm/src/a1x/a1x_boot.c | 6 +-- arch/arm/src/a1x/a1x_lowputc.c | 10 ++--- arch/arm/src/a1x/a1x_serial.c | 49 +++++++++++---------- arch/arm/src/arm/up_allocpage.c | 2 +- arch/arm/src/arm/up_assert.c | 10 ++--- arch/arm/src/arm/up_blocktask.c | 6 +-- arch/arm/src/arm/up_dataabort.c | 2 +- arch/arm/src/arm/up_doirq.c | 2 +- arch/arm/src/arm/up_elf.c | 32 +++++++------- arch/arm/src/arm/up_prefetchabort.c | 2 +- arch/arm/src/arm/up_releasepending.c | 6 +-- arch/arm/src/arm/up_reprioritizertr.c | 6 +-- arch/arm/src/arm/up_schedulesigaction.c | 2 +- arch/arm/src/arm/up_sigdeliver.c | 2 +- arch/arm/src/arm/up_unblocktask.c | 18 ++++---- arch/arm/src/arm/up_va2pte.c | 4 +- arch/arm/src/armv6-m/up_assert.c | 6 +-- arch/arm/src/armv6-m/up_blocktask.c | 6 +-- arch/arm/src/armv6-m/up_doirq.c | 4 +- arch/arm/src/armv6-m/up_elf.c | 48 ++++++++++---------- arch/arm/src/armv6-m/up_hardfault.c | 4 +- arch/arm/src/armv6-m/up_releasepending.c | 6 +-- arch/arm/src/armv6-m/up_reprioritizertr.c | 6 +-- arch/arm/src/armv6-m/up_schedulesigaction.c | 2 +- arch/arm/src/armv6-m/up_sigdeliver.c | 2 +- arch/arm/src/armv6-m/up_svcall.c | 12 ++--- arch/arm/src/armv6-m/up_unblocktask.c | 6 +-- 27 files changed, 131 insertions(+), 130 deletions(-) diff --git a/arch/arm/src/a1x/a1x_boot.c b/arch/arm/src/a1x/a1x_boot.c index 1105301ab6..321eb1d18f 100644 --- a/arch/arm/src/a1x/a1x_boot.c +++ b/arch/arm/src/a1x/a1x_boot.c @@ -268,9 +268,9 @@ static void a1x_copyvectorblock(void) * 0xffff0000) */ - src = (uint32_t*)&_vector_start; - end = (uint32_t*)&_vector_end; - dest = (uint32_t*)(A1X_VECTOR_VSRAM + VECTOR_TABLE_OFFSET); + src = (uint32_t *)&_vector_start; + end = (uint32_t *)&_vector_end; + dest = (uint32_t *)(A1X_VECTOR_VSRAM + VECTOR_TABLE_OFFSET); while (src < end) { diff --git a/arch/arm/src/a1x/a1x_lowputc.c b/arch/arm/src/a1x/a1x_lowputc.c index 402204c721..ccf43d6028 100644 --- a/arch/arm/src/a1x/a1x_lowputc.c +++ b/arch/arm/src/a1x/a1x_lowputc.c @@ -264,15 +264,15 @@ void a1x_lowsetup(void) /* Clear fifos */ - putreg32(UART_FCR_RFIFOR|UART_FCR_XFIFOR, CONSOLE_BASE+A1X_UART_FCR_OFFSET); + putreg32(UART_FCR_RFIFOR | UART_FCR_XFIFOR, CONSOLE_BASE + A1X_UART_FCR_OFFSET); /* Set trigger */ - putreg32(UART_FCR_FIFOE|UART_FCR_RT_HALF, CONSOLE_BASE+A1X_UART_FCR_OFFSET); + putreg32(UART_FCR_FIFOE | UART_FCR_RT_HALF, CONSOLE_BASE + A1X_UART_FCR_OFFSET); /* Set up the LCR and set DLAB=1 */ - putreg32(CONSOLE_LCR_VALUE|UART_LCR_DLAB, CONSOLE_BASE+A1X_UART_LCR_OFFSET); + putreg32(CONSOLE_LCR_VALUE | UART_LCR_DLAB, CONSOLE_BASE + A1X_UART_LCR_OFFSET); /* Set the BAUD divisor */ @@ -285,8 +285,8 @@ void a1x_lowsetup(void) /* Configure the FIFOs */ - putreg32(UART_FCR_RT_HALF|UART_FCR_XFIFOR|UART_FCR_RFIFOR|UART_FCR_FIFOE, - CONSOLE_BASE+A1X_UART_FCR_OFFSET); + putreg32(UART_FCR_RT_HALF | UART_FCR_XFIFOR | UART_FCR_RFIFOR | UART_FCR_FIFOE, + CONSOLE_BASE + A1X_UART_FCR_OFFSET); #endif #endif /* HAVE_UART_DEVICE */ } diff --git a/arch/arm/src/a1x/a1x_serial.c b/arch/arm/src/a1x/a1x_serial.c index 425176721f..2fb4a5383b 100644 --- a/arch/arm/src/a1x/a1x_serial.c +++ b/arch/arm/src/a1x/a1x_serial.c @@ -948,17 +948,17 @@ static inline uint32_t a1x_uartdl(uint32_t baud) static int up_setup(struct uart_dev_s *dev) { #ifndef CONFIG_SUPPRESS_UART_CONFIG - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint16_t dl; uint32_t lcr; /* Clear fifos */ - up_serialout(priv, A1X_UART_FCR_OFFSET, (UART_FCR_RFIFOR|UART_FCR_XFIFOR)); + up_serialout(priv, A1X_UART_FCR_OFFSET, (UART_FCR_RFIFOR | UART_FCR_XFIFOR)); /* Set trigger */ - up_serialout(priv, A1X_UART_FCR_OFFSET, (UART_FCR_FIFOE|UART_FCR_RT_HALF)); + up_serialout(priv, A1X_UART_FCR_OFFSET, (UART_FCR_FIFOE | UART_FCR_RT_HALF)); /* Set up the IER */ @@ -1019,7 +1019,8 @@ static int up_setup(struct uart_dev_s *dev) /* Configure the FIFOs */ up_serialout(priv, A1X_UART_FCR_OFFSET, - (UART_FCR_RT_HALF|UART_FCR_XFIFOR|UART_FCR_RFIFOR|UART_FCR_FIFOE)); + (UART_FCR_RT_HALF | UART_FCR_XFIFOR | UART_FCR_RFIFOR | + UART_FCR_FIFOE)); /* Enable Auto-Flow Control in the Modem Control Register */ @@ -1041,7 +1042,7 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disableuartint(priv, NULL); } @@ -1062,7 +1063,7 @@ static void up_shutdown(struct uart_dev_s *dev) static int up_attach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ */ @@ -1070,11 +1071,11 @@ static int up_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, priv->handler); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the UART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the UART + */ - up_enable_irq(priv->irq); + up_enable_irq(priv->irq); } return ret; @@ -1092,7 +1093,7 @@ static int up_attach(struct uart_dev_s *dev) static void up_detach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disable_irq(priv->irq); irq_detach(priv->irq); } @@ -1115,7 +1116,7 @@ static int uart_interrupt(struct uart_dev_s *dev) uint32_t status; int passes; - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; /* Loop until there are no characters to be transferred or, * until we have been looping for a long time. @@ -1268,7 +1269,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) { struct inode *inode = filep->f_inode; struct uart_dev_s *dev = inode->i_private; - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret = OK; switch (cmd) @@ -1276,7 +1277,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct up_dev_s *user = (struct up_dev_s*)arg; + struct up_dev_s *user = (struct up_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -1309,7 +1310,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TERMIOS case TCGETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; if (!termiosp) { @@ -1329,7 +1330,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) case TCSETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; uint32_t lcr; /* Holds current values of line control register */ uint16_t dl; /* Divisor latch */ @@ -1391,7 +1392,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) static int up_receive(struct uart_dev_s *dev, uint32_t *status) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t rbr; *status = up_serialin(priv, A1X_UART_LSR_OFFSET); @@ -1409,7 +1410,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { #ifndef CONFIG_SUPPRESS_SERIAL_INTS @@ -1434,7 +1435,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) static bool up_rxavailable(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, A1X_UART_LSR_OFFSET) & UART_LSR_DR) != 0); } @@ -1448,7 +1449,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_serialout(priv, A1X_UART_THR_OFFSET, (uint32_t)ch); } @@ -1462,7 +1463,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -1498,7 +1499,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) static bool up_txready(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, A1X_UART_LSR_OFFSET) & UART_LSR_THRE) != 0); } @@ -1512,7 +1513,7 @@ static bool up_txready(struct uart_dev_s *dev) static bool up_txempty(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, A1X_UART_LSR_OFFSET) & UART_LSR_THRE) != 0); } @@ -1653,7 +1654,7 @@ void up_serialinit(void) int up_putc(int ch) { #ifdef HAVE_SERIAL_CONSOLE - struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; + struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; uint32_t ier; up_disableuartint(priv, &ier); #endif diff --git a/arch/arm/src/arm/up_allocpage.c b/arch/arm/src/arm/up_allocpage.c index da3c441f3a..90bbfe2de1 100644 --- a/arch/arm/src/arm/up_allocpage.c +++ b/arch/arm/src/arm/up_allocpage.c @@ -236,7 +236,7 @@ int up_allocpage(FAR struct tcb_s *tcb, FAR void **vpage) /* Finally, return the virtual address of allocated page */ - *vpage = (void*)(vaddr & ~PAGEMASK); + *vpage = (void *)(vaddr & ~PAGEMASK); return OK; } diff --git a/arch/arm/src/arm/up_assert.c b/arch/arm/src/arm/up_assert.c index 1db9f9f687..7f0d33b848 100644 --- a/arch/arm/src/arm/up_assert.c +++ b/arch/arm/src/arm/up_assert.c @@ -126,7 +126,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base) for (stack = sp & ~0x1f; stack < stack_base; stack += 32) { - uint32_t *ptr = (uint32_t*)stack; + uint32_t *ptr = (uint32_t *)stack; lldbg("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); @@ -153,7 +153,7 @@ static inline void up_registerdump(void) for (regs = REG_R0; regs <= REG_R15; regs += 8) { - uint32_t *ptr = (uint32_t*)¤t_regs[regs]; + uint32_t *ptr = (uint32_t *)¤t_regs[regs]; lldbg("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); @@ -198,7 +198,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) #ifdef CONFIG_ARCH_STACKDUMP static void up_dumpstate(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; uint32_t sp = up_getsp(); uint32_t ustackbase; uint32_t ustacksize; @@ -310,7 +310,7 @@ static void _up_assert(int errorcode) { /* Are we in an interrupt handler or the idle task? */ - if (current_regs || ((struct tcb_s*)g_readytorun.head)->pid == 0) + if (current_regs || ((struct tcb_s *)g_readytorun.head)->pid == 0) { (void)irqsave(); for (;;) @@ -340,7 +340,7 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { #ifdef CONFIG_PRINT_TASKNAME - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; #endif board_led_on(LED_ASSERTION); diff --git a/arch/arm/src/arm/up_blocktask.c b/arch/arm/src/arm/up_blocktask.c index d0fb9c9e97..e22983a2e6 100644 --- a/arch/arm/src/arm/up_blocktask.c +++ b/arch/arm/src/arm/up_blocktask.c @@ -76,7 +76,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; bool switch_needed; /* Verify that the context switch can be performed */ @@ -128,7 +128,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Reset scheduler parameters */ @@ -152,7 +152,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; #ifdef CONFIG_ARCH_ADDRENV /* Make sure that the address environment for the previously diff --git a/arch/arm/src/arm/up_dataabort.c b/arch/arm/src/arm/up_dataabort.c index 2dbf898e17..2af3374529 100644 --- a/arch/arm/src/arm/up_dataabort.c +++ b/arch/arm/src/arm/up_dataabort.c @@ -113,7 +113,7 @@ void up_dataabort(uint32_t *regs, uint32_t far, uint32_t fsr) */ - savestate = (uint32_t*)current_regs; + savestate = (uint32_t *)current_regs; #endif current_regs = regs; diff --git a/arch/arm/src/arm/up_doirq.c b/arch/arm/src/arm/up_doirq.c index ab8dad9059..35ba735cdb 100644 --- a/arch/arm/src/arm/up_doirq.c +++ b/arch/arm/src/arm/up_doirq.c @@ -109,7 +109,7 @@ void up_doirq(int irq, uint32_t *regs) #ifdef CONFIG_ARCH_FPU /* Restore floating point registers */ - up_restorefpu((uint32_t*)current_regs); + up_restorefpu((uint32_t *)current_regs); #endif #ifdef CONFIG_ARCH_ADDRENV diff --git a/arch/arm/src/arm/up_elf.c b/arch/arm/src/arm/up_elf.c index e46703563d..07eba7341d 100644 --- a/arch/arm/src/arm/up_elf.c +++ b/arch/arm/src/arm/up_elf.c @@ -173,10 +173,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, case R_ARM_JUMP24: { bvdbg("Performing PC24 [%d] link at addr %08lx [%08lx] to sym '%s' st_value=%08lx\n", - ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t*)addr), + ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value); - offset = (*(uint32_t*)addr & 0x00ffffff) << 2; + offset = (*(uint32_t *)addr & 0x00ffffff) << 2; if (offset & 0x02000000) { offset -= 0x04000000; @@ -193,8 +193,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, offset >>= 2; - *(uint32_t*)addr &= 0xff000000; - *(uint32_t*)addr |= offset & 0x00ffffff; + *(uint32_t *)addr &= 0xff000000; + *(uint32_t *)addr |= offset & 0x00ffffff; } break; @@ -202,34 +202,34 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, case R_ARM_TARGET1: /* New ABI: TARGET1 always treated as ABS32 */ { bvdbg("Performing ABS32 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n", - (long)addr, (long)(*(uint32_t*)addr), sym, (long)sym->st_value); + (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value); - *(uint32_t*)addr += sym->st_value; + *(uint32_t *)addr += sym->st_value; } break; case R_ARM_V4BX: { bvdbg("Performing V4BX link at addr=%08lx [%08lx]\n", - (long)addr, (long)(*(uint32_t*)addr)); + (long)addr, (long)(*(uint32_t *)addr)); /* Preserve only Rm and the condition code */ - *(uint32_t*)addr &= 0xf000000f; + *(uint32_t *)addr &= 0xf000000f; /* Change instruction to 'mov pc, Rm' */ - *(uint32_t*)addr |= 0x01a0f000; + *(uint32_t *)addr |= 0x01a0f000; } break; case R_ARM_PREL31: { bvdbg("Performing PREL31 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n", - (long)addr, (long)(*(uint32_t*)addr), sym, (long)sym->st_value); + (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value); - offset = *(uint32_t*)addr + sym->st_value - addr; - *(uint32_t*)addr = offset & 0x7fffffff; + offset = *(uint32_t *)addr + sym->st_value - addr; + *(uint32_t *)addr = offset & 0x7fffffff; } break; @@ -237,10 +237,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, case R_ARM_MOVT_ABS: { bvdbg("Performing MOVx_ABS [%d] link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n", - ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t*)addr), + ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value); - offset = *(uint32_t*)addr; + offset = *(uint32_t *)addr; offset = ((offset & 0xf0000) >> 4) | (offset & 0xfff); offset = (offset ^ 0x8000) - 0x8000; @@ -250,8 +250,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, offset >>= 16; } - *(uint32_t*)addr &= 0xfff0f000; - *(uint32_t*)addr |= ((offset & 0xf000) << 4) | (offset & 0x0fff); + *(uint32_t *)addr &= 0xfff0f000; + *(uint32_t *)addr |= ((offset & 0xf000) << 4) | (offset & 0x0fff); } break; diff --git a/arch/arm/src/arm/up_prefetchabort.c b/arch/arm/src/arm/up_prefetchabort.c index 69fba8be59..3d1fe36e50 100644 --- a/arch/arm/src/arm/up_prefetchabort.c +++ b/arch/arm/src/arm/up_prefetchabort.c @@ -96,7 +96,7 @@ void up_prefetchabort(uint32_t *regs) * for register dumps and possibly context switching. */ - savestate = (uint32_t*)current_regs; + savestate = (uint32_t *)current_regs; #endif current_regs = regs; diff --git a/arch/arm/src/arm/up_releasepending.c b/arch/arm/src/arm/up_releasepending.c index aec5a6c332..9d640ab9a8 100644 --- a/arch/arm/src/arm/up_releasepending.c +++ b/arch/arm/src/arm/up_releasepending.c @@ -65,7 +65,7 @@ void up_release_pending(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; slldbg("From TCB=%p\n", rtcb); @@ -96,7 +96,7 @@ void up_release_pending(void) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -121,7 +121,7 @@ void up_release_pending(void) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; #ifdef CONFIG_ARCH_ADDRENV /* Make sure that the address environment for the previously diff --git a/arch/arm/src/arm/up_reprioritizertr.c b/arch/arm/src/arm/up_reprioritizertr.c index 0f84b82081..e89114ce4e 100644 --- a/arch/arm/src/arm/up_reprioritizertr.c +++ b/arch/arm/src/arm/up_reprioritizertr.c @@ -92,7 +92,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) } else { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; bool switch_needed; slldbg("TCB=%p PRI=%d\n", tcb, priority); @@ -150,7 +150,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -174,7 +174,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; #ifdef CONFIG_ARCH_ADDRENV /* Make sure that the address environment for the previously diff --git a/arch/arm/src/arm/up_schedulesigaction.c b/arch/arm/src/arm/up_schedulesigaction.c index a943c0abde..ed4813f4a9 100644 --- a/arch/arm/src/arm/up_schedulesigaction.c +++ b/arch/arm/src/arm/up_schedulesigaction.c @@ -121,7 +121,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs); - if (tcb == (struct tcb_s*)g_readytorun.head) + if (tcb == (struct tcb_s *)g_readytorun.head) { /* CASE 1: We are not in an interrupt handler and * a task is signalling itself for some reason. diff --git a/arch/arm/src/arm/up_sigdeliver.c b/arch/arm/src/arm/up_sigdeliver.c index 20cec506c7..625a0993ae 100644 --- a/arch/arm/src/arm/up_sigdeliver.c +++ b/arch/arm/src/arm/up_sigdeliver.c @@ -82,7 +82,7 @@ void up_sigdeliver(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; uint32_t regs[XCPTCONTEXT_REGS]; sig_deliver_t sigdeliver; diff --git a/arch/arm/src/arm/up_unblocktask.c b/arch/arm/src/arm/up_unblocktask.c index 1a73761839..f04af09ccd 100644 --- a/arch/arm/src/arm/up_unblocktask.c +++ b/arch/arm/src/arm/up_unblocktask.c @@ -71,7 +71,7 @@ void up_unblock_task(struct tcb_s *tcb) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; /* Verify that the context switch can be performed */ @@ -110,7 +110,7 @@ void up_unblock_task(struct tcb_s *tcb) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -136,16 +136,16 @@ void up_unblock_task(struct tcb_s *tcb) * g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; #ifdef CONFIG_ARCH_ADDRENV - /* Make sure that the address environment for the previously - * running task is closed down gracefully (data caches dump, - * MMU flushed) and set up the address environment for the new - * thread at the head of the ready-to-run list. - */ + /* Make sure that the address environment for the previously + * running task is closed down gracefully (data caches dump, + * MMU flushed) and set up the address environment for the new + * thread at the head of the ready-to-run list. + */ - (void)group_addrenv(rtcb); + (void)group_addrenv(rtcb); #endif /* Update scheduler parameters */ diff --git a/arch/arm/src/arm/up_va2pte.c b/arch/arm/src/arm/up_va2pte.c index eb5a4c56b4..16230f8285 100644 --- a/arch/arm/src/arm/up_va2pte.c +++ b/arch/arm/src/arm/up_va2pte.c @@ -101,11 +101,11 @@ uint32_t *up_va2pte(uintptr_t vaddr) /* Get the L1 table entry associated with this virtual address */ - L1 = *(uint32_t*)PG_POOL_VA2L1VADDR(vaddr); + L1 = *(uint32_t *)PG_POOL_VA2L1VADDR(vaddr); /* Get the address of the L2 page table from the L1 entry */ - L2 = (uint32_t*)PG_POOL_L12VPTABLE(L1); + L2 = (uint32_t *)PG_POOL_L12VPTABLE(L1); /* Get the index into the L2 page table. Each L1 entry maps * 256 x 4Kb or 1024 x 1Kb pages. diff --git a/arch/arm/src/armv6-m/up_assert.c b/arch/arm/src/armv6-m/up_assert.c index 11563b19c1..6a51f930f1 100644 --- a/arch/arm/src/armv6-m/up_assert.c +++ b/arch/arm/src/armv6-m/up_assert.c @@ -240,7 +240,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace,FAR void *arg) #ifdef CONFIG_ARCH_STACKDUMP static void up_dumpstate(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; uint32_t sp = up_getsp(); uint32_t ustackbase; uint32_t ustacksize; @@ -365,7 +365,7 @@ static void _up_assert(int errorcode) { /* Are we in an interrupt handler or the idle task? */ - if (current_regs || ((struct tcb_s*)g_readytorun.head)->pid == 0) + if (current_regs || ((struct tcb_s *)g_readytorun.head)->pid == 0) { (void)irqsave(); for (;;) @@ -395,7 +395,7 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { #ifdef CONFIG_PRINT_TASKNAME - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; #endif board_led_on(LED_ASSERTION); diff --git a/arch/arm/src/armv6-m/up_blocktask.c b/arch/arm/src/armv6-m/up_blocktask.c index ae58df4dae..b22a2ddd72 100644 --- a/arch/arm/src/armv6-m/up_blocktask.c +++ b/arch/arm/src/armv6-m/up_blocktask.c @@ -74,7 +74,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; bool switch_needed; /* Verify that the context switch can be performed */ @@ -126,7 +126,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Reset scheduler parameters */ @@ -141,7 +141,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) else { - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head; /* Reset scheduler parameters */ diff --git a/arch/arm/src/armv6-m/up_doirq.c b/arch/arm/src/armv6-m/up_doirq.c index 57ad2f3af0..54557585f2 100644 --- a/arch/arm/src/armv6-m/up_doirq.c +++ b/arch/arm/src/armv6-m/up_doirq.c @@ -90,7 +90,7 @@ uint32_t *up_doirq(int irq, uint32_t *regs) * current_regs is also used to manage interrupt level context switches. */ - savestate = (uint32_t*)current_regs; + savestate = (uint32_t *)current_regs; current_regs = regs; /* Acknowledge the interrupt */ @@ -107,7 +107,7 @@ uint32_t *up_doirq(int irq, uint32_t *regs) * switch occurred during interrupt processing. */ - regs = (uint32_t*)current_regs; + regs = (uint32_t *)current_regs; /* Restore the previous value of current_regs. NULL would indicate that * we are no longer in an interrupt handler. It will be non-NULL if we diff --git a/arch/arm/src/armv6-m/up_elf.c b/arch/arm/src/armv6-m/up_elf.c index d4529540ad..dbe002cbb1 100644 --- a/arch/arm/src/armv6-m/up_elf.c +++ b/arch/arm/src/armv6-m/up_elf.c @@ -169,10 +169,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, case R_ARM_JUMP24: { bvdbg("Performing PC24 [%d] link at addr %08lx [%08lx] to sym '%s' st_value=%08lx\n", - ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t*)addr), + ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value); - offset = (*(uint32_t*)addr & 0x00ffffff) << 2; + offset = (*(uint32_t *)addr & 0x00ffffff) << 2; if (offset & 0x02000000) { offset -= 0x04000000; @@ -189,8 +189,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, offset >>= 2; - *(uint32_t*)addr &= 0xff000000; - *(uint32_t*)addr |= offset & 0x00ffffff; + *(uint32_t *)addr &= 0xff000000; + *(uint32_t *)addr |= offset & 0x00ffffff; } break; @@ -198,9 +198,9 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, case R_ARM_TARGET1: /* New ABI: TARGET1 always treated as ABS32 */ { bvdbg("Performing ABS32 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n", - (long)addr, (long)(*(uint32_t*)addr), sym, (long)sym->st_value); + (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value); - *(uint32_t*)addr += sym->st_value; + *(uint32_t *)addr += sym->st_value; } break; @@ -242,8 +242,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, * J2 = lower_insn[11] */ - upper_insn = (uint32_t)(*(uint16_t*)addr); - lower_insn = (uint32_t)(*(uint16_t*)(addr + 2)); + upper_insn = (uint32_t)(*(uint16_t *)addr); + lower_insn = (uint32_t)(*(uint16_t *)(addr + 2)); bvdbg("Performing THM_JUMP24 [%d] link at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n", ELF32_R_TYPE(rel->r_info), (long)addr, (int)upper_insn, (int)lower_insn, @@ -315,10 +315,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, J2 = S ^ (~(offset >> 22) & 1); upper_insn = ((upper_insn & 0xf800) | (S << 10) | ((offset >> 12) & 0x03ff)); - *(uint16_t*)addr = (uint16_t)upper_insn; + *(uint16_t *)addr = (uint16_t)upper_insn; lower_insn = ((lower_insn & 0xd000) | (J1 << 13) | (J2 << 11) | ((offset >> 1) & 0x07ff)); - *(uint16_t*)(addr + 2) = (uint16_t)lower_insn; + *(uint16_t *)(addr + 2) = (uint16_t)lower_insn; bvdbg(" S=%d J1=%d J2=%d insn [%04x %04x]\n", S, J1, J2, (int)upper_insn, (int)lower_insn); @@ -328,25 +328,25 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, case R_ARM_V4BX: { bvdbg("Performing V4BX link at addr=%08lx [%08lx]\n", - (long)addr, (long)(*(uint32_t*)addr)); + (long)addr, (long)(*(uint32_t *)addr)); /* Preserve only Rm and the condition code */ - *(uint32_t*)addr &= 0xf000000f; + *(uint32_t *)addr &= 0xf000000f; /* Change instruction to 'mov pc, Rm' */ - *(uint32_t*)addr |= 0x01a0f000; + *(uint32_t *)addr |= 0x01a0f000; } break; case R_ARM_PREL31: { bvdbg("Performing PREL31 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n", - (long)addr, (long)(*(uint32_t*)addr), sym, (long)sym->st_value); + (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value); - offset = *(uint32_t*)addr + sym->st_value - addr; - *(uint32_t*)addr = offset & 0x7fffffff; + offset = *(uint32_t *)addr + sym->st_value - addr; + *(uint32_t *)addr = offset & 0x7fffffff; } break; @@ -354,10 +354,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, case R_ARM_MOVT_ABS: { bvdbg("Performing MOVx_ABS [%d] link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n", - ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t*)addr), + ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value); - offset = *(uint32_t*)addr; + offset = *(uint32_t *)addr; offset = ((offset & 0xf0000) >> 4) | (offset & 0xfff); offset = (offset ^ 0x8000) - 0x8000; @@ -367,8 +367,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, offset >>= 16; } - *(uint32_t*)addr &= 0xfff0f000; - *(uint32_t*)addr |= ((offset & 0xf000) << 4) | (offset & 0x0fff); + *(uint32_t *)addr &= 0xfff0f000; + *(uint32_t *)addr |= ((offset & 0xf000) << 4) | (offset & 0x0fff); } break; @@ -405,8 +405,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, * imm8 = imm16[0:7] = lower_insn[7:0] */ - upper_insn = (uint32_t)(*(uint16_t*)addr); - lower_insn = (uint32_t)(*(uint16_t*)(addr + 2)); + upper_insn = (uint32_t)(*(uint16_t *)addr); + lower_insn = (uint32_t)(*(uint16_t *)(addr + 2)); bvdbg("Performing THM_MOVx [%d] link at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n", ELF32_R_TYPE(rel->r_info), (long)addr, (int)upper_insn, (int)lower_insn, @@ -440,10 +440,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, } upper_insn = ((upper_insn & 0xfbf0) | ((offset & 0xf000) >> 12) | ((offset & 0x0800) >> 1)); - *(uint16_t*)addr = (uint16_t)upper_insn; + *(uint16_t *)addr = (uint16_t)upper_insn; lower_insn = ((lower_insn & 0x8f00) | ((offset & 0x0700) << 4) | (offset & 0x00ff)); - *(uint16_t*)(addr + 2) = (uint16_t)lower_insn; + *(uint16_t *)(addr + 2) = (uint16_t)lower_insn; bvdbg(" insn [%04x %04x]\n", (int)upper_insn, (int)lower_insn); diff --git a/arch/arm/src/armv6-m/up_hardfault.c b/arch/arm/src/armv6-m/up_hardfault.c index b7bbe88144..2e77c853d7 100644 --- a/arch/arm/src/armv6-m/up_hardfault.c +++ b/arch/arm/src/armv6-m/up_hardfault.c @@ -89,11 +89,11 @@ int up_hardfault(int irq, FAR void *context) { - uint32_t *regs = (uint32_t*)context; + uint32_t *regs = (uint32_t *)context; /* Get the value of the program counter where the fault occurred */ - uint16_t *pc = (uint16_t*)regs[REG_PC] - 1; + uint16_t *pc = (uint16_t *)regs[REG_PC] - 1; /* Check if the pc lies in known FLASH memory. * REVISIT: What if the PC lies in "unknown" external memory? diff --git a/arch/arm/src/armv6-m/up_releasepending.c b/arch/arm/src/armv6-m/up_releasepending.c index 953c8e272d..e7262ff37b 100644 --- a/arch/arm/src/armv6-m/up_releasepending.c +++ b/arch/arm/src/armv6-m/up_releasepending.c @@ -64,7 +64,7 @@ void up_release_pending(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; slldbg("From TCB=%p\n", rtcb); @@ -95,7 +95,7 @@ void up_release_pending(void) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -110,7 +110,7 @@ void up_release_pending(void) else { - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ diff --git a/arch/arm/src/armv6-m/up_reprioritizertr.c b/arch/arm/src/armv6-m/up_reprioritizertr.c index 9ca4c5db6e..4fa1dd2425 100644 --- a/arch/arm/src/armv6-m/up_reprioritizertr.c +++ b/arch/arm/src/armv6-m/up_reprioritizertr.c @@ -91,7 +91,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) } else { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; bool switch_needed; slldbg("TCB=%p PRI=%d\n", tcb, priority); @@ -150,7 +150,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -165,7 +165,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) else { - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ diff --git a/arch/arm/src/armv6-m/up_schedulesigaction.c b/arch/arm/src/armv6-m/up_schedulesigaction.c index ada505f3a3..83d1d7463d 100644 --- a/arch/arm/src/armv6-m/up_schedulesigaction.c +++ b/arch/arm/src/armv6-m/up_schedulesigaction.c @@ -122,7 +122,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs); - if (tcb == (struct tcb_s*)g_readytorun.head) + if (tcb == (struct tcb_s *)g_readytorun.head) { /* CASE 1: We are not in an interrupt handler and a task is * signalling itself for some reason. diff --git a/arch/arm/src/armv6-m/up_sigdeliver.c b/arch/arm/src/armv6-m/up_sigdeliver.c index f7944ac014..f0f4dd54bf 100644 --- a/arch/arm/src/armv6-m/up_sigdeliver.c +++ b/arch/arm/src/armv6-m/up_sigdeliver.c @@ -87,7 +87,7 @@ void up_sigdeliver(void) * copy an may overwrite the regs[] array contents. Sorry. */ - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; uint32_t regs[XCPTCONTEXT_REGS + 4]; sig_deliver_t sigdeliver; diff --git a/arch/arm/src/armv6-m/up_svcall.c b/arch/arm/src/armv6-m/up_svcall.c index 1151c480e9..7e67e2b101 100644 --- a/arch/arm/src/armv6-m/up_svcall.c +++ b/arch/arm/src/armv6-m/up_svcall.c @@ -159,7 +159,7 @@ static void dispatch_syscall(void) int up_svcall(int irq, FAR void *context) { - uint32_t *regs = (uint32_t*)context; + uint32_t *regs = (uint32_t *)context; uint32_t cmd; DEBUGASSERT(regs && regs == current_regs); @@ -211,7 +211,7 @@ int up_svcall(int irq, FAR void *context) case SYS_save_context: { DEBUGASSERT(regs[REG_R1] != 0); - memcpy((uint32_t*)regs[REG_R1], regs, XCPTCONTEXT_SIZE); + memcpy((uint32_t *)regs[REG_R1], regs, XCPTCONTEXT_SIZE); } break; @@ -233,7 +233,7 @@ int up_svcall(int irq, FAR void *context) case SYS_restore_context: { DEBUGASSERT(regs[REG_R1] != 0); - current_regs = (uint32_t*)regs[REG_R1]; + current_regs = (uint32_t *)regs[REG_R1]; } break; @@ -256,8 +256,8 @@ int up_svcall(int irq, FAR void *context) case SYS_switch_context: { DEBUGASSERT(regs[REG_R1] != 0 && regs[REG_R2] != 0); - memcpy((uint32_t*)regs[REG_R1], regs, XCPTCONTEXT_SIZE); - current_regs = (uint32_t*)regs[REG_R2]; + memcpy((uint32_t *)regs[REG_R1], regs, XCPTCONTEXT_SIZE); + current_regs = (uint32_t *)regs[REG_R2]; } break; @@ -407,7 +407,7 @@ int up_svcall(int irq, FAR void *context) * parameter will reside at an offset of 4 from the stack pointer. */ - regs[REG_R3] = *(uint32_t*)(regs[REG_SP]+4); + regs[REG_R3] = *(uint32_t *)(regs[REG_SP]+4); } break; #endif diff --git a/arch/arm/src/armv6-m/up_unblocktask.c b/arch/arm/src/armv6-m/up_unblocktask.c index 3212a756b8..16638f9fc1 100644 --- a/arch/arm/src/armv6-m/up_unblocktask.c +++ b/arch/arm/src/armv6-m/up_unblocktask.c @@ -69,7 +69,7 @@ void up_unblock_task(struct tcb_s *tcb) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; /* Verify that the context switch can be performed */ @@ -108,7 +108,7 @@ void up_unblock_task(struct tcb_s *tcb) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -123,7 +123,7 @@ void up_unblock_task(struct tcb_s *tcb) else { - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ From fc3ed64864e60ff8a97397841a569e3b118c3235 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 6 Oct 2015 17:28:32 -0600 Subject: [PATCH 23/33] Make some spacing comply better with coding standard --- arch/arm/src/armv6-m/up_assert.c | 2 +- arch/arm/src/c5471/c5471_ethernet.c | 55 +++--- arch/arm/src/c5471/c5471_irq.c | 2 +- arch/arm/src/c5471/c5471_serial.c | 51 +++--- arch/arm/src/calypso/calypso_armio.c | 4 +- arch/arm/src/calypso/calypso_heap.c | 2 +- arch/arm/src/calypso/calypso_keypad.c | 2 +- arch/arm/src/calypso/calypso_serial.c | 90 +++++----- arch/arm/src/calypso/calypso_timer.c | 14 +- arch/arm/src/common/up_allocateheap.c | 6 +- arch/arm/src/common/up_checkstack.c | 6 +- arch/arm/src/common/up_createstack.c | 2 +- arch/arm/src/common/up_exit.c | 4 +- arch/arm/src/common/up_usestack.c | 2 +- arch/arm/src/dm320/dm320_allocateheap.c | 2 +- arch/arm/src/dm320/dm320_boot.c | 10 +- arch/arm/src/dm320/dm320_decodeirq.c | 4 +- arch/arm/src/dm320/dm320_framebuffer.c | 16 +- arch/arm/src/dm320/dm320_serial.c | 40 ++--- arch/arm/src/dm320/dm320_usbdev.c | 224 ++++++++++++++---------- arch/arm/src/efm32/efm32_adc.c | 22 +-- arch/arm/src/efm32/efm32_clockconfig.c | 2 +- arch/arm/src/efm32/efm32_flash.c | 16 +- arch/arm/src/efm32/efm32_irq.c | 6 +- arch/arm/src/efm32/efm32_leserial.c | 28 +-- arch/arm/src/efm32/efm32_pwm.c | 6 +- arch/arm/src/efm32/efm32_rmu.c | 4 +- arch/arm/src/efm32/efm32_serial.c | 38 ++-- arch/arm/src/efm32/efm32_spi.c | 8 +- arch/arm/src/efm32/efm32_timer.c | 18 +- arch/arm/src/efm32/efm32_timerisr.c | 3 +- arch/arm/src/efm32/efm32_usbdev.c | 32 ++-- arch/arm/src/efm32/efm32_usbhost.c | 6 +- 33 files changed, 392 insertions(+), 335 deletions(-) diff --git a/arch/arm/src/armv6-m/up_assert.c b/arch/arm/src/armv6-m/up_assert.c index 6a51f930f1..558351dc4a 100644 --- a/arch/arm/src/armv6-m/up_assert.c +++ b/arch/arm/src/armv6-m/up_assert.c @@ -125,7 +125,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base) for (stack = sp & ~0x1f; stack < stack_base; stack += 32) { - uint32_t *ptr = (uint32_t*)stack; + uint32_t *ptr = (uint32_t *)stack; lldbg("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); diff --git a/arch/arm/src/c5471/c5471_ethernet.c b/arch/arm/src/c5471/c5471_ethernet.c index aea787afe1..9a8f7b0622 100644 --- a/arch/arm/src/c5471/c5471_ethernet.c +++ b/arch/arm/src/c5471/c5471_ethernet.c @@ -1815,7 +1815,7 @@ static int c5471_txavail(struct net_driver_s *dev) /* If so, then poll uIP for new XMIT data */ (void)devif_poll(&c5471->c_dev, c5471_txpoll); - } + } } irqrestore(flags); @@ -1912,7 +1912,8 @@ static void c5471_eimreset (struct c5471_driver_s *c5471) /* Assert nRESET to reset the board's PHY0/1 chips */ - putreg32((CLKM_CTL_RST_EXT_RESET|CLKM_CTL_RST_LEAD_RESET), CLKM_CTL_RST); + putreg32((CLKM_CTL_RST_EXT_RESET | CLKM_CTL_RST_LEAD_RESET), + CLKM_CTL_RST); up_mdelay(2); /* Release the peripheral nRESET signal */ @@ -1960,7 +1961,8 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) else val = EIM_TXDESC_WRAP_FIRST; - val |= EIM_TXDESC_OWN_HOST|EIM_TXDESC_INTRE|EIM_TXDESC_PADCRC|EIM_PACKET_BYTES; + val |= EIM_TXDESC_OWN_HOST | EIM_TXDESC_INTRE | EIM_TXDESC_PADCRC | + EIM_PACKET_BYTES; putreg32(val, desc); desc += sizeof(uint32_t); @@ -1986,7 +1988,8 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) else val = EIM_RXDESC_WRAP_FIRST; - val |= EIM_RXDESC_OWN_ENET|EIM_RXDESC_INTRE|EIM_RXDESC_PADCRC|EIM_PACKET_BYTES; + val |= EIM_RXDESC_OWN_ENET | EIM_RXDESC_INTRE | EIM_RXDESC_PADCRC | + EIM_PACKET_BYTES; putreg32(val, desc); desc += sizeof(uint32_t); @@ -2015,7 +2018,8 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) else val = EIM_TXDESC_WRAP_FIRST; - val |= EIM_TXDESC_OWN_HOST|EIM_TXDESC_INTRE|EIM_TXDESC_PADCRC|EIM_PACKET_BYTES; + val |= EIM_TXDESC_OWN_HOST | EIM_TXDESC_INTRE | EIM_TXDESC_PADCRC | + EIM_PACKET_BYTES; putreg32(val, desc); desc += sizeof(uint32_t); @@ -2044,7 +2048,8 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) else val = EIM_RXDESC_WRAP_FIRST; - val |= EIM_RXDESC_OWN_ENET|EIM_RXDESC_INTRE|EIM_RXDESC_PADCRC|EIM_PACKET_BYTES; + val |= EIM_RXDESC_OWN_ENET | EIM_RXDESC_INTRE | EIM_RXDESC_PADCRC | + EIM_PACKET_BYTES; putreg32(val, desc); desc += sizeof(uint32_t); @@ -2069,9 +2074,10 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) #if 0 putreg32(EIM_FILTER_UNICAST, EIM_CPU_FILTER); #else -// putreg32(EIM_FILTER_LOGICAL|EIM_FILTER_UNICAST|EIM_FILTER_MULTICAST| +// putreg32(EIM_FILTER_LOGICAL | EIM_FILTER_UNICAST | EIM_FILTER_MULTICAST | // EIM_FILTER_BROADCAST, EIM_CPU_FILTER); - putreg32(EIM_FILTER_UNICAST|EIM_FILTER_MULTICAST|EIM_FILTER_BROADCAST, EIM_CPU_FILTER); + putreg32(EIM_FILTER_UNICAST | EIM_FILTER_MULTICAST | EIM_FILTER_BROADCAST, + EIM_CPU_FILTER); #endif /* Disable all Ethernet interrupts */ @@ -2081,11 +2087,12 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) /* Setup the EIM control register */ #if 1 - putreg32(EIM_CTRL_ENET0_EN|EIM_CTRL_RXENET0_EN|EIM_CTRL_TXENET0_EN| - EIM_CTRL_RXCPU_EN|EIM_CTRL_TXCPU_EN, EIM_CTRL); + putreg32(EIM_CTRL_ENET0_EN | EIM_CTRL_RXENET0_EN | EIM_CTRL_TXENET0_EN | + EIM_CTRL_RXCPU_EN | EIM_CTRL_TXCPU_EN, EIM_CTRL); #else - putreg32(EIM_CTRL_ENET0_EN|EIM_CTRL_ENET0_FLW|EIM_CTRL_RXENET0_EN| - EIM_CTRL_TXENET0_EN|EIM_CTRL_RXCPU_EN|EIM_CTRL_TXCPU_EN, EIM_CTRL); + putreg32(EIM_CTRL_ENET0_EN | EIM_CTRL_ENET0_FLW | EIM_CTRL_RXENET0_EN | + EIM_CTRL_TXENET0_EN | EIM_CTRL_RXCPU_EN | EIM_CTRL_TXCPU_EN, + EIM_CTRL); #endif #if 1 @@ -2103,9 +2110,11 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) /* Setup the ENET0 mode register */ #if 1 - putreg32(ENET_MODE_RJCT_SFE|ENET_MODE_MWIDTH|ENET_MODE_FULLDUPLEX, ENET0_MODE); + putreg32(ENET_MODE_RJCT_SFE | ENET_MODE_MWIDTH | ENET_MODE_FULLDUPLEX, + ENET0_MODE); #else - putreg32(ENET_MODE_RJCT_SFE|ENET_MODE_MWIDTH|ENET_MODE_HALFDUPLEX, ENET0_MODE); + putreg32(ENET_MODE_RJCT_SFE | ENET_MODE_MWIDTH | ENET_MODE_HALFDUPLEX, + ENET0_MODE); #endif putreg32(0x00000000, ENET0_BOFFSEED); @@ -2114,7 +2123,7 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) putreg32(0x00000000, ENET0_VTYPE); #if 0 - putreg32(ENET_ADR_BROADCAST|ENET_ADR_PROMISCUOUS, ENET0_ADRMODE_EN); + putreg32(ENET_ADR_BROADCAST | ENET_ADR_PROMISCUOUS, ENET0_ADRMODE_EN); #else /* The CPU port is not PROMISCUOUS, it wants a no-promiscuous address * match yet the SWITCH receives packets from the PROMISCUOUS ENET0 @@ -2239,19 +2248,19 @@ void up_netinitialize(void) /* Initialize the driver structure */ memset(g_c5471, 0, CONFIG_C5471_NET_NINTERFACES*sizeof(struct c5471_driver_s)); - g_c5471[0].c_dev.d_ifup = c5471_ifup; /* I/F down callback */ - g_c5471[0].c_dev.d_ifdown = c5471_ifdown; /* I/F up (new IP address) callback */ - g_c5471[0].c_dev.d_txavail = c5471_txavail; /* New TX data callback */ + g_c5471[0].c_dev.d_ifup = c5471_ifup; /* I/F down callback */ + g_c5471[0].c_dev.d_ifdown = c5471_ifdown; /* I/F up (new IP address) callback */ + g_c5471[0].c_dev.d_txavail = c5471_txavail; /* New TX data callback */ #ifdef CONFIG_NET_IGMP - g_c5471[0].c_dev.d_addmac = c5471_addmac; /* Add multicast MAC address */ - g_c5471[0].c_dev.d_rmmac = c5471_rmmac; /* Remove multicast MAC address */ + g_c5471[0].c_dev.d_addmac = c5471_addmac; /* Add multicast MAC address */ + g_c5471[0].c_dev.d_rmmac = c5471_rmmac; /* Remove multicast MAC address */ #endif - g_c5471[0].c_dev.d_private = (void*)g_c5471; /* Used to recover private state from dev */ + g_c5471[0].c_dev.d_private = (void *)g_c5471; /* Used to recover private state from dev */ /* Create a watchdog for timing polling for and timing of transmisstions */ - g_c5471[0].c_txpoll = wd_create(); /* Create periodic poll timer */ - g_c5471[0].c_txtimeout = wd_create(); /* Create TX timeout timer */ + g_c5471[0].c_txpoll = wd_create(); /* Create periodic poll timer */ + g_c5471[0].c_txtimeout = wd_create(); /* Create TX timeout timer */ /* Register the device with the OS so that socket IOCTLs can be performed */ diff --git a/arch/arm/src/c5471/c5471_irq.c b/arch/arm/src/c5471/c5471_irq.c index 607a3bb72a..57485fc393 100644 --- a/arch/arm/src/c5471/c5471_irq.c +++ b/arch/arm/src/c5471/c5471_irq.c @@ -135,7 +135,7 @@ static inline void up_ackfiq(unsigned int irq) static inline void up_vectorinitialize(void) { up_vector_t *src = g_vectorinittab; - up_vector_t *dest = (up_vector_t*)&_svectors; + up_vector_t *dest = (up_vector_t *)&_svectors; int i; for (i = 0; i < NVECTORS; i++) diff --git a/arch/arm/src/c5471/c5471_serial.c b/arch/arm/src/c5471/c5471_serial.c index 6e616a787b..485ad9de2a 100644 --- a/arch/arm/src/c5471/c5471_serial.c +++ b/arch/arm/src/c5471/c5471_serial.c @@ -268,7 +268,7 @@ static inline void up_disableuartint(struct up_dev_s *priv, uint16_t *ier) static inline void up_restoreuartint(struct up_dev_s *priv, uint16_t ier) { - priv->regs.ier |= ier & (UART_IER_RECVINT|UART_IER_XMITINT); + priv->regs.ier |= ier & (UART_IER_RECVINT | UART_IER_XMITINT); up_serialout(priv, UART_IER_OFFS, priv->regs.ier); } @@ -380,11 +380,11 @@ static int up_setup(struct uart_dev_s *dev) if (priv->parity == 1) /* Odd parity */ { - cval |= (UART_LCR_PAREN|UART_LCR_PARODD); + cval |= (UART_LCR_PAREN | UART_LCR_PARODD); } else if (priv->parity == 2) /* Even parity */ { - cval |= (UART_LCR_PAREN|UART_LCR_PAREVEN); + cval |= (UART_LCR_PAREN | UART_LCR_PAREVEN); } /* Both the IrDA and MODEM UARTs support RESET and UART mode. */ @@ -465,7 +465,7 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; + struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; up_disableuartint(priv, NULL); } @@ -486,7 +486,7 @@ static void up_shutdown(struct uart_dev_s *dev) static int up_attach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ */ @@ -494,12 +494,13 @@ static int up_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, up_interrupt); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the UART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the UART + */ - up_enable_irq(priv->irq); + up_enable_irq(priv->irq); } + return ret; } @@ -515,7 +516,7 @@ static int up_attach(struct uart_dev_s *dev) static void up_detach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disable_irq(priv->irq); irq_detach(priv->irq); } @@ -551,7 +552,7 @@ static int up_interrupt(int irq, void *context) { PANIC(); } - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; cause = up_inserial(priv, UART_ISR_OFFS) & 0x0000003f; @@ -586,11 +587,11 @@ static int up_interrupt(int irq, void *context) /* Is this an interrupt from the IrDA UART? */ if (irq == C5471_IRQ_UART_IRDA) - { - /* Restore the IrDA UART interrupt enables */ + { + /* Restore the IrDA UART interrupt enables */ - up_serialout(priv, UART_IER_OFFS, ier_val); - } + up_serialout(priv, UART_IER_OFFS, ier_val); + } } else if ((cause & 0x0000000c) == 0x00000004) { @@ -617,7 +618,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) { struct inode *inode = filep->f_inode; struct uart_dev_s *dev = inode->i_private; - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret = OK; switch (cmd) @@ -625,7 +626,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct up_dev_s *user = (struct up_dev_s*)arg; + struct up_dev_s *user = (struct up_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -675,7 +676,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) static int up_receive(struct uart_dev_s *dev, unsigned int *status) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t rhr; uint32_t lsr; @@ -703,7 +704,7 @@ static int up_receive(struct uart_dev_s *dev, unsigned int *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { #ifndef CONFIG_SUPPRESS_SERIAL_INTS @@ -728,7 +729,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) static bool up_rxavailable(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return up_inserial(priv, UART_LSR_OFFS) & UART_RX_FIFO_NOEMPTY; } @@ -742,7 +743,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_serialout(priv, UART_THR_OFFS, (uint8_t)ch); } @@ -756,7 +757,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { #ifndef CONFIG_SUPPRESS_SERIAL_INTS @@ -781,7 +782,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) static bool up_txready(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return (up_inserial(priv, UART_SSR_OFFS) & UART_SSR_TXFULL) == 0; } @@ -795,7 +796,7 @@ static bool up_txready(struct uart_dev_s *dev) static bool up_txempty(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return (up_inserial(priv, UART_LSR_OFFS) & UART_LSR_TREF) != 0; } @@ -849,7 +850,7 @@ void up_serialinit(void) int up_putc(int ch) { - struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; + struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; uint16_t ier; up_disableuartint(priv, &ier); diff --git a/arch/arm/src/calypso/calypso_armio.c b/arch/arm/src/calypso/calypso_armio.c index 8699533c6c..c210fa34dc 100644 --- a/arch/arm/src/calypso/calypso_armio.c +++ b/arch/arm/src/calypso/calypso_armio.c @@ -90,11 +90,11 @@ void calypso_armio(void) { /* Enable ARMIO clock */ - putreg16(1<<5, ARMIO_REG(CNTL_REG)); + putreg16(1 << 5, ARMIO_REG(CNTL_REG)); /* Mask GPIO interrupt and keypad interrupt */ - putreg16(KBD_INT|GPIO_INT, ARMIO_REG(KBD_GPIO_MASKIT)); + putreg16(KBD_INT | GPIO_INT, ARMIO_REG(KBD_GPIO_MASKIT)); /* Attach and enable the interrupt */ diff --git a/arch/arm/src/calypso/calypso_heap.c b/arch/arm/src/calypso/calypso_heap.c index 14d73b11ce..697e05a8f5 100644 --- a/arch/arm/src/calypso/calypso_heap.c +++ b/arch/arm/src/calypso/calypso_heap.c @@ -96,6 +96,6 @@ void up_addregion(void) /* Configure the RHEA bridge with some sane default values */ calypso_rhea_cfg(0, 0, 0xff, 0, 1, 0, 0); - kmm_addregion((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE); + kmm_addregion((FAR void *)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE); } #endif diff --git a/arch/arm/src/calypso/calypso_keypad.c b/arch/arm/src/calypso/calypso_keypad.c index e32bcc9a12..2430667ca5 100644 --- a/arch/arm/src/calypso/calypso_keypad.c +++ b/arch/arm/src/calypso/calypso_keypad.c @@ -160,7 +160,7 @@ static int pwr_btn_dec(uint32_t * state, uint8_t reg, char *buf, size_t * len) * false keystrokes otherwise */ - return 1; + return 1; } } diff --git a/arch/arm/src/calypso/calypso_serial.c b/arch/arm/src/calypso/calypso_serial.c index 8a7c181505..d8e4b7f61f 100644 --- a/arch/arm/src/calypso/calypso_serial.c +++ b/arch/arm/src/calypso/calypso_serial.c @@ -302,7 +302,7 @@ static inline void up_disableuartint(struct up_dev_s *priv, uint16_t *ier) static inline void up_restoreuartint(struct up_dev_s *priv, uint16_t ier) { - priv->regs.ier |= ier & (UART_IER_RECVINT|UART_IER_XMITINT); + priv->regs.ier |= ier & (UART_IER_RECVINT | UART_IER_XMITINT); up_serialout(priv, UART_IER_OFFS, priv->regs.ier); } @@ -419,11 +419,11 @@ static int up_setup(struct uart_dev_s *dev) if (priv->parity == 1) /* Odd parity */ { - cval |= (UART_LCR_PAREN|UART_LCR_PARODD); + cval |= (UART_LCR_PAREN | UART_LCR_PARODD); } else if (priv->parity == 2) /* Even parity */ { - cval |= (UART_LCR_PAREN|UART_LCR_PAREVEN); + cval |= (UART_LCR_PAREN | UART_LCR_PAREVEN); } /* Both the IrDA and MODEM UARTs support RESET and UART mode. */ @@ -462,7 +462,7 @@ static int up_setup(struct uart_dev_s *dev) #ifdef UART_MULTIPLEX_REGS priv->regs.lcr = 0x80; up_serialout(priv, UART_LCR_OFFS, priv->regs.lcr); - //up_serialout(priv, UART_MCR_OFFS, 1<<4); /* loopback */ + //up_serialout(priv, UART_MCR_OFFS, 1 << 4); /* loopback */ #endif up_serialout(priv, UART_TFCR_OFFS, 0); /* Reset to 0 */ @@ -526,7 +526,7 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; + struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; up_disableuartint(priv, NULL); } @@ -547,7 +547,7 @@ static void up_shutdown(struct uart_dev_s *dev) static int up_attach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ */ @@ -555,11 +555,11 @@ static int up_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, up_interrupt); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the UART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the UART + */ - up_enable_irq(priv->irq); + up_enable_irq(priv->irq); } return ret; @@ -577,7 +577,7 @@ static int up_attach(struct uart_dev_s *dev) static void up_detach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disable_irq(priv->irq); irq_detach(priv->irq); } @@ -613,7 +613,7 @@ static int up_interrupt(int irq, void *context) { PANIC(); } - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; cause = up_inserial(priv, UART_ISR_OFFS) & 0x0000003f; @@ -641,14 +641,14 @@ static int up_interrupt(int irq, void *context) #ifdef CONFIG_SERCOMM_CONSOLE if (priv->sercomm) - { - sercomm_recvchars(dev); - } + { + sercomm_recvchars(dev); + } else #endif - { - uart_recvchars(dev); - } + { + uart_recvchars(dev); + } /* read UART_RHR to clear int condition * toss = up_inserialchar(priv,&status); @@ -657,38 +657,38 @@ static int up_interrupt(int irq, void *context) /* Is this an interrupt from the IrDA UART? */ if (irq == UART_IRQ_IRDA) - { - /* Restore the IrDA UART interrupt enables */ + { + /* Restore the IrDA UART interrupt enables */ - up_serialout(priv, UART_IER_OFFS, ier_val); - } + up_serialout(priv, UART_IER_OFFS, ier_val); + } } else if ((cause & 0x0000000c) == 0x00000004) { #ifdef CONFIG_SERCOMM_CONSOLE if (priv->sercomm) - { - sercomm_recvchars(dev); - } + { + sercomm_recvchars(dev); + } else #endif - { - uart_recvchars(dev); - } + { + uart_recvchars(dev); + } } if ((cause & 0x00000002) != 0) { #ifdef CONFIG_SERCOMM_CONSOLE if (priv->sercomm) - { - sercomm_xmitchars(dev); - } + { + sercomm_xmitchars(dev); + } else #endif - { - uart_xmitchars(dev); - } + { + uart_xmitchars(dev); + } } return OK; @@ -706,7 +706,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) { struct inode *inode = filep->f_inode; struct uart_dev_s *dev = inode->i_private; - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret = OK; switch (cmd) @@ -714,7 +714,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct up_dev_s *user = (struct up_dev_s*)arg; + struct up_dev_s *user = (struct up_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -764,7 +764,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) static int up_receive(struct uart_dev_s *dev, unsigned int *status) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t rhr; uint32_t lsr; @@ -792,7 +792,7 @@ static int up_receive(struct uart_dev_s *dev, unsigned int *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { #ifndef CONFIG_SUPPRESS_SERIAL_INTS @@ -817,7 +817,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) static bool up_rxavailable(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return up_inserial(priv, UART_LSR_OFFS) & UART_RX_FIFO_NOEMPTY; } @@ -831,7 +831,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_serialout(priv, UART_THR_OFFS, (uint8_t)ch); } @@ -845,7 +845,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { #ifndef CONFIG_SUPPRESS_SERIAL_INTS @@ -870,7 +870,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) static bool up_txready(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return (up_inserial(priv, UART_SSR_OFFS) & UART_SSR_TXFULL) == 0; } @@ -884,7 +884,7 @@ static bool up_txready(struct uart_dev_s *dev) static bool up_txempty(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return (up_inserial(priv, UART_LSR_OFFS) & UART_LSR_TREF) != 0; } @@ -923,7 +923,7 @@ void up_earlyserialinit(void) void up_serialinit(void) { #ifdef CONFIG_SERCOMM_CONSOLE - ((struct up_dev_s*)TTYS0_DEV.priv)->sercomm = true; + ((struct up_dev_s *)TTYS0_DEV.priv)->sercomm = true; (void)sercomm_register("/dev/console", &TTYS0_DEV); (void)uart_register("/dev/ttyS0", &TTYS1_DEV); #else @@ -944,7 +944,7 @@ void up_serialinit(void) int up_putc(int ch) { - struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; + struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; uint16_t ier; up_disableuartint(priv, &ier); diff --git a/arch/arm/src/calypso/calypso_timer.c b/arch/arm/src/calypso/calypso_timer.c index 7b98041670..86626c5de6 100644 --- a/arch/arm/src/calypso/calypso_timer.c +++ b/arch/arm/src/calypso/calypso_timer.c @@ -80,9 +80,13 @@ void hwtimer_enable(int num, int on) ctl = getreg8(TIMER_REG(num, CNTL_TIMER)); if (on) - ctl |= CNTL_START|CNTL_CLOCK_ENABLE; + { + ctl |= CNTL_START | CNTL_CLOCK_ENABLE; + } else + { ctl &= ~CNTL_START; + } putreg8(ctl, TIMER_REG(num, CNTL_TIMER)); } @@ -107,10 +111,12 @@ uint16_t hwtimer_read(int num) { uint8_t ctl = getreg8(TIMER_REG(num, CNTL_TIMER)); - /* somehow a read results in an abort */ + /* Somehow a read results in an abort */ - if ((ctl & (CNTL_START|CNTL_CLOCK_ENABLE)) != (CNTL_START|CNTL_CLOCK_ENABLE)) - return 0xFFFF; + if ((ctl & (CNTL_START | CNTL_CLOCK_ENABLE)) != (CNTL_START | CNTL_CLOCK_ENABLE)) + { + return 0xffff; + } return getreg16(TIMER_REG(num, READ_TIMER)); } diff --git a/arch/arm/src/common/up_allocateheap.c b/arch/arm/src/common/up_allocateheap.c index de4ace825b..f1f219ebc8 100644 --- a/arch/arm/src/common/up_allocateheap.c +++ b/arch/arm/src/common/up_allocateheap.c @@ -143,14 +143,14 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) /* Return the user-space heap settings */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)ubase; + *heap_start = (FAR void *)ubase; *heap_size = usize; #else /* Return the heap settings */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)g_idle_topstack; + *heap_start = (FAR void *)g_idle_topstack; *heap_size = CONFIG_RAM_END - g_idle_topstack; #endif } @@ -181,7 +181,7 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size) * that was not dedicated to the user heap). */ - *heap_start = (FAR void*)USERSPACE->us_bssend; + *heap_start = (FAR void *)USERSPACE->us_bssend; *heap_size = ubase - (uintptr_t)USERSPACE->us_bssend; } #endif diff --git a/arch/arm/src/common/up_checkstack.c b/arch/arm/src/common/up_checkstack.c index dbf08f2ecc..e1c92e61e1 100644 --- a/arch/arm/src/common/up_checkstack.c +++ b/arch/arm/src/common/up_checkstack.c @@ -140,7 +140,7 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size) up_putc('\n'); } - } + } #endif /* Return our guess about how much stack space was used */ @@ -180,12 +180,12 @@ ssize_t up_check_tcbstack_remain(FAR struct tcb_s *tcb) size_t up_check_stack(void) { - return up_check_tcbstack((FAR struct tcb_s*)g_readytorun.head); + return up_check_tcbstack((FAR struct tcb_s *)g_readytorun.head); } ssize_t up_check_stack_remain(void) { - return up_check_tcbstack_remain((FAR struct tcb_s*)g_readytorun.head); + return up_check_tcbstack_remain((FAR struct tcb_s *)g_readytorun.head); } #if CONFIG_ARCH_INTERRUPTSTACK > 3 diff --git a/arch/arm/src/common/up_createstack.c b/arch/arm/src/common/up_createstack.c index d7b010054d..7cec83a18f 100644 --- a/arch/arm/src/common/up_createstack.c +++ b/arch/arm/src/common/up_createstack.c @@ -215,7 +215,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) /* Save the adjusted stack values in the struct tcb_s */ - tcb->adj_stack_ptr = (uint32_t*)top_of_stack; + tcb->adj_stack_ptr = (uint32_t *)top_of_stack; tcb->adj_stack_size = size_of_stack; /* If stack debug is enabled, then fill the stack with a diff --git a/arch/arm/src/common/up_exit.c b/arch/arm/src/common/up_exit.c index 1c8a09f8f0..968e0a7371 100644 --- a/arch/arm/src/common/up_exit.c +++ b/arch/arm/src/common/up_exit.c @@ -138,7 +138,7 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) void _exit(int status) { - struct tcb_s* tcb; + struct tcb_s *tcb; /* Disable interrupts. They will be restored when the next * task is started. @@ -161,7 +161,7 @@ void _exit(int status) * head of the list. */ - tcb = (struct tcb_s*)g_readytorun.head; + tcb = (struct tcb_s *)g_readytorun.head; #ifdef CONFIG_ARCH_ADDRENV /* Make sure that the address environment for the previously running diff --git a/arch/arm/src/common/up_usestack.c b/arch/arm/src/common/up_usestack.c index fe0b483919..74bfecca35 100644 --- a/arch/arm/src/common/up_usestack.c +++ b/arch/arm/src/common/up_usestack.c @@ -159,7 +159,7 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) /* Save the adjusted stack values in the struct tcb_s */ - tcb->adj_stack_ptr = (uint32_t*)top_of_stack; + tcb->adj_stack_ptr = (uint32_t *)top_of_stack; tcb->adj_stack_size = size_of_stack; return OK; diff --git a/arch/arm/src/dm320/dm320_allocateheap.c b/arch/arm/src/dm320/dm320_allocateheap.c index dc33b76e56..c6802c4c5c 100644 --- a/arch/arm/src/dm320/dm320_allocateheap.c +++ b/arch/arm/src/dm320/dm320_allocateheap.c @@ -86,6 +86,6 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) { board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)g_idle_topstack; + *heap_start = (FAR void *)g_idle_topstack; *heap_size = (DM320_SDRAM_VADDR + CONFIG_RAM_SIZE) - g_idle_topstack; } diff --git a/arch/arm/src/dm320/dm320_boot.c b/arch/arm/src/dm320/dm320_boot.c index 8e676fa88b..089d7b45fb 100644 --- a/arch/arm/src/dm320/dm320_boot.c +++ b/arch/arm/src/dm320/dm320_boot.c @@ -101,7 +101,7 @@ static const struct section_mapping_s section_mapping[] = static inline void up_setlevel1entry(uint32_t paddr, uint32_t vaddr, uint32_t mmuflags) { - uint32_t *pgtable = (uint32_t*)PGTABLE_BASE_VADDR; + uint32_t *pgtable = (uint32_t *)PGTABLE_BASE_VADDR; uint32_t index = vaddr >> 20; /* Save the page table entry */ @@ -116,7 +116,7 @@ static inline void up_setlevel1entry(uint32_t paddr, uint32_t vaddr, uint32_t mm static inline void up_setlevel2coarseentry(uint32_t ctabvaddr, uint32_t paddr, uint32_t vaddr, uint32_t mmuflags) { - uint32_t *ctable = (uint32_t*)ctabvaddr; + uint32_t *ctable = (uint32_t *)ctabvaddr; uint32_t index; /* The coarse table divides a 1Mb address space up into 256 entries, each @@ -188,9 +188,9 @@ static void up_vectormapping(void) static void up_copyvectorblock(void) { - uint32_t *src = (uint32_t*)&_vector_start; - uint32_t *end = (uint32_t*)&_vector_end; - uint32_t *dest = (uint32_t*)VECTOR_BASE; + uint32_t *src = (uint32_t *)&_vector_start; + uint32_t *end = (uint32_t *)&_vector_end; + uint32_t *dest = (uint32_t *)VECTOR_BASE; while (src < end) { diff --git a/arch/arm/src/dm320/dm320_decodeirq.c b/arch/arm/src/dm320/dm320_decodeirq.c index cbb03c5dcc..e410484b5f 100644 --- a/arch/arm/src/dm320/dm320_decodeirq.c +++ b/arch/arm/src/dm320/dm320_decodeirq.c @@ -71,7 +71,7 @@ * Public Functions ********************************************************************************/ -void up_decodeirq(uint32_t* regs) +void up_decodeirq(uint32_t *regs) { #ifdef CONFIG_SUPPRESS_INTERRUPTS lowsyslog(LOG_ERR, "Unexpected IRQ\n"); @@ -124,7 +124,7 @@ void up_decodeirq(uint32_t* regs) #ifdef CONFIG_ARCH_FPU /* Restore floating point registers */ - up_restorefpu((uint32_t*)current_regs); + up_restorefpu((uint32_t *)current_regs); #endif #ifdef CONFIG_ARCH_ADDRENV diff --git a/arch/arm/src/dm320/dm320_framebuffer.c b/arch/arm/src/dm320/dm320_framebuffer.c index e3471c3b39..19dd0ef114 100644 --- a/arch/arm/src/dm320/dm320_framebuffer.c +++ b/arch/arm/src/dm320/dm320_framebuffer.c @@ -471,7 +471,7 @@ #ifdef CONFIG_FB_HWCURSOR # define DM320_RECTCURSOR_SETUP \ ((CONFIG_DM320_CURSORLINEHEIGHT << 1) | \ - (CONFIG_DM320_CURSORLINEWIDTH <<4) | \ + (CONFIG_DM320_CURSORLINEWIDTH << 4) | \ (CONFIG_DM320_CURSORCLUT << 8)) #endif @@ -676,7 +676,7 @@ static int dm320_allocvideomemory(void) #ifndef CONFIG_DM320_VID0_DISABLE #ifndef CONFIG_DM320_DISABLE_PINGPONG g_vid0base = (FAR void *)kmm_malloc(2 * DM320_VID0_FBLEN); - g_vid0ppbase = (FAR char*)g_vid0base + DM320_VID0_FBLEN; + g_vid0ppbase = (FAR char *)g_vid0base + DM320_VID0_FBLEN; #else g_vid0base = (FAR void *)kmm_malloc(DM320_VID0_FBLEN); #endif @@ -1301,13 +1301,13 @@ static int dm320_setcursor(FAR struct fb_vtable_s *vtable, FAR struct fb_setcurs settings->pos.x = MAX_YRES; } - if (settings->pos.y > MAX_YRES) - { - settings->pos.y = MAX_YRES; - } + if (settings->pos.y > MAX_YRES) + { + settings->pos.y = MAX_YRES; + } - putreg16(settings->pos.x, DM320_OSD_CURXP); - putreg16(settings->pos.y, DM320_OSD_CURYP); + putreg16(settings->pos.x, DM320_OSD_CURXP); + putreg16(settings->pos.y, DM320_OSD_CURYP); } #ifdef CONFIG_FB_HWCURSORSIZE diff --git a/arch/arm/src/dm320/dm320_serial.c b/arch/arm/src/dm320/dm320_serial.c index 59dbecc179..07f5ce91df 100644 --- a/arch/arm/src/dm320/dm320_serial.c +++ b/arch/arm/src/dm320/dm320_serial.c @@ -292,7 +292,7 @@ static inline void up_enablebreaks(struct up_dev_s *priv, bool enable) static int up_setup(struct uart_dev_s *dev) { #ifndef CONFIG_SUPPRESS_UART_CONFIG - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint16_t brsr; /* Clear fifos */ @@ -336,7 +336,7 @@ static int up_setup(struct uart_dev_s *dev) } else { - priv->msr &= ~(UART_MSR_PSB|UART_MSR_PEB); + priv->msr &= ~(UART_MSR_PSB | UART_MSR_PEB); } /* Set up the BRSR */ @@ -402,7 +402,7 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disableuartint(priv, NULL); } @@ -423,7 +423,7 @@ static void up_shutdown(struct uart_dev_s *dev) static int up_attach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ */ @@ -431,11 +431,11 @@ static int up_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, up_interrupt); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the UART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the UART + */ - up_enable_irq(priv->irq); + up_enable_irq(priv->irq); } return ret; } @@ -452,7 +452,7 @@ static int up_attach(struct uart_dev_s *dev) static void up_detach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disable_irq(priv->irq); irq_detach(priv->irq); } @@ -489,7 +489,7 @@ static int up_interrupt(int irq, void *context) { PANIC(); } - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; /* Loop until there are no characters to be transferred or, * until we have been looping for a long time. @@ -543,7 +543,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) { struct inode *inode = filep->f_inode; struct uart_dev_s *dev = inode->i_private; - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret = OK; switch (cmd) @@ -551,7 +551,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct up_dev_s *user = (struct up_dev_s*)arg; + struct up_dev_s *user = (struct up_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -601,7 +601,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) static int up_receive(struct uart_dev_s *dev, uint32_t *status) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint16_t dtrr; dtrr = up_serialin(priv, UART_DTRR); @@ -619,7 +619,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { #ifndef CONFIG_SUPPRESS_SERIAL_INTS @@ -643,7 +643,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) static bool up_rxavailable(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, UART_SR) & UART_SR_RFNEF) != 0); } @@ -657,7 +657,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_serialout(priv, UART_DTRR, (uint16_t)ch); } @@ -671,7 +671,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { #ifndef CONFIG_SUPPRESS_SERIAL_INTS @@ -695,7 +695,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) static bool up_txready(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, UART_SR) & UART_SR_TFTI) != 0); } @@ -709,7 +709,7 @@ static bool up_txready(struct uart_dev_s *dev) static bool up_txempty(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, UART_SR) & UART_SR_TREF) == 0); } @@ -763,7 +763,7 @@ void up_serialinit(void) int up_putc(int ch) { - struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; + struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; uint16_t ier; up_disableuartint(priv, &ier); diff --git a/arch/arm/src/dm320/dm320_usbdev.c b/arch/arm/src/dm320/dm320_usbdev.c index 389fc845b0..f2d5307ad1 100644 --- a/arch/arm/src/dm320/dm320_usbdev.c +++ b/arch/arm/src/dm320/dm320_usbdev.c @@ -65,7 +65,7 @@ * Pre-processor Definitions ****************************************************************************/ -/* Configuration ***************************************************************/ +/* Configuration ************************************************************/ #ifndef CONFIG_USBDEV_MAXPOWER # define CONFIG_USBDEV_MAXPOWER 100 /* mA */ @@ -385,28 +385,28 @@ static struct dm320_usbdev_s g_usbdev; static const struct dm320_epinfo_s g_epinfo[DM320_NENDPOINTS] = { { - 0, /* EP0 */ - USB_EP_ATTR_XFER_CONTROL, /* Type: Control IN/OUT */ - USB_TXFIFO2_SZ_64|USB_TXFIFO2_SINGLE_BUF, /* Bits for TX/RXFIFO2 */ - DM320_EP0MAXPACKET /* Max packet size */ + 0, /* EP0 */ + USB_EP_ATTR_XFER_CONTROL, /* Type: Control IN/OUT */ + USB_TXFIFO2_SZ_64 | USB_TXFIFO2_SINGLE_BUF, /* Bits for TX/RXFIFO2 */ + DM320_EP0MAXPACKET /* Max packet size */ }, { - DM320_EPBULKIN | USB_DIR_IN, /* Logical endpoint number: 1 IN */ - USB_EP_ATTR_XFER_BULK, /* Type: Bulk */ - USB_TXFIFO2_SZ_64|USB_TXFIFO2_SINGLE_BUF, /* Bits for TX/RXFIFO2 */ - DM320_BULKMAXPACKET, /* Max packet size */ + DM320_EPBULKIN | USB_DIR_IN, /* Logical endpoint number: 1 IN */ + USB_EP_ATTR_XFER_BULK, /* Type: Bulk */ + USB_TXFIFO2_SZ_64 | USB_TXFIFO2_SINGLE_BUF, /* Bits for TX/RXFIFO2 */ + DM320_BULKMAXPACKET, /* Max packet size */ }, { - DM320_EPBULKOUT | USB_DIR_OUT, /* Logical endpoint number: 2 OUT */ - USB_EP_ATTR_XFER_BULK, /* Type: Bulk */ - USB_TXFIFO2_SZ_64|USB_TXFIFO2_SINGLE_BUF, /* Bits for TX/RXFIFO2 */ - DM320_BULKMAXPACKET /* Max packet size */ + DM320_EPBULKOUT | USB_DIR_OUT, /* Logical endpoint number: 2 OUT */ + USB_EP_ATTR_XFER_BULK, /* Type: Bulk */ + USB_TXFIFO2_SZ_64 | USB_TXFIFO2_SINGLE_BUF, /* Bits for TX/RXFIFO2 */ + DM320_BULKMAXPACKET /* Max packet size */ }, { - DM320_EPINTRIN| USB_DIR_IN, /* Logical endpoint number: 3 IN */ - USB_EP_ATTR_XFER_INT, /* Type: Interrupt */ - USB_TXFIFO2_SZ_64|USB_TXFIFO2_SINGLE_BUF, /* Bits for TX/RXFIFO2 */ - DM320_INTRMAXPACKET /* Max packet size */ + DM320_EPINTRIN | USB_DIR_IN, /* Logical endpoint number: 3 IN */ + USB_EP_ATTR_XFER_INT, /* Type: Interrupt */ + USB_TXFIFO2_SZ_64 | USB_TXFIFO2_SINGLE_BUF, /* Bits for TX/RXFIFO2 */ + DM320_INTRMAXPACKET /* Max packet size */ } }; @@ -454,20 +454,20 @@ static uint8_t dm320_getreg8(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ @@ -504,10 +504,11 @@ static uint32_t dm320_getreg16(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return val; } } @@ -516,20 +517,20 @@ static uint32_t dm320_getreg16(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ @@ -566,10 +567,11 @@ static uint32_t dm320_getreg32(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return val; } } @@ -578,20 +580,20 @@ static uint32_t dm320_getreg32(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ @@ -829,7 +831,7 @@ static int dm320_epread(uint8_t epphy, uint8_t *buf, uint16_t nbytes) } } else - { + { bytesleft = dm320_getreg8(DM320_USB_RXCOUNT2); bytesleft = (bytesleft << 8) + dm320_getreg8(DM320_USB_RXCOUNT1); if (bytesleft > nbytes) @@ -838,15 +840,15 @@ static int dm320_epread(uint8_t epphy, uint8_t *buf, uint16_t nbytes) } } - ret = bytesleft; - fifo = (uint8_t*)DM320_USB_FIFO0; + ret = bytesleft; + fifo = (uint8_t *)DM320_USB_FIFO0; fifo = fifo + (epphy << 2); while (bytesleft > 0) - { - *buf++ = *fifo; - bytesleft--; - } + { + *buf++ = *fifo; + bytesleft--; + } /* Clear RXPKTRDY bit in PER_RXCSR1 */ @@ -1204,7 +1206,7 @@ static inline void dm320_ep0setup(struct dm320_usbdev_s *priv) /* Read EP0 data */ - ret = dm320_epread(USB_EP0_SELECT, (uint8_t*)&ctrl, USB_SIZEOF_CTRLREQ); + ret = dm320_epread(USB_EP0_SELECT, (uint8_t *)&ctrl, USB_SIZEOF_CTRLREQ); if (ret <= 0) { return; @@ -1351,7 +1353,8 @@ static inline void dm320_ep0setup(struct dm320_usbdev_s *priv) * len: 0; data = none */ - dm320_putreg8(USB_PERCSR0_CLRRXRDY|USB_PERCSR0_DATAEND, DM320_USB_PERCSR0); + dm320_putreg8(USB_PERCSR0_CLRRXRDY | USB_PERCSR0_DATAEND, + DM320_USB_PERCSR0); usbtrace(TRACE_INTDECODE(DM320_TRACEINTID_SETADDRESS), 0); priv->paddr = value & 0xff; } @@ -1400,8 +1403,10 @@ static inline void dm320_ep0setup(struct dm320_usbdev_s *priv) * index: interface; * len: 0; data = none */ + { - dm320_putreg8(USB_PERCSR0_CLRRXRDY|USB_PERCSR0_DATAEND, DM320_USB_PERCSR0); + dm320_putreg8(USB_PERCSR0_CLRRXRDY | USB_PERCSR0_DATAEND, + DM320_USB_PERCSR0); usbtrace(TRACE_INTDECODE(DM320_TRACEINTID_GETSETIFCONFIG), 0); dm320_dispatchrequest(priv, &ctrl); } @@ -1415,14 +1420,16 @@ static inline void dm320_ep0setup(struct dm320_usbdev_s *priv) * len: 2; data = frame number */ - dm320_putreg8(USB_PERCSR0_CLRRXRDY|USB_PERCSR0_SENDST, DM320_USB_PERCSR0); + dm320_putreg8(USB_PERCSR0_CLRRXRDY | USB_PERCSR0_SENDST, + DM320_USB_PERCSR0); usbtrace(TRACE_INTDECODE(DM320_TRACEINTID_SYNCHFRAME), 0); } break; default: { - dm320_putreg8(USB_PERCSR0_CLRRXRDY|USB_PERCSR0_SENDST, DM320_USB_PERCSR0); + dm320_putreg8(USB_PERCSR0_CLRRXRDY | USB_PERCSR0_SENDST, + DM320_USB_PERCSR0); usbtrace(TRACE_DEVERROR(DM320_TRACEERR_STALLEDREQUEST), ctrl.req); priv->stalled = 1; } @@ -1441,27 +1448,59 @@ static inline void dm320_ep0setup(struct dm320_usbdev_s *priv) static inline uint32_t dm320_highestpriinterrupt(int intstatus) { if ((intstatus & USB_INT_CONNECTED) != 0) - return USB_INT_CONNECTED; + { + return USB_INT_CONNECTED; + } + if ((intstatus & USB_INT_DISCONNECTED) != 0) - return USB_INT_DISCONNECTED; + { + return USB_INT_DISCONNECTED; + } + if ((intstatus & USB_INT_RESET) != 0) - return USB_INT_RESET; + { + return USB_INT_RESET; + } + if ((intstatus & USB_INT_RESUME) != 0) - return USB_INT_RESUME; + { + return USB_INT_RESUME; + } + if ((intstatus & USB_INT_SESSRQ) != 0) - return USB_INT_SESSRQ; + { + return USB_INT_SESSRQ; + } + if ((intstatus & USB_INT_VBUSERR) != 0) - return USB_INT_VBUSERR; + { + return USB_INT_VBUSERR; + } + if ((intstatus & USB_INT_SOF) != 0) - return USB_INT_SOF; + { + return USB_INT_SOF; + } + if ((intstatus & USB_INT_SUSPEND) != 0) - return USB_INT_SUSPEND; + { + return USB_INT_SUSPEND; + } + if ((intstatus & USB_INT_CONTROL) != 0) - return USB_INT_CONTROL; + { + return USB_INT_CONTROL; + } + if ((intstatus & USB_INT_RXFIFO) != 0) - return USB_INT_RXFIFO; + { + return USB_INT_RXFIFO; + } + if ((intstatus & USB_INT_TXFIFO) != 0) - return USB_INT_TXFIFO; + { + return USB_INT_TXFIFO; + } return USB_INT_NOINTERRUPT; } @@ -1721,7 +1760,8 @@ static inline void dm320_epinitialize(struct dm320_usbdev_s *priv) /* Initialize endpoint 0 */ dm320_putreg8(USB_EP0_SELECT, DM320_USB_INDEX); - dm320_putreg8(USB_PERCSR0_CLRSETEND|USB_PERCSR0_CLRRXRDY, DM320_USB_PERCSR0); + dm320_putreg8(USB_PERCSR0_CLRSETEND | USB_PERCSR0_CLRRXRDY, + DM320_USB_PERCSR0); dm320_putreg8(USB_CSR2_FLFIFO, DM320_USB_CSR2); dm320_putreg8(USB_CSR2_FLFIFO, DM320_USB_CSR2); @@ -1755,15 +1795,17 @@ static inline void dm320_epinitialize(struct dm320_usbdev_s *priv) { /* Initialize TX endpoint */ - dm320_putreg8(USB_TXCSR1_CLRDATTOG|USB_TXCSR1_FLFIFO|USB_TXCSR1_UNDERRUN, - DM320_USB_PERTXCSR1); + dm320_putreg8(USB_TXCSR1_CLRDATTOG | USB_TXCSR1_FLFIFO | + USB_TXCSR1_UNDERRUN, + DM320_USB_PERTXCSR1); dm320_putreg8(USB_TXCSR1_FLFIFO, DM320_USB_PERTXCSR1); - dm320_putreg8(USB_TXCSR2_FRDATTOG|USB_TXCSR2_MODE_TX, DM320_USB_TXCSR2); + dm320_putreg8(USB_TXCSR2_FRDATTOG | USB_TXCSR2_MODE_TX, + DM320_USB_TXCSR2); /* FIFO address, max packet size, dual/single buffered */ dm320_putreg8(addrlo, DM320_USB_TXFIFO1); - dm320_putreg8(addrhi|g_epinfo[i].fifo, DM320_USB_TXFIFO2); + dm320_putreg8(addrhi | g_epinfo[i].fifo, DM320_USB_TXFIFO2); /* TX endpoint max packet size */ @@ -1776,15 +1818,15 @@ static inline void dm320_epinitialize(struct dm320_usbdev_s *priv) { /* Initialize RX endpoint */ - dm320_putreg8(USB_PERRXCSR1_CLRDATTOG|USB_PERRXCSR1_FLFIFO, - DM320_USB_PERRXCSR1); + dm320_putreg8(USB_PERRXCSR1_CLRDATTOG | USB_PERRXCSR1_FLFIFO, + DM320_USB_PERRXCSR1); dm320_putreg8(USB_PERRXCSR1_FLFIFO, DM320_USB_PERRXCSR1); dm320_putreg8(0x00, DM320_USB_PERRXCSR2); /* FIFO address, max packet size, dual/single buffered */ dm320_putreg8(addrhi, DM320_USB_RXFIFO1); - dm320_putreg8(addrhi|g_epinfo[i].fifo | USB_RXFIF02_DPB, DM320_USB_RXFIFO2); + dm320_putreg8(addrhi | g_epinfo[i].fifo | USB_RXFIF02_DPB, DM320_USB_RXFIFO2); /* RX endpoint max packet size */ @@ -1837,8 +1879,9 @@ static void dm320_ctrlinitialize(FAR struct dm320_usbdev_s *priv) dm320_putreg8((DM320_EPBULKIN << 1), DM320_USB_INTRRX1E); dm320_putreg8((DM320_EPBULKOUT << 1) | USB_EP0, DM320_USB_INTRTX1E); - dm320_putreg8(USB_INT_RESET|USB_INT_RESUME|USB_INT_SUSPEND|USB_INT_SESSRQ|USB_INT_SOF, - DM320_USB_INTRUSBE); + dm320_putreg8(USB_INT_RESET | USB_INT_RESUME | USB_INT_SUSPEND | + USB_INT_SESSRQ | USB_INT_SOF, + DM320_USB_INTRUSBE); /* Initialize endpoints ******************************************************/ @@ -2534,8 +2577,9 @@ int usbdev_register(FAR struct usbdevclass_driver_s *driver) dm320_epreset(0); dm320_putreg8(USB_EP0, DM320_USB_INTRTX1E); - dm320_putreg8(USB_INT_RESET|USB_INT_RESUME|USB_INT_SUSPEND|USB_INT_SESSRQ|USB_INT_SOF, - DM320_USB_INTRUSBE); + dm320_putreg8(USB_INT_RESET | USB_INT_RESUME | USB_INT_SUSPEND | + USB_INT_SESSRQ | USB_INT_SOF, + DM320_USB_INTRUSBE); /* Enable interrupts */ diff --git a/arch/arm/src/efm32/efm32_adc.c b/arch/arm/src/efm32/efm32_adc.c index c841597018..c79daba3bb 100644 --- a/arch/arm/src/efm32/efm32_adc.c +++ b/arch/arm/src/efm32/efm32_adc.c @@ -166,8 +166,8 @@ static struct efm32_dev_s g_adcpriv1 = static struct adc_dev_s g_adcdev1 = { - .ad_ops = &g_adcops, - .ad_priv= &g_adcpriv1, + .ad_ops = &g_adcops, + .ad_priv = &g_adcpriv1, }; #endif @@ -213,7 +213,7 @@ static void adc_putreg(struct efm32_dev_s *priv, int offset, uint32_t value) putreg32(value, priv->base + offset); } -/***************************************************************************//** +/**************************************************************************** * Name: ADC_CalibrateLoadScan * * Description: @@ -297,7 +297,7 @@ static void ADC_CalibrateLoadScan(ADC_TypeDef *adc, ADC_Ref_TypeDef ref) } } -/***************************************************************************//** +/**************************************************************************** * Name: ADC_CalibrateLoadSingle * * Description: @@ -385,7 +385,7 @@ static void ADC_CalibrateLoadSingle(ADC_TypeDef *adc, ADC_Ref_TypeDef ref) * Public Functions ****************************************************************************/ -/***************************************************************************//** +/**************************************************************************** * Name: ADC_Init * Initialize ADC. * @@ -397,7 +397,7 @@ static void ADC_CalibrateLoadSingle(ADC_TypeDef *adc, ADC_Ref_TypeDef ref) * NOTE: This function will stop any ongoing conversion. * * Input Parameters: - * adc- Pointer to ADC peripheral register block. + * adc - Pointer to ADC peripheral register block. * int - Pointer to ADC initialization structure. * ****************************************************************************/ @@ -426,7 +426,7 @@ void ADC_Init(ADC_TypeDef *adc, const ADC_Init_TypeDef *init) adc->CTRL = tmp; } -/***************************************************************************//** +/**************************************************************************** * Name: ADC_InitScan * * Description: @@ -489,7 +489,7 @@ void ADC_InitScan(ADC_TypeDef *adc, const ADC_InitScan_TypeDef *init) adc->SCANCTRL = tmp; } -/***************************************************************************//** +/**************************************************************************** * Name: ADC_InitSingle * * Description: @@ -552,7 +552,7 @@ void ADC_InitSingle(ADC_TypeDef *adc, const ADC_InitSingle_TypeDef *init) adc->SINGLECTRL = tmp; } -/***************************************************************************//** +/**************************************************************************** * Name: ADC_PrescaleCalc * * Description: @@ -603,7 +603,7 @@ uint8_t ADC_PrescaleCalc(uint32_t adcFreq, uint32_t hfperFreq) return (uint8_t)ret; } -/***************************************************************************//** +/**************************************************************************** * Name: ADC_Reset * * Description: @@ -638,7 +638,7 @@ void ADC_Reset(ADC_TypeDef *adc) /* Do not reset route register, setting should be done independently */ } -/***************************************************************************//** +/**************************************************************************** * Name: ADC_TimebaseCalc * * Description: diff --git a/arch/arm/src/efm32/efm32_clockconfig.c b/arch/arm/src/efm32/efm32_clockconfig.c index 40e1739084..e2f0d3b5df 100644 --- a/arch/arm/src/efm32/efm32_clockconfig.c +++ b/arch/arm/src/efm32/efm32_clockconfig.c @@ -509,7 +509,7 @@ uint32_t efm32_coreleclk_config(int frequency) /* Check if the core frequency is higher than CMU_MAX_FREQ_HFLE */ - if (frequency > CMU_MAX_FREQ_HFLE) + if (frequency > CMU_MAX_FREQ_HFLE) { /* Enable HFLE */ diff --git a/arch/arm/src/efm32/efm32_flash.c b/arch/arm/src/efm32/efm32_flash.c index 014f3f8cae..11bc4d07f2 100644 --- a/arch/arm/src/efm32/efm32_flash.c +++ b/arch/arm/src/efm32/efm32_flash.c @@ -208,7 +208,7 @@ void efm32_flash_unlock(void) * -EACCES - Operation tried to access a locked area of the flash. ****************************************************************************/ -int __ramfunc__ msc_load_verify_address(uint32_t* address) +int __ramfunc__ msc_load_verify_address(uint32_t *address) { uint32_t status; uint32_t timeout; @@ -247,7 +247,9 @@ int __ramfunc__ msc_load_verify_address(uint32_t* address) /* Check for write protected page */ if (status & MSC_STATUS_LOCKED) - return -EACCES; + { + return -EACCES; + } } return OK; @@ -280,7 +282,7 @@ int __ramfunc__ msc_load_verify_address(uint32_t* address) * to complete. ****************************************************************************/ -int __ramfunc__ msc_load_write_data(uint32_t* data, uint32_t num_words, +int __ramfunc__ msc_load_write_data(uint32_t *data, uint32_t num_words, bool write_strategy_safe) { int timeout; @@ -748,8 +750,8 @@ ssize_t __ramfunc__ up_progmem_write(size_t addr, const void *buf, size_t size) int word_count; int num_words; int page_words; - uint32_t* p_data; - uint32_t* address = (uint32_t*) addr; + uint32_t *p_data; + uint32_t *address = (uint32_t *)addr; uint32_t num_bytes = size; /* EFM32 requires word access */ @@ -781,7 +783,7 @@ ssize_t __ramfunc__ up_progmem_write(size_t addr, const void *buf, size_t size) * increments the address internally for each data load inside a page. */ - for (word_count = 0, p_data = (uint32_t*) buf; word_count < num_words;) + for (word_count = 0, p_data = (uint32_t *)buf; word_count < num_words;) { int page_bytes; ssize_t page_idx; @@ -789,7 +791,7 @@ ssize_t __ramfunc__ up_progmem_write(size_t addr, const void *buf, size_t size) /* Compute the number of words to write to the current page. */ - page_idx = up_progmem_getpage((size_t)address+(word_count<<2)); + page_idx = up_progmem_getpage((size_t)address+(word_count << 2)); if (page_idx < 0) { ret = -EINVAL; diff --git a/arch/arm/src/efm32/efm32_irq.c b/arch/arm/src/efm32/efm32_irq.c index 1b6bb18790..e8830e4121 100644 --- a/arch/arm/src/efm32/efm32_irq.c +++ b/arch/arm/src/efm32/efm32_irq.c @@ -63,9 +63,9 @@ /* Get a 32-bit version of the default priority */ #define DEFPRIORITY32 \ - (NVIC_SYSH_PRIORITY_DEFAULT << 24 |\ - NVIC_SYSH_PRIORITY_DEFAULT << 16 |\ - NVIC_SYSH_PRIORITY_DEFAULT << 8 |\ + (NVIC_SYSH_PRIORITY_DEFAULT << 24 | \ + NVIC_SYSH_PRIORITY_DEFAULT << 16 | \ + NVIC_SYSH_PRIORITY_DEFAULT << 8 | \ NVIC_SYSH_PRIORITY_DEFAULT) /* Given the address of a NVIC ENABLE register, this is the offset to diff --git a/arch/arm/src/efm32/efm32_leserial.c b/arch/arm/src/efm32/efm32_leserial.c index 9ae4fd8341..2c8bcf4650 100644 --- a/arch/arm/src/efm32/efm32_leserial.c +++ b/arch/arm/src/efm32/efm32_leserial.c @@ -362,7 +362,7 @@ static void efm32_disableuartint(struct efm32_leuart_s *priv, uint32_t *ien) static int efm32_setup(struct uart_dev_s *dev) { - struct efm32_leuart_s *priv = (struct efm32_leuart_s*)dev->priv; + struct efm32_leuart_s *priv = (struct efm32_leuart_s *)dev->priv; #ifndef CONFIG_SUPPRESS_LEUART_CONFIG const struct efm32_config_s *config = priv->config; @@ -390,7 +390,7 @@ static int efm32_setup(struct uart_dev_s *dev) static void efm32_shutdown(struct uart_dev_s *dev) { - struct efm32_leuart_s *priv = (struct efm32_leuart_s*)dev->priv; + struct efm32_leuart_s *priv = (struct efm32_leuart_s *)dev->priv; /* Disable interrupts */ @@ -421,7 +421,7 @@ static void efm32_shutdown(struct uart_dev_s *dev) static int efm32_attach(struct uart_dev_s *dev) { - struct efm32_leuart_s *priv = (struct efm32_leuart_s*)dev->priv; + struct efm32_leuart_s *priv = (struct efm32_leuart_s *)dev->priv; const struct efm32_config_s *config = priv->config; int ret; @@ -450,7 +450,7 @@ static int efm32_attach(struct uart_dev_s *dev) static void efm32_detach(struct uart_dev_s *dev) { - struct efm32_leuart_s *priv = (struct efm32_leuart_s*)dev->priv; + struct efm32_leuart_s *priv = (struct efm32_leuart_s *)dev->priv; const struct efm32_config_s *config = priv->config; /* Disable interrupts */ @@ -473,7 +473,7 @@ static void efm32_detach(struct uart_dev_s *dev) static int efm32_interrupt(struct uart_dev_s *dev) { - struct efm32_leuart_s *priv = (struct efm32_leuart_s*)dev->priv; + struct efm32_leuart_s *priv = (struct efm32_leuart_s *)dev->priv; uint32_t intflags; DEBUGASSERT(priv); @@ -569,7 +569,7 @@ static int efm32_ioctl(struct file *filep, int cmd, unsigned long arg) dev = inode->i_private; DEBUGASSERT(dev, dev->priv); - priv = (struct efm32_leuart_s*)dev->priv; + priv = (struct efm32_leuart_s *)dev->priv; switch (cmd) { @@ -599,7 +599,7 @@ static int efm32_ioctl(struct file *filep, int cmd, unsigned long arg) static int efm32_receive(struct uart_dev_s *dev, uint32_t *status) { - struct efm32_leuart_s *priv = (struct efm32_leuart_s*)dev->priv; + struct efm32_leuart_s *priv = (struct efm32_leuart_s *)dev->priv; uint32_t rxdatax; /* Get error status information: @@ -632,7 +632,7 @@ static int efm32_receive(struct uart_dev_s *dev, uint32_t *status) static void efm32_rxint(struct uart_dev_s *dev, bool enable) { - struct efm32_leuart_s *priv = (struct efm32_leuart_s*)dev->priv; + struct efm32_leuart_s *priv = (struct efm32_leuart_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -666,7 +666,7 @@ static void efm32_rxint(struct uart_dev_s *dev, bool enable) static bool efm32_rxavailable(struct uart_dev_s *dev) { - struct efm32_leuart_s *priv = (struct efm32_leuart_s*)dev->priv; + struct efm32_leuart_s *priv = (struct efm32_leuart_s *)dev->priv; /* Return true if the receive data is available (RXDATAV). */ @@ -683,7 +683,7 @@ static bool efm32_rxavailable(struct uart_dev_s *dev) static void efm32_send(struct uart_dev_s *dev, int ch) { - struct efm32_leuart_s *priv = (struct efm32_leuart_s*)dev->priv; + struct efm32_leuart_s *priv = (struct efm32_leuart_s *)dev->priv; efm32_serialout(priv, EFM32_LEUART_TXDATA_OFFSET, (uint32_t)ch); } @@ -697,7 +697,7 @@ static void efm32_send(struct uart_dev_s *dev, int ch) static void efm32_txint(struct uart_dev_s *dev, bool enable) { - struct efm32_leuart_s *priv = (struct efm32_leuart_s*)dev->priv; + struct efm32_leuart_s *priv = (struct efm32_leuart_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -737,7 +737,7 @@ static void efm32_txint(struct uart_dev_s *dev, bool enable) static bool efm32_txready(struct uart_dev_s *dev) { - struct efm32_leuart_s *priv = (struct efm32_leuart_s*)dev->priv; + struct efm32_leuart_s *priv = (struct efm32_leuart_s *)dev->priv; /* The TX Buffer Level (TXBL) status bit indicates the level of the * transmit buffer. Set when the transmit buffer is empty, and cleared @@ -757,7 +757,7 @@ static bool efm32_txready(struct uart_dev_s *dev) static bool efm32_txempty(struct uart_dev_s *dev) { - struct efm32_leuart_s *priv = (struct efm32_leuart_s*)dev->priv; + struct efm32_leuart_s *priv = (struct efm32_leuart_s *)dev->priv; /* TX Complete (TXC) is set when a transmission has completed and no more * data is available in the transmit buffer. @@ -837,7 +837,7 @@ void up_serialinit(void) #ifdef HAVE_LEUART_CONSOLE int up_putc(int ch) { - struct efm32_leuart_s *priv = (struct efm32_leuart_s*)CONSOLE_DEV.priv; + struct efm32_leuart_s *priv = (struct efm32_leuart_s *)CONSOLE_DEV.priv; uint32_t ien; efm32_disableuartint(priv, &ien); diff --git a/arch/arm/src/efm32/efm32_pwm.c b/arch/arm/src/efm32/efm32_pwm.c index d0240c8b4d..43fcb6971a 100644 --- a/arch/arm/src/efm32/efm32_pwm.c +++ b/arch/arm/src/efm32/efm32_pwm.c @@ -413,9 +413,7 @@ static int pwm_timer(FAR struct efm32_pwmtimer_s *priv, if (efm32_timer_set_freq(priv->base,priv->pclk,info->frequency) < 0) { pwmdbg("Cannot set TIMER frequency %dHz from clock %dHz\n", - info->frequency, - priv->pclk - ); + info->frequency, priv->pclk); return -EINVAL; } @@ -734,7 +732,7 @@ static int pwm_shutdown(FAR struct pwm_lowerhalf_s *dev) /* Then put the GPIO pin back to the default state */ - pincfg = priv->pincfg & (GPIO_PORT_MASK|GPIO_PIN_MASK); + pincfg = priv->pincfg & (GPIO_PORT_MASK | GPIO_PIN_MASK); pincfg |= (_GPIO_DISABLE); diff --git a/arch/arm/src/efm32/efm32_rmu.c b/arch/arm/src/efm32/efm32_rmu.c index 3910e24aee..9996ec117a 100644 --- a/arch/arm/src/efm32/efm32_rmu.c +++ b/arch/arm/src/efm32/efm32_rmu.c @@ -68,7 +68,7 @@ typedef struct { const uint32_t val; const uint32_t mask; - const char* str; + const char *str; } efm32_reset_cause_list_t; #endif @@ -265,7 +265,7 @@ void efm32_rmu_initialize(void) rmudbg("RMU => reg = 0x%08X\n", g_efm32_rstcause); for (;;) { - const char* str; + const char *str; str = efm32_reset_cause_list_str(g_efm32_rstcause, &idx); if (str == NULL) diff --git a/arch/arm/src/efm32/efm32_serial.c b/arch/arm/src/efm32/efm32_serial.c index 8a970fc39e..7f3517f2c2 100644 --- a/arch/arm/src/efm32/efm32_serial.c +++ b/arch/arm/src/efm32/efm32_serial.c @@ -188,7 +188,7 @@ #endif /* Pick ttys4. This could be one of UART0-1. It can't be USART0-2 because -* those have already been assigned to ttsyS0, 1, 2, or 3. One of + * those have already been assigned to ttsyS0, 1, 2, or 3. One of * these could also be the console. There is really only 1 unassigned. */ @@ -613,7 +613,7 @@ static void efm32_disableuartint(struct efm32_usart_s *priv, uint32_t *ien) static int efm32_setup(struct uart_dev_s *dev) { - struct efm32_usart_s *priv = (struct efm32_usart_s*)dev->priv; + struct efm32_usart_s *priv = (struct efm32_usart_s *)dev->priv; uint32_t regval; #ifndef CONFIG_SUPPRESS_UART_CONFIG @@ -650,7 +650,7 @@ static int efm32_setup(struct uart_dev_s *dev) static void efm32_shutdown(struct uart_dev_s *dev) { - struct efm32_usart_s *priv = (struct efm32_usart_s*)dev->priv; + struct efm32_usart_s *priv = (struct efm32_usart_s *)dev->priv; /* Disable interrupts */ @@ -681,7 +681,7 @@ static void efm32_shutdown(struct uart_dev_s *dev) static int efm32_attach(struct uart_dev_s *dev) { - struct efm32_usart_s *priv = (struct efm32_usart_s*)dev->priv; + struct efm32_usart_s *priv = (struct efm32_usart_s *)dev->priv; const struct efm32_config_s *config = priv->config; int ret; @@ -719,7 +719,7 @@ static int efm32_attach(struct uart_dev_s *dev) static void efm32_detach(struct uart_dev_s *dev) { - struct efm32_usart_s *priv = (struct efm32_usart_s*)dev->priv; + struct efm32_usart_s *priv = (struct efm32_usart_s *)dev->priv; const struct efm32_config_s *config = priv->config; /* Disable interrupts */ @@ -744,7 +744,7 @@ static void efm32_detach(struct uart_dev_s *dev) static int efm32_rxinterrupt(struct uart_dev_s *dev) { - struct efm32_usart_s *priv = (struct efm32_usart_s*)dev->priv; + struct efm32_usart_s *priv = (struct efm32_usart_s *)dev->priv; uint32_t intflags; DEBUGASSERT(priv); @@ -832,7 +832,7 @@ static int efm32_uart1_rxinterrupt(int irq, void *context) static int efm32_txinterrupt(struct uart_dev_s *dev) { - struct efm32_usart_s *priv = (struct efm32_usart_s*)dev->priv; + struct efm32_usart_s *priv = (struct efm32_usart_s *)dev->priv; uint32_t intflags; DEBUGASSERT(priv); @@ -933,7 +933,7 @@ static int efm32_ioctl(struct file *filep, int cmd, unsigned long arg) DEBUGASSERT(dev->priv); #ifdef CONFIG_SERIAL_TERMIOS - priv = (struct efm32_usart_s*)dev->priv; + priv = (struct efm32_usart_s *)dev->priv; #endif switch (cmd) @@ -941,7 +941,7 @@ static int efm32_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TERMIOS case TCGETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; if (!termiosp) { @@ -963,7 +963,7 @@ static int efm32_ioctl(struct file *filep, int cmd, unsigned long arg) case TCSETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; if (!termiosp) { @@ -1013,7 +1013,7 @@ static int efm32_ioctl(struct file *filep, int cmd, unsigned long arg) { uint32_t ien; - struct efm32_config_s* config = priv->config; + struct efm32_config_s *config = priv->config; config->baud = cfgetispeed(termiosp); @@ -1050,7 +1050,7 @@ static int efm32_ioctl(struct file *filep, int cmd, unsigned long arg) static int efm32_receive(struct uart_dev_s *dev, uint32_t *status) { - struct efm32_usart_s *priv = (struct efm32_usart_s*)dev->priv; + struct efm32_usart_s *priv = (struct efm32_usart_s *)dev->priv; uint32_t rxdatax; /* Get error status information: @@ -1083,7 +1083,7 @@ static int efm32_receive(struct uart_dev_s *dev, uint32_t *status) static void efm32_rxint(struct uart_dev_s *dev, bool enable) { - struct efm32_usart_s *priv = (struct efm32_usart_s*)dev->priv; + struct efm32_usart_s *priv = (struct efm32_usart_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -1117,7 +1117,7 @@ static void efm32_rxint(struct uart_dev_s *dev, bool enable) static bool efm32_rxavailable(struct uart_dev_s *dev) { - struct efm32_usart_s *priv = (struct efm32_usart_s*)dev->priv; + struct efm32_usart_s *priv = (struct efm32_usart_s *)dev->priv; /* Return true if the receive data is available (RXDATAV). */ @@ -1134,7 +1134,7 @@ static bool efm32_rxavailable(struct uart_dev_s *dev) static void efm32_send(struct uart_dev_s *dev, int ch) { - struct efm32_usart_s *priv = (struct efm32_usart_s*)dev->priv; + struct efm32_usart_s *priv = (struct efm32_usart_s *)dev->priv; efm32_serialout(priv, EFM32_USART_TXDATA_OFFSET, (uint32_t)ch); } @@ -1148,7 +1148,7 @@ static void efm32_send(struct uart_dev_s *dev, int ch) static void efm32_txint(struct uart_dev_s *dev, bool enable) { - struct efm32_usart_s *priv = (struct efm32_usart_s*)dev->priv; + struct efm32_usart_s *priv = (struct efm32_usart_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -1188,7 +1188,7 @@ static void efm32_txint(struct uart_dev_s *dev, bool enable) static bool efm32_txready(struct uart_dev_s *dev) { - struct efm32_usart_s *priv = (struct efm32_usart_s*)dev->priv; + struct efm32_usart_s *priv = (struct efm32_usart_s *)dev->priv; /* The TX Buffer Level (TXBL) status bit indicates the level of the * transmit buffer. If TXBIL is set, TXBL is set whenever the transmit @@ -1208,7 +1208,7 @@ static bool efm32_txready(struct uart_dev_s *dev) static bool efm32_txempty(struct uart_dev_s *dev) { - struct efm32_usart_s *priv = (struct efm32_usart_s*)dev->priv; + struct efm32_usart_s *priv = (struct efm32_usart_s *)dev->priv; /* TX Complete (TXC) is set when a transmission has completed and no more * data is available in the transmit buffer. @@ -1309,7 +1309,7 @@ void up_serialinit(void) int up_putc(int ch) { #ifdef HAVE_UART_CONSOLE - struct efm32_usart_s *priv = (struct efm32_usart_s*)CONSOLE_DEV.priv; + struct efm32_usart_s *priv = (struct efm32_usart_s *)CONSOLE_DEV.priv; uint32_t ien; efm32_disableuartint(priv, &ien); diff --git a/arch/arm/src/efm32/efm32_spi.c b/arch/arm/src/efm32/efm32_spi.c index a042517e59..f6396bffee 100644 --- a/arch/arm/src/efm32/efm32_spi.c +++ b/arch/arm/src/efm32/efm32_spi.c @@ -1288,8 +1288,8 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, { /* 16-bit mode */ - const uint16_t *src = (const uint16_t*)txbuffer;; - uint16_t *dest = (uint16_t*)rxbuffer; + const uint16_t *src = (const uint16_t *)txbuffer;; + uint16_t *dest = (uint16_t *)rxbuffer; uint16_t word; unrecvd = nwords; @@ -1342,8 +1342,8 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, { /* 8-bit mode */ - const uint8_t *src = (const uint8_t*)txbuffer;; - uint8_t *dest = (uint8_t*)rxbuffer; + const uint8_t *src = (const uint8_t *)txbuffer;; + uint8_t *dest = (uint8_t *)rxbuffer; uint8_t word; unrecvd = nwords; diff --git a/arch/arm/src/efm32/efm32_timer.c b/arch/arm/src/efm32/efm32_timer.c index d8047521ab..b00adb35a2 100644 --- a/arch/arm/src/efm32/efm32_timer.c +++ b/arch/arm/src/efm32/efm32_timer.c @@ -200,7 +200,7 @@ void efm32_timer_reset(uintptr_t base) //putreg32(_TIMER_ROUTE_RESETVALUE, base + EFM32_TIMER_ROUTE_OFFSET ); - for(i = 0; i < EFM32_TIMER_NCC; i++) + for (i = 0; i < EFM32_TIMER_NCC; i++) { uintptr_t base_cc = base + EFM32_TIMER_CC_OFFSET(i); putreg32(_TIMER_CC_CTRL_RESETVALUE, base_cc+EFM32_TIMER_CC_CTRL_OFFSET); @@ -247,8 +247,8 @@ int efm32_timer_set_freq(uintptr_t base, uint32_t clk_freq, uint32_t freq) while (cnt_freq > freq) { prescaler++; - cnt_freq>>=1; - if (prescaler > (_TIMER_CTRL_PRESC_MASK>>_TIMER_CTRL_PRESC_SHIFT)) + cnt_freq >>= 1; + if (prescaler > (_TIMER_CTRL_PRESC_MASK >> _TIMER_CTRL_PRESC_SHIFT)) { return -1; } @@ -256,18 +256,14 @@ int efm32_timer_set_freq(uintptr_t base, uint32_t clk_freq, uint32_t freq) modifyreg32(base + EFM32_TIMER_CTRL_OFFSET, _TIMER_CTRL_PRESC_MASK, - prescaler<<_TIMER_CTRL_PRESC_SHIFT - ); + prescaler << _TIMER_CTRL_PRESC_SHIFT); - prescaler = 1< 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ @@ -1231,12 +1231,12 @@ static void efm32_epin_request(FAR struct efm32_usbdev_s *priv, if (privreq->req.len == 0) { - /* The ZLP flag is set TRUE whenever we want to force the driver to - * send a zero-length-packet on the next pass through the loop (below). - * The flag is cleared whenever a packet is sent in the loop below. - */ + /* The ZLP flag is set TRUE whenever we want to force the driver to + * send a zero-length-packet on the next pass through the loop (below). + * The flag is cleared whenever a packet is sent in the loop below. + */ - privep->zlp = true; + privep->zlp = true; } /* Add one more packet to the TxFIFO. We will wait for the transfer @@ -3213,7 +3213,7 @@ static inline void efm32_rxinterrupt(FAR struct efm32_usbdev_s *priv) * last SETUP packet will be processed. */ - efm32_rxfifo_read(&priv->epout[EP0], (FAR uint8_t*)&priv->ctrlreq, + efm32_rxfifo_read(&priv->epout[EP0], (FAR uint8_t *)&priv->ctrlreq, USB_SIZEOF_CTRLREQ); /* Was this an IN or an OUT SETUP packet. If it is an OUT SETUP, diff --git a/arch/arm/src/efm32/efm32_usbhost.c b/arch/arm/src/efm32/efm32_usbhost.c index 17ac5ea423..b9cc9e6af8 100644 --- a/arch/arm/src/efm32/efm32_usbhost.c +++ b/arch/arm/src/efm32/efm32_usbhost.c @@ -2952,9 +2952,9 @@ static void efm32_gint_disconnected(FAR struct efm32_usbhost_s *priv) priv->rhport.hport.speed = USB_SPEED_FULL; - /* Notify any waiters that there is a change in the connection state */ + /* Notify any waiters that there is a change in the connection state */ - if (priv->pscwait) + if (priv->pscwait) { efm32_givesem(&priv->pscsem); priv->pscwait = false; @@ -4400,7 +4400,7 @@ static int efm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, ret = efm32_ctrl_sendsetup(priv, ep0info, req); if (ret < 0) - { + { usbhost_trace1(USBHOST_TRACE1_SENDSETUP, -ret); continue; } From d0d62668e70314fbf60e523d7569cd726438d2b1 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 6 Oct 2015 18:32:16 -0600 Subject: [PATCH 24/33] Make some spacing comply better with coding standard --- arch/arm/src/c5471/c5471_ethernet.c | 7 +- arch/arm/src/dm320/dm320_framebuffer.c | 20 ++-- arch/arm/src/efm32/efm32_usbdev.c | 2 +- arch/arm/src/imx/imx_allocateheap.c | 6 +- arch/arm/src/imx/imx_boot.c | 8 +- arch/arm/src/imx/imx_decodeirq.c | 4 +- arch/arm/src/imx/imx_serial.c | 101 ++++++++++---------- arch/arm/src/imx/imx_spi.c | 34 +++---- arch/arm/src/kinetis/kinetis_allocateheap.c | 6 +- arch/arm/src/kinetis/kinetis_enet.c | 20 ++-- arch/arm/src/kinetis/kinetis_irq.c | 6 +- arch/arm/src/kinetis/kinetis_lowputc.c | 6 +- arch/arm/src/kinetis/kinetis_sdhc.c | 76 ++++++++------- arch/arm/src/kinetis/kinetis_serial.c | 30 +++--- arch/arm/src/kinetis/kinetis_userspace.c | 10 +- arch/arm/src/kl/kl_irq.c | 2 +- arch/arm/src/kl/kl_lowputc.c | 2 +- arch/arm/src/kl/kl_serial.c | 26 ++--- arch/arm/src/kl/kl_spi.c | 4 +- arch/arm/src/kl/kl_userspace.c | 10 +- 20 files changed, 191 insertions(+), 189 deletions(-) diff --git a/arch/arm/src/c5471/c5471_ethernet.c b/arch/arm/src/c5471/c5471_ethernet.c index 9a8f7b0622..6391ec857f 100644 --- a/arch/arm/src/c5471/c5471_ethernet.c +++ b/arch/arm/src/c5471/c5471_ethernet.c @@ -2002,7 +2002,7 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) putreg32(0, pbuf); pbuf += sizeof(uint32_t); /* Ether Module's "Buffer Usage Word" */ - } + } /* TX CPU */ @@ -2032,7 +2032,7 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) putreg32(0, pbuf); pbuf += sizeof(uint32_t); /* Ether Module's "Buffer Usage Word" */ - } + } /* RX CPU */ @@ -2062,7 +2062,8 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) putreg32(0, pbuf); pbuf += sizeof(uint32_t); /* Ether Module's "Buffer Usage Word" */ - } + } + ndbg("END desc: %08x pbuf: %08x\n", desc, pbuf); /* Save the descriptor packet size */ diff --git a/arch/arm/src/dm320/dm320_framebuffer.c b/arch/arm/src/dm320/dm320_framebuffer.c index 19dd0ef114..8c08138fd8 100644 --- a/arch/arm/src/dm320/dm320_framebuffer.c +++ b/arch/arm/src/dm320/dm320_framebuffer.c @@ -1308,26 +1308,26 @@ static int dm320_setcursor(FAR struct fb_vtable_s *vtable, FAR struct fb_setcurs putreg16(settings->pos.x, DM320_OSD_CURXP); putreg16(settings->pos.y, DM320_OSD_CURYP); - } + } #ifdef CONFIG_FB_HWCURSORSIZE if ((settings->flags & FB_CUR_SETSIZE) != 0) { gvdbg("h=%d w=%d\n", settings->size.h, settings->size.w); - if (settings->size.w > MAX_YRES) - { + if (settings->size.w > MAX_YRES) + { settings->size.w = MAX_YRES; - } + } - if (settings->size.h > MAX_YRES) - { + if (settings->size.h > MAX_YRES) + { settings->size.h = MAX_YRES; - } + } - putreg16(settings->size.w, DM320_OSD_CURXL); - putreg16(settings->size.h, DM320_OSD_CURYL); - } + putreg16(settings->size.w, DM320_OSD_CURXL); + putreg16(settings->size.h, DM320_OSD_CURYL); + } #endif regval = getreg16(DM320_OSD_RECTCUR); diff --git a/arch/arm/src/efm32/efm32_usbdev.c b/arch/arm/src/efm32/efm32_usbdev.c index dadabd14cf..3d34ec7029 100644 --- a/arch/arm/src/efm32/efm32_usbdev.c +++ b/arch/arm/src/efm32/efm32_usbdev.c @@ -5189,7 +5189,7 @@ static void efm32_hwinitialize(FAR struct efm32_usbdev_s *priv) /* First Turn on USB clocking */ modifyreg32(EFM32_CMU_HFCORECLKEN0,0, - CMU_HFCORECLKEN0_USB|CMU_HFCORECLKEN0_USBC); + CMU_HFCORECLKEN0_USB | CMU_HFCORECLKEN0_USBC); /* At start-up the core is in FS mode. */ diff --git a/arch/arm/src/imx/imx_allocateheap.c b/arch/arm/src/imx/imx_allocateheap.c index eb5e8400ed..2447d6a2b2 100644 --- a/arch/arm/src/imx/imx_allocateheap.c +++ b/arch/arm/src/imx/imx_allocateheap.c @@ -86,7 +86,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) { board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)g_idle_topstack; + *heap_start = (FAR void *)g_idle_topstack; *heap_size = (IMX_SDRAM_VSECTION + CONFIG_RAM_SIZE) - g_idle_topstack; } @@ -110,14 +110,14 @@ void up_addregion(void) # if (CONFIG_RAM_NUTTXENTRY & 0xffff0000) != CONFIG_RAM_VSTART uint32_t start = CONFIG_RAM_VSTART + 0x1000; uint32_t end = (CONFIG_RAM_NUTTXENTRY & 0xffff0000); - kmm_addregion((FAR void*)start, end - start); + kmm_addregion((FAR void *)start, end - start); # endif #endif /* Check for any additional memory regions */ #if defined(CONFIG_HEAP2_BASE) && defined(CONFIG_HEAP2_SIZE) - kmm_addregion((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE); + kmm_addregion((FAR void *)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE); #endif } #endif diff --git a/arch/arm/src/imx/imx_boot.c b/arch/arm/src/imx/imx_boot.c index 4a26434637..44d8bf7b05 100644 --- a/arch/arm/src/imx/imx_boot.c +++ b/arch/arm/src/imx/imx_boot.c @@ -118,7 +118,7 @@ extern void imx_boardinitialize(void); static inline void up_setlevel1entry(uint32_t paddr, uint32_t vaddr, uint32_t mmuflags) { - uint32_t *pgtable = (uint32_t*)PGTABLE_BASE_VADDR; + uint32_t *pgtable = (uint32_t *)PGTABLE_BASE_VADDR; uint32_t index = vaddr >> 20; /* Save the page table entry */ @@ -180,9 +180,9 @@ static void up_copyvectorblock(void) */ #if !defined(CONFIG_BOOT_RUNFROMFLASH) && !defined(CONFIG_BOOT_COPYTORAM) - uint32_t *src = (uint32_t*)&_vector_start; - uint32_t *end = (uint32_t*)&_vector_end; - uint32_t *dest = (uint32_t*)VECTOR_BASE; + uint32_t *src = (uint32_t *)&_vector_start; + uint32_t *end = (uint32_t *)&_vector_end; + uint32_t *dest = (uint32_t *)VECTOR_BASE; while (src < end) { diff --git a/arch/arm/src/imx/imx_decodeirq.c b/arch/arm/src/imx/imx_decodeirq.c index 9619792b6c..9a8223545e 100644 --- a/arch/arm/src/imx/imx_decodeirq.c +++ b/arch/arm/src/imx/imx_decodeirq.c @@ -71,7 +71,7 @@ * Public Functions ********************************************************************************/ -void up_decodeirq(uint32_t* regs) +void up_decodeirq(uint32_t *regs) { #ifdef CONFIG_SUPPRESS_INTERRUPTS lowsyslog(LOG_ERR, "Unexpected IRQ\n"); @@ -127,7 +127,7 @@ void up_decodeirq(uint32_t* regs) #ifdef CONFIG_ARCH_FPU /* Restore floating point registers */ - up_restorefpu((uint32_t*)current_regs); + up_restorefpu((uint32_t *)current_regs); #endif #ifdef CONFIG_ARCH_ADDRENV diff --git a/arch/arm/src/imx/imx_serial.c b/arch/arm/src/imx/imx_serial.c index f17321acf3..4e6775fc15 100644 --- a/arch/arm/src/imx/imx_serial.c +++ b/arch/arm/src/imx/imx_serial.c @@ -456,7 +456,7 @@ static inline void up_waittxready(struct up_dev_s *priv) static int up_setup(struct uart_dev_s *dev) { #ifndef CONFIG_SUPPRESS_UART_CONFIG - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t regval; uint32_t ucr2; uint32_t div; @@ -663,7 +663,7 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Disable the UART */ @@ -690,7 +690,7 @@ static void up_shutdown(struct uart_dev_s *dev) static int up_attach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ */ @@ -718,11 +718,11 @@ static int up_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, up_interrupt); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the UART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the UART + */ - up_enable_irq(priv->irq); + up_enable_irq(priv->irq); } #endif return ret; @@ -740,7 +740,7 @@ static int up_attach(struct uart_dev_s *dev) static void up_detach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; #if defined(CONFIG_ARCH_CHIP_IMX1) || defined(CONFIG_ARCH_CHIP_IMXL) up_disable_irq(priv->rxirq); @@ -828,7 +828,7 @@ static int up_interrupt(int irq, void *context) int passes = 0; dev = up_mapirq(irq); - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; /* Loop until there are no characters to be transferred or, * until we have been looping for a long time. @@ -892,7 +892,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct up_dev_s *user = (struct up_dev_s*)arg; + struct up_dev_s *user = (struct up_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -927,7 +927,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) static int up_receive(struct uart_dev_s *dev, uint32_t *status) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t rxd0; rxd0 = up_serialin(priv, UART_RXD0); @@ -945,7 +945,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Enable interrupts for data availab at Rx FIFO */ @@ -972,7 +972,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) static bool up_rxavailable(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Return true is data is ready in the Rx FIFO */ @@ -989,7 +989,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_serialout(priv, UART_TXD0, (uint32_t)ch); } @@ -1003,7 +1003,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* We won't take an interrupt until the FIFO is completely empty (although * there may still be a transmission in progress). @@ -1032,7 +1032,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) static bool up_txready(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* When TXFULL is set, there is no space in the Tx FIFO */ @@ -1049,7 +1049,7 @@ static bool up_txready(struct uart_dev_s *dev) static bool up_txempty(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* When TXDC is set, the FIFO is empty and the transmission is complete */ @@ -1072,50 +1072,50 @@ static bool up_txempty(struct uart_dev_s *dev) void up_earlyserialinit(void) { - /* Configure and disable the UART1 */ + /* Configure and disable the UART1 */ #ifdef CONFIG_IMX_UART1 - up_serialout(&g_uart1priv, UART_UCR1, 0); - up_serialout(&g_uart1priv, UART_UCR2, 0); + up_serialout(&g_uart1priv, UART_UCR1, 0); + up_serialout(&g_uart1priv, UART_UCR2, 0); - /* Configure UART1 pins: RXD, TXD, RTS, and CTS */ + /* Configure UART1 pins: RXD, TXD, RTS, and CTS */ - imxgpio_configpfoutput(GPIOC, 9); /* Port C, pin 9: CTS */ - imxgpio_configpfinput(GPIOC, 10); /* Port C, pin 10: RTS */ - imxgpio_configpfoutput(GPIOC, 11); /* Port C, pin 11: TXD */ - imxgpio_configpfinput(GPIOC, 12); /* Port C, pin 12: RXD */ + imxgpio_configpfoutput(GPIOC, 9); /* Port C, pin 9: CTS */ + imxgpio_configpfinput(GPIOC, 10); /* Port C, pin 10: RTS */ + imxgpio_configpfoutput(GPIOC, 11); /* Port C, pin 11: TXD */ + imxgpio_configpfinput(GPIOC, 12); /* Port C, pin 12: RXD */ #endif - /* Configure and disable the UART2 */ + /* Configure and disable the UART2 */ #ifdef CONFIG_IMX_UART2 - up_serialout(&g_uart2priv, UART_UCR1, 0); - up_serialout(&g_uart2priv, UART_UCR2, 0); + up_serialout(&g_uart2priv, UART_UCR1, 0); + up_serialout(&g_uart2priv, UART_UCR2, 0); - /* Configure UART2 pins: RXD, TXD, RTS, and CTS (only, also - * supports DTR, DCD, RI, and DSR -- not configured) - */ + /* Configure UART2 pins: RXD, TXD, RTS, and CTS (only, also + * supports DTR, DCD, RI, and DSR -- not configured) + */ - imxgpio_configpfoutput(GPIOB, 28); /* Port B, pin 28: CTS */ - imxgpio_configpfinput(GPIOB, 29); /* Port B, pin 29: RTS */ - imxgpio_configpfoutput(GPIOB, 30); /* Port B, pin 30: TXD */ - imxgpio_configpfinput(GPIOB, 31); /* Port B, pin 31: RXD */ + imxgpio_configpfoutput(GPIOB, 28); /* Port B, pin 28: CTS */ + imxgpio_configpfinput(GPIOB, 29); /* Port B, pin 29: RTS */ + imxgpio_configpfoutput(GPIOB, 30); /* Port B, pin 30: TXD */ + imxgpio_configpfinput(GPIOB, 31); /* Port B, pin 31: RXD */ #endif - /* Configure and disable the UART3 */ + /* Configure and disable the UART3 */ #ifdef CONFIG_IMX_UART3 - up_serialout(&g_uart3priv, UART_UCR1, 0); - up_serialout(&g_uart3priv, UART_UCR2, 0); + up_serialout(&g_uart3priv, UART_UCR1, 0); + up_serialout(&g_uart3priv, UART_UCR2, 0); - /* Configure UART2 pins: RXD, TXD, RTS, and CTS (only, also - * supports DTR, DCD, RI, and DSR -- not configured) - */ + /* Configure UART2 pins: RXD, TXD, RTS, and CTS (only, also + * supports DTR, DCD, RI, and DSR -- not configured) + */ - imxgpio_configpfoutput(GPIOC, 28); /* Port C, pin 18: CTS */ - imxgpio_configpfinput(GPIOC, 29); /* Port C, pin 29: RTS */ - imxgpio_configpfoutput(GPIOC, 30); /* Port C, pin 30: TXD */ - imxgpio_configpfinput(GPIOC, 31); /* Port C, pin 31: RXD */ + imxgpio_configpfoutput(GPIOC, 28); /* Port C, pin 18: CTS */ + imxgpio_configpfinput(GPIOC, 29); /* Port C, pin 29: RTS */ + imxgpio_configpfoutput(GPIOC, 30); /* Port C, pin 30: TXD */ + imxgpio_configpfinput(GPIOC, 31); /* Port C, pin 31: RXD */ #endif /* Then enable the console UART. The others will be initialized @@ -1165,7 +1165,7 @@ void up_serialinit(void) int up_putc(int ch) { - struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; + struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; uint32_t ier; up_disableuartint(priv, &ier); @@ -1211,12 +1211,11 @@ static inline void up_waittxready(void) for (tmp = 1000 ; tmp > 0 ; tmp--) { + /* Loop until TXFULL is zero -- meaning that there is space available + * in the TX FIFO. + */ - /* Loop until TXFULL is zero -- meaning that there is space available - * in the TX FIFO. - */ - - if ((getreg32(IMX_REGISTER_BASE + UART_UTS) & UART_UTS_TXFULL) == 0) + if ((getreg32(IMX_REGISTER_BASE + UART_UTS) & UART_UTS_TXFULL) == 0) { break; } diff --git a/arch/arm/src/imx/imx_spi.c b/arch/arm/src/imx/imx_spi.c index ca65011796..a43df8c784 100644 --- a/arch/arm/src/imx/imx_spi.c +++ b/arch/arm/src/imx/imx_spi.c @@ -306,16 +306,16 @@ static void spi_txnull(struct imx_spidev_s *priv) static void spi_txuint16(struct imx_spidev_s *priv) { - uint16_t *ptr = (uint16_t*)priv->txbuffer; + uint16_t *ptr = (uint16_t *)priv->txbuffer; spi_putreg(priv, CSPI_TXD_OFFSET, *ptr++); - priv->txbuffer = (void*)ptr; + priv->txbuffer = (void *)ptr; } static void spi_txuint8(struct imx_spidev_s *priv) { - uint8_t *ptr = (uint8_t*)priv->txbuffer; + uint8_t *ptr = (uint8_t *)priv->txbuffer; spi_putreg(priv, CSPI_TXD_OFFSET, *ptr++); - priv->txbuffer = (void*)ptr; + priv->txbuffer = (void *)ptr; } /**************************************************************************** @@ -342,16 +342,16 @@ static void spi_rxnull(struct imx_spidev_s *priv) static void spi_rxuint16(struct imx_spidev_s *priv) { - uint16_t *ptr = (uint16_t*)priv->rxbuffer; + uint16_t *ptr = (uint16_t *)priv->rxbuffer; *ptr++ = (uint16_t)spi_getreg(priv, CSPI_TXD_OFFSET); - priv->rxbuffer = (void*)ptr; + priv->rxbuffer = (void *)ptr; } static void spi_rxuint8(struct imx_spidev_s *priv) { - uint8_t *ptr = (uint8_t*)priv->rxbuffer; + uint8_t *ptr = (uint8_t *)priv->rxbuffer; *ptr++ = (uint8_t)spi_getreg(priv, CSPI_TXD_OFFSET); - priv->rxbuffer = (void*)ptr; + priv->rxbuffer = (void *)ptr; } /**************************************************************************** @@ -507,18 +507,18 @@ static int spi_transfer(struct imx_spidev_s *priv, const void *txbuffer, /* Set up to perform the transfer */ - priv->txbuffer = (uint8_t*)txbuffer; /* Source buffer */ - priv->rxbuffer = (uint8_t*)rxbuffer; /* Destination buffer */ - priv->ntxwords = nwords; /* Number of words left to send */ - priv->nrxwords = 0; /* Number of words received */ - priv->nwords = nwords; /* Total number of exchanges */ + priv->txbuffer = (uint8_t *)txbuffer; /* Source buffer */ + priv->rxbuffer = (uint8_t *)rxbuffer; /* Destination buffer */ + priv->ntxwords = nwords; /* Number of words left to send */ + priv->nrxwords = 0; /* Number of words received */ + priv->nwords = nwords; /* Total number of exchanges */ /* Set up the low-level data transfer function pointers */ if (priv->nbits > 8) { priv->txword = spi_txuint16; - priv->rxword =spi_rxuint16; + priv->rxword = spi_rxuint16; } else { @@ -833,7 +833,7 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) break; case SPIDEV_MODE3: /* CPOL=1 CHPHA=1 */ - modebits = CSPI_CTRL_PHA|CSPI_CTRL_POL; + modebits = CSPI_CTRL_PHA | CSPI_CTRL_POL; break; default: @@ -843,7 +843,7 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) /* Then set the selected mode */ regval = spi_getreg(priv, CSPI_CTRL_OFFSET); - regval &= ~(CSPI_CTRL_PHA|CSPI_CTRL_POL); + regval &= ~(CSPI_CTRL_PHA | CSPI_CTRL_POL); regval |= modebits; spi_putreg(priv, CSPI_CTRL_OFFSET, regval); } @@ -895,7 +895,7 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits) static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) { - struct imx_spidev_s *priv = (struct imx_spidev_s*)dev; + struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; uint16_t response = 0; (void)spi_transfer(priv, &wd, &response, 1); diff --git a/arch/arm/src/kinetis/kinetis_allocateheap.c b/arch/arm/src/kinetis/kinetis_allocateheap.c index 258b1a16a5..ac96b2d455 100644 --- a/arch/arm/src/kinetis/kinetis_allocateheap.c +++ b/arch/arm/src/kinetis/kinetis_allocateheap.c @@ -132,7 +132,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) /* Return the user-space heap settings */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)ubase; + *heap_start = (FAR void *)ubase; *heap_size = usize; /* Allow user-mode access to the user heap memory */ @@ -143,7 +143,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) /* Return the heap settings */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)g_idle_topstack; + *heap_start = (FAR void *)g_idle_topstack; *heap_size = CONFIG_RAM_END - g_idle_topstack; #endif } @@ -187,7 +187,7 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size) * that was not dedicated to the user heap). */ - *heap_start = (FAR void*)USERSPACE->us_bssend; + *heap_start = (FAR void *)USERSPACE->us_bssend; *heap_size = ubase - (uintptr_t)USERSPACE->us_bssend; } #endif diff --git a/arch/arm/src/kinetis/kinetis_enet.c b/arch/arm/src/kinetis/kinetis_enet.c index 80636a35f1..9359681580 100644 --- a/arch/arm/src/kinetis/kinetis_enet.c +++ b/arch/arm/src/kinetis/kinetis_enet.c @@ -523,7 +523,7 @@ static void kinetis_receive(FAR struct kinetis_driver_s *priv) */ priv->dev.d_len = kinesis_swap16(priv->rxdesc[priv->rxtail].length); - priv->dev.d_buf = (uint8_t*)kinesis_swap32((uint32_t)priv->rxdesc[priv->rxtail].data); + priv->dev.d_buf = (uint8_t *)kinesis_swap32((uint32_t)priv->rxdesc[priv->rxtail].data); /* Doing this here could cause corruption! */ @@ -1060,13 +1060,13 @@ static int kinetis_txavail(struct net_driver_s *dev) * packet. */ - if (!kinetics_txringfull(priv)) - { - /* No, there is space for another transfer. Poll uIP for new - * XMIT data. - */ + if (!kinetics_txringfull(priv)) + { + /* No, there is space for another transfer. Poll uIP for new + * XMIT data. + */ - (void)devif_poll(&priv->dev, kinetis_txpoll); + (void)devif_poll(&priv->dev, kinetis_txpoll); } } @@ -1417,7 +1417,7 @@ static void kinetis_initbuffers(struct kinetis_driver_s *priv) { priv->txdesc[i].status1 = 0; priv->txdesc[i].length = 0; - priv->txdesc[i].data = (uint8_t*)kinesis_swap32((uint32_t)addr); + priv->txdesc[i].data = (uint8_t *)kinesis_swap32((uint32_t)addr); #ifdef CONFIG_ENET_ENHANCEDBD priv->txdesc[i].status2 = TXDESC_IINS | TXDESC_PINS; #endif @@ -1430,7 +1430,7 @@ static void kinetis_initbuffers(struct kinetis_driver_s *priv) { priv->rxdesc[i].status1 = RXDESC_E; priv->rxdesc[i].length = 0; - priv->rxdesc[i].data = (uint8_t*)kinesis_swap32((uint32_t)addr); + priv->rxdesc[i].data = (uint8_t *)kinesis_swap32((uint32_t)addr); #ifdef CONFIG_ENET_ENHANCEDBD priv->rxdesc[i].bdu = 0; priv->rxdesc[i].status2 = RXDESC_INT; @@ -1619,7 +1619,7 @@ int kinetis_netinitialize(int intf) priv->dev.d_addmac = kinetis_addmac; /* Add multicast MAC address */ priv->dev.d_rmmac = kinetis_rmmac; /* Remove multicast MAC address */ #endif - priv->dev.d_private = (void*)g_enet; /* Used to recover private state from dev */ + priv->dev.d_private = (void *)g_enet; /* Used to recover private state from dev */ /* Create a watchdog for timing polling for and timing of transmisstions */ diff --git a/arch/arm/src/kinetis/kinetis_irq.c b/arch/arm/src/kinetis/kinetis_irq.c index 368a5ecc74..b70a689f4a 100644 --- a/arch/arm/src/kinetis/kinetis_irq.c +++ b/arch/arm/src/kinetis/kinetis_irq.c @@ -59,9 +59,9 @@ /* Get a 32-bit version of the default priority */ #define DEFPRIORITY32 \ - (NVIC_SYSH_PRIORITY_DEFAULT << 24 |\ - NVIC_SYSH_PRIORITY_DEFAULT << 16 |\ - NVIC_SYSH_PRIORITY_DEFAULT << 8 |\ + (NVIC_SYSH_PRIORITY_DEFAULT << 24 | \ + NVIC_SYSH_PRIORITY_DEFAULT << 16 | \ + NVIC_SYSH_PRIORITY_DEFAULT << 8 | \ NVIC_SYSH_PRIORITY_DEFAULT) /* Given the address of a NVIC ENABLE register, this is the offset to diff --git a/arch/arm/src/kinetis/kinetis_lowputc.c b/arch/arm/src/kinetis/kinetis_lowputc.c index c01ceec5b9..03f9b901f4 100644 --- a/arch/arm/src/kinetis/kinetis_lowputc.c +++ b/arch/arm/src/kinetis/kinetis_lowputc.c @@ -284,7 +284,7 @@ void kinetis_uartreset(uintptr_t uart_base) /* Just disable the transmitter and receiver */ regval = getreg8(uart_base+KINETIS_UART_C2_OFFSET); - regval &= ~(UART_C2_RE|UART_C2_TE); + regval &= ~(UART_C2_RE | UART_C2_TE); putreg8(regval, uart_base+KINETIS_UART_C2_OFFSET); } #endif @@ -313,7 +313,7 @@ void kinetis_uartconfigure(uintptr_t uart_base, uint32_t baud, /* Disable the transmitter and receiver throughout the reconfiguration */ regval = getreg8(uart_base+KINETIS_UART_C2_OFFSET); - regval &= ~(UART_C2_RE|UART_C2_TE); + regval &= ~(UART_C2_RE | UART_C2_TE); putreg8(regval, uart_base+KINETIS_UART_C2_OFFSET); /* Configure number of bits, stop bits and parity */ @@ -324,7 +324,7 @@ void kinetis_uartconfigure(uintptr_t uart_base, uint32_t baud, if (parity == 1) { - regval |= (UART_C1_PE|UART_C1_PT); /* Enable + odd parity type */ + regval |= (UART_C1_PE | UART_C1_PT); /* Enable + odd parity type */ } /* Check for even parity */ diff --git a/arch/arm/src/kinetis/kinetis_sdhc.c b/arch/arm/src/kinetis/kinetis_sdhc.c index 93529f8e6b..e97863ae5c 100644 --- a/arch/arm/src/kinetis/kinetis_sdhc.c +++ b/arch/arm/src/kinetis/kinetis_sdhc.c @@ -903,7 +903,7 @@ static void kinetis_receive(struct kinetis_dev_s *priv) { /* Transfer any trailing fractional word */ - uint8_t *ptr = (uint8_t*)priv->buffer; + uint8_t *ptr = (uint8_t *)priv->buffer; int i; for (i = 0; i < priv->remaining; i++) @@ -1134,10 +1134,10 @@ static int kinetis_interrupt(int irq, void *context) kinetis_receive(priv); } - /* Otherwise, Is the TX buffer write ready? If so we must - * be processing a non-DMA send transaction. NOTE: We can't be - * processing both! - */ + /* Otherwise, Is the TX buffer write ready? If so we must + * be processing a non-DMA send transaction. NOTE: We can't be + * processing both! + */ else if ((pending & SDHC_INT_BWR) != 0) { @@ -1163,7 +1163,7 @@ static int kinetis_interrupt(int irq, void *context) /* Terminate the transfer with an error */ flldbg("ERROR: Data block CRC failure, remaining: %d\n", priv->remaining); - kinetis_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_ERROR); + kinetis_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_ERROR); } /* Handle data timeout error */ @@ -1173,7 +1173,7 @@ static int kinetis_interrupt(int irq, void *context) /* Terminate the transfer with an error */ flldbg("ERROR: Data timeout, remaining: %d\n", priv->remaining); - kinetis_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_TIMEOUT); + kinetis_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_TIMEOUT); } } @@ -1188,7 +1188,7 @@ static int kinetis_interrupt(int irq, void *context) { /* Yes.. Is their a thread waiting for response done? */ - if ((priv->waitevents & (SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE)) != 0) + if ((priv->waitevents & (SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE)) != 0) { /* Yes.. mask further interrupts and wake the thread up */ @@ -1463,7 +1463,7 @@ static void kinetis_frequency(FAR struct sdio_dev_s *dev, uint32_t frequency) prescaler = 128; } else /* if (frequency >= (BOARD_CORECLK_FREQ / 256) && - frequency <= (BOARD_CORECLK_FREQ / 256 / 16)) */ + * frequency <= (BOARD_CORECLK_FREQ / 256 / 16)) */ { sdclkfs = SDHC_SYSCTL_SDCLKFS_DIV256; prescaler = 256; @@ -1499,9 +1499,9 @@ static void kinetis_frequency(FAR struct sdio_dev_s *dev, uint32_t frequency) */ regval = getreg32(KINETIS_SDHC_SYSCTL); - regval &= ~(SDHC_SYSCTL_SDCLKFS_MASK|SDHC_SYSCTL_DVS_MASK); + regval &= ~(SDHC_SYSCTL_SDCLKFS_MASK | SDHC_SYSCTL_DVS_MASK); regval |= (sdclkfs | SDHC_SYSCTL_DVS_DIV(divisor)); - regval |= (SDHC_SYSCTL_SDCLKEN|SDHC_SYSCTL_PEREN|SDHC_SYSCTL_HCKEN| + regval |= (SDHC_SYSCTL_SDCLKEN | SDHC_SYSCTL_PEREN | SDHC_SYSCTL_HCKEN | SDHC_SYSCTL_IPGEN); putreg32(regval, KINETIS_SDHC_SYSCTL); fvdbg("SYSCTRL: %08x\n", getreg32(KINETIS_SDHC_SYSCTL)); @@ -1549,8 +1549,8 @@ static void kinetis_clock(FAR struct sdio_dev_s *dev, enum sdio_clock_e rate) * enables as well. */ - regval &= ~(SDHC_SYSCTL_IPGEN|SDHC_SYSCTL_HCKEN|SDHC_SYSCTL_PEREN| - SDHC_SYSCTL_SDCLKFS_MASK|SDHC_SYSCTL_DVS_MASK); + regval &= ~(SDHC_SYSCTL_IPGEN | SDHC_SYSCTL_HCKEN | SDHC_SYSCTL_PEREN | + SDHC_SYSCTL_SDCLKFS_MASK | SDHC_SYSCTL_DVS_MASK); putreg32(regval, KINETIS_SDHC_SYSCTL); fvdbg("SYSCTRL: %08x\n", getreg32(KINETIS_SDHC_SYSCTL)); return; @@ -1599,7 +1599,7 @@ static void kinetis_clock(FAR struct sdio_dev_s *dev, enum sdio_clock_e rate) * in. */ - regval &= ~(SDHC_SYSCTL_SDCLKFS_MASK|SDHC_SYSCTL_DVS_MASK); + regval &= ~(SDHC_SYSCTL_SDCLKFS_MASK | SDHC_SYSCTL_DVS_MASK); /* Select the new prescaler and divisor values based on the requested mode * and the settings from the board.h file. @@ -1617,37 +1617,37 @@ static void kinetis_clock(FAR struct sdio_dev_s *dev, enum sdio_clock_e rate) * enables as well. */ - regval &= ~(SDHC_SYSCTL_IPGEN|SDHC_SYSCTL_HCKEN|SDHC_SYSCTL_PEREN); + regval &= ~(SDHC_SYSCTL_IPGEN | SDHC_SYSCTL_HCKEN | SDHC_SYSCTL_PEREN); putreg32(regval, KINETIS_SDHC_SYSCTL); fvdbg("SYSCTRL: %08x\n", getreg32(KINETIS_SDHC_SYSCTL)); return; } case CLOCK_IDMODE : /* Initial ID mode clocking (<400KHz) */ - regval |= (BOARD_SDHC_IDMODE_PRESCALER|BOARD_SDHC_IDMODE_DIVISOR| - SDHC_SYSCTL_SDCLKEN|SDHC_SYSCTL_PEREN|SDHC_SYSCTL_HCKEN| + regval |= (BOARD_SDHC_IDMODE_PRESCALER | BOARD_SDHC_IDMODE_DIVISOR | + SDHC_SYSCTL_SDCLKEN | SDHC_SYSCTL_PEREN | SDHC_SYSCTL_HCKEN | SDHC_SYSCTL_IPGEN); break; case CLOCK_MMC_TRANSFER : /* MMC normal operation clocking */ - regval |= (BOARD_SDHC_MMCMODE_PRESCALER|BOARD_SDHC_MMCMODE_DIVISOR| - SDHC_SYSCTL_SDCLKEN|SDHC_SYSCTL_PEREN|SDHC_SYSCTL_HCKEN| + regval |= (BOARD_SDHC_MMCMODE_PRESCALER | BOARD_SDHC_MMCMODE_DIVISOR | + SDHC_SYSCTL_SDCLKEN | SDHC_SYSCTL_PEREN | SDHC_SYSCTL_HCKEN | SDHC_SYSCTL_IPGEN); break; case CLOCK_SD_TRANSFER_1BIT : /* SD normal operation clocking (narrow * 1-bit mode) */ #ifndef CONFIG_SDIO_WIDTH_D1_ONLY - regval |= (BOARD_SDHC_SD1MODE_PRESCALER|BOARD_SDHC_IDMODE_DIVISOR| - SDHC_SYSCTL_SDCLKEN|SDHC_SYSCTL_PEREN|SDHC_SYSCTL_HCKEN| + regval |= (BOARD_SDHC_SD1MODE_PRESCALER | BOARD_SDHC_IDMODE_DIVISOR | + SDHC_SYSCTL_SDCLKEN | SDHC_SYSCTL_PEREN | SDHC_SYSCTL_HCKEN | SDHC_SYSCTL_IPGEN); break; #endif case CLOCK_SD_TRANSFER_4BIT : /* SD normal operation clocking (wide * 4-bit mode) */ - regval |= (BOARD_SDHC_SD4MODE_PRESCALER|BOARD_SDHC_SD4MODE_DIVISOR| - SDHC_SYSCTL_SDCLKEN|SDHC_SYSCTL_PEREN|SDHC_SYSCTL_HCKEN| + regval |= (BOARD_SDHC_SD4MODE_PRESCALER | BOARD_SDHC_SD4MODE_DIVISOR | + SDHC_SYSCTL_SDCLKEN | SDHC_SYSCTL_PEREN | SDHC_SYSCTL_HCKEN | SDHC_SYSCTL_IPGEN); break; } @@ -1792,17 +1792,19 @@ static int kinetis_sendcmd(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t ar break; case MMCSD_R1B_RESPONSE: /* Response length 48, check busy & cmdindex */ - regval |= (SDHC_XFERTYP_RSPTYP_LEN48BSY|SDHC_XFERTYP_CICEN|SDHC_XFERTYP_CCCEN); + regval |= (SDHC_XFERTYP_RSPTYP_LEN48BSY | SDHC_XFERTYP_CICEN | + SDHC_XFERTYP_CCCEN); break; case MMCSD_R1_RESPONSE: /* Response length 48, check cmdindex */ case MMCSD_R5_RESPONSE: case MMCSD_R6_RESPONSE: - regval |= (SDHC_XFERTYP_RSPTYP_LEN48|SDHC_XFERTYP_CICEN|SDHC_XFERTYP_CCCEN); + regval |= (SDHC_XFERTYP_RSPTYP_LEN48 | SDHC_XFERTYP_CICEN | + SDHC_XFERTYP_CCCEN); break; case MMCSD_R2_RESPONSE: /* Response length 136, check CRC */ - regval |= (SDHC_XFERTYP_RSPTYP_LEN136|SDHC_XFERTYP_CCCEN); + regval |= (SDHC_XFERTYP_RSPTYP_LEN136 | SDHC_XFERTYP_CCCEN); break; case MMCSD_R3_RESPONSE: /* Response length 48 */ @@ -1894,7 +1896,7 @@ static int kinetis_recvsetup(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, /* Save the destination buffer information for use by the interrupt handler */ - priv->buffer = (uint32_t*)buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = nbytes; /* Then set up the SDIO data path */ @@ -1945,7 +1947,7 @@ static int kinetis_sendsetup(FAR struct sdio_dev_s *dev, FAR const uint8_t *buff /* Save the source buffer information for use by the interrupt handler */ - priv->buffer = (uint32_t*)buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = nbytes; /* Then set up the SDIO data path */ @@ -1979,7 +1981,7 @@ static int kinetis_sendsetup(FAR struct sdio_dev_s *dev, FAR const uint8_t *buff static int kinetis_cancel(FAR struct sdio_dev_s *dev) { - struct kinetis_dev_s *priv = (struct kinetis_dev_s*)dev; + struct kinetis_dev_s *priv = (struct kinetis_dev_s *)dev; #ifdef CONFIG_SDIO_DMA uint32_t regval; #endif @@ -2329,7 +2331,7 @@ static int kinetis_recvnotimpl(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_ static void kinetis_waitenable(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset) { - struct kinetis_dev_s *priv = (struct kinetis_dev_s*)dev; + struct kinetis_dev_s *priv = (struct kinetis_dev_s *)dev; uint32_t waitints; DEBUGASSERT(priv != NULL); @@ -2343,7 +2345,7 @@ static void kinetis_waitenable(FAR struct sdio_dev_s *dev, */ waitints = 0; - if ((eventset & (SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE)) != 0) + if ((eventset & (SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE)) != 0) { waitints |= SDHC_RESPDONE_INTS; } @@ -2382,7 +2384,7 @@ static void kinetis_waitenable(FAR struct sdio_dev_s *dev, static sdio_eventset_t kinetis_eventwait(FAR struct sdio_dev_s *dev, uint32_t timeout) { - struct kinetis_dev_s *priv = (struct kinetis_dev_s*)dev; + struct kinetis_dev_s *priv = (struct kinetis_dev_s *)dev; sdio_eventset_t wkupevent = 0; int ret; @@ -2482,7 +2484,7 @@ static sdio_eventset_t kinetis_eventwait(FAR struct sdio_dev_s *dev, static void kinetis_callbackenable(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset) { - struct kinetis_dev_s *priv = (struct kinetis_dev_s*)dev; + struct kinetis_dev_s *priv = (struct kinetis_dev_s *)dev; fvdbg("eventset: %02x\n", eventset); DEBUGASSERT(priv != NULL); @@ -2516,7 +2518,7 @@ static void kinetis_callbackenable(FAR struct sdio_dev_s *dev, static int kinetis_registercallback(FAR struct sdio_dev_s *dev, worker_t callback, void *arg) { - struct kinetis_dev_s *priv = (struct kinetis_dev_s*)dev; + struct kinetis_dev_s *priv = (struct kinetis_dev_s *)dev; /* Disable callbacks and register this callback and is argument */ @@ -2589,7 +2591,7 @@ static int kinetis_dmarecvsetup(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, /* Save the destination buffer information for use by the interrupt handler */ - priv->buffer = (uint32_t*)buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = buflen; /* Then set up the SDIO data path */ @@ -2647,7 +2649,7 @@ static int kinetis_dmasendsetup(FAR struct sdio_dev_s *dev, /* Save the source buffer information for use by the interrupt handler */ - priv->buffer = (uint32_t*)buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = buflen; /* Then set up the SDIO data path */ @@ -2687,7 +2689,7 @@ static int kinetis_dmasendsetup(FAR struct sdio_dev_s *dev, static void kinetis_callback(void *arg) { - struct kinetis_dev_s *priv = (struct kinetis_dev_s*)arg; + struct kinetis_dev_s *priv = (struct kinetis_dev_s *)arg; /* Is a callback registered? */ diff --git a/arch/arm/src/kinetis/kinetis_serial.c b/arch/arm/src/kinetis/kinetis_serial.c index ec0085a4e0..4c4778836d 100644 --- a/arch/arm/src/kinetis/kinetis_serial.c +++ b/arch/arm/src/kinetis/kinetis_serial.c @@ -610,7 +610,7 @@ static void up_disableuartint(struct up_dev_s *priv, uint8_t *ie) static int up_setup(struct uart_dev_s *dev) { #ifndef CONFIG_SUPPRESS_UART_CONFIG - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Configure the UART as an RS-232 UART */ @@ -645,7 +645,7 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Disable interrupts */ @@ -673,7 +673,7 @@ static void up_shutdown(struct uart_dev_s *dev) static int up_attach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ(s). The interrupts are (probably) still @@ -711,7 +711,7 @@ static int up_attach(struct uart_dev_s *dev) static void up_detach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Disable interrupts */ @@ -790,7 +790,7 @@ static int up_interrupte(int irq, void *context) { PANIC(); } - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; DEBUGASSERT(priv); /* Handle error interrupts. This interrupt may be caused by: @@ -879,7 +879,7 @@ static int up_interrupts(int irq, void *context) { PANIC(); } - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; DEBUGASSERT(priv); /* Loop until there are no characters to be transferred or, @@ -978,7 +978,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) dev = inode->i_private; DEBUGASSERT(dev, dev->priv); - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; switch (cmd) { @@ -1008,7 +1008,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) static int up_receive(struct uart_dev_s *dev, uint32_t *status) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint8_t s1; /* Get error status information: @@ -1047,7 +1047,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -1086,7 +1086,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) static bool up_rxavailable(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; #ifdef CONFIG_KINETIS_UARTFIFOS unsigned int count; @@ -1116,7 +1116,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_serialout(priv, KINETIS_UART_D_OFFSET, (uint8_t)ch); } @@ -1130,7 +1130,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -1170,7 +1170,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) static bool up_txready(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; #ifdef CONFIG_KINETIS_UARTFIFOS /* Read the number of bytes currently in the FIFO and compare that to the @@ -1202,7 +1202,7 @@ static bool up_txready(struct uart_dev_s *dev) #ifdef CONFIG_KINETIS_UARTFIFOS static bool up_txempty(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Return true if the transmit buffer/fifo is "empty." */ @@ -1305,7 +1305,7 @@ void up_serialinit(void) int up_putc(int ch) { #ifdef HAVE_SERIAL_CONSOLE - struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; + struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; uint8_t ie; up_disableuartint(priv, &ie); diff --git a/arch/arm/src/kinetis/kinetis_userspace.c b/arch/arm/src/kinetis/kinetis_userspace.c index 4fc37a0904..3e91953620 100644 --- a/arch/arm/src/kinetis/kinetis_userspace.c +++ b/arch/arm/src/kinetis/kinetis_userspace.c @@ -87,8 +87,8 @@ void kinetis_userspace(void) DEBUGASSERT(USERSPACE->us_bssstart != 0 && USERSPACE->us_bssend != 0 && USERSPACE->us_bssstart <= USERSPACE->us_bssend); - dest = (uint8_t*)USERSPACE->us_bssstart; - end = (uint8_t*)USERSPACE->us_bssend; + dest = (uint8_t *)USERSPACE->us_bssstart; + end = (uint8_t *)USERSPACE->us_bssend; while (dest != end) { @@ -101,9 +101,9 @@ void kinetis_userspace(void) USERSPACE->us_datastart != 0 && USERSPACE->us_dataend != 0 && USERSPACE->us_datastart <= USERSPACE->us_dataend); - src = (uint8_t*)USERSPACE->us_datasource; - dest = (uint8_t*)USERSPACE->us_datastart; - end = (uint8_t*)USERSPACE->us_dataend; + src = (uint8_t *)USERSPACE->us_datasource; + dest = (uint8_t *)USERSPACE->us_datastart; + end = (uint8_t *)USERSPACE->us_dataend; while (dest != end) { diff --git a/arch/arm/src/kl/kl_irq.c b/arch/arm/src/kl/kl_irq.c index 167ac9d9d5..783e6d1a72 100644 --- a/arch/arm/src/kl/kl_irq.c +++ b/arch/arm/src/kl/kl_irq.c @@ -59,7 +59,7 @@ /* Get a 32-bit version of the default priority */ #define DEFPRIORITY32 \ - (NVIC_SYSH_PRIORITY_DEFAULT << 24 | NVIC_SYSH_PRIORITY_DEFAULT << 16 |\ + (NVIC_SYSH_PRIORITY_DEFAULT << 24 | NVIC_SYSH_PRIORITY_DEFAULT << 16 | \ NVIC_SYSH_PRIORITY_DEFAULT << 8 | NVIC_SYSH_PRIORITY_DEFAULT) /**************************************************************************** diff --git a/arch/arm/src/kl/kl_lowputc.c b/arch/arm/src/kl/kl_lowputc.c index 4fbb884b9f..597b687a74 100644 --- a/arch/arm/src/kl/kl_lowputc.c +++ b/arch/arm/src/kl/kl_lowputc.c @@ -262,7 +262,7 @@ void kl_uartconfigure(uintptr_t uart_base, uint32_t baud, uint32_t clock, /* Disable the transmitter and receiver throughout the reconfiguration */ regval = getreg8(uart_base+KL_UART_C2_OFFSET); - regval &= ~(UART_C2_RE|UART_C2_TE); + regval &= ~(UART_C2_RE | UART_C2_TE); putreg8(regval, uart_base+KL_UART_C2_OFFSET); /* Configure number of bits, stop bits and parity */ diff --git a/arch/arm/src/kl/kl_serial.c b/arch/arm/src/kl/kl_serial.c index 04df0f470b..8bce624557 100644 --- a/arch/arm/src/kl/kl_serial.c +++ b/arch/arm/src/kl/kl_serial.c @@ -396,7 +396,7 @@ static void up_disableuartint(struct up_dev_s *priv, uint8_t *ie) static int up_setup(struct uart_dev_s *dev) { #ifndef CONFIG_SUPPRESS_UART_CONFIG - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Configure the UART as an RS-232 UART */ @@ -421,7 +421,7 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Disable interrupts */ @@ -449,7 +449,7 @@ static void up_shutdown(struct uart_dev_s *dev) static int up_attach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ(s). The interrupts are (probably) still @@ -477,7 +477,7 @@ static int up_attach(struct uart_dev_s *dev) static void up_detach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Disable interrupts */ @@ -533,7 +533,7 @@ static int up_interrupts(int irq, void *context) { PANIC(); } - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; DEBUGASSERT(priv); /* Loop until there are no characters to be transferred or, @@ -625,7 +625,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) dev = inode->i_private; DEBUGASSERT(dev, dev->priv); - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; switch (cmd) { @@ -655,7 +655,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) static int up_receive(struct uart_dev_s *dev, uint32_t *status) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint8_t s1; /* Get error status information: @@ -694,7 +694,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -728,7 +728,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) static bool up_rxavailable(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Return true if the receive data register is full (RDRF). NOTE: If * FIFOS are enabled, this does not mean that the FIFO is full, @@ -750,7 +750,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_serialout(priv, KL_UART_D_OFFSET, (uint8_t)ch); } @@ -764,7 +764,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -804,7 +804,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) static bool up_txready(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Return true if the transmit data register is "empty." NOTE: If * FIFOS are enabled, this does not mean that the FIFO is empty, @@ -911,7 +911,7 @@ void up_serialinit(void) int up_putc(int ch) { #ifdef HAVE_SERIAL_CONSOLE - struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; + struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; uint8_t ie; up_disableuartint(priv, &ie); diff --git a/arch/arm/src/kl/kl_spi.c b/arch/arm/src/kl/kl_spi.c index 4bcd00199d..d7ac25c528 100644 --- a/arch/arm/src/kl/kl_spi.c +++ b/arch/arm/src/kl/kl_spi.c @@ -530,8 +530,8 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, FAR void *rxbuffer, size_t nwords) { FAR struct kl_spidev_s *priv = (FAR struct kl_spidev_s *)dev; - FAR uint8_t *rxptr = (FAR uint8_t*)rxbuffer; - FAR uint8_t *txptr = (FAR uint8_t*)txbuffer; + FAR uint8_t *rxptr = (FAR uint8_t *)rxbuffer; + FAR uint8_t *txptr = (FAR uint8_t *)txbuffer; uint8_t data; spivdbg("txbuffer=%p rxbuffer=%p nwords=%d\n", txbuffer, rxbuffer, nwords); diff --git a/arch/arm/src/kl/kl_userspace.c b/arch/arm/src/kl/kl_userspace.c index d66bfe2e45..d9ecdda4a4 100644 --- a/arch/arm/src/kl/kl_userspace.c +++ b/arch/arm/src/kl/kl_userspace.c @@ -86,8 +86,8 @@ void kl_userspace(void) DEBUGASSERT(USERSPACE->us_bssstart != 0 && USERSPACE->us_bssend != 0 && USERSPACE->us_bssstart <= USERSPACE->us_bssend); - dest = (uint8_t*)USERSPACE->us_bssstart; - end = (uint8_t*)USERSPACE->us_bssend; + dest = (uint8_t *)USERSPACE->us_bssstart; + end = (uint8_t *)USERSPACE->us_bssend; while (dest != end) { @@ -100,9 +100,9 @@ void kl_userspace(void) USERSPACE->us_datastart != 0 && USERSPACE->us_dataend != 0 && USERSPACE->us_datastart <= USERSPACE->us_dataend); - src = (uint8_t*)USERSPACE->us_datasource; - dest = (uint8_t*)USERSPACE->us_datastart; - end = (uint8_t*)USERSPACE->us_dataend; + src = (uint8_t *)USERSPACE->us_datasource; + dest = (uint8_t *)USERSPACE->us_datastart; + end = (uint8_t *)USERSPACE->us_dataend; while (dest != end) { From 90b7cdcdaf500793e190c98a2df43feac9d2c104 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 6 Oct 2015 19:23:32 -0600 Subject: [PATCH 25/33] LPC11: Make some spacing comply better with coding standard --- arch/arm/src/lpc11xx/lpc11_i2c.c | 18 ++++----- arch/arm/src/lpc11xx/lpc11_irq.c | 2 +- arch/arm/src/lpc11xx/lpc11_serial.c | 53 +++++++++++++------------- arch/arm/src/lpc11xx/lpc11_spi.c | 29 +++++++------- arch/arm/src/lpc11xx/lpc11_ssp.c | 6 +-- arch/arm/src/lpc11xx/lpc11_timer.c | 4 +- arch/arm/src/lpc11xx/lpc11_userspace.c | 10 ++--- 7 files changed, 62 insertions(+), 60 deletions(-) diff --git a/arch/arm/src/lpc11xx/lpc11_i2c.c b/arch/arm/src/lpc11xx/lpc11_i2c.c index 881a0d8ca3..58bcab63c6 100644 --- a/arch/arm/src/lpc11xx/lpc11_i2c.c +++ b/arch/arm/src/lpc11xx/lpc11_i2c.c @@ -226,7 +226,7 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, priv->wrcnt = 0; priv->rdcnt = 0; priv->msg.addr &= ~0x01; - priv->msg.buffer = (uint8_t*)buffer; + priv->msg.buffer = (uint8_t *)buffer; priv->msg.length = buflen; ret = i2c_start(priv); @@ -347,21 +347,21 @@ static int i2c_interrupt(int irq, FAR void *context) #ifdef CONFIG_LPC11_I2C0 if (irq == LPC11_IRQ_I2C0) { - priv=&i2cdevices[0]; + priv = &i2cdevices[0]; } else #endif #ifdef CONFIG_LPC11_I2C1 if (irq == LPC11_IRQ_I2C1) { - priv=&i2cdevices[1]; + priv = &i2cdevices[1]; } else #endif #ifdef CONFIG_LPC11_I2C2 if (irq == LPC11_IRQ_I2C2) { - priv=&i2cdevices[2]; + priv = &i2cdevices[2]; } else #endif @@ -399,7 +399,7 @@ static int i2c_interrupt(int irq, FAR void *context) case 0x28: priv->wrcnt++; - if (priv->wrcntmsg.length) + if (priv->wrcnt < priv->msg.length) { putreg32(priv->msg.buffer[priv->wrcnt], priv->base + LPC11_I2C_DAT_OFFSET); } @@ -465,11 +465,11 @@ struct i2c_dev_s *up_i2cinitialize(int port) flags = irqsave(); - priv= &i2cdevices[port]; + priv = &i2cdevices[port]; #ifdef CONFIG_LPC11_I2C0 if (port == 0) { - priv= (FAR struct lpc11_i2cdev_s *)&i2cdevices[0]; + priv = (FAR struct lpc11_i2cdev_s *)&i2cdevices[0]; priv->base = LPC11_I2C0_BASE; priv->irqid = LPC11_IRQ_I2C0; @@ -493,7 +493,7 @@ struct i2c_dev_s *up_i2cinitialize(int port) #ifdef CONFIG_LPC11_I2C1 if (port == 1) { - priv= (FAR struct lpc11_i2cdev_s *)&i2cdevices[1]; + priv = (FAR struct lpc11_i2cdev_s *)&i2cdevices[1]; priv->base = LPC11_I2C1_BASE; priv->irqid = LPC11_IRQ_I2C1; @@ -517,7 +517,7 @@ struct i2c_dev_s *up_i2cinitialize(int port) #ifdef CONFIG_LPC11_I2C2 if (port == 2) { - priv= (FAR struct lpc11_i2cdev_s *)&i2cdevices[2]; + priv = (FAR struct lpc11_i2cdev_s *)&i2cdevices[2]; priv->base = LPC11_I2C2_BASE; priv->irqid = LPC11_IRQ_I2C2; diff --git a/arch/arm/src/lpc11xx/lpc11_irq.c b/arch/arm/src/lpc11xx/lpc11_irq.c index 8fcef88650..445f408652 100644 --- a/arch/arm/src/lpc11xx/lpc11_irq.c +++ b/arch/arm/src/lpc11xx/lpc11_irq.c @@ -59,7 +59,7 @@ /* Get a 32-bit version of the default priority */ #define DEFPRIORITY32 \ - (NVIC_SYSH_PRIORITY_DEFAULT << 24 | NVIC_SYSH_PRIORITY_DEFAULT << 16 |\ + (NVIC_SYSH_PRIORITY_DEFAULT << 24 | NVIC_SYSH_PRIORITY_DEFAULT << 16 | \ NVIC_SYSH_PRIORITY_DEFAULT << 8 | NVIC_SYSH_PRIORITY_DEFAULT) /**************************************************************************** diff --git a/arch/arm/src/lpc11xx/lpc11_serial.c b/arch/arm/src/lpc11xx/lpc11_serial.c index 47d68aae08..e97a57a0dc 100644 --- a/arch/arm/src/lpc11xx/lpc11_serial.c +++ b/arch/arm/src/lpc11xx/lpc11_serial.c @@ -407,17 +407,17 @@ static inline uint32_t lpc11_uartdl(uint32_t baud) static int up_setup(struct uart_dev_s *dev) { #ifndef CONFIG_SUPPRESS_UART_CONFIG - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint16_t dl; uint32_t lcr; /* Clear fifos */ - up_serialout(priv, LPC11_UART_FCR_OFFSET, (UART_FCR_RXRST|UART_FCR_TXRST)); + up_serialout(priv, LPC11_UART_FCR_OFFSET, (UART_FCR_RXRST | UART_FCR_TXRST)); /* Set trigger */ - up_serialout(priv, LPC11_UART_FCR_OFFSET, (UART_FCR_FIFOEN|UART_FCR_RXTRIGGER_8)); + up_serialout(priv, LPC11_UART_FCR_OFFSET, (UART_FCR_FIFOEN | UART_FCR_RXTRIGGER_8)); /* Set up the IER */ @@ -443,11 +443,11 @@ static int up_setup(struct uart_dev_s *dev) if (priv->parity == 1) { - lcr |= (UART_LCR_PE|UART_LCR_PS_ODD); + lcr |= (UART_LCR_PE | UART_LCR_PS_ODD); } else if (priv->parity == 2) { - lcr |= (UART_LCR_PE|UART_LCR_PS_EVEN); + lcr |= (UART_LCR_PE | UART_LCR_PS_EVEN); } /* Enter DLAB=1 */ @@ -471,7 +471,8 @@ static int up_setup(struct uart_dev_s *dev) /* Configure the FIFOs */ up_serialout(priv, LPC11_UART_FCR_OFFSET, - (UART_FCR_RXTRIGGER_8|UART_FCR_TXRST|UART_FCR_RXRST|UART_FCR_FIFOEN)); + (UART_FCR_RXTRIGGER_8 | UART_FCR_TXRST | UART_FCR_RXRST | + UART_FCR_FIFOEN)); #endif @@ -488,7 +489,7 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disableuartint(priv, NULL); } @@ -510,7 +511,7 @@ static void up_shutdown(struct uart_dev_s *dev) static int up_attach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ */ @@ -518,11 +519,11 @@ static int up_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, up_interrupt); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the UART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the UART + */ - up_enable_irq(priv->irq); + up_enable_irq(priv->irq); } return ret; @@ -540,7 +541,7 @@ static int up_attach(struct uart_dev_s *dev) static void up_detach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disable_irq(priv->irq); irq_detach(priv->irq); } @@ -575,7 +576,7 @@ static int up_interrupt(int irq, void *context) PANIC(); } - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; /* Loop until there are no characters to be transferred or, * until we have been looping for a long time. @@ -658,7 +659,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) { struct inode *inode = filep->f_inode; struct uart_dev_s *dev = inode->i_private; - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret = OK; switch (cmd) @@ -666,7 +667,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct up_dev_s *user = (struct up_dev_s*)arg; + struct up_dev_s *user = (struct up_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -699,7 +700,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TERMIOS case TCGETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; if (!termiosp) { @@ -719,7 +720,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) case TCSETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; uint32_t lcr; /* Holds current values of line control register */ uint16_t dl; /* Divisor latch */ @@ -788,7 +789,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) static int up_receive(struct uart_dev_s *dev, uint32_t *status) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t rbr; *status = up_serialin(priv, LPC11_UART_LSR_OFFSET); @@ -806,7 +807,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { #ifndef CONFIG_SUPPRESS_SERIAL_INTS @@ -831,7 +832,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) static bool up_rxavailable(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, LPC11_UART_LSR_OFFSET) & UART_LSR_RDR) != 0); } @@ -845,7 +846,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_serialout(priv, LPC11_UART_THR_OFFSET, (uint32_t)ch); } @@ -859,7 +860,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -895,7 +896,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) static bool up_txready(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, LPC11_UART_LSR_OFFSET) & UART_LSR_THRE) != 0); } @@ -909,7 +910,7 @@ static bool up_txready(struct uart_dev_s *dev) static bool up_txempty(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, LPC11_UART_LSR_OFFSET) & UART_LSR_THRE) != 0); } @@ -991,7 +992,7 @@ void up_serialinit(void) int up_putc(int ch) { #ifdef HAVE_SERIAL_CONSOLE - struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; + struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; uint32_t ier; up_disableuartint(priv, &ier); #endif diff --git a/arch/arm/src/lpc11xx/lpc11_spi.c b/arch/arm/src/lpc11xx/lpc11_spi.c index f65f8386ff..43f81afd43 100644 --- a/arch/arm/src/lpc11xx/lpc11_spi.c +++ b/arch/arm/src/lpc11xx/lpc11_spi.c @@ -269,9 +269,9 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, divisor = SPI_CLOCK / frequency; - /* The SPI CCR register must contain an even number greater than or equal - * to 8. - */ + /* The SPI CCR register must contain an even number greater than or equal + * to 8. + */ if (divisor < 8) { @@ -332,7 +332,7 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) /* Yes... Set CR appropriately */ regval = getreg32(LPC11_SPI_CR); - regval &= ~(SPI_CR_CPOL|SPI_CR_CPHA); + regval &= ~(SPI_CR_CPOL | SPI_CR_CPHA); switch (mode) { @@ -348,7 +348,7 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) break; case SPIDEV_MODE3: /* CPOL=1; CPHA=1 */ - regval |= (SPI_CR_CPOL|SPI_CR_CPHA); + regval |= (SPI_CR_CPOL | SPI_CR_CPHA); break; default: @@ -467,7 +467,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t nwords) { - FAR uint8_t *ptr = (FAR uint8_t*)buffer; + FAR uint8_t *ptr = (FAR uint8_t *)buffer; uint8_t data; spidbg("nwords: %d\n", nwords); @@ -515,7 +515,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nwords) { - FAR uint8_t *ptr = (FAR uint8_t*)buffer; + FAR uint8_t *ptr = (FAR uint8_t *)buffer; spidbg("nwords: %d\n", nwords); while (nwords) @@ -531,16 +531,16 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, * data transfer. */ - while ((getreg32(LPC11_SPI_SR) & SPI_SR_SPIF) == 0); + while ((getreg32(LPC11_SPI_SR) & SPI_SR_SPIF) == 0); - /* Read the SPI Status Register again to clear the status bit */ + /* Read the SPI Status Register again to clear the status bit */ - (void)getreg32(LPC11_SPI_SR); + (void)getreg32(LPC11_SPI_SR); - /* Read the received data from the SPI Data Register */ + /* Read the received data from the SPI Data Register */ - *ptr++ = (uint8_t)getreg32(LPC11_SPI_DR); - nwords--; + *ptr++ = (uint8_t)getreg32(LPC11_SPI_DR); + nwords--; } } @@ -598,7 +598,8 @@ FAR struct spi_dev_s *lpc11_spiinitialize(int port) /* Configure 8-bit SPI mode and master mode */ - putreg32(SPI_CR_BITS_8BITS|SPI_CR_BITENABLE|SPI_CR_MSTR, LPC11_SPI_CR); + putreg32(SPI_CR_BITS_8BITS | SPI_CR_BITENABLE | SPI_CR_MSTR, + LPC11_SPI_CR); /* Set the initial SPI configuration */ diff --git a/arch/arm/src/lpc11xx/lpc11_ssp.c b/arch/arm/src/lpc11xx/lpc11_ssp.c index d7a3f2acd0..764a50d139 100644 --- a/arch/arm/src/lpc11xx/lpc11_ssp.c +++ b/arch/arm/src/lpc11xx/lpc11_ssp.c @@ -518,7 +518,7 @@ static void ssp_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) /* Yes... Set CR0 appropriately */ regval = ssp_getreg(priv, LPC11_SSP_CR0_OFFSET); - regval &= ~(SSP_CR0_CPOL|SSP_CR0_CPHA); + regval &= ~(SSP_CR0_CPOL | SSP_CR0_CPHA); switch (mode) { @@ -534,7 +534,7 @@ static void ssp_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) break; case SPIDEV_MODE3: /* CPOL=1; CPHA=1 */ - regval |= (SSP_CR0_CPOL|SSP_CR0_CPHA); + regval |= (SSP_CR0_CPOL | SSP_CR0_CPHA); break; default: @@ -1012,7 +1012,7 @@ FAR struct spi_dev_s *lpc11_sspinitialize(int port) /* Configure 8-bit SPI mode */ - ssp_putreg(priv, LPC11_SSP_CR0_OFFSET, SSP_CR0_DSS_8BIT|SSP_CR0_FRF_SPI); + ssp_putreg(priv, LPC11_SSP_CR0_OFFSET, SSP_CR0_DSS_8BIT | SSP_CR0_FRF_SPI); /* Disable the SSP and all interrupts (we'll poll for all data) */ diff --git a/arch/arm/src/lpc11xx/lpc11_timer.c b/arch/arm/src/lpc11xx/lpc11_timer.c index c9ab200682..6f867202e2 100644 --- a/arch/arm/src/lpc11xx/lpc11_timer.c +++ b/arch/arm/src/lpc11xx/lpc11_timer.c @@ -423,7 +423,7 @@ static int timer_setup(FAR struct pwm_lowerhalf_s *dev) * external bit */ - putreg32(((1 << 1)|(3 << 6)), LPC17_TMR0_EMR); + putreg32(((1 << 1) | (3 << 6)), LPC17_TMR0_EMR); putreg32((1 << 0), LPC17_TMR0_TCR); /* Start timer0 */ /* Configure the output pins GPIO3.26 */ @@ -436,7 +436,7 @@ static int timer_setup(FAR struct pwm_lowerhalf_s *dev) putreg32(~(0x3 << 0), LPC17_TMR1_CCR); /* Prescaler count frequency:Fpclk/1 */ putreg32(~(0x3 << 0), LPC17_TMR1_CTCR);/* Prescaler count frequency:Fpclk/1 */ putreg32((2 << 0), LPC17_TMR1_MCR); /* Reset on match register MR0 */ -// putreg32(((1 << 0)|(3 << 4)), LPC17_TMR1_EMR); /* Output bit toggle on external match event MAT0 */ +// putreg32(((1 << 0) | (3 << 4)), LPC17_TMR1_EMR); /* Output bit toggle on external match event MAT0 */ putreg32((1 << 0), LPC17_TMR1_TCR); /* Start timer1 */ /* configure the output pins GPIO3.26 */ diff --git a/arch/arm/src/lpc11xx/lpc11_userspace.c b/arch/arm/src/lpc11xx/lpc11_userspace.c index f2372643ac..6ee07ad6b5 100644 --- a/arch/arm/src/lpc11xx/lpc11_userspace.c +++ b/arch/arm/src/lpc11xx/lpc11_userspace.c @@ -87,8 +87,8 @@ void lpc11_userspace(void) DEBUGASSERT(USERSPACE->us_bssstart != 0 && USERSPACE->us_bssend != 0 && USERSPACE->us_bssstart <= USERSPACE->us_bssend); - dest = (uint8_t*)USERSPACE->us_bssstart; - end = (uint8_t*)USERSPACE->us_bssend; + dest = (uint8_t *)USERSPACE->us_bssstart; + end = (uint8_t *)USERSPACE->us_bssend; while (dest != end) { @@ -101,9 +101,9 @@ void lpc11_userspace(void) USERSPACE->us_datastart != 0 && USERSPACE->us_dataend != 0 && USERSPACE->us_datastart <= USERSPACE->us_dataend); - src = (uint8_t*)USERSPACE->us_datasource; - dest = (uint8_t*)USERSPACE->us_datastart; - end = (uint8_t*)USERSPACE->us_dataend; + src = (uint8_t *)USERSPACE->us_datasource; + dest = (uint8_t *)USERSPACE->us_datastart; + end = (uint8_t *)USERSPACE->us_dataend; while (dest != end) { From b6638315a40b82067baf0edefda688d1405873a2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 7 Oct 2015 11:39:06 -0600 Subject: [PATCH 26/33] Correct some spacing issues --- arch/arm/src/arm/up_assert.c | 2 +- arch/arm/src/armv6-m/up_assert.c | 4 +- arch/arm/src/armv6-m/up_reprioritizertr.c | 2 +- arch/arm/src/armv6-m/up_systemreset.c | 2 +- arch/arm/src/armv7-a/arm_assert.c | 2 +- arch/arm/src/armv7-a/arm_pgalloc.c | 2 +- arch/arm/src/armv7-a/arm_reprioritizertr.c | 2 +- arch/arm/src/armv7-m/up_assert.c | 2 +- arch/arm/src/armv7-m/up_itm_syslog.c | 8 +- arch/arm/src/armv7-m/up_reprioritizertr.c | 2 +- arch/arm/src/armv7-m/up_systemreset.c | 2 +- arch/arm/src/c5471/c5471_ethernet.c | 4 +- arch/arm/src/dm320/dm320_serial.c | 2 +- arch/arm/src/dm320/dm320_usbdev.c | 4 +- arch/arm/src/efm32/efm32_adc.c | 2 +- arch/arm/src/efm32/efm32_flash.c | 58 ++--- arch/arm/src/efm32/efm32_gpioirq.c | 6 +- arch/arm/src/efm32/efm32_i2c.c | 10 +- arch/arm/src/efm32/efm32_pwm.c | 17 +- arch/arm/src/efm32/efm32_rmu.c | 12 +- arch/arm/src/efm32/efm32_serial.c | 2 +- arch/arm/src/efm32/efm32_spi.c | 4 +- arch/arm/src/efm32/efm32_start.c | 2 +- arch/arm/src/efm32/efm32_timer.c | 10 +- arch/arm/src/efm32/efm32_usbdev.c | 22 +- arch/arm/src/efm32/efm32_usbhost.c | 20 +- arch/arm/src/imx/imx_serial.c | 2 +- arch/arm/src/kinetis/kinetis_enet.c | 2 +- arch/arm/src/kinetis/kinetis_sdhc.c | 10 +- arch/arm/src/kinetis/kinetis_start.c | 2 +- arch/arm/src/kl/kl_lowputc.c | 70 +++--- arch/arm/src/kl/kl_start.c | 2 +- arch/arm/src/lpc11xx/lpc11_gpioint.c | 2 +- arch/arm/src/lpc11xx/lpc11_spi.c | 2 +- arch/arm/src/lpc11xx/lpc11_start.c | 2 +- arch/arm/src/lpc11xx/lpc11_timer.c | 30 +-- arch/arm/src/lpc17xx/lpc176x_clockconfig.c | 13 +- arch/arm/src/lpc17xx/lpc178x_gpio.c | 3 +- arch/arm/src/lpc17xx/lpc17_adc.c | 8 +- arch/arm/src/lpc17xx/lpc17_allocateheap.c | 12 +- arch/arm/src/lpc17xx/lpc17_can.c | 31 +-- arch/arm/src/lpc17xx/lpc17_dac.c | 12 +- arch/arm/src/lpc17xx/lpc17_ethernet.c | 38 ++-- arch/arm/src/lpc17xx/lpc17_gpdma.c | 4 +- arch/arm/src/lpc17xx/lpc17_gpioint.c | 2 +- arch/arm/src/lpc17xx/lpc17_i2c.c | 20 +- arch/arm/src/lpc17xx/lpc17_irq.c | 8 +- arch/arm/src/lpc17xx/lpc17_lcd.c | 4 +- arch/arm/src/lpc17xx/lpc17_lowputc.c | 29 +-- arch/arm/src/lpc17xx/lpc17_mcpwm.c | 74 +++---- arch/arm/src/lpc17xx/lpc17_sdcard.c | 197 +++++++++-------- arch/arm/src/lpc17xx/lpc17_serial.c | 55 ++--- arch/arm/src/lpc17xx/lpc17_spi.c | 27 +-- arch/arm/src/lpc17xx/lpc17_ssp.c | 6 +- arch/arm/src/lpc17xx/lpc17_start.c | 2 +- arch/arm/src/lpc17xx/lpc17_timer.c | 36 ++-- arch/arm/src/lpc17xx/lpc17_timerisr.c | 3 +- arch/arm/src/lpc17xx/lpc17_usbdev.c | 83 +++---- arch/arm/src/lpc17xx/lpc17_usbhost.c | 38 ++-- arch/arm/src/lpc17xx/lpc17_userspace.c | 10 +- arch/arm/src/lpc214x/lpc214x_decodeirq.c | 2 +- arch/arm/src/lpc214x/lpc214x_serial.c | 51 ++--- arch/arm/src/lpc214x/lpc214x_usbdev.c | 107 ++++----- arch/arm/src/lpc2378/lpc23xx_decodeirq.c | 2 +- arch/arm/src/lpc2378/lpc23xx_i2c.c | 26 +-- arch/arm/src/lpc2378/lpc23xx_spi.c | 10 +- arch/arm/src/lpc31xx/lpc31_allocateheap.c | 8 +- arch/arm/src/lpc31xx/lpc31_boot.c | 12 +- arch/arm/src/lpc31xx/lpc31_clkfreq.c | 2 +- arch/arm/src/lpc31xx/lpc31_clkinit.c | 8 +- arch/arm/src/lpc31xx/lpc31_decodeirq.c | 2 +- arch/arm/src/lpc31xx/lpc31_ehci.c | 2 +- arch/arm/src/lpc31xx/lpc31_i2c.c | 2 +- arch/arm/src/lpc31xx/lpc31_irq.c | 11 +- arch/arm/src/lpc31xx/lpc31_lowputc.c | 70 +++--- arch/arm/src/lpc31xx/lpc31_pllconfig.c | 2 +- arch/arm/src/lpc31xx/lpc31_serial.c | 82 +++---- arch/arm/src/lpc31xx/lpc31_setfreqin.c | 2 +- arch/arm/src/lpc31xx/lpc31_softreset.c | 2 +- arch/arm/src/lpc31xx/lpc31_spi.c | 12 +- arch/arm/src/lpc31xx/lpc31_timerisr.c | 2 +- arch/arm/src/lpc31xx/lpc31_usbdev.c | 239 +++++++++++---------- arch/arm/src/lpc43xx/lpc43_adc.c | 69 +++--- arch/arm/src/lpc43xx/lpc43_allocateheap.c | 10 +- arch/arm/src/lpc43xx/lpc43_dac.c | 17 +- arch/arm/src/lpc43xx/lpc43_ehci.c | 2 +- arch/arm/src/lpc43xx/lpc43_ethernet.c | 38 ++-- arch/arm/src/lpc43xx/lpc43_i2c.c | 42 ++-- arch/arm/src/lpc43xx/lpc43_irq.c | 6 +- arch/arm/src/lpc43xx/lpc43_pinconfig.c | 12 +- arch/arm/src/lpc43xx/lpc43_rit.c | 4 +- arch/arm/src/lpc43xx/lpc43_serial.c | 55 ++--- arch/arm/src/lpc43xx/lpc43_spi.c | 24 +-- arch/arm/src/lpc43xx/lpc43_ssp.c | 8 +- arch/arm/src/lpc43xx/lpc43_start.c | 3 +- arch/arm/src/lpc43xx/lpc43_timerisr.c | 2 +- arch/arm/src/lpc43xx/lpc43_uart.c | 12 +- arch/arm/src/lpc43xx/lpc43_usb0dev.c | 36 ++-- arch/arm/src/lpc43xx/lpc43_userspace.c | 10 +- arch/arm/src/moxart/moxart_16550.c | 2 +- arch/arm/src/moxart/moxart_systemreset.c | 2 +- arch/arm/src/nuc1xx/nuc_irq.c | 2 +- arch/arm/src/nuc1xx/nuc_lowputc.c | 6 +- arch/arm/src/nuc1xx/nuc_serial.c | 44 ++-- arch/arm/src/nuc1xx/nuc_start.c | 2 +- arch/arm/src/nuc1xx/nuc_userspace.c | 10 +- arch/arm/src/sam34/sam4l_clockconfig.c | 6 +- arch/arm/src/sam34/sam4l_periphclks.c | 4 +- arch/arm/src/sam34/sam_aes.c | 16 +- arch/arm/src/sam34/sam_allocateheap.c | 18 +- arch/arm/src/sam34/sam_clockconfig.c | 8 +- arch/arm/src/sam34/sam_dmac.c | 4 +- arch/arm/src/sam34/sam_emac.c | 54 ++--- arch/arm/src/sam34/sam_gpioirq.c | 10 +- arch/arm/src/sam34/sam_hsmci.c | 66 +++--- arch/arm/src/sam34/sam_irq.c | 10 +- arch/arm/src/sam34/sam_lowputc.c | 2 +- arch/arm/src/sam34/sam_rtc.c | 2 +- arch/arm/src/sam34/sam_rtt.c | 22 +- arch/arm/src/sam34/sam_serial.c | 55 ++--- arch/arm/src/sam34/sam_spi.c | 10 +- arch/arm/src/sam34/sam_start.c | 4 +- arch/arm/src/sam34/sam_tc.c | 20 +- arch/arm/src/sam34/sam_timerisr.c | 3 +- arch/arm/src/sam34/sam_udp.c | 2 +- arch/arm/src/sam34/sam_userspace.c | 10 +- arch/arm/src/sam34/sam_wdt.c | 20 +- arch/arm/src/sama5/sam_allocateheap.c | 4 +- arch/arm/src/sama5/sam_boot.c | 6 +- arch/arm/src/sama5/sam_can.c | 20 +- arch/arm/src/sama5/sam_dbgu.c | 42 ++-- arch/arm/src/sama5/sam_dmac.c | 4 +- arch/arm/src/sama5/sam_ehci.c | 17 +- arch/arm/src/sama5/sam_emaca.c | 54 ++--- arch/arm/src/sama5/sam_emacb.c | 58 ++--- arch/arm/src/sama5/sam_flexcom_serial.c | 54 ++--- arch/arm/src/sama5/sam_gmac.c | 50 ++--- arch/arm/src/sama5/sam_hsmci.c | 70 +++--- arch/arm/src/sama5/sam_lcd.c | 8 +- arch/arm/src/sama5/sam_lowputc.c | 6 +- arch/arm/src/sama5/sam_nand.c | 12 +- arch/arm/src/sama5/sam_ohci.c | 28 +-- arch/arm/src/sama5/sam_pioirq.c | 86 ++++---- arch/arm/src/sama5/sam_pmecc.c | 22 +- arch/arm/src/sama5/sam_serial.c | 50 ++--- arch/arm/src/sama5/sam_serialinit.c | 2 +- arch/arm/src/sama5/sam_spi.c | 6 +- arch/arm/src/sama5/sam_ssc.c | 2 +- arch/arm/src/sama5/sam_trng.c | 4 +- arch/arm/src/sama5/sam_tsd.c | 34 +-- arch/arm/src/sama5/sam_udphs.c | 2 +- arch/arm/src/sama5/sam_wdt.c | 20 +- arch/arm/src/sama5/sam_xdmac.c | 6 +- arch/arm/src/sama5/sama5d2x_memorymap.c | 18 +- arch/arm/src/sama5/sama5d3x_memorymap.c | 18 +- arch/arm/src/sama5/sama5d4x_memorymap.c | 18 +- arch/arm/src/samdl/sam_dmac.c | 6 +- arch/arm/src/samdl/sam_serial.c | 14 +- arch/arm/src/samdl/sam_spi.c | 4 +- arch/arm/src/samdl/sam_start.c | 2 +- arch/arm/src/samv7/sam_allocateheap.c | 4 +- arch/arm/src/samv7/sam_emac.c | 28 +-- arch/arm/src/samv7/sam_gpioirq.c | 10 +- arch/arm/src/samv7/sam_hsmci.c | 20 +- arch/arm/src/samv7/sam_lowputc.c | 2 +- arch/arm/src/samv7/sam_mcan.c | 24 +-- arch/arm/src/samv7/sam_qspi.c | 2 +- arch/arm/src/samv7/sam_serial.c | 33 +-- arch/arm/src/samv7/sam_spi.c | 2 +- arch/arm/src/samv7/sam_spi_slave.c | 2 +- arch/arm/src/samv7/sam_ssc.c | 2 +- arch/arm/src/samv7/sam_start.c | 4 +- arch/arm/src/samv7/sam_xdmac.c | 6 +- 173 files changed, 1711 insertions(+), 1639 deletions(-) diff --git a/arch/arm/src/arm/up_assert.c b/arch/arm/src/arm/up_assert.c index 7f0d33b848..f8cd706fa5 100644 --- a/arch/arm/src/arm/up_assert.c +++ b/arch/arm/src/arm/up_assert.c @@ -313,7 +313,7 @@ static void _up_assert(int errorcode) if (current_regs || ((struct tcb_s *)g_readytorun.head)->pid == 0) { (void)irqsave(); - for (;;) + for (; ; ) { #ifdef CONFIG_ARCH_LEDS board_led_on(LED_PANIC); diff --git a/arch/arm/src/armv6-m/up_assert.c b/arch/arm/src/armv6-m/up_assert.c index 558351dc4a..4c570637a5 100644 --- a/arch/arm/src/armv6-m/up_assert.c +++ b/arch/arm/src/armv6-m/up_assert.c @@ -226,7 +226,7 @@ static int usbtrace_syslog(FAR const char *fmt, ...) return ret; } -static int assert_tracecallback(FAR struct usbtrace_s *trace,FAR void *arg) +static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) { usbtrace_trprintf(usbtrace_syslog, trace->event, trace->value); return 0; @@ -368,7 +368,7 @@ static void _up_assert(int errorcode) if (current_regs || ((struct tcb_s *)g_readytorun.head)->pid == 0) { (void)irqsave(); - for (;;) + for (; ; ) { #ifdef CONFIG_ARCH_LEDS board_led_on(LED_PANIC); diff --git a/arch/arm/src/armv6-m/up_reprioritizertr.c b/arch/arm/src/armv6-m/up_reprioritizertr.c index 4fa1dd2425..b1c4f7a5d4 100644 --- a/arch/arm/src/armv6-m/up_reprioritizertr.c +++ b/arch/arm/src/armv6-m/up_reprioritizertr.c @@ -136,7 +136,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sched_suspend_scheduler(rtcb); - /* Are we in an interrupt handler? */ + /* Are we in an interrupt handler? */ if (current_regs) { diff --git a/arch/arm/src/armv6-m/up_systemreset.c b/arch/arm/src/armv6-m/up_systemreset.c index 6106028615..c5cafd9b81 100644 --- a/arch/arm/src/armv6-m/up_systemreset.c +++ b/arch/arm/src/armv6-m/up_systemreset.c @@ -76,7 +76,7 @@ void up_systemreset(void) /* Wait for the reset */ - for (;;); + for (; ; ); } diff --git a/arch/arm/src/armv7-a/arm_assert.c b/arch/arm/src/armv7-a/arm_assert.c index 3c66d64c1d..19630740eb 100644 --- a/arch/arm/src/armv7-a/arm_assert.c +++ b/arch/arm/src/armv7-a/arm_assert.c @@ -368,7 +368,7 @@ static void _up_assert(int errorcode) if (current_regs || ((struct tcb_s *)g_readytorun.head)->pid == 0) { (void)irqsave(); - for (;;) + for (; ; ) { #ifdef CONFIG_ARCH_LEDS board_led_on(LED_PANIC); diff --git a/arch/arm/src/armv7-a/arm_pgalloc.c b/arch/arm/src/armv7-a/arm_pgalloc.c index 8c355664b6..82ad115660 100644 --- a/arch/arm/src/armv7-a/arm_pgalloc.c +++ b/arch/arm/src/armv7-a/arm_pgalloc.c @@ -293,7 +293,7 @@ uintptr_t pgalloc(uintptr_t brkaddr, unsigned int npages) index = (brkaddr & 0x000ff000) >> 12; - /* Map the .text region virtual address to this physical address */ + /* Map the .text region virtual address to this physical address */ DEBUGASSERT(l2table[index] == 0); l2table[index] = paddr | MMU_L2_UDATAFLAGS; diff --git a/arch/arm/src/armv7-a/arm_reprioritizertr.c b/arch/arm/src/armv7-a/arm_reprioritizertr.c index a799329f44..93c9cd0b09 100644 --- a/arch/arm/src/armv7-a/arm_reprioritizertr.c +++ b/arch/arm/src/armv7-a/arm_reprioritizertr.c @@ -136,7 +136,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sched_suspend_scheduler(rtcb); - /* Are we in an interrupt handler? */ + /* Are we in an interrupt handler? */ if (current_regs) { diff --git a/arch/arm/src/armv7-m/up_assert.c b/arch/arm/src/armv7-m/up_assert.c index cd9ba9c353..0a264cb8cb 100644 --- a/arch/arm/src/armv7-m/up_assert.c +++ b/arch/arm/src/armv7-m/up_assert.c @@ -377,7 +377,7 @@ static void _up_assert(int errorcode) if (current_regs || ((struct tcb_s *)g_readytorun.head)->pid == 0) { (void)irqsave(); - for (;;) + for (; ; ) { #ifdef CONFIG_ARCH_LEDS board_led_on(LED_PANIC); diff --git a/arch/arm/src/armv7-m/up_itm_syslog.c b/arch/arm/src/armv7-m/up_itm_syslog.c index 749d03f1f6..94b499879a 100644 --- a/arch/arm/src/armv7-m/up_itm_syslog.c +++ b/arch/arm/src/armv7-m/up_itm_syslog.c @@ -101,10 +101,10 @@ void itm_syslog_initialize(void) regval |= NVIC_DEMCR_TRCENA; putreg32(regval, NVIC_DEMCR); - putreg32(0xc5acce55,ITM_LAR); - putreg32(0, ITM_TER); - putreg32(0, ITM_TCR); - putreg32(2, TPI_SPPR); /* Pin protocol: 2=> Manchester (USART) */ + putreg32(0xc5acce55, ITM_LAR); + putreg32(0, ITM_TER); + putreg32(0, ITM_TCR); + putreg32(2, TPI_SPPR); /* Pin protocol: 2=> Manchester (USART) */ /* Default 880kbps */ diff --git a/arch/arm/src/armv7-m/up_reprioritizertr.c b/arch/arm/src/armv7-m/up_reprioritizertr.c index 1024565701..11a40e3008 100644 --- a/arch/arm/src/armv7-m/up_reprioritizertr.c +++ b/arch/arm/src/armv7-m/up_reprioritizertr.c @@ -136,7 +136,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sched_suspend_scheduler(rtcb); - /* Are we in an interrupt handler? */ + /* Are we in an interrupt handler? */ if (current_regs) { diff --git a/arch/arm/src/armv7-m/up_systemreset.c b/arch/arm/src/armv7-m/up_systemreset.c index 96f1b92089..509f7707af 100644 --- a/arch/arm/src/armv7-m/up_systemreset.c +++ b/arch/arm/src/armv7-m/up_systemreset.c @@ -77,7 +77,7 @@ void up_systemreset(void) /* Wait for the reset */ - for (;;); + for (; ; ); } diff --git a/arch/arm/src/c5471/c5471_ethernet.c b/arch/arm/src/c5471/c5471_ethernet.c index 6391ec857f..761802337b 100644 --- a/arch/arm/src/c5471/c5471_ethernet.c +++ b/arch/arm/src/c5471/c5471_ethernet.c @@ -1058,7 +1058,7 @@ static void c5471_rxstatus(struct c5471_driver_s *c5471) /* Walk that last packet we just received to collect xmit status bits. */ rxstatus = 0; - for (;;) + for (; ; ) { if (EIM_TXDESC_OWN_HOST & getreg32(desc)) { @@ -1405,7 +1405,7 @@ static void c5471_txstatus(struct c5471_driver_s *c5471) txstatus = 0; if (c5471->c_lastdescstart && c5471->c_lastdescend) { - for (;;) + for (; ; ) { txstatus |= (getreg32(desc) & EIM_RXDESC_STATUSMASK); if (desc == c5471->c_lastdescend) diff --git a/arch/arm/src/dm320/dm320_serial.c b/arch/arm/src/dm320/dm320_serial.c index 07f5ce91df..5f56d6a349 100644 --- a/arch/arm/src/dm320/dm320_serial.c +++ b/arch/arm/src/dm320/dm320_serial.c @@ -495,7 +495,7 @@ static int up_interrupt(int irq, void *context) * until we have been looping for a long time. */ - for (;;) + for (; ; ) { /* Get the current UART status and check for loop * termination conditions diff --git a/arch/arm/src/dm320/dm320_usbdev.c b/arch/arm/src/dm320/dm320_usbdev.c index f2d5307ad1..ea7b808cb5 100644 --- a/arch/arm/src/dm320/dm320_usbdev.c +++ b/arch/arm/src/dm320/dm320_usbdev.c @@ -960,7 +960,7 @@ static int dm320_wrrequest(struct dm320_ep_s *privep) * may be resuming transfer already in progress. */ - for (;;) + for (; ; ) { /* Get the number of bytes left to be sent in the packet */ @@ -2251,7 +2251,7 @@ static FAR struct usbdev_ep_s *dm320_allocep(FAR struct usbdev_s *dev, uint8_t e if (g_epinfo[ndx].attr == eptype) { - /* Success! */ + /* Success! */ return &priv->eplist[ndx].ep; } diff --git a/arch/arm/src/efm32/efm32_adc.c b/arch/arm/src/efm32/efm32_adc.c index c79daba3bb..c156ec7872 100644 --- a/arch/arm/src/efm32/efm32_adc.c +++ b/arch/arm/src/efm32/efm32_adc.c @@ -784,7 +784,7 @@ static void adc_startconv(struct efm32_dev_s *priv, bool enable) regval &= ~ADC_CR2_SWSTART; } - adc_putreg(priv, EFM32_ADC_CR2_OFFSET,regval); + adc_putreg(priv, EFM32_ADC_CR2_OFFSET, regval); } #endif diff --git a/arch/arm/src/efm32/efm32_flash.c b/arch/arm/src/efm32/efm32_flash.c index 11bc4d07f2..1fb041dc50 100644 --- a/arch/arm/src/efm32/efm32_flash.c +++ b/arch/arm/src/efm32/efm32_flash.c @@ -134,11 +134,11 @@ void efm32_flash_unlock(void) /* Unlock the EFM32_MSC */ - putreg32(MSC_UNLOCK_CODE,EFM32_MSC_LOCK); + putreg32(MSC_UNLOCK_CODE, EFM32_MSC_LOCK); /* Disable writing to the flash */ - bitband_set_peripheral(EFM32_MSC_WRITECTRL,_MSC_WRITECTRL_WREN_SHIFT,0); + bitband_set_peripheral(EFM32_MSC_WRITECTRL, _MSC_WRITECTRL_WREN_SHIFT, 0); #if defined(_MSC_TIMEBASE_MASK) @@ -178,7 +178,7 @@ void efm32_flash_unlock(void) regval |= (cycles << _MSC_TIMEBASE_BASE_SHIFT); } - putreg32(regval,EFM32_MSC_TIMEBASE); + putreg32(regval, EFM32_MSC_TIMEBASE); #endif } @@ -230,8 +230,8 @@ int __ramfunc__ msc_load_verify_address(uint32_t *address) /* Load address */ - putreg32((uint32_t) (address),EFM32_MSC_ADDRB); - putreg32(MSC_WRITECMD_LADDRIM,EFM32_MSC_WRITECMD); + putreg32((uint32_t) (address), EFM32_MSC_ADDRB); + putreg32(MSC_WRITECMD_LADDRIM, EFM32_MSC_WRITECMD); status = getreg32(EFM32_MSC_STATUS); if (status & (MSC_STATUS_INVADDR | MSC_STATUS_LOCKED)) @@ -320,12 +320,12 @@ int __ramfunc__ msc_load_write_data(uint32_t *data, uint32_t num_words, /* Clear double word option, in order to write one single word. */ - bitband_set_peripheral(EFM32_MSC_WRITECTRL,_MSC_WRITECTRL_WDOUBLE_SHIFT,0); + bitband_set_peripheral(EFM32_MSC_WRITECTRL, _MSC_WRITECTRL_WDOUBLE_SHIFT, 0); /* Write first data word. */ - putreg32(*data++,EFM32_MSC_WDATA); - putreg32(MSC_WRITECMD_WRITEONCE,EFM32_MSC_WRITECMD); + putreg32(*data++, EFM32_MSC_WDATA); + putreg32(MSC_WRITECMD_WRITEONCE, EFM32_MSC_WRITECMD); /* Wait for the operation to finish. It may be required to change the * WDOUBLE config after the initial write. It should not be changed @@ -355,7 +355,7 @@ int __ramfunc__ msc_load_write_data(uint32_t *data, uint32_t num_words, * data phase. */ - bitband_set_peripheral(EFM32_MSC_WRITECTRL,_MSC_WRITECTRL_WDOUBLE_SHIFT,1); + bitband_set_peripheral(EFM32_MSC_WRITECTRL, _MSC_WRITECTRL_WDOUBLE_SHIFT, 1); words_per_data_phase = 2; } else @@ -380,7 +380,7 @@ int __ramfunc__ msc_load_write_data(uint32_t *data, uint32_t num_words, word_index = 0; while (word_index < num_words) { - putreg32(*data++,EFM32_MSC_WDATA); + putreg32(*data++, EFM32_MSC_WDATA); word_index++; if (words_per_data_phase == 2) { @@ -388,11 +388,11 @@ int __ramfunc__ msc_load_write_data(uint32_t *data, uint32_t num_words, { } - putreg32(*data++,EFM32_MSC_WDATA); + putreg32(*data++, EFM32_MSC_WDATA); word_index++; } - putreg32(MSC_WRITECMD_WRITEONCE,EFM32_MSC_WRITECMD); + putreg32(MSC_WRITECMD_WRITEONCE, EFM32_MSC_WRITECMD); /* Wait for the transaction to finish. */ @@ -412,13 +412,13 @@ int __ramfunc__ msc_load_write_data(uint32_t *data, uint32_t num_words, } #if defined(CONFIG_EFM32_EFM32G) - putreg32(getreg32(EFM32_MSC_ADDRB)+4,EFM32_MSC_ADDRB); - putreg32(MSC_WRITECMD_LADDRIM,EFM32_MSC_WRITECMD); + putreg32(getreg32(EFM32_MSC_ADDRB)+4, EFM32_MSC_ADDRB); + putreg32(MSC_WRITECMD_LADDRIM, EFM32_MSC_WRITECMD); #endif } } - /* Write strategy: msc_write_fast */ + /* Write strategy: msc_write_fast */ else { @@ -461,15 +461,15 @@ int __ramfunc__ msc_load_write_data(uint32_t *data, uint32_t num_words, regval &= MSC_STATUS_WDATAREADY; if (regval == MSC_STATUS_WORDTIMEOUT) { - putreg32(MSC_WRITECMD_WRITETRIG,EFM32_MSC_WRITECMD); + putreg32(MSC_WRITECMD_WRITETRIG, EFM32_MSC_WRITECMD); } } - putreg32(*data,EFM32_MSC_WDATA); + putreg32(*data, EFM32_MSC_WDATA); if ((words_per_data_phase == 1) || \ ((words_per_data_phase == 2) && (word_index & 0x1))) { - putreg32(MSC_WRITECMD_WRITETRIG,EFM32_MSC_WRITECMD); + putreg32(MSC_WRITECMD_WRITETRIG, EFM32_MSC_WRITECMD); } data++; @@ -498,7 +498,7 @@ int __ramfunc__ msc_load_write_data(uint32_t *data, uint32_t num_words, /* Clear double word option, which should not be left on when returning. */ - bitband_set_peripheral(EFM32_MSC_WRITECTRL,_MSC_WRITECTRL_WDOUBLE_SHIFT,0); + bitband_set_peripheral(EFM32_MSC_WRITECTRL, _MSC_WRITECTRL_WDOUBLE_SHIFT, 0); #endif @@ -509,11 +509,11 @@ void efm32_flash_lock(void) { /* Disable writing to the flash */ - bitband_set_peripheral(EFM32_MSC_WRITECTRL,_MSC_WRITECTRL_WREN_SHIFT,0); + bitband_set_peripheral(EFM32_MSC_WRITECTRL, _MSC_WRITECTRL_WREN_SHIFT, 0); /* Unlock the EFM32_MSC */ - putreg32(0,EFM32_MSC_LOCK); + putreg32(0, EFM32_MSC_LOCK); } #ifndef EFM32_FLASH_SIZE @@ -649,12 +649,12 @@ ssize_t __ramfunc__ up_progmem_erasepage(size_t page) /* enable writing to the flash */ - bitband_set_peripheral(EFM32_MSC_WRITECTRL,_MSC_WRITECTRL_WREN_SHIFT,1); + bitband_set_peripheral(EFM32_MSC_WRITECTRL, _MSC_WRITECTRL_WREN_SHIFT, 1); /* Load address */ - putreg32((uint32_t)up_progmem_getaddress(page),EFM32_MSC_ADDRB); - putreg32(MSC_WRITECMD_LADDRIM,EFM32_MSC_WRITECMD); + putreg32((uint32_t)up_progmem_getaddress(page), EFM32_MSC_ADDRB); + putreg32(MSC_WRITECMD_LADDRIM, EFM32_MSC_WRITECMD); regval = getreg32(EFM32_MSC_STATUS); @@ -676,7 +676,7 @@ ssize_t __ramfunc__ up_progmem_erasepage(size_t page) if (ret == 0) { - putreg32(MSC_WRITECMD_ERASEPAGE,EFM32_MSC_WRITECMD); + putreg32(MSC_WRITECMD_ERASEPAGE, EFM32_MSC_WRITECMD); /* Wait for the erase to complete */ @@ -694,7 +694,7 @@ ssize_t __ramfunc__ up_progmem_erasepage(size_t page) /* Disable writing to the MSC */ - bitband_set_peripheral(EFM32_MSC_WRITECTRL,_MSC_WRITECTRL_WREN_SHIFT,0); + bitband_set_peripheral(EFM32_MSC_WRITECTRL, _MSC_WRITECTRL_WREN_SHIFT, 0); if (ret == 0) { @@ -772,7 +772,7 @@ ssize_t __ramfunc__ up_progmem_write(size_t addr, const void *buf, size_t size) /* enable writing to the flash */ - bitband_set_peripheral(EFM32_MSC_WRITECTRL,_MSC_WRITECTRL_WREN_SHIFT,1); + bitband_set_peripheral(EFM32_MSC_WRITECTRL, _MSC_WRITECTRL_WREN_SHIFT, 1); /* Convert bytes to words */ @@ -783,7 +783,7 @@ ssize_t __ramfunc__ up_progmem_write(size_t addr, const void *buf, size_t size) * increments the address internally for each data load inside a page. */ - for (word_count = 0, p_data = (uint32_t *)buf; word_count < num_words;) + for (word_count = 0, p_data = (uint32_t *)buf; word_count < num_words; ) { int page_bytes; ssize_t page_idx; @@ -841,7 +841,7 @@ ssize_t __ramfunc__ up_progmem_write(size_t addr, const void *buf, size_t size) /* Disable writing to the MSC */ - bitband_set_peripheral(EFM32_MSC_WRITECTRL,_MSC_WRITECTRL_WREN_SHIFT,0); + bitband_set_peripheral(EFM32_MSC_WRITECTRL, _MSC_WRITECTRL_WREN_SHIFT, 0); #if (defined(CONFIG_EFM32_EFM32GG) || defined(CONFIG_EFM32_EFM32WG)) && (2==WORDS_PER_DATA_PHASE) diff --git a/arch/arm/src/efm32/efm32_gpioirq.c b/arch/arm/src/efm32/efm32_gpioirq.c index 0c21c912cb..f778bc894c 100644 --- a/arch/arm/src/efm32/efm32_gpioirq.c +++ b/arch/arm/src/efm32/efm32_gpioirq.c @@ -287,7 +287,7 @@ void efm32_gpioirqenable(int irq) putreg32(regval, EFM32_GPIO_IEN); irqrestore(flags); #else - bitband_set_peripheral(EFM32_GPIO_IEN,(irq - EFM32_IRQ_EXTI0),1); + bitband_set_peripheral(EFM32_GPIO_IEN, (irq - EFM32_IRQ_EXTI0), 1); #endif } } @@ -318,7 +318,7 @@ void efm32_gpioirqdisable(int irq) putreg32(regval, EFM32_GPIO_IEN); irqrestore(flags); #else - bitband_set_peripheral(EFM32_GPIO_IEN,(irq - EFM32_IRQ_EXTI0),0); + bitband_set_peripheral(EFM32_GPIO_IEN, (irq - EFM32_IRQ_EXTI0), 0); #endif } } @@ -349,7 +349,7 @@ void efm32_gpioirqclear(int irq) putreg32(regval, EFM32_GPIO_IFC); irqrestore(flags); #else - bitband_set_peripheral(EFM32_GPIO_IFC,(irq - EFM32_IRQ_EXTI0),1); + bitband_set_peripheral(EFM32_GPIO_IFC, (irq - EFM32_IRQ_EXTI0), 1); #endif } } diff --git a/arch/arm/src/efm32/efm32_i2c.c b/arch/arm/src/efm32/efm32_i2c.c index 495b920cd9..8fa05ae4fb 100644 --- a/arch/arm/src/efm32/efm32_i2c.c +++ b/arch/arm/src/efm32/efm32_i2c.c @@ -422,13 +422,13 @@ static const struct i2c_ops_s efm32_i2c_ops = .write = efm32_i2c_write, .read = efm32_i2c_read #ifdef CONFIG_I2C_WRITEREAD - ,.writeread = efm32_i2c_writeread + , .writeread = efm32_i2c_writeread #endif #ifdef CONFIG_I2C_TRANSFER - ,.transfer = efm32_i2c_transfer + , .transfer = efm32_i2c_transfer #endif #ifdef CONFIG_I2C_SLAVE - ,.setownaddress = efm32_i2c_setownaddress, + , .setownaddress = efm32_i2c_setownaddress, .registercallback = efm32_i2c_registercallback #endif }; @@ -903,7 +903,7 @@ static void efm32_i2c_setclock(FAR struct efm32_i2c_priv_s *priv, static int efm32_i2c_isr(struct efm32_i2c_priv_s *priv) { - for (;;) + for (; ; ) { int regval; @@ -1253,7 +1253,7 @@ static int efm32_i2c_isr(struct efm32_i2c_priv_s *priv) * now, before receiving the last byte. */ - efm32_i2c_putreg(priv,EFM32_I2C_CMD_OFFSET,I2C_CMD_NACK); + efm32_i2c_putreg(priv, EFM32_I2C_CMD_OFFSET, I2C_CMD_NACK); } } } diff --git a/arch/arm/src/efm32/efm32_pwm.c b/arch/arm/src/efm32/efm32_pwm.c index 43fcb6971a..343dba865c 100644 --- a/arch/arm/src/efm32/efm32_pwm.c +++ b/arch/arm/src/efm32/efm32_pwm.c @@ -325,7 +325,8 @@ static void pwm_putreg(struct efm32_pwmtimer_s *priv, int offset, uint32_t value #if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_VERBOSE) static void pwm_dumpregs(struct efm32_pwmtimer_s *priv, FAR const char *msg) { - /* TODO debug pwm_dumpregs */ + /* TODO debug pwm_dumpregs */ + #if 0 pwmvdbg("%s:\n", msg); pwmvdbg(" CR1: %04x CR2: %04x SMCR: %04x DIER: %04x\n", @@ -410,7 +411,7 @@ static int pwm_timer(FAR struct efm32_pwmtimer_s *priv, #error "Not implemented ! Sorry" #endif - if (efm32_timer_set_freq(priv->base,priv->pclk,info->frequency) < 0) + if (efm32_timer_set_freq(priv->base, priv->pclk, info->frequency) < 0) { pwmdbg("Cannot set TIMER frequency %dHz from clock %dHz\n", info->frequency, priv->pclk); @@ -440,7 +441,7 @@ static int pwm_timer(FAR struct efm32_pwmtimer_s *priv, pwm_putreg(priv, EFM32_TIMER_ROUTE_OFFSET, regval); regval = (info->duty * pwm_getreg(priv, EFM32_TIMER_TOP_OFFSET)) >> 16; - pwm_putreg(priv, cc_offet + EFM32_TIMER_CC_CCV_OFFSET , regval); + pwm_putreg(priv, cc_offet + EFM32_TIMER_CC_CCV_OFFSET, regval); //pwm_putreg(priv, cc_offet + EFM32_TIMER_CC_CCVB_OFFSET, regval); regval = (_TIMER_CC_CTRL_MODE_PWM << _TIMER_CC_CTRL_MODE_SHIFT) | \ @@ -677,19 +678,19 @@ static int pwm_setup(FAR struct pwm_lowerhalf_s *dev) switch (priv->timid) { case 0: - modifyreg32(EFM32_CMU_HFPERCLKEN0,0,CMU_HFPERCLKEN0_TIMER0); + modifyreg32(EFM32_CMU_HFPERCLKEN0, 0, CMU_HFPERCLKEN0_TIMER0); break; case 1: - modifyreg32(EFM32_CMU_HFPERCLKEN0,0,CMU_HFPERCLKEN0_TIMER1); + modifyreg32(EFM32_CMU_HFPERCLKEN0, 0, CMU_HFPERCLKEN0_TIMER1); break; case 2: - modifyreg32(EFM32_CMU_HFPERCLKEN0,0,CMU_HFPERCLKEN0_TIMER2); + modifyreg32(EFM32_CMU_HFPERCLKEN0, 0, CMU_HFPERCLKEN0_TIMER2); break; case 3: - modifyreg32(EFM32_CMU_HFPERCLKEN0,0,CMU_HFPERCLKEN0_TIMER3); + modifyreg32(EFM32_CMU_HFPERCLKEN0, 0, CMU_HFPERCLKEN0_TIMER3); break; default: @@ -698,7 +699,7 @@ static int pwm_setup(FAR struct pwm_lowerhalf_s *dev) } efm32_configgpio(priv->pincfg); - pwm_putreg(priv,EFM32_TIMER_ROUTE_OFFSET,BOARD_PWM_TIMER0_PINLOC); + pwm_putreg(priv, EFM32_TIMER_ROUTE_OFFSET, BOARD_PWM_TIMER0_PINLOC); pwm_dumpgpio(priv->pincfg, "PWM setup"); return OK; } diff --git a/arch/arm/src/efm32/efm32_rmu.c b/arch/arm/src/efm32/efm32_rmu.c index 9996ec117a..6b77564b24 100644 --- a/arch/arm/src/efm32/efm32_rmu.c +++ b/arch/arm/src/efm32/efm32_rmu.c @@ -237,7 +237,7 @@ void efm32_rmu_initialize(void) /* Now clear reset cause */ - putreg32(RMU_CMD_RCCLR,EFM32_RMU_CMD); + putreg32(RMU_CMD_RCCLR, EFM32_RMU_CMD); /* Clear some reset causes not cleared with RMU CMD register * (If EMU registers locked, they must be unlocked first) @@ -248,22 +248,22 @@ void efm32_rmu_initialize(void) { /* EMU unlock */ - putreg32(EMU_LOCK_LOCKKEY_LOCK,EMU_LOCK_LOCKKEY_UNLOCK); + putreg32(EMU_LOCK_LOCKKEY_LOCK, EMU_LOCK_LOCKKEY_UNLOCK); } - modifyreg32(EFM32_EMU_AUXCTRL,0,EMU_AUXCTRL_HRCCLR); - modifyreg32(EFM32_EMU_AUXCTRL,EMU_AUXCTRL_HRCCLR,0); + modifyreg32(EFM32_EMU_AUXCTRL, 0, EMU_AUXCTRL_HRCCLR); + modifyreg32(EFM32_EMU_AUXCTRL, EMU_AUXCTRL_HRCCLR, 0); if (locked) { /* EMU lock */ - putreg32(EMU_LOCK_LOCKKEY_LOCK,EMU_LOCK_LOCKKEY_LOCK); + putreg32(EMU_LOCK_LOCKKEY_LOCK, EMU_LOCK_LOCKKEY_LOCK); } #ifdef CONFIG_EFM32_RMU_DEBUG rmudbg("RMU => reg = 0x%08X\n", g_efm32_rstcause); - for (;;) + for (; ; ) { const char *str; diff --git a/arch/arm/src/efm32/efm32_serial.c b/arch/arm/src/efm32/efm32_serial.c index 7f3517f2c2..bfcef819fa 100644 --- a/arch/arm/src/efm32/efm32_serial.c +++ b/arch/arm/src/efm32/efm32_serial.c @@ -1019,7 +1019,7 @@ static int efm32_ioctl(struct file *filep, int cmd, unsigned long arg) /* Just speed is yet implemented */ - efm32_disableuartint(priv,&ien); + efm32_disableuartint(priv, &ien); efm32_uartconfigure(config->uartbase, config->baud, config->parity, config->bits, config->stop2); diff --git a/arch/arm/src/efm32/efm32_spi.c b/arch/arm/src/efm32/efm32_spi.c index f6396bffee..888ea06248 100644 --- a/arch/arm/src/efm32/efm32_spi.c +++ b/arch/arm/src/efm32/efm32_spi.c @@ -1288,7 +1288,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, { /* 16-bit mode */ - const uint16_t *src = (const uint16_t *)txbuffer;; + const uint16_t *src = (const uint16_t *)txbuffer; uint16_t *dest = (uint16_t *)rxbuffer; uint16_t word; @@ -1342,7 +1342,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, { /* 8-bit mode */ - const uint8_t *src = (const uint8_t *)txbuffer;; + const uint8_t *src = (const uint8_t *)txbuffer; uint8_t *dest = (uint8_t *)rxbuffer; uint8_t word; diff --git a/arch/arm/src/efm32/efm32_start.c b/arch/arm/src/efm32/efm32_start.c index 9326700d59..ec0171f230 100644 --- a/arch/arm/src/efm32/efm32_start.c +++ b/arch/arm/src/efm32/efm32_start.c @@ -312,6 +312,6 @@ void __start(void) /* Shouldn't get here */ - for (;;); + for (; ; ); #endif } diff --git a/arch/arm/src/efm32/efm32_timer.c b/arch/arm/src/efm32/efm32_timer.c index b00adb35a2..19c50b56c2 100644 --- a/arch/arm/src/efm32/efm32_timer.c +++ b/arch/arm/src/efm32/efm32_timer.c @@ -215,11 +215,11 @@ void efm32_timer_reset(uintptr_t base) putreg32(TIMER_DTLOCK_LOCKKEY_UNLOCK, base + EFM32_TIMER_DTLOCK_OFFSET); - putreg32(_TIMER_DTCTRL_RESETVALUE,base + EFM32_TIMER_DTCTRL_OFFSET ); - putreg32(_TIMER_DTTIME_RESETVALUE,base + EFM32_TIMER_DTTIME_OFFSET ); - putreg32(_TIMER_DTFC_RESETVALUE, base + EFM32_TIMER_DTFC_OFFSET ); - putreg32(_TIMER_DTOGEN_RESETVALUE,base + EFM32_TIMER_DTOGEN_OFFSET ); - putreg32(_TIMER_DTFAULTC_MASK, base + EFM32_TIMER_DTFAULTC_OFFSET ); + putreg32(_TIMER_DTCTRL_RESETVALUE, base + EFM32_TIMER_DTCTRL_OFFSET); + putreg32(_TIMER_DTTIME_RESETVALUE, base + EFM32_TIMER_DTTIME_OFFSET); + putreg32(_TIMER_DTFC_RESETVALUE, base + EFM32_TIMER_DTFC_OFFSET); + putreg32(_TIMER_DTOGEN_RESETVALUE,base + EFM32_TIMER_DTOGEN_OFFSET); + putreg32(_TIMER_DTFAULTC_MASK, base + EFM32_TIMER_DTFAULTC_OFFSET); #endif } diff --git a/arch/arm/src/efm32/efm32_usbdev.c b/arch/arm/src/efm32/efm32_usbdev.c index 3d34ec7029..308cd49022 100644 --- a/arch/arm/src/efm32/efm32_usbdev.c +++ b/arch/arm/src/efm32/efm32_usbdev.c @@ -1007,7 +1007,7 @@ static void efm32_ep0out_ctrlsetup(FAR struct efm32_usbdev_s *priv) regval = (USB_SIZEOF_CTRLREQ * 3 << _USB_DOEP0TSIZ_XFERSIZE_SHIFT) | (USB_DOEP0TSIZ_PKTCNT) | (3 << _USB_DOEP0TSIZ_SUPCNT_SHIFT); - efm32_putreg(regval,EFM32_USB_DOEP0TSIZ); + efm32_putreg(regval, EFM32_USB_DOEP0TSIZ); /* Then clear NAKing and enable the transfer */ @@ -1672,7 +1672,7 @@ static void efm32_epout_request(FAR struct efm32_usbdev_s *priv, * read request is encountered. */ - for (;;) + for (; ; ) { /* Get a reference to the request at the head of the endpoint's request queue */ @@ -3475,9 +3475,9 @@ static inline void efm32_otginterrupt(FAR struct efm32_usbdev_s *priv) regval = efm32_getreg(EFM32_USB_GOTGINT); if ((regval & OTGFS_GOTGINT_SEDET) != 0) - { + { #warning "Missing logic" - } + } /* Clear OTG interrupt */ @@ -3516,7 +3516,7 @@ static int efm32_usbinterrupt(int irq, FAR void *context) * events. */ - for (;;) + for (; ; ) { /* Get the set of pending, un-masked interrupts */ @@ -3531,6 +3531,7 @@ static int efm32_usbinterrupt(int irq, FAR void *context) { break; } + usbtrace(TRACE_INTDECODE(EFM32_TRACEINTID_INTPENDING), (uint16_t)regval); /* OUT endpoint interrupt. The core sets this bit to indicate that an @@ -3572,7 +3573,7 @@ static int efm32_usbinterrupt(int irq, FAR void *context) efm32_putreg(USB_GINTSTS_WKUPINT, EFM32_USB_GINTSTS); } - /* USB suspend interrupt */ + /* USB suspend interrupt */ if ((regval & USB_GINTSTS_USBSUSP) != 0) { @@ -4757,7 +4758,7 @@ static FAR struct usbdev_ep_s *efm32_ep_alloc(FAR struct usbdev_s *dev, irqrestore(flags); return in ? &priv->epin[epno].ep : &priv->epout[epno].ep; } - } + } /* We should not get here */ } @@ -4839,7 +4840,7 @@ static int efm32_wakeup(struct usbdev_s *dev) regval = efm32_getreg(EFM32_USB_DSTS); if ((regval & USB_DSTS_SUSPSTS) != 0) { - /* Re-start the PHY clock and un-gate USB core clock (HCLK) */ + /* Re-start the PHY clock and un-gate USB core clock (HCLK) */ #ifdef CONFIG_USBDEV_LOWPOWER regval = efm32_getreg(EFM32_USB_PCGCCTL); @@ -5188,7 +5189,7 @@ static void efm32_hwinitialize(FAR struct efm32_usbdev_s *priv) /* First Turn on USB clocking */ - modifyreg32(EFM32_CMU_HFCORECLKEN0,0, + modifyreg32(EFM32_CMU_HFCORECLKEN0, 0, CMU_HFCORECLKEN0_USB | CMU_HFCORECLKEN0_USBC); /* At start-up the core is in FS mode. */ @@ -5271,7 +5272,8 @@ static void efm32_hwinitialize(FAR struct efm32_usbdev_s *priv) /* Set Rx FIFO size */ - efm32_putreg(EFM32_RXFIFO_WORDS << _USB_GRXFSIZ_RXFDEP_SHIFT,EFM32_USB_GRXFSIZ); + efm32_putreg(EFM32_RXFIFO_WORDS << _USB_GRXFSIZ_RXFDEP_SHIFT, + EFM32_USB_GRXFSIZ); /* EP0 TX */ diff --git a/arch/arm/src/efm32/efm32_usbhost.c b/arch/arm/src/efm32/efm32_usbhost.c index b9cc9e6af8..022ccd3553 100644 --- a/arch/arm/src/efm32/efm32_usbhost.c +++ b/arch/arm/src/efm32/efm32_usbhost.c @@ -1728,7 +1728,7 @@ static int efm32_ctrl_sendsetup(FAR struct efm32_usbhost_s *priv, return ret; } - /* Get the elapsed time (in frames) */ + /* Get the elapsed time (in frames) */ elapsed = clock_systimer() - start; } @@ -1949,7 +1949,7 @@ static ssize_t efm32_in_transfer(FAR struct efm32_usbhost_s *priv, int chidx, if (ret < 0) { - usbhost_trace1(USBHOST_TRACE1_TRNSFRFAILED,ret); + usbhost_trace1(USBHOST_TRACE1_TRNSFRFAILED, ret); /* Check for a special case: If (1) the transfer was NAKed and (2) * no Tx FIFO empty or Rx FIFO not-empty event occurred, then we @@ -2194,7 +2194,7 @@ static ssize_t efm32_out_transfer(FAR struct efm32_usbhost_s *priv, int chidx, ret = efm32_chan_waitsetup(priv, chan); if (ret < 0) { - usbhost_trace1(USBHOST_TRACE1_DEVDISCONN,0); + usbhost_trace1(USBHOST_TRACE1_DEVDISCONN, 0); return (ssize_t)ret; } @@ -2207,7 +2207,7 @@ static ssize_t efm32_out_transfer(FAR struct efm32_usbhost_s *priv, int chidx, return (ssize_t)ret; } - /* Wait for the transfer to complete and get the result */ + /* Wait for the transfer to complete and get the result */ ret = efm32_chan_wait(priv, chan); @@ -2215,7 +2215,7 @@ static ssize_t efm32_out_transfer(FAR struct efm32_usbhost_s *priv, int chidx, if (ret < 0) { - usbhost_trace1(USBHOST_TRACE1_TRNSFRFAILED,ret); + usbhost_trace1(USBHOST_TRACE1_TRNSFRFAILED, ret); /* Check for a special case: If (1) the transfer was NAKed and (2) * no Tx FIFO empty or Rx FIFO not-empty event occurred, then we @@ -2899,7 +2899,7 @@ static void efm32_gint_connected(FAR struct efm32_usbhost_s *priv) { /* Yes.. then now we are connected */ - usbhost_vtrace1(USBHOST_VTRACE1_CONNECTED,0); + usbhost_vtrace1(USBHOST_VTRACE1_CONNECTED, 0); priv->connected = true; priv->change = true; DEBUGASSERT(priv->smstate == SMSTATE_DETACHED); @@ -2931,7 +2931,7 @@ static void efm32_gint_disconnected(FAR struct efm32_usbhost_s *priv) { /* Yes.. then we no longer connected */ - usbhost_vtrace1(USBHOST_VTRACE1_DISCONNECTED,0); + usbhost_vtrace1(USBHOST_VTRACE1_DISCONNECTED, 0); /* Are we bound to a class driver? */ @@ -3514,7 +3514,7 @@ static int efm32_gint_isr(int irq, FAR void *context) * little interrupt handling overhead. */ - for (;;) + for (; ; ) { /* Get the unmasked bits in the GINT status */ @@ -3807,7 +3807,7 @@ static int efm32_wait(FAR struct usbhost_connection_s *conn, /* Loop until a change in connection state is detected */ flags = irqsave(); - for (;;) + for (; ; ) { /* Is there a change in the connection state of the single root hub * port? @@ -3901,7 +3901,7 @@ static int efm32_rh_enumerate(FAR struct efm32_usbhost_s *priv, { /* No, return an error */ - usbhost_trace1(USBHOST_TRACE1_DEVDISCONN,0); + usbhost_trace1(USBHOST_TRACE1_DEVDISCONN, 0); return -ENODEV; } diff --git a/arch/arm/src/imx/imx_serial.c b/arch/arm/src/imx/imx_serial.c index 4e6775fc15..c134c13495 100644 --- a/arch/arm/src/imx/imx_serial.c +++ b/arch/arm/src/imx/imx_serial.c @@ -834,7 +834,7 @@ static int up_interrupt(int irq, void *context) * until we have been looping for a long time. */ - for (;;) + for (; ; ) { /* Get the current UART status and check for loop * termination conditions diff --git a/arch/arm/src/kinetis/kinetis_enet.c b/arch/arm/src/kinetis/kinetis_enet.c index 9359681580..50a24bd8c3 100644 --- a/arch/arm/src/kinetis/kinetis_enet.c +++ b/arch/arm/src/kinetis/kinetis_enet.c @@ -680,7 +680,7 @@ static void kinetis_txdone(FAR struct kinetis_driver_s *priv) priv->txtail = 0; } - /* Update statistics */ + /* Update statistics */ EMAC_STAT(priv, tx_done); } diff --git a/arch/arm/src/kinetis/kinetis_sdhc.c b/arch/arm/src/kinetis/kinetis_sdhc.c index e97863ae5c..f457c5c895 100644 --- a/arch/arm/src/kinetis/kinetis_sdhc.c +++ b/arch/arm/src/kinetis/kinetis_sdhc.c @@ -832,9 +832,9 @@ static void kinetis_transmit(struct kinetis_dev_s *priv) priv->remaining = 0; } - /* Put the word in the FIFO */ + /* Put the word in the FIFO */ - putreg32(data.w, KINETIS_SDHC_DATPORT); + putreg32(data.w, KINETIS_SDHC_DATPORT); } fllvdbg("Exit: remaining: %d IRQSTAT: %08x\n", @@ -2426,7 +2426,7 @@ static sdio_eventset_t kinetis_eventwait(FAR struct sdio_dev_s *dev, * may have already occurred before this function was called! */ - for (;;) + for (; ; ) { /* Wait for an event in event set to occur. If this the event has already * occurred, then the semaphore will already have been incremented and @@ -2706,8 +2706,8 @@ static void kinetis_callback(void *arg) /* Media is present. Is the media inserted event enabled? */ if ((priv->cbevents & SDIOMEDIA_INSERTED) == 0) - { - /* No... return without performing the callback */ + { + /* No... return without performing the callback */ return; } diff --git a/arch/arm/src/kinetis/kinetis_start.c b/arch/arm/src/kinetis/kinetis_start.c index df5b6adec3..425a6c6b4b 100644 --- a/arch/arm/src/kinetis/kinetis_start.c +++ b/arch/arm/src/kinetis/kinetis_start.c @@ -165,5 +165,5 @@ void __start(void) /* Shouldn't get here */ - for (;;); + for (; ; ); } diff --git a/arch/arm/src/kl/kl_lowputc.c b/arch/arm/src/kl/kl_lowputc.c index 597b687a74..cb08623a5c 100644 --- a/arch/arm/src/kl/kl_lowputc.c +++ b/arch/arm/src/kl/kl_lowputc.c @@ -154,62 +154,62 @@ void kl_lowputc(uint32_t ch) ****************************************************************************/ void kl_lowsetup(void) { - uint32_t regval; - uint8_t regval8; + uint32_t regval; + uint8_t regval8; #if 0 - regval = getreg32(KL_SIM_SOPT2); - regval |= SIM_SOPT2_PLLFLLSEL | SIM_SOPT2_UART0SRC_MCGCLK ; - putreg32(regval, KL_SIM_SOPT2); + regval = getreg32(KL_SIM_SOPT2); + regval |= SIM_SOPT2_PLLFLLSEL | SIM_SOPT2_UART0SRC_MCGCLK ; + putreg32(regval, KL_SIM_SOPT2); #endif - regval = getreg32(KL_SIM_SCGC4); + regval = getreg32(KL_SIM_SCGC4); #ifdef CONFIG_KL_UART0 - regval |= SIM_SCGC4_UART0; + regval |= SIM_SCGC4_UART0; #endif #ifdef CONFIG_KL_UART1 - regval |= SIM_SCGC4_UART1; + regval |= SIM_SCGC4_UART1; #endif #ifdef CONFIG_KL_UART2 - regval |= SIM_SCGC4_UART2; + regval |= SIM_SCGC4_UART2; #endif - putreg32(regval, KL_SIM_SCGC4); + putreg32(regval, KL_SIM_SCGC4); - regval = getreg32(KL_SIM_SOPT2); - regval &= ~(SIM_SOPT2_UART0SRC_MASK); - putreg32(regval, KL_SIM_SOPT2); + regval = getreg32(KL_SIM_SOPT2); + regval &= ~(SIM_SOPT2_UART0SRC_MASK); + putreg32(regval, KL_SIM_SOPT2); - regval = getreg32(KL_SIM_SOPT2); - regval |= SIM_SOPT2_UART0SRC_MCGCLK; - putreg32(regval, KL_SIM_SOPT2); + regval = getreg32(KL_SIM_SOPT2); + regval |= SIM_SOPT2_UART0SRC_MCGCLK; + putreg32(regval, KL_SIM_SOPT2); - putreg32((PORT_PCR_MUX_ALT2), KL_PORTA_PCR1); - putreg32((PORT_PCR_MUX_ALT2), KL_PORTA_PCR2); + putreg32((PORT_PCR_MUX_ALT2), KL_PORTA_PCR1); + putreg32((PORT_PCR_MUX_ALT2), KL_PORTA_PCR2); - /* Disable UART before changing registers */ + /* Disable UART before changing registers */ - putreg8(0, KL_UART0_C2); - putreg8(0, KL_UART0_C1); - putreg8(0, KL_UART0_C3); - putreg8(0, KL_UART0_S2); + putreg8(0, KL_UART0_C2); + putreg8(0, KL_UART0_C1); + putreg8(0, KL_UART0_C3); + putreg8(0, KL_UART0_S2); - /* Set the baud rate divisor */ + /* Set the baud rate divisor */ - uint16_t divisor = (CONSOLE_FREQ / OVER_SAMPLE) / CONSOLE_BAUD; - regval8 = OVER_SAMPLE - 1; - putreg8(regval8, KL_UART0_C4); + uint16_t divisor = (CONSOLE_FREQ / OVER_SAMPLE) / CONSOLE_BAUD; + regval8 = OVER_SAMPLE - 1; + putreg8(regval8, KL_UART0_C4); - regval8 = (divisor >> 8) & UART_BDH_SBR_MASK; - putreg8(regval8, KL_UART0_BDH); + regval8 = (divisor >> 8) & UART_BDH_SBR_MASK; + putreg8(regval8, KL_UART0_BDH); - regval8 = (divisor & UART_BDL_SBR_MASK); - putreg8(regval8, KL_UART0_BDL); + regval8 = (divisor & UART_BDL_SBR_MASK); + putreg8(regval8, KL_UART0_BDL); - /* Enable UART before changing registers */ + /* Enable UART before changing registers */ - regval8 = getreg8(KL_UART0_C2); - regval8 |= (UART_C2_RE | UART_C2_TE); - putreg8(regval8, KL_UART0_C2); + regval8 = getreg8(KL_UART0_C2); + regval8 |= (UART_C2_RE | UART_C2_TE); + putreg8(regval8, KL_UART0_C2); /* Configure the console (only) now. Other UARTs will be configured * when the serial driver is opened. diff --git a/arch/arm/src/kl/kl_start.c b/arch/arm/src/kl/kl_start.c index c87f65b7c3..63491ac74d 100644 --- a/arch/arm/src/kl/kl_start.c +++ b/arch/arm/src/kl/kl_start.c @@ -181,6 +181,6 @@ void __start(void) /* Shoulnd't get here */ - for (;;); + for (; ; ); } diff --git a/arch/arm/src/lpc11xx/lpc11_gpioint.c b/arch/arm/src/lpc11xx/lpc11_gpioint.c index 71075d5275..764d5e3135 100644 --- a/arch/arm/src/lpc11xx/lpc11_gpioint.c +++ b/arch/arm/src/lpc11xx/lpc11_gpioint.c @@ -454,7 +454,7 @@ static int lpc11_gpiointerrupt(int irq, void *context) void lpc11_gpioirqinitialize(void) { - /* Disable all GPIO interrupts */ + /* Disable all GPIO interrupts */ putreg32(0, LPC17_GPIOINT0_INTENR); putreg32(0, LPC17_GPIOINT0_INTENF); diff --git a/arch/arm/src/lpc11xx/lpc11_spi.c b/arch/arm/src/lpc11xx/lpc11_spi.c index 43f81afd43..734923bac9 100644 --- a/arch/arm/src/lpc11xx/lpc11_spi.c +++ b/arch/arm/src/lpc11xx/lpc11_spi.c @@ -485,7 +485,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, while ((getreg32(LPC11_SPI_SR) & SPI_SR_SPIF) == 0); - /* Read the SPI Status Register again to clear the status bit */ + /* Read the SPI Status Register again to clear the status bit */ (void)getreg32(LPC11_SPI_SR); nwords--; diff --git a/arch/arm/src/lpc11xx/lpc11_start.c b/arch/arm/src/lpc11xx/lpc11_start.c index 6ec8f727fc..7842969149 100644 --- a/arch/arm/src/lpc11xx/lpc11_start.c +++ b/arch/arm/src/lpc11xx/lpc11_start.c @@ -171,5 +171,5 @@ void __start(void) /* Shouldn't get here */ - for (;;); + for (; ; ); } diff --git a/arch/arm/src/lpc11xx/lpc11_timer.c b/arch/arm/src/lpc11xx/lpc11_timer.c index 6f867202e2..56aafb6959 100644 --- a/arch/arm/src/lpc11xx/lpc11_timer.c +++ b/arch/arm/src/lpc11xx/lpc11_timer.c @@ -400,24 +400,24 @@ static int timer_setup(FAR struct pwm_lowerhalf_s *dev) regval = getreg32(LPC17_SYSCON_PCLKSEL0); regval &= ~(0x3 << 2); - regval |= (0x1 << 2); /* PCLK_MC peripheral clk=CCLK=12.5 MHz */ + regval |= (0x1 << 2); /* PCLK_MC peripheral clk=CCLK=12.5 MHz */ regval &= ~(0x3 << 4); - regval |= (0x1 << 4); /* PCLK_MC peripheral clk=CCLK=12.5 MHz */ + regval |= (0x1 << 4); /* PCLK_MC peripheral clk=CCLK=12.5 MHz */ putreg32(regval, LPC17_SYSCON_PCLKSEL0); regval = getreg32(LPC17_SYSCON_PCLKSEL1); regval &= ~(0x3 << 12); - regval |= (0x1 << 12); /* PCLK_MC peripheral clk=CCLK=12.5 MHz */ + regval |= (0x1 << 12); /* PCLK_MC peripheral clk=CCLK=12.5 MHz */ regval &= ~(0x3 << 14); - regval |= (0x1 << 14); /* PCLK_MC peripheral clk=CCLK=12.5 MHz */ + regval |= (0x1 << 14); /* PCLK_MC peripheral clk=CCLK=12.5 MHz */ putreg32(regval, LPC17_SYSCON_PCLKSEL1); priv->pclk = (0x1 << 12) | (0x1 << 4); - putreg32(1000, LPC17_TMR0_MR1); /* Set TIMER0 MR1 = number of counts */ + putreg32(1000, LPC17_TMR0_MR1); /* Set TIMER0 MR1 = number of counts */ - putreg32(1, LPC17_TMR0_PR); /* Prescaler count frequency: Fpclk/1 */ - putreg32(~(0x3 << 0), LPC17_TMR0_CCR); /* Prescaler count frequency: Fpclk/1 */ - putreg32(~(0x3 << 0), LPC17_TMR0_CTCR);/* Prescaler count frequency: Fpclk/1 */ - putreg32((2 << 3), LPC17_TMR0_MCR); /* Reset on match register MR1 */ + putreg32(1, LPC17_TMR0_PR); /* Prescaler count frequency: Fpclk/1 */ + putreg32(~(0x3 << 0), LPC17_TMR0_CCR); /* Prescaler count frequency: Fpclk/1 */ + putreg32(~(0x3 << 0), LPC17_TMR0_CTCR); /* Prescaler count frequency: Fpclk/1 */ + putreg32((2 << 3), LPC17_TMR0_MCR); /* Reset on match register MR1 */ /* Output bit toggle on external match event External match on MR1, Toggle * external bit @@ -430,14 +430,14 @@ static int timer_setup(FAR struct pwm_lowerhalf_s *dev) lpc11_configgpio(GPIO_MAT0p1_2); - putreg32(500, LPC17_TMR1_MR0); /* Set TIMER1 MR0 = number of counts */ + putreg32(500, LPC17_TMR1_MR0); /* Set TIMER1 MR0 = number of counts */ - putreg32(1, LPC17_TMR1_PR); /* Prescaler count frequency:Fpclk/1 */ - putreg32(~(0x3 << 0), LPC17_TMR1_CCR); /* Prescaler count frequency:Fpclk/1 */ - putreg32(~(0x3 << 0), LPC17_TMR1_CTCR);/* Prescaler count frequency:Fpclk/1 */ - putreg32((2 << 0), LPC17_TMR1_MCR); /* Reset on match register MR0 */ + putreg32(1, LPC17_TMR1_PR); /* Prescaler count frequency:Fpclk/1 */ + putreg32(~(0x3 << 0), LPC17_TMR1_CCR); /* Prescaler count frequency:Fpclk/1 */ + putreg32(~(0x3 << 0), LPC17_TMR1_CTCR); /* Prescaler count frequency:Fpclk/1 */ + putreg32((2 << 0), LPC17_TMR1_MCR); /* Reset on match register MR0 */ // putreg32(((1 << 0) | (3 << 4)), LPC17_TMR1_EMR); /* Output bit toggle on external match event MAT0 */ - putreg32((1 << 0), LPC17_TMR1_TCR); /* Start timer1 */ + putreg32((1 << 0), LPC17_TMR1_TCR); /* Start timer1 */ /* configure the output pins GPIO3.26 */ // lpc11_configgpio(GPIO_MAT0p1_2); diff --git a/arch/arm/src/lpc17xx/lpc176x_clockconfig.c b/arch/arm/src/lpc17xx/lpc176x_clockconfig.c index 4befd37591..d74e2b8dc8 100644 --- a/arch/arm/src/lpc17xx/lpc176x_clockconfig.c +++ b/arch/arm/src/lpc17xx/lpc176x_clockconfig.c @@ -138,14 +138,14 @@ void lpc17_clockconfig(void) /* Enable and connect PLL0 */ - putreg32(SYSCON_PLLCON_PLLE|SYSCON_PLLCON_PLLC, LPC17_SYSCON_PLL0CON); + putreg32(SYSCON_PLLCON_PLLE | SYSCON_PLLCON_PLLC, LPC17_SYSCON_PLL0CON); putreg32(0xaa, LPC17_SYSCON_PLL0FEED); putreg32(0x55, LPC17_SYSCON_PLL0FEED); /* Wait for PLL to report that it is connected and enabled */ - while ((getreg32(LPC17_SYSCON_PLL0STAT) & (SYSCON_PLL0STAT_PLLE|SYSCON_PLL0STAT_PLLC)) - != (SYSCON_PLL0STAT_PLLE|SYSCON_PLL0STAT_PLLC)); + while ((getreg32(LPC17_SYSCON_PLL0STAT) & (SYSCON_PLL0STAT_PLLE | SYSCON_PLL0STAT_PLLC)) + != (SYSCON_PLL0STAT_PLLE | SYSCON_PLL0STAT_PLLC)); #endif /* CONFIG_LPC17_PLL0 */ @@ -178,14 +178,14 @@ void lpc17_clockconfig(void) /* Enable and connect PLL1 */ - putreg32(SYSCON_PLLCON_PLLE|SYSCON_PLLCON_PLLC, LPC17_SYSCON_PLL1CON); + putreg32(SYSCON_PLLCON_PLLE | SYSCON_PLLCON_PLLC, LPC17_SYSCON_PLL1CON); putreg32(0xaa, LPC17_SYSCON_PLL1FEED); putreg32(0x55, LPC17_SYSCON_PLL1FEED); /* Wait for PLL to report that it is connected and enabled */ - while ((getreg32(LPC17_SYSCON_PLL1STAT) & (SYSCON_PLL1STAT_PLLE|SYSCON_PLL1STAT_PLLC)) - != (SYSCON_PLL1STAT_PLLE|SYSCON_PLL1STAT_PLLC)); + while ((getreg32(LPC17_SYSCON_PLL1STAT) & (SYSCON_PLL1STAT_PLLE | SYSCON_PLL1STAT_PLLC)) + != (SYSCON_PLL1STAT_PLLE | SYSCON_PLL1STAT_PLLC)); #else /* CONFIG_LPC17_PLL1 */ @@ -218,4 +218,3 @@ void lpc17_clockconfig(void) putreg32(BOARD_FLASHCFG_VALUE, LPC17_SYSCON_FLASHCFG); #endif } - diff --git a/arch/arm/src/lpc17xx/lpc178x_gpio.c b/arch/arm/src/lpc17xx/lpc178x_gpio.c index 4a27945c15..a30b7d4255 100644 --- a/arch/arm/src/lpc17xx/lpc178x_gpio.c +++ b/arch/arm/src/lpc17xx/lpc178x_gpio.c @@ -217,7 +217,8 @@ static uint32_t lpc17_getioconmask(unsigned int port, unsigned int pin) * ****************************************************************************/ -static void lpc17_seti2cmode(unsigned int port,unsigned int pin, uint32_t value) +static void lpc17_seti2cmode(unsigned int port, unsigned int pin, + uint32_t value) { uint32_t regaddr; uint32_t regval; diff --git a/arch/arm/src/lpc17xx/lpc17_adc.c b/arch/arm/src/lpc17xx/lpc17_adc.c index 0587e3085b..220691ebfa 100644 --- a/arch/arm/src/lpc17xx/lpc17_adc.c +++ b/arch/arm/src/lpc17xx/lpc17_adc.c @@ -383,7 +383,7 @@ static int adc_interrupt(int irq, void *context) { value = priv->buf[ch] / priv->count[ch]; value <<= 15; - adc_receive(&g_adcdev,ch,value); + adc_receive(&g_adcdev, ch, value); priv->buf[ch] = 0; priv->count[ch] = 0; } @@ -408,7 +408,7 @@ static int adc_interrupt(int irq, void *context) { value = priv->buf[ch] / priv->count[ch]; value <<= 15; - adc_receive(&g_adcdev,ch,value); + adc_receive(&g_adcdev, ch, value); priv->buf[ch] = 0; priv->count[ch] = 0; } @@ -424,7 +424,7 @@ static int adc_interrupt(int irq, void *context) /* Verify that an interrupt has actually occured */ regVal2 = getreg32(LPC17_ADC_STAT); /* Read ADSTAT will clear the interrupt flag */ - if ((regVal2) & (1<<16)) + if ((regVal2) & (1 << 16)) { if ((priv->mask & 0x01) != 0) { @@ -563,7 +563,7 @@ static int adc_interrupt(int irq, void *context) regVal3 = getreg32(LPC17_ADC_GDR); /* Read ADGDR clear the DONE and OVERRUN bits */ putreg32((priv->mask) | /* Select channels 0 to 7 on ADC0 */ - ((32) << 8) | /* CLKDIV = 16 */ + (32 << 8) | /* CLKDIV = 16 */ (0 << 16) | /* BURST = 1, BURST capture all selected channels */ (1 << 17) | /* Reserved bit = 0 */ (1 << 21) | /* PDN = 1, normal operation */ diff --git a/arch/arm/src/lpc17xx/lpc17_allocateheap.c b/arch/arm/src/lpc17xx/lpc17_allocateheap.c index b9b524d1eb..e6969326b6 100644 --- a/arch/arm/src/lpc17xx/lpc17_allocateheap.c +++ b/arch/arm/src/lpc17xx/lpc17_allocateheap.c @@ -250,7 +250,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) /* Return the user-space heap settings */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)ubase; + *heap_start = (FAR void *)ubase; *heap_size = usize; /* Allow user-mode access to the user heap memory */ @@ -261,7 +261,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) /* Return the heap settings */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)g_idle_topstack; + *heap_start = (FAR void *)g_idle_topstack; *heap_size = CONFIG_RAM_END - g_idle_topstack; #endif } @@ -305,7 +305,7 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size) * that was not dedicated to the user heap). */ - *heap_start = (FAR void*)USERSPACE->us_bssend; + *heap_start = (FAR void *)USERSPACE->us_bssend; *heap_size = ubase - (uintptr_t)USERSPACE->us_bssend; } #endif @@ -345,17 +345,17 @@ void up_addregion(void) /* Add the AHB SRAM user heap region. */ - kumm_addregion((FAR void*)LPC17_AHB_HEAPBASE, LPC17_AHB_HEAPSIZE); + kumm_addregion((FAR void *)LPC17_AHB_HEAPBASE, LPC17_AHB_HEAPSIZE); #endif #if CONFIG_MM_REGIONS >= 3 #if defined(CONFIG_LPC17_EXTDRAM) && defined(CONFIG_LPC17_EXTDRAMHEAP) - kmm_addregion((FAR void*)LPC17_EXTDRAM_CS0, CONFIG_LPC17_EXTDRAMSIZE); + kmm_addregion((FAR void *)LPC17_EXTDRAM_CS0, CONFIG_LPC17_EXTDRAMSIZE); #endif #if !defined(CONFIG_LPC17_EXTDRAMHEAP) || (CONFIG_MM_REGIONS >= 4) #if defined(CONFIG_LPC17_EXTSRAM0) && defined(CONFIG_LPC17_EXTSRAM0HEAP) - kmm_addregion((FAR void*)LPC17_EXTSRAM_CS0, CONFIG_LPC17_EXTSRAM0SIZE); + kmm_addregion((FAR void *)LPC17_EXTSRAM_CS0, CONFIG_LPC17_EXTSRAM0SIZE); #endif #endif #endif diff --git a/arch/arm/src/lpc17xx/lpc17_can.c b/arch/arm/src/lpc17xx/lpc17_can.c index f1e8209deb..2cd55626c4 100644 --- a/arch/arm/src/lpc17xx/lpc17_can.c +++ b/arch/arm/src/lpc17xx/lpc17_can.c @@ -335,20 +335,20 @@ static void can_printreg(uint32_t addr, uint32_t value) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = value; - count = 1; + prevaddr = addr; + preval = value; + count = 1; } /* Show the register value read */ @@ -616,9 +616,9 @@ static void can_rxint(FAR struct can_dev_s *dev, bool enable) canvdbg("CAN%d enable: %d\n", priv->port, enable); - /* The EIR register is also modifed from the interrupt handler, so we have - * to protect this code section. - */ + /* The EIR register is also modifed from the interrupt handler, so we have + * to protect this code section. + */ flags = irqsave(); regval = can_getreg(priv, LPC17_CAN_IER_OFFSET); @@ -630,6 +630,7 @@ static void can_rxint(FAR struct can_dev_s *dev, bool enable) { regval &= ~CAN_IER_RIE; } + can_putreg(priv, LPC17_CAN_IER_OFFSET, regval); irqrestore(flags); } @@ -829,7 +830,7 @@ static int can_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg) regval |= CAN_IER_TIE2; can_putreg(priv, LPC17_CAN_IER_OFFSET, regval); - /* Set up the transfer */ + /* Set up the transfer */ can_putreg(priv, LPC17_CAN_TFI2_OFFSET, tfi); can_putreg(priv, LPC17_CAN_TID2_OFFSET, tid); @@ -1185,7 +1186,7 @@ static int can_bittiming(struct up_dev_s *priv) { ts1 = CONFIG_CAN_TSEG1; ts2 = CONFIG_CAN_TSEG2; - brp = (nclks + (CAN_BIT_QUANTA/2)) / CAN_BIT_QUANTA; + brp = (nclks + (CAN_BIT_QUANTA / 2)) / CAN_BIT_QUANTA; DEBUGASSERT(brp >=1 && brp <= CAN_BTR_BRP_MAX); } diff --git a/arch/arm/src/lpc17xx/lpc17_dac.c b/arch/arm/src/lpc17xx/lpc17_dac.c index 3f2fa5a700..adc9db849c 100644 --- a/arch/arm/src/lpc17xx/lpc17_dac.c +++ b/arch/arm/src/lpc17xx/lpc17_dac.c @@ -91,12 +91,12 @@ static int dac_ioctl(FAR struct dac_dev_s *dev, int cmd, unsigned long arg); static const struct dac_ops_s g_dacops = { - .ao_reset =dac_reset, - .ao_setup = dac_setup, + .ao_reset = dac_reset, + .ao_setup = dac_setup, .ao_shutdown = dac_shutdown, - .ao_txint = dac_txint, - .ao_send = dac_send, - .ao_ioctl = dac_ioctl, + .ao_txint = dac_txint, + .ao_send = dac_send, + .ao_ioctl = dac_ioctl, }; static struct dac_dev_s g_dacdev = @@ -124,7 +124,7 @@ static void dac_reset(FAR struct dac_dev_s *dev) regval |= (SYSCON_PCLKSEL_CCLK8 << SYSCON_PCLKSEL0_DAC_SHIFT); putreg32(regval, LPC17_SYSCON_PCLKSEL0); - //putreg32(DAC_CTRL_DBLBUFEN,LPC17_DAC_CTRL); ? + //putreg32(DAC_CTRL_DBLBUFEN, LPC17_DAC_CTRL); ? lpc17_configgpio(GPIO_AOUT); diff --git a/arch/arm/src/lpc17xx/lpc17_ethernet.c b/arch/arm/src/lpc17xx/lpc17_ethernet.c index 0e1e34253e..41fe4e7f9f 100644 --- a/arch/arm/src/lpc17xx/lpc17_ethernet.c +++ b/arch/arm/src/lpc17xx/lpc17_ethernet.c @@ -599,7 +599,7 @@ static int lpc17_txdesc(struct lpc17_driver_s *priv) prodidx = lpc17_getreg(LPC17_ETH_TXPRODIDX) & ETH_TXPRODIDX_MASK; if (++prodidx >= CONFIG_NET_NTXDESC) { - /* Wrap back to index zero */ + /* Wrap back to index zero */ prodidx = 0; } @@ -659,8 +659,8 @@ static int lpc17_transmit(struct lpc17_driver_s *priv) * fields. */ - txdesc = (uint32_t*)(LPC17_TXDESC_BASE + (prodidx << 3)); - txbuffer = (void*)*txdesc++; + txdesc = (uint32_t *)(LPC17_TXDESC_BASE + (prodidx << 3)); + txbuffer = (void *)*txdesc++; *txdesc = TXDESC_CONTROL_INT | TXDESC_CONTROL_LAST | TXDESC_CONTROL_CRC | (priv->lp_dev.d_len - 1); @@ -682,7 +682,7 @@ static int lpc17_transmit(struct lpc17_driver_s *priv) if (++prodidx >= CONFIG_NET_NTXDESC) { - /* Wrap back to index zero */ + /* Wrap back to index zero */ prodidx = 0; } @@ -873,7 +873,7 @@ static void lpc17_rxdone_process(struct lpc17_driver_s *priv) /* Get the Rx status and packet length (-4+1) */ - rxstat = (uint32_t*)(LPC17_RXSTAT_BASE + (considx << 3)); + rxstat = (uint32_t *)(LPC17_RXSTAT_BASE + (considx << 3)); pktlen = (*rxstat & RXSTAT_INFO_RXSIZE_MASK) - 3; /* Check for errors. NOTE: The DMA engine reports bogus length errors, @@ -920,8 +920,8 @@ static void lpc17_rxdone_process(struct lpc17_driver_s *priv) /* Get the Rx buffer address from the Rx descriptor */ - rxdesc = (uint32_t*)(LPC17_RXDESC_BASE + (considx << 3)); - rxbuffer = (void*)*rxdesc; + rxdesc = (uint32_t *)(LPC17_RXDESC_BASE + (considx << 3)); + rxbuffer = (void *)*rxdesc; /* Copy the data data from the EMAC DMA RAM to priv->lp_dev.d_buf. * Set amount of data in priv->lp_dev.d_len @@ -1059,8 +1059,8 @@ static void lpc17_rxdone_process(struct lpc17_driver_s *priv) */ if (++considx >= CONFIG_NET_NRXDESC) - { - /* Wrap back to index zero */ + { + /* Wrap back to index zero */ considx = 0; } @@ -1245,7 +1245,7 @@ static int lpc17_interrupt(int irq, void *context) * error. */ - if ((status & (ETH_INT_RXOVR|ETH_INT_TXUNR)) != 0) + if ((status & (ETH_INT_RXOVR | ETH_INT_TXUNR)) != 0) { if ((status & ETH_INT_RXOVR) != 0) { @@ -1259,7 +1259,7 @@ static int lpc17_interrupt(int irq, void *context) EMAC_STAT(priv, tx_underrun); } - /* ifup() will reset the EMAC and bring it back up */ + /* ifup() will reset the EMAC and bring it back up */ (void)lpc17_ifup(&priv->lp_dev); } @@ -2334,8 +2334,8 @@ static int lpc17_rmmac(struct net_driver_s *dev, const uint8_t *mac) #if defined(CONFIG_NET_REGDEBUG) && defined(CONFIG_DEBUG_GPIO) static void lpc17_showpins(void) { - lpc17_dumpgpio(GPIO_PORT1|GPIO_PIN0, "P1[1-15]"); - lpc17_dumpgpio(GPIO_PORT1|GPIO_PIN16, "P1[16-31]"); + lpc17_dumpgpio(GPIO_PORT1 | GPIO_PIN0, "P1[1-15]"); + lpc17_dumpgpio(GPIO_PORT1 | GPIO_PIN16, "P1[16-31]"); } #endif @@ -2449,7 +2449,7 @@ static uint16_t lpc17_phyread(uint8_t phyaddr, uint8_t regaddr) /* Wait for the PHY command to complete */ - while ((lpc17_getreg(LPC17_ETH_MIND) & (ETH_MIND_BUSY|ETH_MIND_NVALID)) != 0); + while ((lpc17_getreg(LPC17_ETH_MIND) & (ETH_MIND_BUSY | ETH_MIND_NVALID)) != 0); lpc17_putreg(0, LPC17_ETH_MCMD); /* Return the PHY register data */ @@ -2970,7 +2970,7 @@ static inline void lpc17_txdescinit(struct lpc17_driver_s *priv) /* Initialize Tx descriptors and link to packet buffers */ - txdesc = (uint32_t*)LPC17_TXDESC_BASE; + txdesc = (uint32_t *)LPC17_TXDESC_BASE; pktaddr = LPC17_TXBUFFER_BASE; for (i = 0; i < CONFIG_NET_NTXDESC; i++) @@ -2982,7 +2982,7 @@ static inline void lpc17_txdescinit(struct lpc17_driver_s *priv) /* Initialize Tx status */ - txstat = (uint32_t*)LPC17_TXSTAT_BASE; + txstat = (uint32_t *)LPC17_TXSTAT_BASE; for (i = 0; i < CONFIG_NET_NTXDESC; i++) { *txstat++ = 0; @@ -3026,7 +3026,7 @@ static inline void lpc17_rxdescinit(struct lpc17_driver_s *priv) /* Initialize Rx descriptors and link to packet buffers */ - rxdesc = (uint32_t*)LPC17_RXDESC_BASE; + rxdesc = (uint32_t *)LPC17_RXDESC_BASE; pktaddr = LPC17_RXBUFFER_BASE; for (i = 0; i < CONFIG_NET_NRXDESC; i++) @@ -3038,7 +3038,7 @@ static inline void lpc17_rxdescinit(struct lpc17_driver_s *priv) /* Initialize Rx status */ - rxstat = (uint32_t*)LPC17_RXSTAT_BASE; + rxstat = (uint32_t *)LPC17_RXSTAT_BASE; for (i = 0; i < CONFIG_NET_NRXDESC; i++) { *rxstat++ = 0; @@ -3264,7 +3264,7 @@ static inline int lpc17_ethinitialize(int intf) priv->lp_dev.d_addmac = lpc17_addmac; /* Add multicast MAC address */ priv->lp_dev.d_rmmac = lpc17_rmmac; /* Remove multicast MAC address */ #endif - priv->lp_dev.d_private = (void*)priv; /* Used to recover private state from dev */ + priv->lp_dev.d_private = (void *)priv; /* Used to recover private state from dev */ #if CONFIG_LPC17_NINTERFACES > 1 # error "A mechanism to associate base address an IRQ with an interface is needed" diff --git a/arch/arm/src/lpc17xx/lpc17_gpdma.c b/arch/arm/src/lpc17xx/lpc17_gpdma.c index a8c77281b0..dbecb2ec3a 100644 --- a/arch/arm/src/lpc17xx/lpc17_gpdma.c +++ b/arch/arm/src/lpc17xx/lpc17_gpdma.c @@ -519,7 +519,7 @@ int lpc17_dmasetup(DMA_HANDLE handle, uint32_t control, uint32_t config, * interrupt enable bit which is controlled by the driver. */ - regval = control & ~(DMACH_CONTROL_XFRSIZE_MASK|DMACH_CONTROL_I); + regval = control & ~(DMACH_CONTROL_XFRSIZE_MASK | DMACH_CONTROL_I); regval |= ((uint32_t)nxfrs << DMACH_CONTROL_XFRSIZE_SHIFT); putreg32(regval, base + LPC17_DMACH_CONTROL_OFFSET); @@ -535,7 +535,7 @@ int lpc17_dmasetup(DMA_HANDLE handle, uint32_t control, uint32_t config, * are provided by the caller. Little endian is assumed. */ - regval = config & (DMACH_CONFIG_SRCPER_MASK|DMACH_CONFIG_DSTPER_MASK| + regval = config & (DMACH_CONFIG_SRCPER_MASK | DMACH_CONFIG_DSTPER_MASK | DMACH_CONFIG_XFRTYPE_MASK); putreg32(regval, base + LPC17_DMACH_CONFIG_OFFSET); diff --git a/arch/arm/src/lpc17xx/lpc17_gpioint.c b/arch/arm/src/lpc17xx/lpc17_gpioint.c index 9a65617201..1fa18a3681 100644 --- a/arch/arm/src/lpc17xx/lpc17_gpioint.c +++ b/arch/arm/src/lpc17xx/lpc17_gpioint.c @@ -454,7 +454,7 @@ static int lpc17_gpiointerrupt(int irq, void *context) void lpc17_gpioirqinitialize(void) { - /* Disable all GPIO interrupts */ + /* Disable all GPIO interrupts */ putreg32(0, LPC17_GPIOINT0_INTENR); putreg32(0, LPC17_GPIOINT0_INTENF); diff --git a/arch/arm/src/lpc17xx/lpc17_i2c.c b/arch/arm/src/lpc17xx/lpc17_i2c.c index fc566876cf..6298dcb688 100644 --- a/arch/arm/src/lpc17xx/lpc17_i2c.c +++ b/arch/arm/src/lpc17xx/lpc17_i2c.c @@ -223,7 +223,7 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int bufle priv->wrcnt = 0; priv->rdcnt = 0; priv->msg.addr &= ~0x01; - priv->msg.buffer = (uint8_t*)buffer; + priv->msg.buffer = (uint8_t *)buffer; priv->msg.length = buflen; ret = i2c_start(priv); @@ -344,21 +344,21 @@ static int i2c_interrupt(int irq, FAR void *context) #ifdef CONFIG_LPC17_I2C0 if (irq == LPC17_IRQ_I2C0) { - priv=&i2cdevices[0]; + priv = &i2cdevices[0]; } else #endif #ifdef CONFIG_LPC17_I2C1 if (irq == LPC17_IRQ_I2C1) { - priv=&i2cdevices[1]; + priv = &i2cdevices[1]; } else #endif #ifdef CONFIG_LPC17_I2C2 if (irq == LPC17_IRQ_I2C2) { - priv=&i2cdevices[2]; + priv = &i2cdevices[2]; } else #endif @@ -366,7 +366,7 @@ static int i2c_interrupt(int irq, FAR void *context) PANIC(); } -/* Reference UM10360 19.10.5 */ + /* Reference UM10360 19.10.5 */ state = getreg32(priv->base + LPC17_I2C_STAT_OFFSET); putreg32(I2C_CONCLR_SIC, priv->base + LPC17_I2C_CONCLR_OFFSET); @@ -396,7 +396,7 @@ static int i2c_interrupt(int irq, FAR void *context) case 0x28: priv->wrcnt++; - if (priv->wrcntmsg.length) + if (priv->wrcnt < priv->msg.length) { putreg32(priv->msg.buffer[priv->wrcnt], priv->base + LPC17_I2C_DAT_OFFSET); } @@ -462,11 +462,11 @@ struct i2c_dev_s *up_i2cinitialize(int port) flags = irqsave(); - priv= &i2cdevices[port]; + priv = &i2cdevices[port]; #ifdef CONFIG_LPC17_I2C0 if (port == 0) { - priv= (FAR struct lpc17_i2cdev_s *)&i2cdevices[0]; + priv = (FAR struct lpc17_i2cdev_s *)&i2cdevices[0]; priv->base = LPC17_I2C0_BASE; priv->irqid = LPC17_IRQ_I2C0; @@ -490,7 +490,7 @@ struct i2c_dev_s *up_i2cinitialize(int port) #ifdef CONFIG_LPC17_I2C1 if (port == 1) { - priv= (FAR struct lpc17_i2cdev_s *)&i2cdevices[1]; + priv = (FAR struct lpc17_i2cdev_s *)&i2cdevices[1]; priv->base = LPC17_I2C1_BASE; priv->irqid = LPC17_IRQ_I2C1; @@ -514,7 +514,7 @@ struct i2c_dev_s *up_i2cinitialize(int port) #ifdef CONFIG_LPC17_I2C2 if (port == 2) { - priv= (FAR struct lpc17_i2cdev_s *)&i2cdevices[2]; + priv = (FAR struct lpc17_i2cdev_s *)&i2cdevices[2]; priv->base = LPC17_I2C2_BASE; priv->irqid = LPC17_IRQ_I2C2; diff --git a/arch/arm/src/lpc17xx/lpc17_irq.c b/arch/arm/src/lpc17xx/lpc17_irq.c index fcf816f802..5fae6bf708 100644 --- a/arch/arm/src/lpc17xx/lpc17_irq.c +++ b/arch/arm/src/lpc17xx/lpc17_irq.c @@ -60,9 +60,9 @@ /* Get a 32-bit version of the default priority */ #define DEFPRIORITY32 \ - (NVIC_SYSH_PRIORITY_DEFAULT << 24 |\ - NVIC_SYSH_PRIORITY_DEFAULT << 16 |\ - NVIC_SYSH_PRIORITY_DEFAULT << 8 |\ + (NVIC_SYSH_PRIORITY_DEFAULT << 24 | \ + NVIC_SYSH_PRIORITY_DEFAULT << 16 | \ + NVIC_SYSH_PRIORITY_DEFAULT << 8 | \ NVIC_SYSH_PRIORITY_DEFAULT) /* Given the address of a NVIC ENABLE register, this is the offset to @@ -373,7 +373,7 @@ void up_irqinitialize(void) /* Set the priority of the SVCall interrupt */ #ifdef CONFIG_ARCH_IRQPRIO -/* up_prioritize_irq(LPC17_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ + /* up_prioritize_irq(LPC17_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ #endif #ifdef CONFIG_ARMV7M_USEBASEPRI lpc17_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); diff --git a/arch/arm/src/lpc17xx/lpc17_lcd.c b/arch/arm/src/lpc17xx/lpc17_lcd.c index 2d2ca6b5c0..03f3e4e6b5 100644 --- a/arch/arm/src/lpc17xx/lpc17_lcd.c +++ b/arch/arm/src/lpc17xx/lpc17_lcd.c @@ -780,14 +780,14 @@ void lpc17_lcdclear(nxgl_mxpixel_t color) { int i; #if LPC17_BPP > 16 - uint32_t *dest = (uint32_t*)CONFIG_LPC17_LCD_VRAMBASE; + uint32_t *dest = (uint32_t *)CONFIG_LPC17_LCD_VRAMBASE; gvdbg("Clearing display: color=%08x VRAM=%08x size=%d\n", color, CONFIG_LPC17_LCD_VRAMBASE, CONFIG_LPC17_LCD_HWIDTH * CONFIG_LPC17_LCD_VHEIGHT * sizeof(uint32_t)); #else - uint16_t *dest = (uint16_t*)CONFIG_LPC17_LCD_VRAMBASE; + uint16_t *dest = (uint16_t *)CONFIG_LPC17_LCD_VRAMBASE; gvdbg("Clearing display: color=%08x VRAM=%08x size=%d\n", color, CONFIG_LPC17_LCD_VRAMBASE, diff --git a/arch/arm/src/lpc17xx/lpc17_lowputc.c b/arch/arm/src/lpc17xx/lpc17_lowputc.c index 05bc2c2c2d..bef1be6887 100644 --- a/arch/arm/src/lpc17xx/lpc17_lowputc.c +++ b/arch/arm/src/lpc17xx/lpc17_lowputc.c @@ -314,8 +314,8 @@ void lpc17_lowsetup(void) */ regval = getreg32(LPC17_SYSCON_PCONP); - regval &= ~(SYSCON_PCONP_PCUART0|SYSCON_PCONP_PCUART1| - SYSCON_PCONP_PCUART2|SYSCON_PCONP_PCUART3); + regval &= ~(SYSCON_PCONP_PCUART0 | SYSCON_PCONP_PCUART1 | + SYSCON_PCONP_PCUART2 | SYSCON_PCONP_PCUART3); #if defined(CONFIG_UART0_SERIAL_CONSOLE) regval |= SYSCON_PCONP_PCUART0; #elif defined(CONFIG_UART1_SERIAL_CONSOLE) @@ -333,7 +333,7 @@ void lpc17_lowsetup(void) #ifdef LPC176x regval = getreg32(LPC17_SYSCON_PCLKSEL0); - regval &= ~(SYSCON_PCLKSEL0_UART0_MASK|SYSCON_PCLKSEL0_UART1_MASK); + regval &= ~(SYSCON_PCLKSEL0_UART0_MASK | SYSCON_PCLKSEL0_UART1_MASK); #if defined(CONFIG_UART0_SERIAL_CONSOLE) regval |= (CONSOLE_CCLKDIV << SYSCON_PCLKSEL0_UART0_SHIFT); #elif defined(CONFIG_UART1_SERIAL_CONSOLE) @@ -342,7 +342,7 @@ void lpc17_lowsetup(void) putreg32(regval, LPC17_SYSCON_PCLKSEL0); regval = getreg32(LPC17_SYSCON_PCLKSEL1); - regval &= ~(SYSCON_PCLKSEL1_UART2_MASK|SYSCON_PCLKSEL1_UART3_MASK); + regval &= ~(SYSCON_PCLKSEL1_UART2_MASK | SYSCON_PCLKSEL1_UART3_MASK); #if defined(CONFIG_UART2_SERIAL_CONSOLE) regval |= (CONSOLE_CCLKDIV << SYSCON_PCLKSEL1_UART2_SHIFT); #elif defined(CONFIG_UART3_SERIAL_CONSOLE) @@ -381,31 +381,34 @@ void lpc17_lowsetup(void) /* Clear fifos */ - putreg32(UART_FCR_RXRST|UART_FCR_TXRST, CONSOLE_BASE+LPC17_UART_FCR_OFFSET); + putreg32(UART_FCR_RXRST | UART_FCR_TXRST, + CONSOLE_BASE + LPC17_UART_FCR_OFFSET); /* Set trigger */ - putreg32(UART_FCR_FIFOEN|UART_FCR_RXTRIGGER_8, CONSOLE_BASE+LPC17_UART_FCR_OFFSET); + putreg32(UART_FCR_FIFOEN | UART_FCR_RXTRIGGER_8, + CONSOLE_BASE + LPC17_UART_FCR_OFFSET); /* Set up the LCR and set DLAB=1 */ - putreg32(CONSOLE_LCR_VALUE|UART_LCR_DLAB, CONSOLE_BASE+LPC17_UART_LCR_OFFSET); + putreg32(CONSOLE_LCR_VALUE | UART_LCR_DLAB, + CONSOLE_BASE + LPC17_UART_LCR_OFFSET); /* Set the BAUD divisor */ - putreg32(CONSOLE_DL >> 8, CONSOLE_BASE+LPC17_UART_DLM_OFFSET); - putreg32(CONSOLE_DL & 0xff, CONSOLE_BASE+LPC17_UART_DLL_OFFSET); + putreg32(CONSOLE_DL >> 8, CONSOLE_BASE + LPC17_UART_DLM_OFFSET); + putreg32(CONSOLE_DL & 0xff, CONSOLE_BASE + LPC17_UART_DLL_OFFSET); /* Clear DLAB */ - putreg32(CONSOLE_LCR_VALUE, CONSOLE_BASE+LPC17_UART_LCR_OFFSET); + putreg32(CONSOLE_LCR_VALUE, CONSOLE_BASE + LPC17_UART_LCR_OFFSET); /* Configure the FIFOs */ - putreg32(UART_FCR_RXTRIGGER_8|UART_FCR_TXRST|UART_FCR_RXRST|UART_FCR_FIFOEN, - CONSOLE_BASE+LPC17_UART_FCR_OFFSET); + putreg32(UART_FCR_RXTRIGGER_8 | UART_FCR_TXRST | UART_FCR_RXRST | + UART_FCR_FIFOEN, + CONSOLE_BASE + LPC17_UART_FCR_OFFSET); #endif #endif /* HAVE_UART */ } - diff --git a/arch/arm/src/lpc17xx/lpc17_mcpwm.c b/arch/arm/src/lpc17xx/lpc17_mcpwm.c index 7afe861079..26fe141096 100644 --- a/arch/arm/src/lpc17xx/lpc17_mcpwm.c +++ b/arch/arm/src/lpc17xx/lpc17_mcpwm.c @@ -179,7 +179,7 @@ static struct lpc17_mcpwmtimer_s g_pwm1dev = .timtype = TIMTYPE_TIM1, .base = LPC17_MCPWM_BASE, .pincfg = GPIO_MCPWM_MCOA0, - .pclk = (0x1<<12), + .pclk = (1 << 12), }; #endif @@ -435,22 +435,22 @@ static int mcpwm_setup(FAR struct pwm_lowerhalf_s *dev) regval = getreg32(LPC17_SYSCON_PCLKSEL1); regval &= ~(0x3 << 30); - regval |= (0x2 << 30); /* PCLK_MC peripheral clk = CCLK/2 = 50 MHz */ + regval |= (0x2 << 30); /* PCLK_MC peripheral clk = CCLK/2 = 50 MHz */ putreg32(regval, LPC17_SYSCON_PCLKSEL1); priv->pclk = (0x1 << 12) | (0x1 << 4); - putreg32((1 << 15), LPC17_MCPWM_INTENCLR); /* Disable MCABORT pin interrupt */ - putreg32((1 << 0), LPC17_MCPWM_INTENCLR); /* Disable ILIM0 interrupt */ - putreg32((1 << 1), LPC17_MCPWM_INTENCLR); /* Disable IMAT0 interrupt */ - putreg32((1 << 2), LPC17_MCPWM_INTENCLR); /* Disable ICAP0 interrupt */ - putreg32((1 << 4), LPC17_MCPWM_INTENCLR); /* Disable ILIM1 interrupt */ - putreg32((1 << 5), LPC17_MCPWM_INTENCLR); /* Disable IMAT1 interrupt */ - putreg32((1 << 6), LPC17_MCPWM_INTENCLR); /* Disable ICAP1 interrupt */ - putreg32((1 << 8), LPC17_MCPWM_INTENCLR); /* Disable ILIM2 interrupt */ - putreg32((1 << 9), LPC17_MCPWM_INTENCLR); /* Disable IMAT2 interrupt */ - putreg32((1 << 10), LPC17_MCPWM_INTENCLR); /* Disable ICAP2 interrupt */ + putreg32((1 << 15), LPC17_MCPWM_INTENCLR); /* Disable MCABORT pin interrupt */ + putreg32((1 << 0), LPC17_MCPWM_INTENCLR); /* Disable ILIM0 interrupt */ + putreg32((1 << 1), LPC17_MCPWM_INTENCLR); /* Disable IMAT0 interrupt */ + putreg32((1 << 2), LPC17_MCPWM_INTENCLR); /* Disable ICAP0 interrupt */ + putreg32((1 << 4), LPC17_MCPWM_INTENCLR); /* Disable ILIM1 interrupt */ + putreg32((1 << 5), LPC17_MCPWM_INTENCLR); /* Disable IMAT1 interrupt */ + putreg32((1 << 6), LPC17_MCPWM_INTENCLR); /* Disable ICAP1 interrupt */ + putreg32((1 << 8), LPC17_MCPWM_INTENCLR); /* Disable ILIM2 interrupt */ + putreg32((1 << 9), LPC17_MCPWM_INTENCLR); /* Disable IMAT2 interrupt */ + putreg32((1 << 10), LPC17_MCPWM_INTENCLR); /* Disable ICAP2 interrupt */ - putreg32((0xFFFFFFFF), LPC17_MCPWM_CAPCLR);/* Clear all event capture */ + putreg32((0xFFFFFFFF), LPC17_MCPWM_CAPCLR); /* Clear all event capture */ /* Configure the output pins */ @@ -459,39 +459,39 @@ static int mcpwm_setup(FAR struct pwm_lowerhalf_s *dev) /* Program the timing registers */ - putreg32((1 << 0), LPC17_MCPWM_CONCLR); /* Stop MCPWM timer0 */ - putreg32((1 << 8), LPC17_MCPWM_CONCLR); /* Stop MCPWM timer1 */ - putreg32((1 << 16), LPC17_MCPWM_CONCLR); /* Stop MCPWM timer2 */ + putreg32((1 << 0), LPC17_MCPWM_CONCLR); /* Stop MCPWM timer0 */ + putreg32((1 << 8), LPC17_MCPWM_CONCLR); /* Stop MCPWM timer1 */ + putreg32((1 << 16), LPC17_MCPWM_CONCLR); /* Stop MCPWM timer2 */ - putreg32((1 << 30), LPC17_MCPWM_CONCLR); /* MCPWM not in AC mode */ + putreg32((1 << 30), LPC17_MCPWM_CONCLR); /* MCPWM not in AC mode */ - putreg32(1000, LPC17_MCPWM_TC0); /* Count frequency: Fpclk/1000 = 50 MHz/1000 = 50 KHz */ - putreg32(400, LPC17_MCPWM_LIM0); /* Set the starting duty cycle to 0.25 */ - putreg32(0, LPC17_MCPWM_MAT0); /* Reset the timer */ + putreg32(1000, LPC17_MCPWM_TC0); /* Count frequency: Fpclk/1000 = 50 MHz/1000 = 50 KHz */ + putreg32(400, LPC17_MCPWM_LIM0); /* Set the starting duty cycle to 0.25 */ + putreg32(0, LPC17_MCPWM_MAT0); /* Reset the timer */ - putreg32(100000, LPC17_MCPWM_TC1); /* Count frequency:Fpclk/100000 = 50 MHz/100000 = 500 Hz */ - putreg32(50000, LPC17_MCPWM_LIM1); /* Set the starting duty cycle to 0.5 */ - putreg32(0, LPC17_MCPWM_MAT1); /* Reset the timer */ + putreg32(100000, LPC17_MCPWM_TC1); /* Count frequency:Fpclk/100000 = 50 MHz/100000 = 500 Hz */ + putreg32(50000, LPC17_MCPWM_LIM1); /* Set the starting duty cycle to 0.5 */ + putreg32(0, LPC17_MCPWM_MAT1); /* Reset the timer */ - putreg32(1000, LPC17_MCPWM_TC2); /* Count frequency:Fpclk/1000 = 50 MHz/1000 = 50 KHz */ - putreg32(400, LPC17_MCPWM_LIM2); /* Set the starting duty cycle to 0.25 */ - putreg32(0, LPC17_MCPWM_MAT2); /* Reset the timer */ + putreg32(1000, LPC17_MCPWM_TC2); /* Count frequency:Fpclk/1000 = 50 MHz/1000 = 50 KHz */ + putreg32(400, LPC17_MCPWM_LIM2); /* Set the starting duty cycle to 0.25 */ + putreg32(0, LPC17_MCPWM_MAT2); /* Reset the timer */ - putreg32((1 << 2), LPC17_MCPWM_CONCLR); /* Channel 0 polarity set to default */ - putreg32((1 << 10), LPC17_MCPWM_CONCLR); /* Channel 1 polarity set to default */ - putreg32((1 << 18), LPC17_MCPWM_CONCLR); /* Channel 2 polarity set to default */ + putreg32((1 << 2), LPC17_MCPWM_CONCLR); /* Channel 0 polarity set to default */ + putreg32((1 << 10), LPC17_MCPWM_CONCLR); /* Channel 1 polarity set to default */ + putreg32((1 << 18), LPC17_MCPWM_CONCLR); /* Channel 2 polarity set to default */ - putreg32((1 << 3), LPC17_MCPWM_CONCLR); /* Channel 0 dead time disabled */ - putreg32((1 << 11), LPC17_MCPWM_CONCLR); /* Channel 1 dead time disabled */ - putreg32((1 << 19), LPC17_MCPWM_CONCLR); /* Channel 2 dead time disabled */ + putreg32((1 << 3), LPC17_MCPWM_CONCLR); /* Channel 0 dead time disabled */ + putreg32((1 << 11), LPC17_MCPWM_CONCLR); /* Channel 1 dead time disabled */ + putreg32((1 << 19), LPC17_MCPWM_CONCLR); /* Channel 2 dead time disabled */ - putreg32((1 << 1), LPC17_MCPWM_CONCLR); /* Channel 0 edge aligned */ - putreg32((1 << 9), LPC17_MCPWM_CONCLR); /* Channel 1 edge aligned */ - putreg32((1 << 17), LPC17_MCPWM_CONCLR); /* Channel 2 edge aligned */ + putreg32((1 << 1), LPC17_MCPWM_CONCLR); /* Channel 0 edge aligned */ + putreg32((1 << 9), LPC17_MCPWM_CONCLR); /* Channel 1 edge aligned */ + putreg32((1 << 17), LPC17_MCPWM_CONCLR); /* Channel 2 edge aligned */ - putreg32((0xFFFFFFFF), LPC17_MCPWM_CNTCONCLR);/* All channels in counter mode on PCLK */ + putreg32((0xFFFFFFFF), LPC17_MCPWM_CNTCONCLR); /* All channels in counter mode on PCLK */ - putreg32((1 << 0), LPC17_MCPWM_CONSET); /* Start MCPWM timer0 */ + putreg32((1 << 0), LPC17_MCPWM_CONSET); /* Start MCPWM timer0 */ irqrestore(flags); pwm_dumpgpio(priv->pincfg, "PWM setup"); diff --git a/arch/arm/src/lpc17xx/lpc17_sdcard.c b/arch/arm/src/lpc17xx/lpc17_sdcard.c index b020d901b8..80ab3727ff 100644 --- a/arch/arm/src/lpc17xx/lpc17_sdcard.c +++ b/arch/arm/src/lpc17xx/lpc17_sdcard.c @@ -120,10 +120,10 @@ * SDCARD_MMCXFR_CLKDIV, and SDCARD_SDXFR_CLKDIV. */ -#define LPC17_CLCKCR_INIT (SDCARD_INIT_CLKDIV|SDCARD_CLOCK_WIDBUS_D1) -#define SDCARD_CLOCK_MMCXFR (SDCARD_MMCXFR_CLKDIV|SDCARD_CLOCK_WIDBUS_D1) -#define SDCARD_CLOCK_SDXFR (SDCARD_SDXFR_CLKDIV|SDCARD_CLOCK_WIDBUS_D1) -#define SDCARD_CLOCK_SDWIDEXFR (SDCARD_SDXFR_CLKDIV|SDCARD_CLOCK_WIDBUS_D4) +#define LPC17_CLCKCR_INIT (SDCARD_INIT_CLKDIV | SDCARD_CLOCK_WIDBUS_D1) +#define SDCARD_CLOCK_MMCXFR (SDCARD_MMCXFR_CLKDIV | SDCARD_CLOCK_WIDBUS_D1) +#define SDCARD_CLOCK_SDXFR (SDCARD_SDXFR_CLKDIV | SDCARD_CLOCK_WIDBUS_D1) +#define SDCARD_CLOCK_SDWIDEXFR (SDCARD_SDXFR_CLKDIV | SDCARD_CLOCK_WIDBUS_D4) /* Timing */ @@ -149,19 +149,19 @@ * controlled by the driver. */ -#define SDCARD_RXDMA32_CONTROL (DMACH_CONTROL_SBSIZE_8|DMACH_CONTROL_DBSIZE_8|\ - DMACH_CONTROL_SWIDTH_32BIT|DMACH_CONTROL_DWIDTH_32BIT|\ +#define SDCARD_RXDMA32_CONTROL (DMACH_CONTROL_SBSIZE_8 | DMACH_CONTROL_DBSIZE_8 | \ + DMACH_CONTROL_SWIDTH_32BIT | DMACH_CONTROL_DWIDTH_32BIT | \ DMACH_CONTROL_DI) -#define SDCARD_TXDMA32_CONTROL (DMACH_CONTROL_SBSIZE_8|DMACH_CONTROL_DBSIZE_8|\ - DMACH_CONTROL_SWIDTH_32BIT|DMACH_CONTROL_DWIDTH_32BIT|\ +#define SDCARD_TXDMA32_CONTROL (DMACH_CONTROL_SBSIZE_8 | DMACH_CONTROL_DBSIZE_8 | \ + DMACH_CONTROL_SWIDTH_32BIT | DMACH_CONTROL_DWIDTH_32BIT | \ DMACH_CONTROL_SI) /* DMA configuration register settings. Only the SRCPER, DSTPER, and * XFRTTYPE fields of the CONFIG register need be specified. */ -#define SDCARD_RXDMA32_CONFIG (DMACH_CONFIG_SRCPER_SDCARD|DMACH_CONFIG_XFRTYPE_P2M_SC) -#define SDCARD_TXDMA32_CONFIG (DMACH_CONFIG_DSTPER_SDCARD|DMACH_CONFIG_XFRTYPE_M2P_DC) +#define SDCARD_RXDMA32_CONFIG (DMACH_CONFIG_SRCPER_SDCARD | DMACH_CONFIG_XFRTYPE_P2M_SC) +#define SDCARD_TXDMA32_CONFIG (DMACH_CONFIG_DSTPER_SDCARD | DMACH_CONFIG_XFRTYPE_M2P_DC) /* FIFO sizes */ @@ -170,39 +170,39 @@ /* Data transfer interrupt mask bits */ -#define SDCARD_RECV_MASK (SDCARD_MASK0_DCRCFAILIE|SDCARD_MASK0_DTIMEOUTIE|\ - SDCARD_MASK0_DATAENDIE|SDCARD_MASK0_RXOVERRIE|\ - SDCARD_MASK0_RXFIFOHFIE|SDCARD_MASK0_STBITERRIE) -#define SDCARD_SEND_MASK (SDCARD_MASK0_DCRCFAILIE|SDCARD_MASK0_DTIMEOUTIE|\ - SDCARD_MASK0_DATAENDIE|SDCARD_MASK0_TXUNDERRIE|\ - SDCARD_MASK0_TXFIFOHEIE|SDCARD_MASK0_STBITERRIE) -#define SDCARD_DMARECV_MASK (SDCARD_MASK0_DCRCFAILIE|SDCARD_MASK0_DTIMEOUTIE|\ - SDCARD_MASK0_DATAENDIE|SDCARD_MASK0_RXOVERRIE|\ +#define SDCARD_RECV_MASK (SDCARD_MASK0_DCRCFAILIE | SDCARD_MASK0_DTIMEOUTIE | \ + SDCARD_MASK0_DATAENDIE | SDCARD_MASK0_RXOVERRIE | \ + SDCARD_MASK0_RXFIFOHFIE | SDCARD_MASK0_STBITERRIE) +#define SDCARD_SEND_MASK (SDCARD_MASK0_DCRCFAILIE | SDCARD_MASK0_DTIMEOUTIE | \ + SDCARD_MASK0_DATAENDIE | SDCARD_MASK0_TXUNDERRIE | \ + SDCARD_MASK0_TXFIFOHEIE | SDCARD_MASK0_STBITERRIE) +#define SDCARD_DMARECV_MASK (SDCARD_MASK0_DCRCFAILIE | SDCARD_MASK0_DTIMEOUTIE | \ + SDCARD_MASK0_DATAENDIE | SDCARD_MASK0_RXOVERRIE | \ SDCARD_MASK0_STBITERRIE) -#define SDCARD_DMASEND_MASK (SDCARD_MASK0_DCRCFAILIE|SDCARD_MASK0_DTIMEOUTIE|\ - SDCARD_MASK0_DATAENDIE|SDCARD_MASK0_TXUNDERRIE|\ +#define SDCARD_DMASEND_MASK (SDCARD_MASK0_DCRCFAILIE | SDCARD_MASK0_DTIMEOUTIE | \ + SDCARD_MASK0_DATAENDIE | SDCARD_MASK0_TXUNDERRIE | \ SDCARD_MASK0_STBITERRIE) /* Event waiting interrupt mask bits */ #define SDCARD_CMDDONE_STA (SDCARD_STATUS_CMDSENT) -#define SDCARD_RESPDONE_STA (SDCARD_STATUS_CTIMEOUT|SDCARD_STATUS_CCRCFAIL|\ +#define SDCARD_RESPDONE_STA (SDCARD_STATUS_CTIMEOUT | SDCARD_STATUS_CCRCFAIL | \ SDCARD_STATUS_CMDREND) #define SDCARD_XFRDONE_STA (0) #define SDCARD_CMDDONE_MASK (SDCARD_MASK0_CMDSENTIE) -#define SDCARD_RESPDONE_MASK (SDCARD_MASK0_CCRCFAILIE|SDCARD_MASK0_CTIMEOUTIE|\ +#define SDCARD_RESPDONE_MASK (SDCARD_MASK0_CCRCFAILIE | SDCARD_MASK0_CTIMEOUTIE | \ SDCARD_MASK0_CMDRENDIE) #define SDCARD_XFRDONE_MASK (0) #define SDCARD_CMDDONE_ICR (SDCARD_CLEAR_CMDSENTC) -#define SDCARD_RESPDONE_ICR (SDCARD_CLEAR_CTIMEOUTC|SDCARD_CLEAR_CCRCFAILC|\ +#define SDCARD_RESPDONE_ICR (SDCARD_CLEAR_CTIMEOUTC | SDCARD_CLEAR_CCRCFAILC | \ SDCARD_CLEAR_CMDRENDC) -#define SDCARD_XFRDONE_ICR (SDCARD_CLEAR_DATAENDC|SDCARD_CLEAR_DCRCFAILC|\ - SDCARD_CLEAR_DTIMEOUTC|SDCARD_CLEAR_RXOVERRC|\ - SDCARD_CLEAR_TXUNDERRC|SDCARD_CLEAR_STBITERRC) +#define SDCARD_XFRDONE_ICR (SDCARD_CLEAR_DATAENDC | SDCARD_CLEAR_DCRCFAILC | \ + SDCARD_CLEAR_DTIMEOUTC | SDCARD_CLEAR_RXOVERRC | \ + SDCARD_CLEAR_TXUNDERRC | SDCARD_CLEAR_STBITERRC) -#define SDCARD_WAITALL_ICR (SDCARD_CMDDONE_ICR|SDCARD_RESPDONE_ICR|\ +#define SDCARD_WAITALL_ICR (SDCARD_CMDDONE_ICR | SDCARD_RESPDONE_ICR | \ SDCARD_XFRDONE_ICR) /* Let's wait until we have both SD card transfer complete and DMA complete. */ @@ -516,13 +516,15 @@ static inline void lpc17_setclock(uint32_t clkcr) /* Clear CLKDIV, PWRSAV, BYPASS, and WIDBUS bits */ - regval &= ~(SDCARD_CLOCK_CLKDIV_MASK|SDCARD_CLOCK_PWRSAV|SDCARD_CLOCK_BYPASS| - SDCARD_CLOCK_WIDBUS|SDCARD_CLOCK_CLKEN); + regval &= ~(SDCARD_CLOCK_CLKDIV_MASK | SDCARD_CLOCK_PWRSAV | + SDCARD_CLOCK_BYPASS | SDCARD_CLOCK_WIDBUS | + SDCARD_CLOCK_CLKEN); /* Replace with user provided settings */ - clkcr &= (SDCARD_CLOCK_CLKDIV_MASK|SDCARD_CLOCK_PWRSAV|SDCARD_CLOCK_BYPASS| - SDCARD_CLOCK_WIDBUS|SDCARD_CLOCK_CLKEN); + clkcr &= (SDCARD_CLOCK_CLKDIV_MASK | SDCARD_CLOCK_PWRSAV | + SDCARD_CLOCK_BYPASS | SDCARD_CLOCK_WIDBUS | + SDCARD_CLOCK_CLKEN); regval |= clkcr; putreg32(regval, LPC17_SDCARD_CLOCK); @@ -617,7 +619,7 @@ static void lpc17_setpwrctrl(uint32_t pwrctrl) */ regval = getreg32(LPC17_SDCARD_PWR); - regval &= ~(SDCARD_PWR_CTRL_MASK | SDCARD_PWR_OPENDRAIN | SDCARD_PWR_ROD); + regval &= ~(SDCARD_PWR_CTRL_MASK | SDCARD_PWR_OPENDRAIN | SDCARD_PWR_ROD); regval |= pwrctrl; putreg32(regval, LPC17_SDCARD_PWR); } @@ -805,7 +807,7 @@ static void lpc17_dmacallback(DMA_HANDLE handle, void *arg, int status) * Transfer. */ - lpc17_sample((struct lpc17_dev_s*)arg, SAMPLENDX_DMA_CALLBACK); + lpc17_sample((struct lpc17_dev_s *)arg, SAMPLENDX_DMA_CALLBACK); /* Get the result of the DMA transfer */ @@ -890,9 +892,11 @@ static void lpc17_dataconfig(uint32_t timeout, uint32_t dlen, uint32_t dctrl) */ regval = getreg32(LPC17_SDCARD_DCTRL); - regval &= ~(SDCARD_DCTRL_DTDIR|SDCARD_DCTRL_DTMODE|SDCARD_DCTRL_DBLOCKSIZE_MASK); - dctrl &= (SDCARD_DCTRL_DTDIR|SDCARD_DCTRL_DTMODE|SDCARD_DCTRL_DBLOCKSIZE_MASK); - regval |= (dctrl|SDCARD_DCTRL_DTEN); + regval &= ~(SDCARD_DCTRL_DTDIR | SDCARD_DCTRL_DTMODE | + SDCARD_DCTRL_DBLOCKSIZE_MASK); + dctrl &= (SDCARD_DCTRL_DTDIR | SDCARD_DCTRL_DTMODE | + SDCARD_DCTRL_DBLOCKSIZE_MASK); + regval |= (dctrl | SDCARD_DCTRL_DTEN); putreg32(regval, LPC17_SDCARD_DCTRL); } @@ -917,8 +921,8 @@ static void lpc17_datadisable(void) /* Reset DCTRL DTEN, DTDIR, DTMODE, DMAEN, and DBLOCKSIZE fields */ regval = getreg32(LPC17_SDCARD_DCTRL); - regval &= ~(SDCARD_DCTRL_DTEN|SDCARD_DCTRL_DTDIR|SDCARD_DCTRL_DTMODE| - SDCARD_DCTRL_DMAEN|SDCARD_DCTRL_DBLOCKSIZE_MASK); + regval &= ~(SDCARD_DCTRL_DTEN | SDCARD_DCTRL_DTDIR | SDCARD_DCTRL_DTMODE | + SDCARD_DCTRL_DMAEN | SDCARD_DCTRL_DBLOCKSIZE_MASK); putreg32(regval, LPC17_SDCARD_DCTRL); } @@ -1027,7 +1031,7 @@ static void lpc17_recvfifo(struct lpc17_dev_s *priv) { /* Transfer any trailing fractional word */ - uint8_t *ptr = (uint8_t*)priv->buffer; + uint8_t *ptr = (uint8_t *)priv->buffer; int i; for (i = 0; i < priv->remaining; i++) @@ -1216,30 +1220,30 @@ static int lpc17_interrupt(int irq, void *context) #ifdef CONFIG_SDIO_DMA if (!priv->dmamode) #endif - { - /* Is the RX FIFO half full or more? Is so then we must be - * processing a receive transaction. - */ - - if ((pending & SDCARD_STATUS_RXFIFOHF) != 0) - { - /* Receive data from the RX FIFO */ - - lpc17_recvfifo(priv); - } - - /* Otherwise, Is the transmit FIFO half empty or less? If so we must - * be processing a send transaction. NOTE: We can't be processing - * both! + { + /* Is the RX FIFO half full or more? Is so then we must be + * processing a receive transaction. */ - else if ((pending & SDCARD_STATUS_TXFIFOHE) != 0) - { - /* Send data via the TX FIFO */ + if ((pending & SDCARD_STATUS_RXFIFOHF) != 0) + { + /* Receive data from the RX FIFO */ - lpc17_sendfifo(priv); - } - } + lpc17_recvfifo(priv); + } + + /* Otherwise, Is the transmit FIFO half empty or less? If so we must + * be processing a send transaction. NOTE: We can't be processing + * both! + */ + + else if ((pending & SDCARD_STATUS_TXFIFOHE) != 0) + { + /* Send data via the TX FIFO */ + + lpc17_sendfifo(priv); + } + } /* Handle data end events */ @@ -1294,7 +1298,7 @@ static int lpc17_interrupt(int irq, void *context) /* Terminate the transfer with an error */ flldbg("ERROR: Data block CRC failure, remaining: %d\n", priv->remaining); - lpc17_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_ERROR); + lpc17_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_ERROR); } /* Handle data timeout error */ @@ -1304,7 +1308,7 @@ static int lpc17_interrupt(int irq, void *context) /* Terminate the transfer with an error */ flldbg("ERROR: Data timeout, remaining: %d\n", priv->remaining); - lpc17_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_TIMEOUT); + lpc17_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_TIMEOUT); } /* Handle RX FIFO overrun error */ @@ -1314,7 +1318,7 @@ static int lpc17_interrupt(int irq, void *context) /* Terminate the transfer with an error */ flldbg("ERROR: RX FIFO overrun, remaining: %d\n", priv->remaining); - lpc17_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_ERROR); + lpc17_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_ERROR); } /* Handle TX FIFO underrun error */ @@ -1324,7 +1328,7 @@ static int lpc17_interrupt(int irq, void *context) /* Terminate the transfer with an error */ flldbg("ERROR: TX FIFO underrun, remaining: %d\n", priv->remaining); - lpc17_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_ERROR); + lpc17_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_ERROR); } /* Handle start bit error */ @@ -1334,8 +1338,8 @@ static int lpc17_interrupt(int irq, void *context) /* Terminate the transfer with an error */ flldbg("ERROR: Start bit, remaining: %d\n", priv->remaining); - lpc17_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_ERROR); - } + lpc17_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_ERROR); + } } /* Handle wait events *************************************************/ @@ -1353,7 +1357,7 @@ static int lpc17_interrupt(int irq, void *context) { /* Yes.. wake the thread up */ - putreg32(SDCARD_RESPDONE_ICR|SDCARD_CMDDONE_ICR, LPC17_SDCARD_CLEAR); + putreg32(SDCARD_RESPDONE_ICR | SDCARD_CMDDONE_ICR, LPC17_SDCARD_CLEAR); lpc17_endwait(priv, SDIOWAIT_RESPONSEDONE); } } @@ -1472,7 +1476,7 @@ static void lpc17_reset(FAR struct sdio_dev_s *dev) /* Configure and enable the SD card peripheral */ - lpc17_setclock(LPC17_CLCKCR_INIT|SDCARD_CLOCK_CLKEN); + lpc17_setclock(LPC17_CLCKCR_INIT | SDCARD_CLOCK_CLKEN); lpc17_setpwrctrl(SDCARD_PWR_CTRL_ON); irqrestore(flags); @@ -1653,8 +1657,9 @@ static int lpc17_sendcmd(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t arg) /* Clear CMDINDEX, WAITRESP, WAITINT, WAITPEND, and CPSMEN bits */ regval = getreg32(LPC17_SDCARD_CMD); - regval &= ~(SDCARD_CMD_INDEX_MASK|SDCARD_CMD_WAITRESP_MASK| - SDCARD_CMD_WAITINT|SDCARD_CMD_WAITPEND|SDCARD_CMD_CPSMEN); + regval &= ~(SDCARD_CMD_INDEX_MASK | SDCARD_CMD_WAITRESP_MASK | + SDCARD_CMD_WAITINT | SDCARD_CMD_WAITPEND | + SDCARD_CMD_CPSMEN); /* Set WAITRESP bits */ @@ -1688,7 +1693,7 @@ static int lpc17_sendcmd(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t arg) /* Write the SD card CMD */ - putreg32(SDCARD_RESPDONE_ICR|SDCARD_CMDDONE_ICR, LPC17_SDCARD_CLEAR); + putreg32(SDCARD_RESPDONE_ICR | SDCARD_CMDDONE_ICR, LPC17_SDCARD_CLEAR); putreg32(regval, LPC17_SDCARD_CMD); return OK; } @@ -1731,7 +1736,7 @@ static int lpc17_recvsetup(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, /* Save the destination buffer information for use by the interrupt handler */ - priv->buffer = (uint32_t*)buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = nbytes; #ifdef CONFIG_SDIO_DMA priv->dmamode = false; @@ -1740,7 +1745,8 @@ static int lpc17_recvsetup(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, /* Then set up the SD card data path */ dblocksize = lpc17_log2(nbytes) << SDCARD_DCTRL_DBLOCKSIZE_SHIFT; - lpc17_dataconfig(SDCARD_DTIMER_DATATIMEOUT, nbytes, dblocksize|SDCARD_DCTRL_DTDIR); + lpc17_dataconfig(SDCARD_DTIMER_DATATIMEOUT, nbytes, + dblocksize | SDCARD_DCTRL_DTDIR); /* And enable interrupts */ @@ -1785,7 +1791,7 @@ static int lpc17_sendsetup(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer /* Save the source buffer information for use by the interrupt handler */ - priv->buffer = (uint32_t*)buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = nbytes; #ifdef CONFIG_SDIO_DMA priv->dmamode = false; @@ -1822,7 +1828,7 @@ static int lpc17_sendsetup(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer static int lpc17_cancel(FAR struct sdio_dev_s *dev) { - struct lpc17_dev_s *priv = (struct lpc17_dev_s*)dev; + struct lpc17_dev_s *priv = (struct lpc17_dev_s *)dev; /* Disable all transfer- and event- related interrupts */ @@ -2027,7 +2033,7 @@ static int lpc17_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t /* Clear all pending message completion events and return the R1/R6 response */ - putreg32(SDCARD_RESPDONE_ICR|SDCARD_CMDDONE_ICR, LPC17_SDCARD_CLEAR); + putreg32(SDCARD_RESPDONE_ICR | SDCARD_CMDDONE_ICR, LPC17_SDCARD_CLEAR); *rshort = getreg32(LPC17_SDCARD_RESP0); return ret; } @@ -2074,7 +2080,7 @@ static int lpc17_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlo /* Return the long response */ - putreg32(SDCARD_RESPDONE_ICR|SDCARD_CMDDONE_ICR, LPC17_SDCARD_CLEAR); + putreg32(SDCARD_RESPDONE_ICR | SDCARD_CMDDONE_ICR, LPC17_SDCARD_CLEAR); if (rlong) { rlong[0] = getreg32(LPC17_SDCARD_RESP0); @@ -2123,7 +2129,7 @@ static int lpc17_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *r } } - putreg32(SDCARD_RESPDONE_ICR|SDCARD_CMDDONE_ICR, LPC17_SDCARD_CLEAR); + putreg32(SDCARD_RESPDONE_ICR | SDCARD_CMDDONE_ICR, LPC17_SDCARD_CLEAR); if (rshort) { *rshort = getreg32(LPC17_SDCARD_RESP0); @@ -2135,7 +2141,7 @@ static int lpc17_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *r static int lpc17_recvnotimpl(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *rnotimpl) { - putreg32(SDCARD_RESPDONE_ICR|SDCARD_CMDDONE_ICR, LPC17_SDCARD_CLEAR); + putreg32(SDCARD_RESPDONE_ICR | SDCARD_CMDDONE_ICR, LPC17_SDCARD_CLEAR); return -ENOSYS; } @@ -2166,7 +2172,7 @@ static int lpc17_recvnotimpl(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t static void lpc17_waitenable(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset) { - struct lpc17_dev_s *priv = (struct lpc17_dev_s*)dev; + struct lpc17_dev_s *priv = (struct lpc17_dev_s *)dev; uint32_t waitmask; DEBUGASSERT(priv != NULL); @@ -2225,7 +2231,7 @@ static void lpc17_waitenable(FAR struct sdio_dev_s *dev, static sdio_eventset_t lpc17_eventwait(FAR struct sdio_dev_s *dev, uint32_t timeout) { - struct lpc17_dev_s *priv = (struct lpc17_dev_s*)dev; + struct lpc17_dev_s *priv = (struct lpc17_dev_s *)dev; sdio_eventset_t wkupevent = 0; irqstate_t flags; int ret; @@ -2250,10 +2256,10 @@ static sdio_eventset_t lpc17_eventwait(FAR struct sdio_dev_s *dev, if (!timeout) { - /* Then just tell the caller that we already timed out */ + /* Then just tell the caller that we already timed out */ - wkupevent = SDIOWAIT_TIMEOUT; - goto errout; + wkupevent = SDIOWAIT_TIMEOUT; + goto errout; } /* Start the watchdog timer */ @@ -2263,8 +2269,8 @@ static sdio_eventset_t lpc17_eventwait(FAR struct sdio_dev_s *dev, 1, (uint32_t)priv); if (ret != OK) { - fdbg("ERROR: wd_start failed: %d\n", ret); - } + fdbg("ERROR: wd_start failed: %d\n", ret); + } } /* Loop until the event (or the timeout occurs). Race conditions are avoided @@ -2273,7 +2279,7 @@ static sdio_eventset_t lpc17_eventwait(FAR struct sdio_dev_s *dev, * may have already occurred before this function was called! */ - for (;;) + for (; ; ) { /* Wait for an event in event set to occur. If this the event has already * occurred, then the semaphore will already have been incremented and @@ -2333,7 +2339,7 @@ errout: static void lpc17_callbackenable(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset) { - struct lpc17_dev_s *priv = (struct lpc17_dev_s*)dev; + struct lpc17_dev_s *priv = (struct lpc17_dev_s *)dev; fvdbg("eventset: %02x\n", eventset); DEBUGASSERT(priv != NULL); @@ -2367,7 +2373,7 @@ static void lpc17_callbackenable(FAR struct sdio_dev_s *dev, static int lpc17_registercallback(FAR struct sdio_dev_s *dev, worker_t callback, void *arg) { - struct lpc17_dev_s *priv = (struct lpc17_dev_s*)dev; + struct lpc17_dev_s *priv = (struct lpc17_dev_s *)dev; /* Disable callbacks and register this callback and is argument */ @@ -2445,14 +2451,15 @@ static int lpc17_dmarecvsetup(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, /* Save the destination buffer information for use by the interrupt handler */ - priv->buffer = (uint32_t*)buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = buflen; priv->dmamode = true; /* Then set up the SD card data path */ dblocksize = lpc17_log2(buflen) << SDCARD_DCTRL_DBLOCKSIZE_SHIFT; - lpc17_dataconfig(SDCARD_DTIMER_DATATIMEOUT, buflen, dblocksize|SDCARD_DCTRL_DTDIR); + lpc17_dataconfig(SDCARD_DTIMER_DATATIMEOUT, buflen, + dblocksize | SDCARD_DCTRL_DTDIR); /* Configure the RX DMA */ @@ -2523,7 +2530,7 @@ static int lpc17_dmasendsetup(FAR struct sdio_dev_s *dev, /* Save the source buffer information for use by the interrupt handler */ - priv->buffer = (uint32_t*)buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = buflen; priv->dmamode = true; @@ -2578,7 +2585,7 @@ static int lpc17_dmasendsetup(FAR struct sdio_dev_s *dev, static void lpc17_callback(void *arg) { - struct lpc17_dev_s *priv = (struct lpc17_dev_s*)arg; + struct lpc17_dev_s *priv = (struct lpc17_dev_s *)arg; /* Is a callback registered? */ @@ -2595,8 +2602,8 @@ static void lpc17_callback(void *arg) /* Media is present. Is the media inserted event enabled? */ if ((priv->cbevents & SDIOMEDIA_INSERTED) == 0) - { - /* No... return without performing the callback */ + { + /* No... return without performing the callback */ return; } diff --git a/arch/arm/src/lpc17xx/lpc17_serial.c b/arch/arm/src/lpc17xx/lpc17_serial.c index 4ffa10cc97..2c2e773502 100644 --- a/arch/arm/src/lpc17xx/lpc17_serial.c +++ b/arch/arm/src/lpc17xx/lpc17_serial.c @@ -877,17 +877,17 @@ static inline uint32_t lpc17_uartdl(uint32_t baud) static int up_setup(struct uart_dev_s *dev) { #ifndef CONFIG_SUPPRESS_UART_CONFIG - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint16_t dl; uint32_t lcr; /* Clear fifos */ - up_serialout(priv, LPC17_UART_FCR_OFFSET, (UART_FCR_RXRST|UART_FCR_TXRST)); + up_serialout(priv, LPC17_UART_FCR_OFFSET, (UART_FCR_RXRST | UART_FCR_TXRST)); /* Set trigger */ - up_serialout(priv, LPC17_UART_FCR_OFFSET, (UART_FCR_FIFOEN|UART_FCR_RXTRIGGER_8)); + up_serialout(priv, LPC17_UART_FCR_OFFSET, (UART_FCR_FIFOEN | UART_FCR_RXTRIGGER_8)); /* Set up the IER */ @@ -913,11 +913,11 @@ static int up_setup(struct uart_dev_s *dev) if (priv->parity == 1) { - lcr |= (UART_LCR_PE|UART_LCR_PS_ODD); + lcr |= (UART_LCR_PE | UART_LCR_PS_ODD); } else if (priv->parity == 2) { - lcr |= (UART_LCR_PE|UART_LCR_PS_EVEN); + lcr |= (UART_LCR_PE | UART_LCR_PS_EVEN); } /* Enter DLAB=1 */ @@ -941,7 +941,8 @@ static int up_setup(struct uart_dev_s *dev) /* Configure the FIFOs */ up_serialout(priv, LPC17_UART_FCR_OFFSET, - (UART_FCR_RXTRIGGER_8|UART_FCR_TXRST|UART_FCR_RXRST|UART_FCR_FIFOEN)); + (UART_FCR_RXTRIGGER_8 | UART_FCR_TXRST | UART_FCR_RXRST | + UART_FCR_FIFOEN)); /* Enable Auto-RTS and Auto-CS Flow Control in the Modem Control Register */ @@ -949,7 +950,7 @@ static int up_setup(struct uart_dev_s *dev) if (priv->uartbase == LPC17_UART1_BASE) { #if defined(CONFIG_UART1_IFLOWCONTROL) && defined(CONFIG_UART1_OFLOWCONTROL) - up_serialout(priv, LPC17_UART_MCR_OFFSET, (UART_MCR_RTSEN|UART_MCR_CTSEN)); + up_serialout(priv, LPC17_UART_MCR_OFFSET, (UART_MCR_RTSEN | UART_MCR_CTSEN)); #elif defined(CONFIG_UART1_IFLOWCONTROL) up_serialout(priv, LPC17_UART_MCR_OFFSET, UART_MCR_RTSEN); #else @@ -972,7 +973,7 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disableuartint(priv, NULL); } @@ -993,7 +994,7 @@ static void up_shutdown(struct uart_dev_s *dev) static int up_attach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ */ @@ -1001,11 +1002,11 @@ static int up_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, up_interrupt); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the UART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the UART + */ - up_enable_irq(priv->irq); + up_enable_irq(priv->irq); } return ret; @@ -1023,7 +1024,7 @@ static int up_attach(struct uart_dev_s *dev) static void up_detach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disable_irq(priv->irq); irq_detach(priv->irq); } @@ -1078,7 +1079,7 @@ static int up_interrupt(int irq, void *context) { PANIC(); } - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; /* Loop until there are no characters to be transferred or, * until we have been looping for a long time. @@ -1172,7 +1173,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) { struct inode *inode = filep->f_inode; struct uart_dev_s *dev = inode->i_private; - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret = OK; switch (cmd) @@ -1180,7 +1181,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct up_dev_s *user = (struct up_dev_s*)arg; + struct up_dev_s *user = (struct up_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -1213,7 +1214,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TERMIOS case TCGETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; if (!termiosp) { @@ -1233,7 +1234,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) case TCSETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; uint32_t lcr; /* Holds current values of line control register */ uint16_t dl; /* Divisor latch */ @@ -1302,7 +1303,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) static int up_receive(struct uart_dev_s *dev, uint32_t *status) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t rbr; *status = up_serialin(priv, LPC17_UART_LSR_OFFSET); @@ -1320,7 +1321,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { #ifndef CONFIG_SUPPRESS_SERIAL_INTS @@ -1345,7 +1346,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) static bool up_rxavailable(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, LPC17_UART_LSR_OFFSET) & UART_LSR_RDR) != 0); } @@ -1359,7 +1360,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_serialout(priv, LPC17_UART_THR_OFFSET, (uint32_t)ch); } @@ -1373,7 +1374,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -1409,7 +1410,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) static bool up_txready(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, LPC17_UART_LSR_OFFSET) & UART_LSR_THRE) != 0); } @@ -1423,7 +1424,7 @@ static bool up_txready(struct uart_dev_s *dev) static bool up_txempty(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, LPC17_UART_LSR_OFFSET) & UART_LSR_THRE) != 0); } @@ -1536,7 +1537,7 @@ void up_serialinit(void) int up_putc(int ch) { #ifdef HAVE_CONSOLE - struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; + struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; uint32_t ier; up_disableuartint(priv, &ier); #endif diff --git a/arch/arm/src/lpc17xx/lpc17_spi.c b/arch/arm/src/lpc17xx/lpc17_spi.c index 58fbb7de9b..dfc35251d6 100644 --- a/arch/arm/src/lpc17xx/lpc17_spi.c +++ b/arch/arm/src/lpc17xx/lpc17_spi.c @@ -264,7 +264,9 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) divisor = SPI_CLOCK / frequency; - /* The SPI CCR register must contain an even number greater than or equal to 8. */ + /* The SPI CCR register must contain an even number greater than or equal + * to 8. + */ if (divisor < 8) { @@ -325,7 +327,7 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) /* Yes... Set CR appropriately */ regval = getreg32(LPC17_SPI_CR); - regval &= ~(SPI_CR_CPOL|SPI_CR_CPHA); + regval &= ~(SPI_CR_CPOL | SPI_CR_CPHA); switch (mode) { @@ -341,7 +343,7 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) break; case SPIDEV_MODE3: /* CPOL=1; CPHA=1 */ - regval |= (SPI_CR_CPOL|SPI_CR_CPHA); + regval |= (SPI_CR_CPOL | SPI_CR_CPHA); break; default: @@ -458,7 +460,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t nwords) { - FAR uint8_t *ptr = (FAR uint8_t*)buffer; + FAR uint8_t *ptr = (FAR uint8_t *)buffer; uint8_t data; spidbg("nwords: %d\n", nwords); @@ -504,7 +506,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nwords) { - FAR uint8_t *ptr = (FAR uint8_t*)buffer; + FAR uint8_t *ptr = (FAR uint8_t *)buffer; spidbg("nwords: %d\n", nwords); while (nwords) @@ -520,16 +522,16 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nw * data transfer. */ - while ((getreg32(LPC17_SPI_SR) & SPI_SR_SPIF) == 0); + while ((getreg32(LPC17_SPI_SR) & SPI_SR_SPIF) == 0); - /* Read the SPI Status Register again to clear the status bit */ + /* Read the SPI Status Register again to clear the status bit */ - (void)getreg32(LPC17_SPI_SR); + (void)getreg32(LPC17_SPI_SR); - /* Read the received data from the SPI Data Register */ + /* Read the received data from the SPI Data Register */ - *ptr++ = (uint8_t)getreg32(LPC17_SPI_DR); - nwords--; + *ptr++ = (uint8_t)getreg32(LPC17_SPI_DR); + nwords--; } } @@ -587,7 +589,8 @@ FAR struct spi_dev_s *lpc17_spiinitialize(int port) /* Configure 8-bit SPI mode and master mode */ - putreg32(SPI_CR_BITS_8BITS|SPI_CR_BITENABLE|SPI_CR_MSTR, LPC17_SPI_CR); + putreg32(SPI_CR_BITS_8BITS | SPI_CR_BITENABLE | SPI_CR_MSTR, + LPC17_SPI_CR); /* Set the initial SPI configuration */ diff --git a/arch/arm/src/lpc17xx/lpc17_ssp.c b/arch/arm/src/lpc17xx/lpc17_ssp.c index dc44e95a25..6036678423 100644 --- a/arch/arm/src/lpc17xx/lpc17_ssp.c +++ b/arch/arm/src/lpc17xx/lpc17_ssp.c @@ -514,7 +514,7 @@ static void ssp_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) /* Yes... Set CR0 appropriately */ regval = ssp_getreg(priv, LPC17_SSP_CR0_OFFSET); - regval &= ~(SSP_CR0_CPOL|SSP_CR0_CPHA); + regval &= ~(SSP_CR0_CPOL | SSP_CR0_CPHA); switch (mode) { @@ -530,7 +530,7 @@ static void ssp_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) break; case SPIDEV_MODE3: /* CPOL=1; CPHA=1 */ - regval |= (SSP_CR0_CPOL|SSP_CR0_CPHA); + regval |= (SSP_CR0_CPOL | SSP_CR0_CPHA); break; default: @@ -1001,7 +1001,7 @@ FAR struct spi_dev_s *lpc17_sspinitialize(int port) /* Configure 8-bit SPI mode */ - ssp_putreg(priv, LPC17_SSP_CR0_OFFSET, SSP_CR0_DSS_8BIT|SSP_CR0_FRF_SPI); + ssp_putreg(priv, LPC17_SSP_CR0_OFFSET, SSP_CR0_DSS_8BIT | SSP_CR0_FRF_SPI); /* Disable the SSP and all interrupts (we'll poll for all data) */ diff --git a/arch/arm/src/lpc17xx/lpc17_start.c b/arch/arm/src/lpc17xx/lpc17_start.c index 82cb30be12..8d95518d02 100644 --- a/arch/arm/src/lpc17xx/lpc17_start.c +++ b/arch/arm/src/lpc17xx/lpc17_start.c @@ -257,5 +257,5 @@ void __start(void) /* Shouldn't get here */ - for (;;); + for (; ; ); } diff --git a/arch/arm/src/lpc17xx/lpc17_timer.c b/arch/arm/src/lpc17xx/lpc17_timer.c index bc177f1685..5869a3188d 100644 --- a/arch/arm/src/lpc17xx/lpc17_timer.c +++ b/arch/arm/src/lpc17xx/lpc17_timer.c @@ -400,44 +400,44 @@ static int timer_setup(FAR struct pwm_lowerhalf_s *dev) regval = getreg32(LPC17_SYSCON_PCLKSEL0); regval &= ~(0x3 << 2); - regval |= (0x1 << 2); /* PCLK_MC peripheral clk=CCLK=12.5 MHz */ + regval |= (0x1 << 2); /* PCLK_MC peripheral clk=CCLK=12.5 MHz */ regval &= ~(0x3 << 4); - regval |= (0x1 << 4); /* PCLK_MC peripheral clk=CCLK=12.5 MHz */ + regval |= (0x1 << 4); /* PCLK_MC peripheral clk=CCLK=12.5 MHz */ putreg32(regval, LPC17_SYSCON_PCLKSEL0); regval = getreg32(LPC17_SYSCON_PCLKSEL1); regval &= ~(0x3 << 12); - regval |= (0x1 << 12); /* PCLK_MC peripheral clk=CCLK=12.5 MHz */ + regval |= (0x1 << 12); /* PCLK_MC peripheral clk=CCLK=12.5 MHz */ regval &= ~(0x3 << 14); - regval |= (0x1 << 14); /* PCLK_MC peripheral clk=CCLK=12.5 MHz */ + regval |= (0x1 << 14); /* PCLK_MC peripheral clk=CCLK=12.5 MHz */ putreg32(regval, LPC17_SYSCON_PCLKSEL1); priv->pclk = (0x1 << 12) | (0x1 << 4); - putreg32(1000, LPC17_TMR0_MR1); /* Set TIMER0 MR1 = number of counts */ + putreg32(1000, LPC17_TMR0_MR1); /* Set TIMER0 MR1 = number of counts */ - putreg32(1, LPC17_TMR0_PR); /* Prescaler count frequency: Fpclk/1 */ - putreg32(~(0x3 << 0), LPC17_TMR0_CCR); /* Prescaler count frequency: Fpclk/1 */ - putreg32(~(0x3 << 0), LPC17_TMR0_CTCR);/* Prescaler count frequency: Fpclk/1 */ - putreg32((2 << 3), LPC17_TMR0_MCR); /* Reset on match register MR1 */ + putreg32(1, LPC17_TMR0_PR); /* Prescaler count frequency: Fpclk/1 */ + putreg32(~(0x3 << 0), LPC17_TMR0_CCR); /* Prescaler count frequency: Fpclk/1 */ + putreg32(~(0x3 << 0), LPC17_TMR0_CTCR); /* Prescaler count frequency: Fpclk/1 */ + putreg32((2 << 3), LPC17_TMR0_MCR); /* Reset on match register MR1 */ /* Output bit toggle on external match event External match on MR1, Toggle * external bit */ - putreg32(((1 << 1)|(3 << 6)), LPC17_TMR0_EMR); - putreg32((1 << 0), LPC17_TMR0_TCR); /* Start timer0 */ + putreg32(((1 << 1) | (3 << 6)), LPC17_TMR0_EMR); + putreg32((1 << 0), LPC17_TMR0_TCR); /* Start timer0 */ /* Configure the output pins GPIO3.26 */ lpc17_configgpio(GPIO_MAT0p1_2); - putreg32(500, LPC17_TMR1_MR0); /* Set TIMER1 MR0 = number of counts */ + putreg32(500, LPC17_TMR1_MR0); /* Set TIMER1 MR0 = number of counts */ - putreg32(1, LPC17_TMR1_PR); /* Prescaler count frequency:Fpclk/1 */ - putreg32(~(0x3 << 0), LPC17_TMR1_CCR); /* Prescaler count frequency:Fpclk/1 */ - putreg32(~(0x3 << 0), LPC17_TMR1_CTCR);/* Prescaler count frequency:Fpclk/1 */ - putreg32((2 << 0), LPC17_TMR1_MCR); /* Reset on match register MR0 */ -// putreg32(((1 << 0)|(3 << 4)), LPC17_TMR1_EMR); /* Output bit toggle on external match event MAT0 */ - putreg32((1 << 0), LPC17_TMR1_TCR); /* Start timer1 */ + putreg32(1, LPC17_TMR1_PR); /* Prescaler count frequency:Fpclk/1 */ + putreg32(~(0x3 << 0), LPC17_TMR1_CCR); /* Prescaler count frequency:Fpclk/1 */ + putreg32(~(0x3 << 0), LPC17_TMR1_CTCR); /* Prescaler count frequency:Fpclk/1 */ + putreg32((2 << 0), LPC17_TMR1_MCR); /* Reset on match register MR0 */ +// putreg32(((1 << 0 )| (3 << 4)), LPC17_TMR1_EMR); /* Output bit toggle on external match event MAT0 */ + putreg32((1 << 0), LPC17_TMR1_TCR); /* Start timer1 */ /* configure the output pins GPIO3.26 */ // lpc17_configgpio(GPIO_MAT0p1_2); diff --git a/arch/arm/src/lpc17xx/lpc17_timerisr.c b/arch/arm/src/lpc17xx/lpc17_timerisr.c index f61cf58073..d0f48a57d1 100644 --- a/arch/arm/src/lpc17xx/lpc17_timerisr.c +++ b/arch/arm/src/lpc17xx/lpc17_timerisr.c @@ -143,7 +143,8 @@ void up_timer_initialize(void) /* Enable SysTick interrupts */ - putreg32((NVIC_SYSTICK_CTRL_CLKSOURCE|NVIC_SYSTICK_CTRL_TICKINT|NVIC_SYSTICK_CTRL_ENABLE), NVIC_SYSTICK_CTRL); + putreg32((NVIC_SYSTICK_CTRL_CLKSOURCE | NVIC_SYSTICK_CTRL_TICKINT | + NVIC_SYSTICK_CTRL_ENABLE), NVIC_SYSTICK_CTRL); /* And enable the timer interrupt */ diff --git a/arch/arm/src/lpc17xx/lpc17_usbdev.c b/arch/arm/src/lpc17xx/lpc17_usbdev.c index d53a28e94c..5463f28935 100644 --- a/arch/arm/src/lpc17xx/lpc17_usbdev.c +++ b/arch/arm/src/lpc17xx/lpc17_usbdev.c @@ -660,7 +660,7 @@ static uint32_t lpc17_usbcmd(uint16_t cmd, uint8_t data) /* Disable interrupt and clear CDFULL and CCEMPTY interrupt status */ flags = irqsave(); - lpc17_putreg(USBDEV_INT_CDFULL|USBDEV_INT_CCEMPTY, LPC17_USBDEV_INTCLR); + lpc17_putreg(USBDEV_INT_CDFULL | USBDEV_INT_CCEMPTY, LPC17_USBDEV_INTCLR); /* Shift the command in position and mask out extra bits */ @@ -870,7 +870,7 @@ static void lpc17_epwrite(uint8_t epphy, const uint8_t *data, uint32_t nbytes) { if (aligned) { - value = *(uint32_t*)data; + value = *(uint32_t *)data; } else { @@ -919,11 +919,11 @@ static int lpc17_epread(uint8_t epphy, uint8_t *data, uint32_t nbytes) if (data) { - if (((uint32_t)data & 3) == 0) + if (((uint32_t)data & 3) == 0) { aligned = 1; } - else + else { aligned = 2; } @@ -951,7 +951,7 @@ static int lpc17_epread(uint8_t epphy, uint8_t *data, uint32_t nbytes) value = lpc17_getreg(LPC17_USBDEV_RXDATA); if (aligned == 1) { - *(uint32_t*)data = value; + *(uint32_t *)data = value; data += 4; } else if (aligned == 2) @@ -1331,7 +1331,7 @@ static void lpc17_eprealize(struct lpc17_ep_s *privep, bool prio, uint32_t packe /* Clear realize interrupt bit */ - lpc17_putreg(USBDEV_INT_EPRLZED,LPC17_USBDEV_INTCLR); + lpc17_putreg(USBDEV_INT_EPRLZED, LPC17_USBDEV_INTCLR); } /**************************************************************************** @@ -1487,7 +1487,8 @@ static void lpc17_usbreset(struct lpc17_usbdev_s *priv) /* Enable Device interrupts */ - lpc17_putreg(USB_SLOW_INT|USB_DEVSTATUS_INT|USB_FAST_INT|USB_FRAME_INT|USB_ERROR_INT, + lpc17_putreg(USB_SLOW_INT | USB_DEVSTATUS_INT | USB_FAST_INT | + USB_FRAME_INT | USB_ERROR_INT, LPC17_USBDEV_INTEN); /* Tell the class driver that we are disconnected. The class @@ -1580,7 +1581,7 @@ static inline void lpc17_ep0setup(struct lpc17_usbdev_s *priv) /* Read EP0 data */ - ret = lpc17_epread(LPC17_EP0_OUT, (uint8_t*)&ctrl, USB_SIZEOF_CTRLREQ); + ret = lpc17_epread(LPC17_EP0_OUT, (uint8_t *)&ctrl, USB_SIZEOF_CTRLREQ); if (ret <= 0) { return; @@ -1638,7 +1639,8 @@ static inline void lpc17_ep0setup(struct lpc17_usbdev_s *priv) } else { - if ((lpc17_usbcmd(CMD_USBDEV_EPSELECT|privep->epphy, 0) & CMD_EPSELECT_ST) != 0) + if ((lpc17_usbcmd(CMD_USBDEV_EPSELECT | privep->epphy, 0) & + CMD_EPSELECT_ST) != 0) { response[0] = 1; /* Stalled */ } @@ -2070,7 +2072,7 @@ static int lpc17_usbinterrupt(int irq, FAR void *context) /* Check for low priority and high priority (non-DMA) interrupts */ usbintstatus = lpc17_getreg(LPC17_SYSCON_USBINTST); - if ((usbintstatus & (SYSCON_USBINTST_REQLP|SYSCON_USBINTST_REQHP)) != 0) + if ((usbintstatus & (SYSCON_USBINTST_REQLP | SYSCON_USBINTST_REQHP)) != 0) { #endif #ifdef CONFIG_LPC17_USBDEV_EPFAST_INTERRUPT @@ -2080,10 +2082,10 @@ static int lpc17_usbinterrupt(int irq, FAR void *context) { /* Clear Fast EP interrupt */ - lpc17_putreg(USBDEV_INT_EPFAST, LPC17_USBDEV_INTCLR); - usbtrace(TRACE_INTDECODE(LPC17_TRACEINTID_EPFAST), 0); + lpc17_putreg(USBDEV_INT_EPFAST, LPC17_USBDEV_INTCLR); + usbtrace(TRACE_INTDECODE(LPC17_TRACEINTID_EPFAST), 0); - /* Do what? */ + /* Do what? */ } #endif @@ -2143,31 +2145,31 @@ static int lpc17_usbinterrupt(int irq, FAR void *context) (uint16_t)g_usbdev.devstatus); if (DEVSTATUS_CONNECT(g_usbdev.devstatus)) { - /* Host is connected */ + /* Host is connected */ - if (!priv->attached) - { - /* We have a transition from unattached to attached */ + if (!priv->attached) + { + /* We have a transition from unattached to attached */ - usbtrace(TRACE_INTDECODE(LPC17_TRACEINTID_CONNECTED), - (uint16_t)g_usbdev.devstatus); - priv->usbdev.speed = USB_SPEED_UNKNOWN; - lpc17_usbcmd(CMD_USBDEV_CONFIG, 0); - priv->attached = 1; + usbtrace(TRACE_INTDECODE(LPC17_TRACEINTID_CONNECTED), + (uint16_t)g_usbdev.devstatus); + priv->usbdev.speed = USB_SPEED_UNKNOWN; + lpc17_usbcmd(CMD_USBDEV_CONFIG, 0); + priv->attached = 1; } - } + } - /* Otherwise the host is not attached */ + /* Otherwise the host is not attached */ - else if (priv->attached) - { - usbtrace(TRACE_INTDECODE(LPC17_TRACEINTID_DISCONNECTED), - (uint16_t)g_usbdev.devstatus); - priv->usbdev.speed = USB_SPEED_UNKNOWN; - lpc17_usbcmd(CMD_USBDEV_CONFIG, 0); - priv->attached = 0; - priv->paddrset = 0; - } + else if (priv->attached) + { + usbtrace(TRACE_INTDECODE(LPC17_TRACEINTID_DISCONNECTED), + (uint16_t)g_usbdev.devstatus); + priv->usbdev.speed = USB_SPEED_UNKNOWN; + lpc17_usbcmd(CMD_USBDEV_CONFIG, 0); + priv->attached = 0; + priv->paddrset = 0; + } } /* Device suspend status */ @@ -2275,7 +2277,7 @@ static int lpc17_usbinterrupt(int irq, FAR void *context) if ((pending & 1) != 0) { - /* Yes.. clear the endpoint interrupt */ + /* Yes.. clear the endpoint interrupt */ (void)lpc17_epclrinterrupt(epphy); @@ -2304,7 +2306,7 @@ static int lpc17_usbinterrupt(int irq, FAR void *context) privep->txbusy = 0; lpc17_wrrequest(privep); - } + } else { /* OUT: host-to-device */ @@ -2313,8 +2315,8 @@ static int lpc17_usbinterrupt(int irq, FAR void *context) /* Read host data into the current read request */ - if (!lpc17_rqempty(privep)) - { + if (!lpc17_rqempty(privep)) + { lpc17_rdrequest(privep); } else @@ -2590,7 +2592,8 @@ static int lpc17_epconfigure(FAR struct usbdev_ep_s *ep, { lpc17_usbcmd(CMD_USBDEV_CONFIG, 1); } - return OK; + + return OK; } /**************************************************************************** @@ -3334,8 +3337,8 @@ void up_usbinitialize(void) /* Enable EP0 for OUT (host-to-device) */ - lpc17_usbcmd(CMD_USBDEV_SETADDRESS, CMD_USBDEV_SETADDRESS_DEVEN|0); - lpc17_usbcmd(CMD_USBDEV_SETADDRESS, CMD_USBDEV_SETADDRESS_DEVEN|0); + lpc17_usbcmd(CMD_USBDEV_SETADDRESS, CMD_USBDEV_SETADDRESS_DEVEN | 0); + lpc17_usbcmd(CMD_USBDEV_SETADDRESS, CMD_USBDEV_SETADDRESS_DEVEN | 0); /* Reset/Re-initialize the USB hardware */ diff --git a/arch/arm/src/lpc17xx/lpc17_usbhost.c b/arch/arm/src/lpc17xx/lpc17_usbhost.c index 237882eee4..0c13c7be3b 100644 --- a/arch/arm/src/lpc17xx/lpc17_usbhost.c +++ b/arch/arm/src/lpc17xx/lpc17_usbhost.c @@ -664,7 +664,7 @@ static struct lpc17_gtd_s *lpc17_tdalloc(void) ret = (struct lpc17_gtd_s *)g_tdfree; if (ret) { - g_tdfree = ((struct lpc17_list_s*)ret)->flink; + g_tdfree = ((struct lpc17_list_s *)ret)->flink; } irqrestore(flags); @@ -715,7 +715,7 @@ static uint8_t *lpc17_tballoc(void) uint8_t *ret = (uint8_t *)g_tbfree; if (ret) { - g_tbfree = ((struct lpc17_list_s*)ret)->flink; + g_tbfree = ((struct lpc17_list_s *)ret)->flink; } return ret; } @@ -763,7 +763,7 @@ static uint8_t *lpc17_allocio(void) ret = (uint8_t *)g_iofree; if (ret) { - g_iofree = ((struct lpc17_list_s*)ret)->flink; + g_iofree = ((struct lpc17_list_s *)ret)->flink; } irqrestore(flags); @@ -818,7 +818,7 @@ static struct lpc17_xfrinfo_s *lpc17_alloc_xfrinfo(void) ret = (struct lpc17_xfrinfo_s *)g_xfrfree; if (ret) { - g_xfrfree = ((struct lpc17_list_s*)ret)->flink; + g_xfrfree = ((struct lpc17_list_s *)ret)->flink; } irqrestore(flags); @@ -1943,7 +1943,7 @@ static int lpc17_wait(struct usbhost_connection_s *conn, irqstate_t flags; flags = irqsave(); - for (;;) + for (; ; ) { /* Is there a change in the connection state of the single root hub * port? @@ -2208,11 +2208,11 @@ static int lpc17_epalloc(struct usbhost_driver_s *drvr, { /* Remove the ED from the freelist */ - g_edfree = ((struct lpc17_list_s*)ed)->flink; + g_edfree = ((struct lpc17_list_s *)ed)->flink; /* Configure the endpoint descriptor. */ - memset((void*)ed, 0, sizeof(struct lpc17_ed_s)); + memset((void *)ed, 0, sizeof(struct lpc17_ed_s)); hport = epdesc->hport; ed->hw.ctrl = (uint32_t)(hport->funcaddr) << ED_CONTROL_FA_SHIFT | @@ -2606,7 +2606,7 @@ static int lpc17_ctrlin(struct usbhost_driver_s *drvr, usbhost_ep_t ep0, uint16_t len; int ret; - DEBUGASSERT(priv != NULL && ed != NULL && req!= NULL); + DEBUGASSERT(priv != NULL && ed != NULL && req != NULL); uvdbg("type:%02x req:%02x value:%02x%02x index:%02x%02x len:%02x%02x\n", req->type, req->req, req->value[1], req->value[0], @@ -2617,7 +2617,7 @@ static int lpc17_ctrlin(struct usbhost_driver_s *drvr, usbhost_ep_t ep0, lpc17_takesem(&priv->exclsem); len = lpc17_getle16(req->len); - ret = lpc17_ctrltd(priv, ed, GTD_STATUS_DP_SETUP, (uint8_t*)req, USB_SIZEOF_CTRLREQ); + ret = lpc17_ctrltd(priv, ed, GTD_STATUS_DP_SETUP, (uint8_t *)req, USB_SIZEOF_CTRLREQ); if (ret == OK) { if (len) @@ -2644,7 +2644,7 @@ static int lpc17_ctrlout(struct usbhost_driver_s *drvr, usbhost_ep_t ep0, uint16_t len; int ret; - DEBUGASSERT(priv != NULL && ed != NULL && req!= NULL); + DEBUGASSERT(priv != NULL && ed != NULL && req != NULL); uvdbg("type:%02x req:%02x value:%02x%02x index:%02x%02x len:%02x%02x\n", req->type, req->req, req->value[1], req->value[0], @@ -2655,12 +2655,12 @@ static int lpc17_ctrlout(struct usbhost_driver_s *drvr, usbhost_ep_t ep0, lpc17_takesem(&priv->exclsem); len = lpc17_getle16(req->len); - ret = lpc17_ctrltd(priv, ed, GTD_STATUS_DP_SETUP, (uint8_t*)req, USB_SIZEOF_CTRLREQ); + ret = lpc17_ctrltd(priv, ed, GTD_STATUS_DP_SETUP, (uint8_t *)req, USB_SIZEOF_CTRLREQ); if (ret == OK) { if (len) { - ret = lpc17_ctrltd(priv, ed, GTD_STATUS_DP_OUT, (uint8_t*)buffer, len); + ret = lpc17_ctrltd(priv, ed, GTD_STATUS_DP_OUT, (uint8_t *)buffer, len); } if (ret == OK) @@ -3013,7 +3013,7 @@ static ssize_t lpc17_transfer(struct usbhost_driver_s *drvr, usbhost_ep_t ep, /* Return the number of bytes successfully transferred */ nbytes = xfrinfo->xfrd; - DEBUGASSERT(nbytes >=0 && nbytes <= buflen); + DEBUGASSERT(nbytes >= 0 && nbytes <= buflen); } else { @@ -3392,7 +3392,7 @@ static int lpc17_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) lpc17_givesem(&ed->wdhsem); xfrinfo->wdhwait = false; - /* And free the transfer structure */ + /* And free the transfer structure */ lpc17_free_xfrinfo(xfrinfo); ed->xfrinfo = NULL; @@ -3408,7 +3408,7 @@ static int lpc17_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) } else { - /* Just free the transfer structure */ + /* Just free the transfer structure */ lpc17_free_xfrinfo(xfrinfo); ed->xfrinfo = NULL; @@ -3712,9 +3712,9 @@ struct usbhost_connection_s *lpc17_usbhost_initialize(int controller) /* Initialize all the TDs, EDs and HCCA to 0 */ - memset((void*)HCCA, 0, sizeof(struct ohci_hcca_s)); - memset((void*)TDTAIL, 0, sizeof(struct ohci_gtd_s)); - memset((void*)EDCTRL, 0, sizeof(struct lpc17_ed_s)); + memset((void *)HCCA, 0, sizeof(struct ohci_hcca_s)); + memset((void *)TDTAIL, 0, sizeof(struct ohci_gtd_s)); + memset((void *)EDCTRL, 0, sizeof(struct lpc17_ed_s)); sem_init(&EDCTRL->wdhsem, 0, 0); /* Initialize user-configurable EDs */ @@ -3819,7 +3819,7 @@ struct usbhost_connection_s *lpc17_usbhost_initialize(int controller) /* Enable OHCI interrupts */ - lpc17_putreg((LPC17_ALL_INTS|OHCI_INT_MIE), LPC17_USBHOST_INTEN); + lpc17_putreg((LPC17_ALL_INTS | OHCI_INT_MIE), LPC17_USBHOST_INTEN); /* Attach USB host controller interrupt handler */ diff --git a/arch/arm/src/lpc17xx/lpc17_userspace.c b/arch/arm/src/lpc17xx/lpc17_userspace.c index 3e8f4e7744..ed433eab7e 100644 --- a/arch/arm/src/lpc17xx/lpc17_userspace.c +++ b/arch/arm/src/lpc17xx/lpc17_userspace.c @@ -87,8 +87,8 @@ void lpc17_userspace(void) DEBUGASSERT(USERSPACE->us_bssstart != 0 && USERSPACE->us_bssend != 0 && USERSPACE->us_bssstart <= USERSPACE->us_bssend); - dest = (uint8_t*)USERSPACE->us_bssstart; - end = (uint8_t*)USERSPACE->us_bssend; + dest = (uint8_t *)USERSPACE->us_bssstart; + end = (uint8_t *)USERSPACE->us_bssend; while (dest != end) { @@ -101,9 +101,9 @@ void lpc17_userspace(void) USERSPACE->us_datastart != 0 && USERSPACE->us_dataend != 0 && USERSPACE->us_datastart <= USERSPACE->us_dataend); - src = (uint8_t*)USERSPACE->us_datasource; - dest = (uint8_t*)USERSPACE->us_datastart; - end = (uint8_t*)USERSPACE->us_dataend; + src = (uint8_t *)USERSPACE->us_datasource; + dest = (uint8_t *)USERSPACE->us_datastart; + end = (uint8_t *)USERSPACE->us_dataend; while (dest != end) { diff --git a/arch/arm/src/lpc214x/lpc214x_decodeirq.c b/arch/arm/src/lpc214x/lpc214x_decodeirq.c index b5cd57f2af..08da50a32c 100644 --- a/arch/arm/src/lpc214x/lpc214x_decodeirq.c +++ b/arch/arm/src/lpc214x/lpc214x_decodeirq.c @@ -150,7 +150,7 @@ static void lpc214x_decodeirq(uint32_t *regs) * current_regs is also used to manage interrupt level context switches. */ - savestate = (uint32_t*)current_regs; + savestate = (uint32_t *)current_regs; current_regs = regs; /* Deliver the IRQ */ diff --git a/arch/arm/src/lpc214x/lpc214x_serial.c b/arch/arm/src/lpc214x/lpc214x_serial.c index a911a2c1a3..4da4732757 100644 --- a/arch/arm/src/lpc214x/lpc214x_serial.c +++ b/arch/arm/src/lpc214x/lpc214x_serial.c @@ -296,19 +296,19 @@ static inline void up_enablebreaks(struct up_dev_s *priv, bool enable) static int up_setup(struct uart_dev_s *dev) { #ifndef CONFIG_SUPPRESS_UART_CONFIG - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint16_t baud; uint8_t lcr; /* Clear fifos */ up_serialout(priv, LPC214X_UART_FCR_OFFSET, - (LPC214X_FCR_RX_FIFO_RESET|LPC214X_FCR_TX_FIFO_RESET)); + (LPC214X_FCR_RX_FIFO_RESET | LPC214X_FCR_TX_FIFO_RESET)); /* Set trigger */ up_serialout(priv, LPC214X_UART_FCR_OFFSET, - (LPC214X_FCR_FIFO_ENABLE|LPC214X_FCR_FIFO_TRIG14)); + (LPC214X_FCR_FIFO_ENABLE | LPC214X_FCR_FIFO_TRIG14)); /* Set up the IER */ @@ -359,8 +359,8 @@ static int up_setup(struct uart_dev_s *dev) /* Configure the FIFOs */ up_serialout(priv, LPC214X_UART_FCR_OFFSET, - (LPC214X_FCR_FIFO_TRIG8|LPC214X_FCR_TX_FIFO_RESET|\ - LPC214X_FCR_RX_FIFO_RESET|LPC214X_FCR_FIFO_ENABLE)); + (LPC214X_FCR_FIFO_TRIG8 | LPC214X_FCR_TX_FIFO_RESET | + LPC214X_FCR_RX_FIFO_RESET | LPC214X_FCR_FIFO_ENABLE)); /* The NuttX serial driver waits for the first THRE interrupt before * sending serial data... However, it appears that the lpc214x hardware @@ -385,7 +385,7 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disableuartint(priv, NULL); } @@ -406,7 +406,7 @@ static void up_shutdown(struct uart_dev_s *dev) static int up_attach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ */ @@ -414,12 +414,13 @@ static int up_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, up_interrupt); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the UART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the UART + */ - up_enable_irq(priv->irq); + up_enable_irq(priv->irq); } + return ret; } @@ -435,7 +436,7 @@ static int up_attach(struct uart_dev_s *dev) static void up_detach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disable_irq(priv->irq); irq_detach(priv->irq); } @@ -472,7 +473,7 @@ static int up_interrupt(int irq, void *context) { PANIC(); } - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; /* Loop until there are no characters to be transferred or, * until we have been looping for a long time. @@ -566,7 +567,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) { struct inode *inode = filep->f_inode; struct uart_dev_s *dev = inode->i_private; - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret = OK; switch (cmd) @@ -574,7 +575,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct up_dev_s *user = (struct up_dev_s*)arg; + struct up_dev_s *user = (struct up_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -624,7 +625,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) static int up_receive(struct uart_dev_s *dev, uint32_t *status) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint8_t rbr; *status = up_serialin(priv, LPC214X_UART_LSR_OFFSET); @@ -642,7 +643,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { #ifndef CONFIG_SUPPRESS_SERIAL_INTS @@ -666,7 +667,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) static bool up_rxavailable(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, LPC214X_UART_LSR_OFFSET) & LPC214X_LSR_RDR) != 0); } @@ -680,7 +681,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_serialout(priv, LPC214X_UART_THR_OFFSET, (uint8_t)ch); } @@ -694,7 +695,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { #ifndef CONFIG_SUPPRESS_SERIAL_INTS @@ -718,7 +719,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) static bool up_txready(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, LPC214X_UART_LSR_OFFSET) & LPC214X_LSR_THRE) != 0); } @@ -732,7 +733,7 @@ static bool up_txready(struct uart_dev_s *dev) static bool up_txempty(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, LPC214X_UART_LSR_OFFSET) & LPC214X_LSR_THRE) != 0); } @@ -755,8 +756,8 @@ void up_earlyserialinit(void) /* Enable UART0 and 1 */ uint32_t pinsel = getreg32(LPC214X_PINSEL0); - pinsel &= ~(LPC214X_UART0_PINMASK|LPC214X_UART1_PINMASK); - pinsel |= (LPC214X_UART0_PINSEL|LPC214X_UART1_PINSEL); + pinsel &= ~(LPC214X_UART0_PINMASK | LPC214X_UART1_PINMASK); + pinsel |= (LPC214X_UART0_PINSEL | LPC214X_UART1_PINSEL); putreg32(pinsel, LPC214X_PINSEL0); /* Disable both UARTS */ @@ -796,7 +797,7 @@ void up_serialinit(void) int up_putc(int ch) { - struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; + struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; uint8_t ier; up_disableuartint(priv, &ier); diff --git a/arch/arm/src/lpc214x/lpc214x_usbdev.c b/arch/arm/src/lpc214x/lpc214x_usbdev.c index 6320ac9ec1..1ceb9c807e 100644 --- a/arch/arm/src/lpc214x/lpc214x_usbdev.c +++ b/arch/arm/src/lpc214x/lpc214x_usbdev.c @@ -217,7 +217,7 @@ * assocated DMA buffer. */ -#define USB_UDCA (uint32_t*)LPC214X_USBDEV_RAMBASE) +#define USB_UDCA (uint32_t *)LPC214X_USBDEV_RAMBASE) #define USB_USCASIZE (LPC214X_NPHYSENDPOINTS*sizeof(uint32_t)) /* Each descriptor must be aligned to a 128 address boundary */ @@ -529,7 +529,7 @@ static uint32_t lpc214x_getreg(uint32_t addr) uint32_t val = getreg32(addr); - /* Is this the same value that we read from the same registe last time? Are + /* Is this the same value that we read from the same register last time? Are * we polling the register? If so, suppress some of the output. */ @@ -550,20 +550,20 @@ static uint32_t lpc214x_getreg(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ @@ -610,7 +610,8 @@ static uint32_t lpc214x_usbcmd(uint16_t cmd, uint8_t data) /* Disable interrupt and clear CDFULL and CCEMPTY interrupt status */ flags = irqsave(); - lpc214x_putreg(USBDEV_DEVINT_CDFULL|USBDEV_DEVINT_CCEMTY, LPC214X_USBDEV_DEVINTCLR); + lpc214x_putreg(USBDEV_DEVINT_CDFULL | USBDEV_DEVINT_CCEMTY, + LPC214X_USBDEV_DEVINTCLR); /* Load command + WR in command code register */ @@ -814,7 +815,7 @@ static void lpc214x_epwrite(uint8_t epphy, const uint8_t *data, uint32_t nbytes) { if (aligned) { - value = *(uint32_t*)data; + value = *(uint32_t *)data; } else { @@ -863,11 +864,11 @@ static int lpc214x_epread(uint8_t epphy, uint8_t *data, uint32_t nbytes) if (data) { - if (((uint32_t)data & 3) == 0) + if (((uint32_t)data & 3) == 0) { aligned = 1; } - else + else { aligned = 2; } @@ -895,7 +896,7 @@ static int lpc214x_epread(uint8_t epphy, uint8_t *data, uint32_t nbytes) value = lpc214x_getreg(LPC214X_USBDEV_RXDATA); if (aligned == 1) { - *(uint32_t*)data = value; + *(uint32_t *)data = value; data += 4; } else if (aligned == 2) @@ -1275,7 +1276,7 @@ static void lpc214x_eprealize(struct lpc214x_ep_s *privep, bool prio, uint32_t p /* Clear realize interrupt bit */ - lpc214x_putreg(USBDEV_DEVINT_EPRLZED,LPC214X_USBDEV_DEVINTCLR); + lpc214x_putreg(USBDEV_DEVINT_EPRLZED, LPC214X_USBDEV_DEVINTCLR); } /**************************************************************************** @@ -1454,7 +1455,8 @@ static void lpc214x_usbreset(struct lpc214x_usbdev_s *priv) /* Enable Device interrupts */ - lpc214x_putreg(USB_SLOW_INT|USB_DEVSTATUS_INT|USB_FAST_INT|USB_FRAME_INT|USB_ERROR_INT, + lpc214x_putreg(USB_SLOW_INT | USB_DEVSTATUS_INT | USB_FAST_INT | + USB_FRAME_INT | USB_ERROR_INT, LPC214X_USBDEV_DEVINTEN); } @@ -1538,7 +1540,7 @@ static inline void lpc214x_ep0setup(struct lpc214x_usbdev_s *priv) /* Read EP0 data */ - ret = lpc214x_epread(LPC214X_EP0_OUT, (uint8_t*)&ctrl, USB_SIZEOF_CTRLREQ); + ret = lpc214x_epread(LPC214X_EP0_OUT, (uint8_t *)&ctrl, USB_SIZEOF_CTRLREQ); if (ret <= 0) { return; @@ -1596,7 +1598,7 @@ static inline void lpc214x_ep0setup(struct lpc214x_usbdev_s *priv) } else { - if ((lpc214x_usbcmd(CMD_USB_EP_SELECT|privep->epphy, 0) & CMD_USB_EPSELECT_ST) != 0) + if ((lpc214x_usbcmd(CMD_USB_EP_SELECT | privep->epphy, 0) & CMD_USB_EPSELECT_ST) != 0) { response[0] = 1; /* Stalled */ } @@ -2035,7 +2037,7 @@ static int lpc214x_usbinterrupt(int irq, FAR void *context) #ifdef CONFIG_LPC214X_USBDEV_DMA /* Check for low priority and high priority (non-DMA) interrupts */ - if ((lpc214x_getreg(LPC214X_USBDEV_INTST) & (USBDEV_INTST_REQLP|USBDEV_INTST_REQHP)) != 0) + if ((lpc214x_getreg(LPC214X_USBDEV_INTST) & (USBDEV_INTST_REQLP | USBDEV_INTST_REQHP)) != 0) { #endif #ifdef CONFIG_LPC214X_USBDEV_EPFAST_INTERRUPT @@ -2045,10 +2047,10 @@ static int lpc214x_usbinterrupt(int irq, FAR void *context) { /* Clear Fast EP interrupt */ - lpc214x_putreg(USBDEV_DEVINT_EPFAST, LPC214X_USBDEV_DEVINTCLR); - usbtrace(TRACE_INTDECODE(LPC214X_TRACEINTID_EPFAST), 0); + lpc214x_putreg(USBDEV_DEVINT_EPFAST, LPC214X_USBDEV_DEVINTCLR); + usbtrace(TRACE_INTDECODE(LPC214X_TRACEINTID_EPFAST), 0); - /* Do what? */ + /* Do what? */ } #endif @@ -2109,31 +2111,31 @@ static int lpc214x_usbinterrupt(int irq, FAR void *context) (uint16_t)g_usbdev.devstatus); if (DEVSTATUS_CONNECT(g_usbdev.devstatus)) { - /* Host is connected */ + /* Host is connected */ - if (!priv->attached) - { - /* We have a transition from unattached to attached */ + if (!priv->attached) + { + /* We have a transition from unattached to attached */ - usbtrace(TRACE_INTDECODE(LPC214X_TRACEINTID_CONNECTED), - (uint16_t)g_usbdev.devstatus); - priv->usbdev.speed = USB_SPEED_UNKNOWN; - lpc214x_usbcmd(CMD_USB_DEV_CONFIG, 0); - priv->attached = 1; + usbtrace(TRACE_INTDECODE(LPC214X_TRACEINTID_CONNECTED), + (uint16_t)g_usbdev.devstatus); + priv->usbdev.speed = USB_SPEED_UNKNOWN; + lpc214x_usbcmd(CMD_USB_DEV_CONFIG, 0); + priv->attached = 1; } - } + } - /* Otherwise the host is not attached */ + /* Otherwise the host is not attached */ - else if (priv->attached) - { - usbtrace(TRACE_INTDECODE(LPC214X_TRACEINTID_DISCONNECTED), - (uint16_t)g_usbdev.devstatus); - priv->usbdev.speed = USB_SPEED_UNKNOWN; - lpc214x_usbcmd(CMD_USB_DEV_CONFIG, 0); - priv->attached = 0; - priv->paddrset = 0; - } + else if (priv->attached) + { + usbtrace(TRACE_INTDECODE(LPC214X_TRACEINTID_DISCONNECTED), + (uint16_t)g_usbdev.devstatus); + priv->usbdev.speed = USB_SPEED_UNKNOWN; + lpc214x_usbcmd(CMD_USB_DEV_CONFIG, 0); + priv->attached = 0; + priv->paddrset = 0; + } } /* Device suspend status */ @@ -2241,7 +2243,7 @@ static int lpc214x_usbinterrupt(int irq, FAR void *context) if ((pending & 1) != 0) { - /* Yes.. clear the endpoint interrupt */ + /* Yes.. clear the endpoint interrupt */ (void)lpc214x_epclrinterrupt(epphy); @@ -2270,7 +2272,7 @@ static int lpc214x_usbinterrupt(int irq, FAR void *context) privep->txbusy = 0; lpc214x_wrrequest(privep); - } + } else { /* OUT: host-to-device */ @@ -2279,8 +2281,8 @@ static int lpc214x_usbinterrupt(int irq, FAR void *context) /* Read host data into the current read request */ - if (!lpc214x_rqempty(privep)) - { + if (!lpc214x_rqempty(privep)) + { lpc214x_rdrequest(privep); } else @@ -2556,7 +2558,8 @@ static int lpc214x_epconfigure(FAR struct usbdev_ep_s *ep, { lpc214x_usbcmd(CMD_USB_DEV_CONFIG, 1); } - return OK; + + return OK; } /**************************************************************************** @@ -3250,8 +3253,8 @@ void up_usbinitialize(void) /* Enable EP0 for OUT (host-to-device) */ - lpc214x_usbcmd(CMD_USB_DEV_SETADDRESS, CMD_USB_SETADDRESS_DEVEN|0); - lpc214x_usbcmd(CMD_USB_DEV_SETADDRESS, CMD_USB_SETADDRESS_DEVEN|0); + lpc214x_usbcmd(CMD_USB_DEV_SETADDRESS, CMD_USB_SETADDRESS_DEVEN | 0); + lpc214x_usbcmd(CMD_USB_DEV_SETADDRESS, CMD_USB_SETADDRESS_DEVEN | 0); /* Reset/Re-initialize the USB hardware */ diff --git a/arch/arm/src/lpc2378/lpc23xx_decodeirq.c b/arch/arm/src/lpc2378/lpc23xx_decodeirq.c index 57334f7b99..0a311b5526 100644 --- a/arch/arm/src/lpc2378/lpc23xx_decodeirq.c +++ b/arch/arm/src/lpc2378/lpc23xx_decodeirq.c @@ -136,7 +136,7 @@ static void lpc23xx_decodeirq(uint32_t *regs) * current_regs is also used to manage interrupt level context switches. */ - savestate = (uint32_t*)current_regs; + savestate = (uint32_t *)current_regs; current_regs = regs; /* Acknowledge the interrupt */ diff --git a/arch/arm/src/lpc2378/lpc23xx_i2c.c b/arch/arm/src/lpc2378/lpc23xx_i2c.c index 35567fdd52..565a0cc5ca 100644 --- a/arch/arm/src/lpc2378/lpc23xx_i2c.c +++ b/arch/arm/src/lpc2378/lpc23xx_i2c.c @@ -229,12 +229,12 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int bufle priv->wrcnt = 0; priv->rdcnt = 0; priv->msg.addr &= ~0x01; - priv->msg.buffer = (uint8_t*)buffer; + priv->msg.buffer = (uint8_t *)buffer; priv->msg.length = buflen; ret = i2c_start (priv); - return ret >0 ? OK : -ETIMEDOUT; + return ret > 0 ? OK : -ETIMEDOUT; } /**************************************************************************** @@ -290,11 +290,11 @@ static int i2c_start (struct lpc23xx_i2cdev_s *priv) if (priv-> state == 0x18 || priv->state == 0x28) { - ret=priv->wrcnt; + ret = priv->wrcnt; } else if (priv-> state == 0x50 || priv->state == 0x58) { - ret=priv->rdcnt; + ret = priv->rdcnt; } return ret; @@ -397,15 +397,15 @@ static int i2c_interrupt (int irq, FAR void *context) break; case 0x18: - priv->wrcnt=0; + priv->wrcnt = 0; putreg32(priv->msg.buffer[0], priv->base + I2C_DAT_OFFSET); break; case 0x28: priv->wrcnt++; - if (priv->wrcntmsg.length) + if (priv->wrcnt < priv->msg.length) { - putreg32(priv->msg.buffer[priv->wrcnt],priv->base+I2C_DAT_OFFSET); + putreg32(priv->msg.buffer[priv->wrcnt], priv->base + I2C_DAT_OFFSET); } else { @@ -421,12 +421,12 @@ static int i2c_interrupt (int irq, FAR void *context) case 0x50: priv->rdcnt++; - if (priv->rdcntmsg.length) + if (priv->rdcnt < priv->msg.length) { priv->msg.buffer[priv->rdcnt] = getreg32(priv->base + I2C_DAT_OFFSET); } - if (priv->rdcnt>=priv->msg.length-1) + if (priv->rdcnt >= priv->msg.length-1) { putreg32(I2C_CONCLR_AAC | I2C_CONCLR_SIC, priv->base + I2C_CONCLR_OFFSET); } @@ -501,7 +501,7 @@ struct i2c_dev_s *up_i2cinitialize(int port) #ifdef CONFIG_LPC2378_I2C1 if (port == 1) { - priv= (FAR struct lpc23xx_i2cdev_s *)&i2cdevices[1]; + priv = (FAR struct lpc23xx_i2cdev_s *)&i2cdevices[1]; priv->base = I2C1_BASE_ADDR; priv->irqid = I2C1_IRQ; @@ -529,7 +529,7 @@ struct i2c_dev_s *up_i2cinitialize(int port) #ifdef CONFIG_LPC2378_I2C2 if (port == 2) { - priv= (FAR struct lpc23xx_i2cdev_s *)&i2cdevices[2]; + priv = (FAR struct lpc23xx_i2cdev_s *)&i2cdevices[2]; priv->base = I2C2_BASE_ADDR; priv->irqid = I2C2_IRQ; @@ -559,7 +559,7 @@ struct i2c_dev_s *up_i2cinitialize(int port) return NULL; } - putreg32(I2C_CONSET_I2EN,priv->base+I2C_CONSET_OFFSET); + putreg32(I2C_CONSET_I2EN, priv->base + I2C_CONSET_OFFSET); sem_init (&priv->mutex, 0, 1); sem_init (&priv->wait, 0, 0); @@ -598,7 +598,7 @@ int up_i2cuninitialize(FAR struct i2c_dev_s * dev) { struct lpc23xx_i2cdev_s *priv = (struct lpc23xx_i2cdev_s *)dev; - putreg32(I2C_CONCLRT_I2ENC,priv->base+I2C_CONCLR_OFFSET); + putreg32(I2C_CONCLRT_I2ENC, priv->base + I2C_CONCLR_OFFSET); up_disable_irq(priv->irqid); irq_detach(priv->irqid); return OK; diff --git a/arch/arm/src/lpc2378/lpc23xx_spi.c b/arch/arm/src/lpc2378/lpc23xx_spi.c index 0ce06502bb..afc6f5860d 100644 --- a/arch/arm/src/lpc2378/lpc23xx_spi.c +++ b/arch/arm/src/lpc2378/lpc23xx_spi.c @@ -335,7 +335,7 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) /* Yes... Set CR appropriately */ regval = getreg32(SPI_CR); - regval &= ~(SPI_CR_CPOL|SPI_CR_CPHA); + regval &= ~(SPI_CR_CPOL | SPI_CR_CPHA); switch (mode) { @@ -351,7 +351,7 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) break; case SPIDEV_MODE3: /* CPOL=1; CPHA=1 */ - regval |= (SPI_CR_CPOL|SPI_CR_CPHA); + regval |= (SPI_CR_CPOL | SPI_CR_CPHA); break; default: @@ -472,7 +472,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t nwords) { - FAR uint8_t *ptr = (FAR uint8_t*)buffer; + FAR uint8_t *ptr = (FAR uint8_t *)buffer; uint8_t data; spidbg("nwords: %d\n", nwords); @@ -518,7 +518,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nwords) { - FAR uint8_t *ptr = (FAR uint8_t*)buffer; + FAR uint8_t *ptr = (FAR uint8_t *)buffer; spidbg("nwords: %d\n", nwords); while (nwords) @@ -605,7 +605,7 @@ FAR struct spi_dev_s *up_spiinitialize(int port) /* Configure 8-bit SPI mode and master mode */ - putreg32(SPI_CR_BITS_8BITS|SPI_CR_BITENABLE|SPI_CR_MSTR, SPI_CR); + putreg32(SPI_CR_BITS_8BITS | SPI_CR_BITENABLE | SPI_CR_MSTR, SPI_CR); /* Set the initial SPI configuration */ diff --git a/arch/arm/src/lpc31xx/lpc31_allocateheap.c b/arch/arm/src/lpc31xx/lpc31_allocateheap.c index f46f3466d6..b6d77b190a 100644 --- a/arch/arm/src/lpc31xx/lpc31_allocateheap.c +++ b/arch/arm/src/lpc31xx/lpc31_allocateheap.c @@ -181,7 +181,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) { board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)g_idle_topstack; + *heap_start = (FAR void *)g_idle_topstack; *heap_size = LPC31_HEAP_VEND - g_idle_topstack; } @@ -198,15 +198,15 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) void up_addregion(void) { #if defined(CONFIG_LPC31_EXTSRAM0) && defined(CONFIG_LPC31_EXTSRAM0HEAP) - kmm_addregion((FAR void*)LPC31_EXTSRAM0_VSECTION, CONFIG_LPC31_EXTSRAM0SIZE); + kmm_addregion((FAR void *)LPC31_EXTSRAM0_VSECTION, CONFIG_LPC31_EXTSRAM0SIZE); #endif #if defined(CONFIG_LPC31_EXTSRAM1) && defined(CONFIG_LPC31_EXTSRAM1HEAP) - kmm_addregion((FAR void*)LPC31_EXTSRAM1_VSECTION, CONFIG_LPC31_EXTSRAM1SIZE); + kmm_addregion((FAR void *)LPC31_EXTSRAM1_VSECTION, CONFIG_LPC31_EXTSRAM1SIZE); #endif #if defined(CONFIG_LPC31_EXTDRAM) && defined(CONFIG_LPC31_EXTDRAMHEAP) - kmm_addregion((FAR void*)LPC31_EXTSDRAM_VSECTION, CONFIG_LPC31_EXTDRAMSIZE); + kmm_addregion((FAR void *)LPC31_EXTSDRAM_VSECTION, CONFIG_LPC31_EXTDRAMSIZE); #endif } #endif diff --git a/arch/arm/src/lpc31xx/lpc31_boot.c b/arch/arm/src/lpc31xx/lpc31_boot.c index cbf7a1e571..643c4131fd 100644 --- a/arch/arm/src/lpc31xx/lpc31_boot.c +++ b/arch/arm/src/lpc31xx/lpc31_boot.c @@ -141,7 +141,7 @@ static const struct section_mapping_s section_mapping[] = #ifndef CONFIG_ARCH_ROMPGTABLE static inline void up_setlevel1entry(uint32_t paddr, uint32_t vaddr, uint32_t mmuflags) { - uint32_t *pgtable = (uint32_t*)PGTABLE_BASE_VADDR; + uint32_t *pgtable = (uint32_t *)PGTABLE_BASE_VADDR; uint32_t index = vaddr >> 20; /* Save the page table entry */ @@ -157,7 +157,7 @@ static inline void up_setlevel1entry(uint32_t paddr, uint32_t vaddr, uint32_t mm static inline void up_setlevel2coarseentry(uint32_t ctabvaddr, uint32_t paddr, uint32_t vaddr, uint32_t mmuflags) { - uint32_t *ctable = (uint32_t*)ctabvaddr; + uint32_t *ctable = (uint32_t *)ctabvaddr; uint32_t index; /* The coarse table divides a 1Mb address space up into 256 entries, each @@ -210,7 +210,7 @@ static void up_vectorpermissions(uint32_t mmuflags) { /* The PTE for the beginning of ISRAM is at the base of the L2 page table */ - uint32_t *ptr = (uint32_t*)PG_L2_VECT_VADDR; + uint32_t *ptr = (uint32_t *)PG_L2_VECT_VADDR; uint32_t pte; /* The pte might be zero the first time this function is called. */ @@ -305,9 +305,9 @@ static void up_copyvectorblock(void) * LPC31_VECTOR_VADDR - Virtual address of vector table (0x00000000 or 0xffff0000) */ - src = (uint32_t*)&_vector_start; - end = (uint32_t*)&_vector_end; - dest = (uint32_t*)LPC31_VECTOR_VSRAM; + src = (uint32_t *)&_vector_start; + end = (uint32_t *)&_vector_end; + dest = (uint32_t *)LPC31_VECTOR_VSRAM; while (src < end) { diff --git a/arch/arm/src/lpc31xx/lpc31_clkfreq.c b/arch/arm/src/lpc31xx/lpc31_clkfreq.c index 1151f42df5..0273bca72b 100644 --- a/arch/arm/src/lpc31xx/lpc31_clkfreq.c +++ b/arch/arm/src/lpc31xx/lpc31_clkfreq.c @@ -167,7 +167,7 @@ uint32_t lpc31_clkfreq(enum lpc31_clockid_e clkid, return 0; } - /* Finally, calculate the frequency based on m and n values */ + /* Finally, calculate the frequency based on m and n values */ freq = (freq * n) / m ; } diff --git a/arch/arm/src/lpc31xx/lpc31_clkinit.c b/arch/arm/src/lpc31xx/lpc31_clkinit.c index f0cdd44103..39bab98db3 100644 --- a/arch/arm/src/lpc31xx/lpc31_clkinit.c +++ b/arch/arm/src/lpc31xx/lpc31_clkinit.c @@ -64,7 +64,7 @@ struct lpc31_domainconfig_s uint32_t nclks; /* Number of clocks in the domain */ uint32_t fdiv1; /* First frequency divider in the domain */ uint32_t nfdiv; /* Number of frequency dividers in the domain */ - const struct lpc31_subdomainconfig_s* sub; /* Sub=domain array */ + const struct lpc31_subdomainconfig_s *sub; /* Sub=domain array */ }; /************************************************************************************ @@ -87,7 +87,7 @@ struct lpc31_domainconfig_s * ************************************************************************************/ -static void lpc31_domaininit(struct lpc31_domainconfig_s* dmn) +static void lpc31_domaininit(struct lpc31_domainconfig_s *dmn) { const struct lpc31_subdomainconfig_s * sub = dmn->sub; uint32_t fdivcfg; @@ -158,7 +158,7 @@ static void lpc31_domaininit(struct lpc31_domainconfig_s* dmn) putreg32(CGU_BCR_FDRUN, regaddr); } - /* Select input base clock for domain */ + /* Select input base clock for domain */ lpc31_selectfreqin(dmn->dmnid, dmn->finsel); } @@ -175,7 +175,7 @@ static void lpc31_domaininit(struct lpc31_domainconfig_s* dmn) * ************************************************************************************/ -void lpc31_clkinit(const struct lpc31_clkinit_s* cfg) +void lpc31_clkinit(const struct lpc31_clkinit_s *cfg) { struct lpc31_domainconfig_s domain; diff --git a/arch/arm/src/lpc31xx/lpc31_decodeirq.c b/arch/arm/src/lpc31xx/lpc31_decodeirq.c index 8401fc75ac..a2794b575d 100644 --- a/arch/arm/src/lpc31xx/lpc31_decodeirq.c +++ b/arch/arm/src/lpc31xx/lpc31_decodeirq.c @@ -131,7 +131,7 @@ void up_decodeirq(uint32_t *regs) #ifdef CONFIG_ARCH_FPU /* Restore floating point registers */ - up_restorefpu((uint32_t*)current_regs); + up_restorefpu((uint32_t *)current_regs); #endif #ifdef CONFIG_ARCH_ADDRENV diff --git a/arch/arm/src/lpc31xx/lpc31_ehci.c b/arch/arm/src/lpc31xx/lpc31_ehci.c index 3daa79210c..0f4bbed663 100644 --- a/arch/arm/src/lpc31xx/lpc31_ehci.c +++ b/arch/arm/src/lpc31xx/lpc31_ehci.c @@ -3451,7 +3451,7 @@ static int lpc31_wait(FAR struct usbhost_connection_s *conn, */ flags = irqsave(); - for (;;) + for (; ; ) { /* Check for a change in the connection state on any root hub port */ diff --git a/arch/arm/src/lpc31xx/lpc31_i2c.c b/arch/arm/src/lpc31xx/lpc31_i2c.c index bb70f7b6aa..1f966c5008 100644 --- a/arch/arm/src/lpc31xx/lpc31_i2c.c +++ b/arch/arm/src/lpc31xx/lpc31_i2c.c @@ -290,7 +290,7 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int bufle DEBUGASSERT(dev != NULL); priv->msg.flags &= ~I2C_M_READ; - priv->msg.buffer = (uint8_t*)buffer; + priv->msg.buffer = (uint8_t *)buffer; priv->msg.length = buflen; ret = i2c_transfer(dev, &priv->msg, 1); diff --git a/arch/arm/src/lpc31xx/lpc31_irq.c b/arch/arm/src/lpc31xx/lpc31_irq.c index 05108d78bb..f0ad81bc4f 100644 --- a/arch/arm/src/lpc31xx/lpc31_irq.c +++ b/arch/arm/src/lpc31xx/lpc31_irq.c @@ -111,8 +111,9 @@ void up_irqinitialize(void) */ uint32_t address = LPC31_INTC_REQUEST(irq+1); - putreg32(INTC_REQUEST_WEACTLOW|INTC_REQUEST_WEENABLE|INTC_REQUEST_TARGET_IRQ| - INTC_REQUEST_PRIOLEVEL(1)|INTC_REQUEST_WEPRIO, address); + putreg32(INTC_REQUEST_WEACTLOW | INTC_REQUEST_WEENABLE | + INTC_REQUEST_TARGET_IRQ | INTC_REQUEST_PRIOLEVEL(1) | + INTC_REQUEST_WEPRIO, address); } @@ -170,7 +171,7 @@ void up_enable_irq(int irq) * preserved because WE_TARGET is zero. */ - putreg32(INTC_REQUEST_ENABLE|INTC_REQUEST_WEENABLE, address); + putreg32(INTC_REQUEST_ENABLE | INTC_REQUEST_WEENABLE, address); } /**************************************************************************** @@ -194,8 +195,8 @@ void up_ack_irq(int irq) * will be preserved because WE_TARGET is zero. */ - putreg32(INTC_REQUEST_CLRSWINT|INTC_REQUEST_ENABLE|INTC_REQUEST_WEENABLE, - address); + putreg32(INTC_REQUEST_CLRSWINT | INTC_REQUEST_ENABLE | + INTC_REQUEST_WEENABLE, address); } /**************************************************************************** diff --git a/arch/arm/src/lpc31xx/lpc31_lowputc.c b/arch/arm/src/lpc31xx/lpc31_lowputc.c index d5a33c307e..6ab86a5b8b 100644 --- a/arch/arm/src/lpc31xx/lpc31_lowputc.c +++ b/arch/arm/src/lpc31xx/lpc31_lowputc.c @@ -67,9 +67,9 @@ # ifdef CONFIG_UART_SERIAL_CONSOLE # define HAVE_CONSOLE 1 - /* Is initialization performed by up_earlyserialinit()? Or is UART - * initialization suppressed? - */ +/* Is initialization performed by up_earlyserialinit()? Or is UART + * initialization suppressed? + */ # if defined(USE_EARLYSERIALINIT) || defined(CONFIG_SUPPRESS_UART_CONFIG) # undef NEED_LOWSETUP @@ -187,7 +187,7 @@ static inline void up_configbaud(void) /* Calculate the divisor with these fractional divider settings */ uint32_t tmp = (tmulval * qtrclk) / ((tmulval + tdivaddval)); - tdiv = (tmp + (CONFIG_UART_BAUD>>1)) / CONFIG_UART_BAUD; + tdiv = (tmp + (CONFIG_UART_BAUD >> 1)) / CONFIG_UART_BAUD; /* Check if this candidate divisor is within a valid range */ @@ -221,45 +221,45 @@ static inline void up_configbaud(void) } } - /* Set the Divisor Latch Access Bit (DLAB) to enable DLL/DLM access */ + /* Set the Divisor Latch Access Bit (DLAB) to enable DLL/DLM access */ - regval = getreg32(LPC31_UART_LCR); - regval |= UART_LCR_DLAB; - putreg32(regval, LPC31_UART_LCR); + regval = getreg32(LPC31_UART_LCR); + regval |= UART_LCR_DLAB; + putreg32(regval, LPC31_UART_LCR); - /* Configure the MS and LS DLAB registers */ + /* Configure the MS and LS DLAB registers */ - putreg32(div & UART_DLL_MASK, LPC31_UART_DLL); - putreg32((div >> 8) & UART_DLL_MASK, LPC31_UART_DLM); + putreg32(div & UART_DLL_MASK, LPC31_UART_DLL); + putreg32((div >> 8) & UART_DLL_MASK, LPC31_UART_DLM); - regval &= ~UART_LCR_DLAB; - putreg32(regval, LPC31_UART_LCR); + regval &= ~UART_LCR_DLAB; + putreg32(regval, LPC31_UART_LCR); - /* Configure the Fractional Divider Register (FDR) */ + /* Configure the Fractional Divider Register (FDR) */ - putreg32((mulval << UART_FDR_MULVAL_SHIFT) | - (divaddval << UART_FDR_DIVADDVAL_SHIFT), - LPC31_UART_FDR); + putreg32((mulval << UART_FDR_MULVAL_SHIFT) | + (divaddval << UART_FDR_DIVADDVAL_SHIFT), + LPC31_UART_FDR); #else - /* Set the Divisor Latch Access Bit (DLAB) to enable DLL/DLM access */ + /* Set the Divisor Latch Access Bit (DLAB) to enable DLL/DLM access */ - regval = getreg32(LPC31_UART_LCR); - regval |= UART_LCR_DLAB; - putreg32(regval, LPC31_UART_LCR); + regval = getreg32(LPC31_UART_LCR); + regval |= UART_LCR_DLAB; + putreg32(regval, LPC31_UART_LCR); - /* Configure the MS and LS DLAB registers */ + /* Configure the MS and LS DLAB registers */ - putreg32(CONFIG_LPC31_UART_DIVISOR & UART_DLL_MASK, LPC31_UART_DLL); - putreg32((CONFIG_LPC31_UART_DIVISOR >> 8) & UART_DLL_MASK, LPC31_UART_DLM); + putreg32(CONFIG_LPC31_UART_DIVISOR & UART_DLL_MASK, LPC31_UART_DLL); + putreg32((CONFIG_LPC31_UART_DIVISOR >> 8) & UART_DLL_MASK, LPC31_UART_DLM); - regval &= ~UART_LCR_DLAB; - putreg32(regval, LPC31_UART_LCR); + regval &= ~UART_LCR_DLAB; + putreg32(regval, LPC31_UART_LCR); - /* Configure the Fractional Divider Register (FDR) */ + /* Configure the Fractional Divider Register (FDR) */ - putreg32((CONFIG_LPC31_UART_MULVAL << UART_FDR_MULVAL_SHIFT) | - (CONFIG_LPC31_UART_DIVADDVAL << UART_FDR_DIVADDVAL_SHIFT), - LPC31_UART_FDR); + putreg32((CONFIG_LPC31_UART_MULVAL << UART_FDR_MULVAL_SHIFT) | + (CONFIG_LPC31_UART_DIVADDVAL << UART_FDR_DIVADDVAL_SHIFT), + LPC31_UART_FDR); #endif } #endif @@ -287,11 +287,11 @@ void lpc31_lowsetup(void) /* Clear fifos */ - putreg32((UART_FCR_RXFIFORST|UART_FCR_TXFIFORST), LPC31_UART_FCR); + putreg32((UART_FCR_RXFIFORST | UART_FCR_TXFIFORST), LPC31_UART_FCR); /* Set trigger */ - putreg32((UART_FCR_FIFOENABLE|UART_FCR_RXTRIGLEVEL_16), LPC31_UART_FCR); + putreg32((UART_FCR_FIFOENABLE | UART_FCR_RXTRIGLEVEL_16), LPC31_UART_FCR); /* Set up the LCR */ @@ -314,7 +314,7 @@ void lpc31_lowsetup(void) #if CONFIG_UART_PARITY == 1 regval |= UART_LCR_PAREN; #elif CONFIG_UART_PARITY == 2 - regval |= (UART_LCR_PAREVEN|UART_LCR_PAREN); + regval |= (UART_LCR_PAREVEN | UART_LCR_PAREN); #endif putreg32(regval, LPC31_UART_LCR); @@ -324,8 +324,8 @@ void lpc31_lowsetup(void) /* Configure the FIFOs */ - putreg32((UART_FCR_RXTRIGLEVEL_16|UART_FCR_TXFIFORST| - UART_FCR_RXFIFORST|UART_FCR_FIFOENABLE), + putreg32((UART_FCR_RXTRIGLEVEL_16 | UART_FCR_TXFIFORST | + UART_FCR_RXFIFORST | UART_FCR_FIFOENABLE), LPC31_UART_FCR); /* The NuttX serial driver waits for the first THRE interrupt before diff --git a/arch/arm/src/lpc31xx/lpc31_pllconfig.c b/arch/arm/src/lpc31xx/lpc31_pllconfig.c index a39d21d138..1ab391a446 100644 --- a/arch/arm/src/lpc31xx/lpc31_pllconfig.c +++ b/arch/arm/src/lpc31xx/lpc31_pllconfig.c @@ -114,7 +114,7 @@ lpc31_switchdomains(const struct lpc31_pllconfig_s * const cfg) * * Description: * Restore the PLL reference clock to the domains that were temporarily - switched to FFAST by lpc31_switchdomains. + * switched to FFAST by lpc31_switchdomains. * ****************************************************************************/ diff --git a/arch/arm/src/lpc31xx/lpc31_serial.c b/arch/arm/src/lpc31xx/lpc31_serial.c index 21c69bca63..ea046e81fe 100644 --- a/arch/arm/src/lpc31xx/lpc31_serial.c +++ b/arch/arm/src/lpc31xx/lpc31_serial.c @@ -258,7 +258,7 @@ static inline void up_configbaud(void) /* Calculate the divisor with these fractional divider settings */ uint32_t tmp = (tmulval * qtrclk) / ((tmulval + tdivaddval)); - tdiv = (tmp + (CONFIG_UART_BAUD>>1)) / CONFIG_UART_BAUD; + tdiv = (tmp + (CONFIG_UART_BAUD >> 1)) / CONFIG_UART_BAUD; /* Check if this candidate divisor is within a valid range */ @@ -292,45 +292,45 @@ static inline void up_configbaud(void) } } - /* Set the Divisor Latch Access Bit (DLAB) to enable DLL/DLM access */ + /* Set the Divisor Latch Access Bit (DLAB) to enable DLL/DLM access */ - regval = getreg32(LPC31_UART_LCR); - regval |= UART_LCR_DLAB; - putreg32(regval, LPC31_UART_LCR); + regval = getreg32(LPC31_UART_LCR); + regval |= UART_LCR_DLAB; + putreg32(regval, LPC31_UART_LCR); - /* Configure the MS and LS DLAB registers */ + /* Configure the MS and LS DLAB registers */ - putreg32(div & UART_DLL_MASK, LPC31_UART_DLL); - putreg32((div >> 8) & UART_DLL_MASK, LPC31_UART_DLM); + putreg32(div & UART_DLL_MASK, LPC31_UART_DLL); + putreg32((div >> 8) & UART_DLL_MASK, LPC31_UART_DLM); - regval &= ~UART_LCR_DLAB; - putreg32(regval, LPC31_UART_LCR); + regval &= ~UART_LCR_DLAB; + putreg32(regval, LPC31_UART_LCR); - /* Configure the Fractional Divider Register (FDR) */ + /* Configure the Fractional Divider Register (FDR) */ - putreg32((mulval << UART_FDR_MULVAL_SHIFT) | - (divaddval << UART_FDR_DIVADDVAL_SHIFT), - LPC31_UART_FDR); + putreg32((mulval << UART_FDR_MULVAL_SHIFT) | + (divaddval << UART_FDR_DIVADDVAL_SHIFT), + LPC31_UART_FDR); #else - /* Set the Divisor Latch Access Bit (DLAB) to enable DLL/DLM access */ + /* Set the Divisor Latch Access Bit (DLAB) to enable DLL/DLM access */ - regval = getreg32(LPC31_UART_LCR); - regval |= UART_LCR_DLAB; - putreg32(regval, LPC31_UART_LCR); + regval = getreg32(LPC31_UART_LCR); + regval |= UART_LCR_DLAB; + putreg32(regval, LPC31_UART_LCR); - /* Configure the MS and LS DLAB registers */ + /* Configure the MS and LS DLAB registers */ - putreg32(CONFIG_LPC31_UART_DIVISOR & UART_DLL_MASK, LPC31_UART_DLL); - putreg32((CONFIG_LPC31_UART_DIVISOR >> 8) & UART_DLL_MASK, LPC31_UART_DLM); + putreg32(CONFIG_LPC31_UART_DIVISOR & UART_DLL_MASK, LPC31_UART_DLL); + putreg32((CONFIG_LPC31_UART_DIVISOR >> 8) & UART_DLL_MASK, LPC31_UART_DLM); - regval &= ~UART_LCR_DLAB; - putreg32(regval, LPC31_UART_LCR); + regval &= ~UART_LCR_DLAB; + putreg32(regval, LPC31_UART_LCR); - /* Configure the Fractional Divider Register (FDR) */ + /* Configure the Fractional Divider Register (FDR) */ - putreg32((CONFIG_LPC31_UART_MULVAL << UART_FDR_MULVAL_SHIFT) | - (CONFIG_LPC31_UART_DIVADDVAL << UART_FDR_DIVADDVAL_SHIFT), - LPC31_UART_FDR); + putreg32((CONFIG_LPC31_UART_MULVAL << UART_FDR_MULVAL_SHIFT) | + (CONFIG_LPC31_UART_DIVADDVAL << UART_FDR_DIVADDVAL_SHIFT), + LPC31_UART_FDR); #endif } @@ -346,16 +346,16 @@ static inline void up_configbaud(void) static int up_setup(struct uart_dev_s *dev) { #ifndef CONFIG_SUPPRESS_UART_CONFIG - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t regval; /* Clear fifos */ - putreg32((UART_FCR_RXFIFORST|UART_FCR_TXFIFORST), LPC31_UART_FCR); + putreg32((UART_FCR_RXFIFORST | UART_FCR_TXFIFORST), LPC31_UART_FCR); /* Set trigger */ - putreg32((UART_FCR_FIFOENABLE|UART_FCR_RXTRIGLEVEL_16), LPC31_UART_FCR); + putreg32((UART_FCR_FIFOENABLE | UART_FCR_RXTRIGLEVEL_16), LPC31_UART_FCR); /* Set up the IER */ @@ -382,7 +382,7 @@ static int up_setup(struct uart_dev_s *dev) #if CONFIG_UART_PARITY == 1 regval |= UART_LCR_PAREN; #elif CONFIG_UART_PARITY == 2 - regval |= (UART_LCR_PAREVEN|UART_LCR_PAREN); + regval |= (UART_LCR_PAREVEN | UART_LCR_PAREN); #endif putreg32(regval, LPC31_UART_LCR); @@ -392,8 +392,8 @@ static int up_setup(struct uart_dev_s *dev) /* Configure the FIFOs */ - putreg32((UART_FCR_RXTRIGLEVEL_16|UART_FCR_TXFIFORST| - UART_FCR_RXFIFORST|UART_FCR_FIFOENABLE), + putreg32((UART_FCR_RXTRIGLEVEL_16 | UART_FCR_TXFIFORST | + UART_FCR_RXFIFORST | UART_FCR_FIFOENABLE), LPC31_UART_FCR); /* The NuttX serial driver waits for the first THRE interrupt before @@ -418,7 +418,7 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disableuartint(priv, NULL); } @@ -447,11 +447,11 @@ static int up_attach(struct uart_dev_s *dev) ret = irq_attach(LPC31_IRQ_UART, up_interrupt); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the UART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the UART + */ - up_enable_irq(LPC31_IRQ_UART); + up_enable_irq(LPC31_IRQ_UART); } return ret; } @@ -589,7 +589,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct up_dev_s *user = (struct up_dev_s*)arg; + struct up_dev_s *user = (struct up_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -657,7 +657,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { #ifndef CONFIG_SUPPRESS_SERIAL_INTS @@ -707,7 +707,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { #ifndef CONFIG_SUPPRESS_SERIAL_INTS diff --git a/arch/arm/src/lpc31xx/lpc31_setfreqin.c b/arch/arm/src/lpc31xx/lpc31_setfreqin.c index bbac382409..e70e08acc6 100644 --- a/arch/arm/src/lpc31xx/lpc31_setfreqin.c +++ b/arch/arm/src/lpc31xx/lpc31_setfreqin.c @@ -88,7 +88,7 @@ void lpc31_selectfreqin(enum lpc31_domainid_e dmnid, uint32_t finsel) * for this domain. */ - scrbits = getreg32(scraddr) & ~(CGU_SCR_ENF1|CGU_SCR_ENF2); + scrbits = getreg32(scraddr) & ~(CGU_SCR_ENF1 | CGU_SCR_ENF2); /* If FS1 is currently enabled set the reference clock to FS2 and enable FS2 */ diff --git a/arch/arm/src/lpc31xx/lpc31_softreset.c b/arch/arm/src/lpc31xx/lpc31_softreset.c index 386cb3710d..b3d32e548b 100644 --- a/arch/arm/src/lpc31xx/lpc31_softreset.c +++ b/arch/arm/src/lpc31xx/lpc31_softreset.c @@ -82,7 +82,7 @@ void lpc31_softreset(enum lpc31_resetid_e resetid) /* Delay a bit */ - for (i = 0;i < 1000; i++); + for (i = 0; i < 1000; i++); /* Then set the soft reset bit */ diff --git a/arch/arm/src/lpc31xx/lpc31_spi.c b/arch/arm/src/lpc31xx/lpc31_spi.c index cf282088f7..6b64863d05 100644 --- a/arch/arm/src/lpc31xx/lpc31_spi.c +++ b/arch/arm/src/lpc31xx/lpc31_spi.c @@ -616,7 +616,7 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) { case SPIDEV_MODE0: /* SPO=0; SPH=0 */ setbits = 0; - clrbits = SPI_SLV_2_SPO|SPI_SLV_2_SPH; + clrbits = SPI_SLV_2_SPO | SPI_SLV_2_SPH; break; case SPIDEV_MODE1: /* SPO=0; SPH=1 */ @@ -630,7 +630,7 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) break; case SPIDEV_MODE3: /* SPO=1; SPH=1 */ - setbits = SPI_SLV_2_SPO|SPI_SLV_2_SPH; + setbits = SPI_SLV_2_SPO | SPI_SLV_2_SPH; clrbits = 0; break; @@ -754,8 +754,8 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, { /* 16-bit mode */ - const uint16_t *src = (const uint16_t*)txbuffer;; - uint16_t *dest = (uint16_t*)rxbuffer; + const uint16_t *src = (const uint16_t *)txbuffer; + uint16_t *dest = (uint16_t *)rxbuffer; uint16_t word; while (nwords > 0) @@ -794,8 +794,8 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, { /* 8-bit mode */ - const uint8_t *src = (const uint8_t*)txbuffer;; - uint8_t *dest = (uint8_t*)rxbuffer; + const uint8_t *src = (const uint8_t *)txbuffer; + uint8_t *dest = (uint8_t *)rxbuffer; uint8_t word; while (nwords > 0) diff --git a/arch/arm/src/lpc31xx/lpc31_timerisr.c b/arch/arm/src/lpc31xx/lpc31_timerisr.c index a6ec418605..1b7c489667 100644 --- a/arch/arm/src/lpc31xx/lpc31_timerisr.c +++ b/arch/arm/src/lpc31xx/lpc31_timerisr.c @@ -133,7 +133,7 @@ void up_timer_initialize(void) freq >>= 4; } - load =((freq * (uint64_t)10000) / 1000000); + load = ((freq * (uint64_t)10000) / 1000000); putreg32((uint32_t)load, LPC31_TIMER0_LOAD); /* Set periodic mode */ diff --git a/arch/arm/src/lpc31xx/lpc31_usbdev.c b/arch/arm/src/lpc31xx/lpc31_usbdev.c index 6c2c110d01..bfde5058ab 100644 --- a/arch/arm/src/lpc31xx/lpc31_usbdev.c +++ b/arch/arm/src/lpc31xx/lpc31_usbdev.c @@ -512,20 +512,20 @@ static uint32_t lpc31_getreg(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ @@ -817,18 +817,24 @@ static int lpc31_progressep(struct lpc31_ep_s *privep) if (privreq->req.len == 0) { - /* If the class driver is responding to a setup packet, then wait for the - * host to illicit thr response */ + /* If the class driver is responding to a setup packet, then wait for the + * host to illicit thr response */ - if (privep->epphy == LPC31_EP0_IN && privep->dev->ep0state == EP0STATE_SETUP_OUT) - lpc31_ep0state (privep->dev, EP0STATE_WAIT_NAK_IN); - else - { - if (LPC31_EPPHYIN(privep->epphy)) - usbtrace(TRACE_DEVERROR(LPC31_TRACEERR_EPINNULLPACKET), 0); - else - usbtrace(TRACE_DEVERROR(LPC31_TRACEERR_EPOUTNULLPACKET), 0); - } + if (privep->epphy == LPC31_EP0_IN && privep->dev->ep0state == EP0STATE_SETUP_OUT) + { + lpc31_ep0state (privep->dev, EP0STATE_WAIT_NAK_IN); + } + else + { + if (LPC31_EPPHYIN(privep->epphy)) + { + usbtrace(TRACE_DEVERROR(LPC31_TRACEERR_EPINNULLPACKET), 0); + } + else + { + usbtrace(TRACE_DEVERROR(LPC31_TRACEERR_EPOUTNULLPACKET), 0); + } + } lpc31_reqcomplete(privep, lpc31_rqdequeue(privep), OK); return OK; @@ -1027,12 +1033,12 @@ static void lpc31_ep0configure(struct lpc31_usbdev_s *priv) DQH_CAPABILITY_IOS | DQH_CAPABILITY_ZLT); - g_qh[LPC31_EP0_IN ].capability = (DQH_CAPABILITY_MAX_PACKET(CONFIG_LPC31_USBDEV_EP0_MAXSIZE) | + g_qh[LPC31_EP0_IN].capability = (DQH_CAPABILITY_MAX_PACKET(CONFIG_LPC31_USBDEV_EP0_MAXSIZE) | DQH_CAPABILITY_IOS | DQH_CAPABILITY_ZLT); g_qh[LPC31_EP0_OUT].currdesc = DTD_NEXTDESC_INVALID; - g_qh[LPC31_EP0_IN ].currdesc = DTD_NEXTDESC_INVALID; + g_qh[LPC31_EP0_IN].currdesc = DTD_NEXTDESC_INVALID; /* Enable EP0 */ lpc31_setbits (USBDEV_ENDPTCTRL0_RXE | USBDEV_ENDPTCTRL0_TXE, LPC31_USBDEV_ENDPTCTRL0); @@ -1185,91 +1191,94 @@ static inline void lpc31_ep0setup(struct lpc31_usbdev_s *priv) lpc31_dispatchrequest(priv, &ctrl); else { - /* Handle standard request. Pick off the things of interest to the USB - * device controller driver; pass what is left to the class driver */ - switch (ctrl.req) - { - case USB_REQ_GETSTATUS: + /* Handle standard request. Pick off the things of interest to the USB + * device controller driver; pass what is left to the class driver + */ + + switch (ctrl.req) { - /* type: device-to-host; recipient = device, interface, endpoint - * value: 0 - * index: zero interface endpoint - * len: 2; data = status - */ + case USB_REQ_GETSTATUS: + { + /* type: device-to-host; recipient = device, interface, endpoint + * value: 0 + * index: zero interface endpoint + * len: 2; data = status + */ - usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_GETSTATUS), 0); - if (!priv->paddrset || len != 2 || - (ctrl.type & USB_REQ_DIR_IN) == 0 || value != 0) - { - priv->stalled = true; - } - else - { - switch (ctrl.type & USB_REQ_RECIPIENT_MASK) - { - case USB_REQ_RECIPIENT_ENDPOINT: + usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_GETSTATUS), 0); + if (!priv->paddrset || len != 2 || + (ctrl.type & USB_REQ_DIR_IN) == 0 || value != 0) + { + priv->stalled = true; + } + else + { + switch (ctrl.type & USB_REQ_RECIPIENT_MASK) { - usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_EPGETSTATUS), 0); - privep = lpc31_epfindbyaddr(priv, index); - if (!privep) - { - usbtrace(TRACE_DEVERROR(LPC31_TRACEERR_BADEPGETSTATUS), 0); - priv->stalled = true; - } - else - { - if (privep->stalled) - priv->ep0buf[0] = 1; /* Stalled */ - else - priv->ep0buf[0] = 0; /* Not stalled */ - priv->ep0buf[1] = 0; + case USB_REQ_RECIPIENT_ENDPOINT: + { + usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_EPGETSTATUS), 0); + privep = lpc31_epfindbyaddr(priv, index); + if (!privep) + { + usbtrace(TRACE_DEVERROR(LPC31_TRACEERR_BADEPGETSTATUS), 0); + priv->stalled = true; + } + else + { + if (privep->stalled) + priv->ep0buf[0] = 1; /* Stalled */ + else + priv->ep0buf[0] = 0; /* Not stalled */ - lpc31_ep0xfer (LPC31_EP0_IN, priv->ep0buf, 2); - lpc31_ep0state (priv, EP0STATE_SHORTWRITE); - } + priv->ep0buf[1] = 0; + + lpc31_ep0xfer (LPC31_EP0_IN, priv->ep0buf, 2); + lpc31_ep0state (priv, EP0STATE_SHORTWRITE); + } } - break; + break; - case USB_REQ_RECIPIENT_DEVICE: - { - if (index == 0) - { - usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_DEVGETSTATUS), 0); + case USB_REQ_RECIPIENT_DEVICE: + { + if (index == 0) + { + usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_DEVGETSTATUS), 0); - /* Features: Remote Wakeup=YES; selfpowered=? */ + /* Features: Remote Wakeup=YES; selfpowered=? */ - priv->ep0buf[0] = (priv->selfpowered << USB_FEATURE_SELFPOWERED) | - (1 << USB_FEATURE_REMOTEWAKEUP); - priv->ep0buf[1] = 0; + priv->ep0buf[0] = (priv->selfpowered << USB_FEATURE_SELFPOWERED) | + (1 << USB_FEATURE_REMOTEWAKEUP); + priv->ep0buf[1] = 0; - lpc31_ep0xfer(LPC31_EP0_IN, priv->ep0buf, 2); - lpc31_ep0state (priv, EP0STATE_SHORTWRITE); - } - else - { - usbtrace(TRACE_DEVERROR(LPC31_TRACEERR_BADDEVGETSTATUS), 0); - priv->stalled = true; - } - } - break; + lpc31_ep0xfer(LPC31_EP0_IN, priv->ep0buf, 2); + lpc31_ep0state (priv, EP0STATE_SHORTWRITE); + } + else + { + usbtrace(TRACE_DEVERROR(LPC31_TRACEERR_BADDEVGETSTATUS), 0); + priv->stalled = true; + } + } + break; - case USB_REQ_RECIPIENT_INTERFACE: - { - usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_IFGETSTATUS), 0); - priv->ep0buf[0] = 0; - priv->ep0buf[1] = 0; + case USB_REQ_RECIPIENT_INTERFACE: + { + usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_IFGETSTATUS), 0); + priv->ep0buf[0] = 0; + priv->ep0buf[1] = 0; - lpc31_ep0xfer(LPC31_EP0_IN, priv->ep0buf, 2); - lpc31_ep0state (priv, EP0STATE_SHORTWRITE); - } - break; + lpc31_ep0xfer(LPC31_EP0_IN, priv->ep0buf, 2); + lpc31_ep0state (priv, EP0STATE_SHORTWRITE); + } + break; - default: - { - usbtrace(TRACE_DEVERROR(LPC31_TRACEERR_BADGETSTATUS), 0); - priv->stalled = true; - } - break; + default: + { + usbtrace(TRACE_DEVERROR(LPC31_TRACEERR_BADGETSTATUS), 0); + priv->stalled = true; + } + break; } } } @@ -1601,13 +1610,18 @@ bool lpc31_epcomplete(struct lpc31_usbdev_s *priv, uint8_t epphy) struct lpc31_dtd_s *dtd = &g_td[epphy]; if (privreq == NULL) /* This shouldn't really happen */ - { - if (LPC31_EPPHYOUT(privep->epphy)) - usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_EPINQEMPTY), 0); - else - usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_EPOUTQEMPTY), 0); - return true; - } + { + if (LPC31_EPPHYOUT(privep->epphy)) + { + usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_EPINQEMPTY), 0); + } + else + { + usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_EPOUTQEMPTY), 0); + } + + return true; + } int xfrd = dtd->xfer_len - (dtd->config >> 16); @@ -1677,7 +1691,7 @@ static int lpc31_usbinterrupt(int irq, FAR void *context) if (disr & USBDEV_USBSTS_URI) { - usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_DEVRESET),0); + usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_DEVRESET), 0); lpc31_usbreset(priv); @@ -1691,7 +1705,7 @@ static int lpc31_usbinterrupt(int irq, FAR void *context) if (!priv->suspended && (disr & USBDEV_USBSTS_SLI) != 0) { - usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_SUSPENDED),0); + usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_SUSPENDED), 0); /* Inform the Class driver of the suspend event */ @@ -1710,7 +1724,7 @@ static int lpc31_usbinterrupt(int irq, FAR void *context) else if (priv->suspended && (disr & USBDEV_USBSTS_SLI) == 0) { - usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_RESUMED),0); + usbtrace(TRACE_INTDECODE(LPC31_TRACEINTID_RESUMED), 0); /* Inform the Class driver of the resume event */ @@ -1777,10 +1791,15 @@ static int lpc31_usbinterrupt(int irq, FAR void *context) for (n = 1; n < LPC31_NLOGENDPOINTS; n++) { - if (mask & LPC31_ENDPTMASK((n<<1))) - lpc31_epcomplete (priv, (n<<1)); - if (mask & LPC31_ENDPTMASK((n<<1)+1)) - lpc31_epcomplete(priv, (n<<1)+1); + if (mask & LPC31_ENDPTMASK((n << 1))) + { + lpc31_epcomplete (priv, (n << 1)); + } + + if (mask & LPC31_ENDPTMASK((n << 1) + 1)) + { + lpc31_epcomplete(priv, (n << 1) + 1); + } } } diff --git a/arch/arm/src/lpc43xx/lpc43_adc.c b/arch/arm/src/lpc43xx/lpc43_adc.c index 71f1181e64..43f3006c7f 100644 --- a/arch/arm/src/lpc43xx/lpc43_adc.c +++ b/arch/arm/src/lpc43xx/lpc43_adc.c @@ -113,24 +113,24 @@ static int adc_interrupt(int irq, void *context); static const struct adc_ops_s g_adcops = { - .ao_reset =adc_reset, - .ao_setup = adc_setup, + .ao_reset = adc_reset, + .ao_setup = adc_setup, .ao_shutdown = adc_shutdown, - .ao_rxint = adc_rxint, - .ao_ioctl = adc_ioctl, + .ao_rxint = adc_rxint, + .ao_ioctl = adc_ioctl, }; static struct up_dev_s g_adcpriv = { - .sps = CONFIG_ADC0_SPS, - .mask = CONFIG_ADC0_MASK, - .irq = LPC43_IRQ_ADC, + .sps = CONFIG_ADC0_SPS, + .mask = CONFIG_ADC0_MASK, + .irq = LPC43_IRQ_ADC, }; static struct adc_dev_s g_adcdev = { - .ad_ops = &g_adcops, - .ad_priv= &g_adcpriv, + .ad_ops = &g_adcops, + .ad_priv = &g_adcpriv, }; /**************************************************************************** @@ -153,34 +153,50 @@ static void adc_reset(FAR struct adc_dev_s *dev) regval |= SYSCON_PCONP_PCADC; putreg32(regval, LPC43_SYSCON_PCONP); - putreg32(ADC_CR_PDN,LPC43_ADC_CR); + putreg32(ADC_CR_PDN, LPC43_ADC_CR); regval = getreg32(LPC43_SYSCON_PCLKSEL0); regval &= ~SYSCON_PCLKSEL0_ADC_MASK; regval |= (SYSCON_PCLKSEL_CCLK8 << SYSCON_PCLKSEL0_ADC_SHIFT); putreg32(regval, LPC43_SYSCON_PCLKSEL0); - uint32_t clkdiv=LPC43_CCLK/8/65/priv->sps; - clkdiv<<=8; - clkdiv&=0xff00; - putreg32(ADC_CR_PDN|ADC_CR_BURST|clkdiv|priv->mask,LPC43_ADC_CR); + uint32_t clkdiv = LPC43_CCLK / 8 / 65 / priv->sps; + clkdiv <<= 8; + clkdiv &= 0xff00; + putreg32(ADC_CR_PDN | ADC_CR_BURST | clkdiv | priv->mask, LPC43_ADC_CR); if (priv->mask&0x01) - lpc43_configgpio(GPIO_AD0p0); + { + lpc43_configgpio(GPIO_AD0p0); + } else if (priv->mask&0x02) - lpc43_configgpio(GPIO_AD0p1); + { + lpc43_configgpio(GPIO_AD0p1); + } else if (priv->mask&0x04) - lpc43_configgpio(GPIO_AD0p2); + { + lpc43_configgpio(GPIO_AD0p2); + } else if (priv->mask&0x08) - lpc43_configgpio(GPIO_AD0p3); + { + lpc43_configgpio(GPIO_AD0p3); + } else if (priv->mask&0x10) - lpc43_configgpio(GPIO_AD0p4); + { + lpc43_configgpio(GPIO_AD0p4); + } else if (priv->mask&0x20) - lpc43_configgpio(GPIO_AD0p5); + { + lpc43_configgpio(GPIO_AD0p5); + } else if (priv->mask&0x40) - lpc43_configgpio(GPIO_AD0p6); + { + lpc43_configgpio(GPIO_AD0p6); + } else if (priv->mask&0x80) - lpc43_configgpio(GPIO_AD0p7); + { + lpc43_configgpio(GPIO_AD0p7); + } irqrestore(flags); } @@ -196,15 +212,18 @@ static int adc_setup(FAR struct adc_dev_s *dev) int i; FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->ad_priv; int ret = irq_attach(priv->irq, adc_interrupt); + if (ret == OK) { for (i = 0; i < 8; i++) { - priv->buf[i]=0; - priv->count[i]=0; + priv->buf[i] = 0; + priv->count[i] = 0; } + up_enable_irq(priv->irq); } + return ret; } @@ -253,7 +272,7 @@ static int adc_interrupt(int irq, void *context) { value = priv->buf[ch] / priv->count[ch]; value <<= 15; - adc_receive(&g_adcdev,ch,value); + adc_receive(&g_adcdev, ch, value); priv->buf[ch] = 0; priv->count[ch] = 0; } diff --git a/arch/arm/src/lpc43xx/lpc43_allocateheap.c b/arch/arm/src/lpc43xx/lpc43_allocateheap.c index 6201ff659a..b914b4d8bb 100644 --- a/arch/arm/src/lpc43xx/lpc43_allocateheap.c +++ b/arch/arm/src/lpc43xx/lpc43_allocateheap.c @@ -249,7 +249,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) /* Start with the first SRAM region */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)g_idle_topstack; + *heap_start = (FAR void *)g_idle_topstack; *heap_size = CONFIG_RAM_END - g_idle_topstack; } @@ -268,7 +268,7 @@ void up_addregion(void) #if CONFIG_MM_REGIONS > 1 /* Add the next SRAM region (which should exist) */ - kmm_addregion((FAR void*)MM_REGION2_BASE, MM_REGION2_SIZE); + kmm_addregion((FAR void *)MM_REGION2_BASE, MM_REGION2_SIZE); #ifdef MM_REGION3_BASE /* Add the third SRAM region (which will not exist in configuration B) */ @@ -276,12 +276,12 @@ void up_addregion(void) #if CONFIG_MM_REGIONS > 2 /* Add the third SRAM region (which may not exist) */ - kmm_addregion((FAR void*)MM_REGION3_BASE, MM_REGION3_SIZE); + kmm_addregion((FAR void *)MM_REGION3_BASE, MM_REGION3_SIZE); #if CONFIG_MM_REGIONS > 3 && defined(MM_DMAHEAP_BASE) /* Add the DMA region (which may not be available) */ - kmm_addregion((FAR void*)MM_DMAHEAP_BASE, MM_DMAHEAP_SIZE); + kmm_addregion((FAR void *)MM_DMAHEAP_BASE, MM_DMAHEAP_SIZE); #endif /* CONFIG_MM_REGIONS > 3 && defined(MM_DMAHEAP_BASE) */ #endif /* CONFIG_MM_REGIONS > 2 */ @@ -290,7 +290,7 @@ void up_addregion(void) #if CONFIG_MM_REGIONS > 2 && defined(MM_DMAHEAP_BASE) /* Add the DMA region (which may not be available) */ - kmm_addregion((FAR void*)MM_DMAHEAP_BASE, MM_DMAHEAP_SIZE); + kmm_addregion((FAR void *)MM_DMAHEAP_BASE, MM_DMAHEAP_SIZE); #endif /* CONFIG_MM_REGIONS > 3 && defined(MM_DMAHEAP_BASE) */ #endif /* MM_REGION3_BASE */ diff --git a/arch/arm/src/lpc43xx/lpc43_dac.c b/arch/arm/src/lpc43xx/lpc43_dac.c index ba102c185f..196d451219 100644 --- a/arch/arm/src/lpc43xx/lpc43_dac.c +++ b/arch/arm/src/lpc43xx/lpc43_dac.c @@ -96,17 +96,17 @@ static int dac_interrupt(int irq, void *context); static const struct dac_ops_s g_dacops = { - .ao_reset =dac_reset, - .ao_setup = dac_setup, + .ao_reset = dac_reset, + .ao_setup = dac_setup, .ao_shutdown = dac_shutdown, - .ao_txint = dac_txint, - .ao_send = dac_send, - .ao_ioctl = dac_ioctl, + .ao_txint = dac_txint, + .ao_send = dac_send, + .ao_ioctl = dac_ioctl, }; static struct dac_dev_s g_dacdev = { - .ad_ops = &g_dacops, + .ad_ops = &g_dacops, }; /**************************************************************************** @@ -129,7 +129,7 @@ static void dac_reset(FAR struct dac_dev_s *dev) regval |= (SYSCON_PCLKSEL_CCLK8 << SYSCON_PCLKSEL0_DAC_SHIFT); putreg32(regval, LPC43_SYSCON_PCLKSEL0); - //putreg32(DAC_CTRL_DBLBUFEN,LPC43_DAC_CTRL); ? + //putreg32(DAC_CTRL_DBLBUFEN, LPC43_DAC_CTRL); ? lpc43_configgpio(GPIO_AOUT); @@ -163,7 +163,7 @@ static void dac_txint(FAR struct dac_dev_s *dev, bool enable) static int dac_send(FAR struct dac_dev_s *dev, FAR struct dac_msg_s *msg) { - putreg32((msg->am_data>>16)&0xfffff,LPC43_DAC_CR); + putreg32((msg->am_data >> 16) & 0xfffff, LPC43_DAC_CR); dac_txdone(&g_dacdev); return 0; } @@ -201,4 +201,3 @@ FAR struct dac_dev_s *lpc43_dacinitialize(void) } #endif /* CONFIG_LPC43_DAC */ - diff --git a/arch/arm/src/lpc43xx/lpc43_ehci.c b/arch/arm/src/lpc43xx/lpc43_ehci.c index 868a26a498..f9ef7799da 100644 --- a/arch/arm/src/lpc43xx/lpc43_ehci.c +++ b/arch/arm/src/lpc43xx/lpc43_ehci.c @@ -3281,7 +3281,7 @@ static int lpc43_wait(FAR struct usbhost_connection_s *conn, */ flags = irqsave(); - for (;;) + for (; ; ) { /* Check for a change in the connection state on any root hub port */ diff --git a/arch/arm/src/lpc43xx/lpc43_ethernet.c b/arch/arm/src/lpc43xx/lpc43_ethernet.c index 18310a2701..aec78c7b5a 100644 --- a/arch/arm/src/lpc43xx/lpc43_ethernet.c +++ b/arch/arm/src/lpc43xx/lpc43_ethernet.c @@ -475,7 +475,7 @@ */ #define ETH_DMAINT_NORMAL \ - (ETH_DMAINT_TI | ETH_DMAINT_TU |ETH_DMAINT_RI | ETH_DMAINT_ERI) + (ETH_DMAINT_TI | ETH_DMAINT_TU | ETH_DMAINT_RI | ETH_DMAINT_ERI) #define ETH_DMAINT_ABNORMAL \ (ETH_DMAINT_TPS | ETH_DMAINT_TJT | ETH_DMAINT_OVF | ETH_DMAINT_UNF | \ @@ -713,20 +713,20 @@ static uint32_t lpc43_getreg(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ @@ -1467,7 +1467,7 @@ static int lpc43_recvframe(FAR struct lpc43_ethmac_s *priv) /* Check if this is an intermediate segment in the frame */ - else if (((rxdesc->rdes0 & ETH_RDES0_LS) == 0)&& + else if (((rxdesc->rdes0 & ETH_RDES0_LS) == 0) && ((rxdesc->rdes0 & ETH_RDES0_FS) == 0)) { priv->segments++; @@ -1519,14 +1519,14 @@ static int lpc43_recvframe(FAR struct lpc43_ethmac_s *priv) */ DEBUGASSERT(dev->d_buf == NULL); - dev->d_buf = (uint8_t*)rxcurr->rdes2; + dev->d_buf = (uint8_t *)rxcurr->rdes2; rxcurr->rdes2 = (uint32_t)buffer; /* Return success, remembering where we should re-start scanning * and resetting the segment scanning logic */ - priv->rxhead = (struct eth_rxdesc_s*)rxdesc->rdes3; + priv->rxhead = (struct eth_rxdesc_s *)rxdesc->rdes3; lpc43_freesegment(priv, rxcurr, priv->segments); nllvdbg("rxhead: %p d_buf: %p d_len: %d\n", @@ -1547,7 +1547,7 @@ static int lpc43_recvframe(FAR struct lpc43_ethmac_s *priv) /* Try the next descriptor */ - rxdesc = (struct eth_rxdesc_s*)rxdesc->rdes3; + rxdesc = (struct eth_rxdesc_s *)rxdesc->rdes3; } /* We get here after all of the descriptors have been scanned or when rxdesc points @@ -1676,7 +1676,7 @@ static void lpc43_receive(FAR struct lpc43_ethmac_s *priv) */ if (priv->dev.d_len > 0) - { + { /* Update the Ethernet header with the correct MAC address */ #ifdef CONFIG_NET_IPv4 @@ -1788,7 +1788,7 @@ static void lpc43_freeframe(FAR struct lpc43_ethmac_s *priv) { /* Yes.. Free the buffer */ - lpc43_freebuffer(priv, (uint8_t*)txdesc->tdes2); + lpc43_freebuffer(priv, (uint8_t *)txdesc->tdes2); } /* In any event, make sure that TDES2 is nullified. */ @@ -1821,7 +1821,7 @@ static void lpc43_freeframe(FAR struct lpc43_ethmac_s *priv) /* Try the next descriptor in the TX chain */ - txdesc = (struct eth_txdesc_s*)txdesc->tdes3; + txdesc = (struct eth_txdesc_s *)txdesc->tdes3; } /* We get here if (1) there are still frames "in-flight". Remember @@ -3954,7 +3954,7 @@ static inline int lpc43_ethinitialize(void) #ifdef CONFIG_NETDEV_PHY_IOCTL priv->dev.d_ioctl = lpc43_ioctl; /* Support PHY ioctl() calls */ #endif - priv->dev.d_private = (void*)&g_lpc43ethmac; /* Used to recover private state from dev */ + priv->dev.d_private = (void *)&g_lpc43ethmac; /* Used to recover private state from dev */ /* Create a watchdog for timing polling for and timing of transmisstions */ diff --git a/arch/arm/src/lpc43xx/lpc43_i2c.c b/arch/arm/src/lpc43xx/lpc43_i2c.c index 040f1744cb..8a188df978 100644 --- a/arch/arm/src/lpc43xx/lpc43_i2c.c +++ b/arch/arm/src/lpc43xx/lpc43_i2c.c @@ -232,7 +232,7 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, priv->wrcnt = 0; priv->rdcnt = 0; priv->msg.addr &= ~0x01; - priv->msg.buffer = (uint8_t*)buffer; + priv->msg.buffer = (uint8_t *)buffer; priv->msg.length = buflen; priv->nmsg = 1; @@ -293,8 +293,8 @@ static int i2c_start(struct lpc43_i2cdev_s *priv) sem_wait(&priv->mutex); - putreg32(I2C_CONCLR_STAC|I2C_CONCLR_SIC,priv->base+LPC43_I2C_CONCLR_OFFSET); - putreg32(I2C_CONSET_STA,priv->base+LPC43_I2C_CONSET_OFFSET); + putreg32(I2C_CONCLR_STAC | I2C_CONCLR_SIC, priv->base + LPC43_I2C_CONCLR_OFFSET); + putreg32(I2C_CONSET_STA, priv->base + LPC43_I2C_CONSET_OFFSET); wd_start(priv->timeout, I2C_TIMEOUT, i2c_timeout, 1, (uint32_t)priv); sem_wait(&priv->wait); @@ -320,7 +320,7 @@ static void i2c_stop(struct lpc43_i2cdev_s *priv) { if (priv->state != 0x38) { - putreg32(I2C_CONSET_STO|I2C_CONSET_AA,priv->base+LPC43_I2C_CONSET_OFFSET); + putreg32(I2C_CONSET_STO | I2C_CONSET_AA, priv->base + LPC43_I2C_CONSET_OFFSET); } sem_post(&priv->wait); @@ -359,10 +359,10 @@ static int i2c_transfer(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *msgs, i DEBUGASSERT(dev != NULL); - priv->wrcnt=0; - priv->rdcnt=0; - priv->msgs = msgs; - priv->nmsg = count; + priv->wrcnt = 0; + priv->rdcnt = 0; + priv->msgs = msgs; + priv->nmsg = count; ret = count - i2c_start(priv); @@ -376,7 +376,7 @@ void startStopNextMessage(struct lpc43_i2cdev_s *priv) if (priv->nmsg > 0) { priv->msgs++; - putreg32(I2C_CONSET_STA,priv->base+LPC43_I2C_CONSET_OFFSET); + putreg32(I2C_CONSET_STA, priv->base + LPC43_I2C_CONSET_OFFSET); } else { @@ -418,7 +418,7 @@ static int i2c_interrupt(int irq, FAR void *context) /* Reference UM10360 19.10.5 */ - state = getreg32(priv->base+LPC43_I2C_STAT_OFFSET); + state = getreg32(priv->base + LPC43_I2C_STAT_OFFSET); msg = priv->msgs; priv->state = state; @@ -435,7 +435,7 @@ static int i2c_interrupt(int irq, FAR void *context) /* Write cases */ case 0x18: /* SLA+W has been transmitted; ACK has been received */ - priv->wrcnt=0; + priv->wrcnt = 0; putreg32(msg->buffer[0], priv->base + LPC43_I2C_DAT_OFFSET); /* put first byte */ break; @@ -444,7 +444,7 @@ static int i2c_interrupt(int irq, FAR void *context) if (priv->wrcnt < msg->length) { - putreg32(msg->buffer[priv->wrcnt],priv->base+LPC43_I2C_DAT_OFFSET); /* Put next byte */ + putreg32(msg->buffer[priv->wrcnt], priv->base + LPC43_I2C_DAT_OFFSET); /* Put next byte */ } else { @@ -462,22 +462,22 @@ static int i2c_interrupt(int irq, FAR void *context) } else { - putreg32(I2C_CONCLR_AAC,priv->base + LPC43_I2C_CONCLR_OFFSET); /* Do not ACK because only one byte */ + putreg32(I2C_CONCLR_AAC, priv->base + LPC43_I2C_CONCLR_OFFSET); /* Do not ACK because only one byte */ } break; case 0x50: /* Data byte has been received; ACK has been returned. */ priv->rdcnt++; - msg->buffer[priv->rdcnt-1 ] = getreg32(priv->base+LPC43_I2C_BUFR_OFFSET); + msg->buffer[priv->rdcnt - 1] = getreg32(priv->base + LPC43_I2C_BUFR_OFFSET); - if (priv->rdcnt >= (msg->length - 1)) { - putreg32(I2C_CONCLR_AAC,priv->base+LPC43_I2C_CONCLR_OFFSET); /* Do not ACK any more */ - - } + if (priv->rdcnt >= (msg->length - 1)) + { + putreg32(I2C_CONCLR_AAC, priv->base + LPC43_I2C_CONCLR_OFFSET); /* Do not ACK any more */ + } break; case 0x58: /* Data byte has been received; NACK has been returned. */ - msg->buffer[priv->rdcnt ] = getreg32(priv->base+LPC43_I2C_BUFR_OFFSET); + msg->buffer[priv->rdcnt] = getreg32(priv->base + LPC43_I2C_BUFR_OFFSET); startStopNextMessage(priv); break; @@ -582,7 +582,7 @@ struct i2c_dev_s *up_i2cinitialize(int port) irqrestore(flags); - putreg32(I2C_CONSET_I2EN,priv->base+LPC43_I2C_CONSET_OFFSET); + putreg32(I2C_CONSET_I2EN, priv->base + LPC43_I2C_CONSET_OFFSET); sem_init(&priv->mutex, 0, 1); sem_init(&priv->wait, 0, 0); @@ -618,7 +618,7 @@ int up_i2cuninitialize(FAR struct i2c_dev_s * dev) { struct lpc43_i2cdev_s *priv = (struct lpc43_i2cdev_s *) dev; - putreg32(I2C_CONCLRT_I2ENC,priv->base+LPC43_I2C_CONCLR_OFFSET); + putreg32(I2C_CONCLRT_I2ENC, priv->base + LPC43_I2C_CONCLR_OFFSET); up_disable_irq(priv->irqid); irq_detach(priv->irqid); return OK; diff --git a/arch/arm/src/lpc43xx/lpc43_irq.c b/arch/arm/src/lpc43xx/lpc43_irq.c index a5961a7d56..bb78263abd 100644 --- a/arch/arm/src/lpc43xx/lpc43_irq.c +++ b/arch/arm/src/lpc43xx/lpc43_irq.c @@ -61,9 +61,9 @@ /* Get a 32-bit version of the default priority */ #define DEFPRIORITY32 \ - (LPC43M4_SYSH_PRIORITY_DEFAULT << 24 |\ - LPC43M4_SYSH_PRIORITY_DEFAULT << 16 |\ - LPC43M4_SYSH_PRIORITY_DEFAULT << 8 |\ + (LPC43M4_SYSH_PRIORITY_DEFAULT << 24 | \ + LPC43M4_SYSH_PRIORITY_DEFAULT << 16 | \ + LPC43M4_SYSH_PRIORITY_DEFAULT << 8 | \ LPC43M4_SYSH_PRIORITY_DEFAULT) /* Given the address of a NVIC ENABLE register, this is the offset to diff --git a/arch/arm/src/lpc43xx/lpc43_pinconfig.c b/arch/arm/src/lpc43xx/lpc43_pinconfig.c index bde44b3f3c..0a274dd6a8 100644 --- a/arch/arm/src/lpc43xx/lpc43_pinconfig.c +++ b/arch/arm/src/lpc43xx/lpc43_pinconfig.c @@ -110,16 +110,16 @@ int lpc43_pin_config(uint32_t pinconf) /* Enable/disable glitch filtering */ if (!PINCONF_GLITCH_ENABLE(pinconf)) - { - regval |= SCU_PIN_ZIF; /* Set bit to disable */ - } + { + regval |= SCU_PIN_ZIF; /* Set bit to disable */ + } /* Only normal and high speed pins support the slew rate setting */ if (PINCONF_IS_SLEW_FAST(pinconf)) - { - regval |= SCU_NDPIN_EHS; /* 0=slow; 1=fast */ - } + { + regval |= SCU_NDPIN_EHS; /* 0=slow; 1=fast */ + } /* Only high drive pins suppose drive strength */ diff --git a/arch/arm/src/lpc43xx/lpc43_rit.c b/arch/arm/src/lpc43xx/lpc43_rit.c index 42e76dbd63..8eec814ac3 100644 --- a/arch/arm/src/lpc43xx/lpc43_rit.c +++ b/arch/arm/src/lpc43xx/lpc43_rit.c @@ -91,7 +91,7 @@ static int lpc43_RIT_isr(int irq, FAR void *context) flags = irqsave(); - putreg32(RIT_CTRL_INT,LPC43_RIT_CTRL); + putreg32(RIT_CTRL_INT, LPC43_RIT_CTRL); internal_timer += (uint64_t)RIT_TIMER_RESOLUTION; if (alarm > 0 && internal_timer >= alarm) @@ -201,7 +201,7 @@ void up_timer_initialize(void) } lldbg("mask_bits = %d, mask = %X, ticks_per_int = %d\r\n", - mask_bits, (0xFFFFFFFF<<(32 - mask_bits)), ticks_per_int); + mask_bits, (0xffffffff << (32 - mask_bits)), ticks_per_int); /* Set the mask and compare value so we get interrupts every * RIT_TIMER_RESOLUTION cycles. diff --git a/arch/arm/src/lpc43xx/lpc43_serial.c b/arch/arm/src/lpc43xx/lpc43_serial.c index d4d84a4acd..0cd0ae9a15 100644 --- a/arch/arm/src/lpc43xx/lpc43_serial.c +++ b/arch/arm/src/lpc43xx/lpc43_serial.c @@ -563,16 +563,16 @@ static inline void up_enablebreaks(struct up_dev_s *priv, bool enable) static int up_setup(struct uart_dev_s *dev) { #ifndef CONFIG_SUPPRESS_UART_CONFIG - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t lcr; /* Clear fifos */ - up_serialout(priv, LPC43_UART_FCR_OFFSET, (UART_FCR_RXRST|UART_FCR_TXRST)); + up_serialout(priv, LPC43_UART_FCR_OFFSET, (UART_FCR_RXRST | UART_FCR_TXRST)); /* Set trigger */ - up_serialout(priv, LPC43_UART_FCR_OFFSET, (UART_FCR_FIFOEN|UART_FCR_RXTRIGGER_8)); + up_serialout(priv, LPC43_UART_FCR_OFFSET, (UART_FCR_FIFOEN | UART_FCR_RXTRIGGER_8)); /* Set up the IER */ @@ -598,11 +598,11 @@ static int up_setup(struct uart_dev_s *dev) if (priv->parity == 1) { - lcr |= (UART_LCR_PE|UART_LCR_PS_ODD); + lcr |= (UART_LCR_PE | UART_LCR_PS_ODD); } else if (priv->parity == 2) { - lcr |= (UART_LCR_PE|UART_LCR_PS_EVEN); + lcr |= (UART_LCR_PE | UART_LCR_PS_EVEN); } /* Save the LCR */ @@ -616,14 +616,15 @@ static int up_setup(struct uart_dev_s *dev) /* Configure the FIFOs */ up_serialout(priv, LPC43_UART_FCR_OFFSET, - (UART_FCR_RXTRIGGER_8|UART_FCR_TXRST|UART_FCR_RXRST|UART_FCR_FIFOEN)); + (UART_FCR_RXTRIGGER_8 | UART_FCR_TXRST | UART_FCR_RXRST | + UART_FCR_FIFOEN)); /* Enable Auto-RTS and Auto-CS Flow Control in the Modem Control Register */ #ifdef CONFIG_UART1_FLOWCONTROL if (priv->id == 1) { - up_serialout(priv, LPC43_UART_MCR_OFFSET, (UART_MCR_RTSEN|UART_MCR_CTSEN)); + up_serialout(priv, LPC43_UART_MCR_OFFSET, (UART_MCR_RTSEN | UART_MCR_CTSEN)); } #endif @@ -641,7 +642,7 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Disable further interrupts from the U[S]ART */ @@ -697,7 +698,7 @@ static void up_shutdown(struct uart_dev_s *dev) static int up_attach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ */ @@ -705,11 +706,11 @@ static int up_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, up_interrupt); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the UART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the UART + */ - up_enable_irq(priv->irq); + up_enable_irq(priv->irq); } return ret; } @@ -726,7 +727,7 @@ static int up_attach(struct uart_dev_s *dev) static void up_detach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disable_irq(priv->irq); irq_detach(priv->irq); } @@ -781,7 +782,7 @@ static int up_interrupt(int irq, void *context) { PANIC(); } - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; /* Loop until there are no characters to be transferred or, * until we have been looping for a long time. @@ -1077,7 +1078,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) { struct inode *inode = filep->f_inode; struct uart_dev_s *dev = inode->i_private; - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret = OK; switch (cmd) @@ -1085,7 +1086,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct up_dev_s *user = (struct up_dev_s*)arg; + struct up_dev_s *user = (struct up_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -1101,7 +1102,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TERMIOS case TCGETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; if (!termiosp) { @@ -1120,7 +1121,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) case TCSETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; if (!termiosp) { @@ -1192,7 +1193,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) static int up_receive(struct uart_dev_s *dev, uint32_t *status) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t rbr; *status = up_serialin(priv, LPC43_UART_LSR_OFFSET); @@ -1210,7 +1211,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { #ifndef CONFIG_SUPPRESS_SERIAL_INTS @@ -1235,7 +1236,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) static bool up_rxavailable(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, LPC43_UART_LSR_OFFSET) & UART_LSR_RDR) != 0); } @@ -1249,7 +1250,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_serialout(priv, LPC43_UART_THR_OFFSET, (uint32_t)ch); } @@ -1263,7 +1264,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -1298,7 +1299,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) static bool up_txready(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, LPC43_UART_LSR_OFFSET) & UART_LSR_THRE) != 0); } @@ -1312,7 +1313,7 @@ static bool up_txready(struct uart_dev_s *dev) static bool up_txempty(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, LPC43_UART_LSR_OFFSET) & UART_LSR_THRE) != 0); } @@ -1412,7 +1413,7 @@ void up_serialinit(void) int up_putc(int ch) { #ifdef HAVE_CONSOLE - struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; + struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; uint32_t ier; up_disableuartint(priv, &ier); #endif diff --git a/arch/arm/src/lpc43xx/lpc43_spi.c b/arch/arm/src/lpc43xx/lpc43_spi.c index fe71636cfe..f1ae4bbf4f 100644 --- a/arch/arm/src/lpc43xx/lpc43_spi.c +++ b/arch/arm/src/lpc43xx/lpc43_spi.c @@ -253,7 +253,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) divisor = SPI_CLOCK / frequency; - /* The SPI CCR register must contain an even number greater than or equal to 8. */ + /* The SPI CCR register must contain an even number greater than or equal to 8. */ if (divisor < 8) { @@ -314,7 +314,7 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) /* Yes... Set CR appropriately */ regval = getreg32(LPC43_SPI_CR); - regval &= ~(SPI_CR_CPOL|SPI_CR_CPHA); + regval &= ~(SPI_CR_CPOL | SPI_CR_CPHA); switch (mode) { @@ -330,7 +330,7 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) break; case SPIDEV_MODE3: /* CPOL=1; CPHA=1 */ - regval |= (SPI_CR_CPOL|SPI_CR_CPHA); + regval |= (SPI_CR_CPOL | SPI_CR_CPHA); break; default: @@ -447,7 +447,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t nwords) { - FAR uint8_t *ptr = (FAR uint8_t*)buffer; + FAR uint8_t *ptr = (FAR uint8_t *)buffer; uint8_t data; spidbg("nwords: %d\n", nwords); @@ -493,7 +493,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nwords) { - FAR uint8_t *ptr = (FAR uint8_t*)buffer; + FAR uint8_t *ptr = (FAR uint8_t *)buffer; spidbg("nwords: %d\n", nwords); while (nwords) @@ -509,16 +509,16 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nw * data transfer. */ - while ((getreg32(LPC43_SPI_SR) & SPI_SR_SPIF) == 0); + while ((getreg32(LPC43_SPI_SR) & SPI_SR_SPIF) == 0); - /* Read the SPI Status Register again to clear the status bit */ + /* Read the SPI Status Register again to clear the status bit */ - (void)getreg32(LPC43_SPI_SR); + (void)getreg32(LPC43_SPI_SR); - /* Read the received data from the SPI Data Register */ + /* Read the received data from the SPI Data Register */ - *ptr++ = (uint8_t)getreg32(LPC43_SPI_DR); - nwords--; + *ptr++ = (uint8_t)getreg32(LPC43_SPI_DR); + nwords--; } } @@ -559,7 +559,7 @@ FAR struct spi_dev_s *lpc43_spiinitialize(int port) /* Configure 8-bit SPI mode and master mode */ - putreg32(SPI_CR_BITS_8BITS|SPI_CR_BITENABLE|SPI_CR_MSTR, LPC43_SPI_CR); + putreg32(SPI_CR_BITS_8BITS | SPI_CR_BITENABLE | SPI_CR_MSTR, LPC43_SPI_CR); /* Set the initial SPI configuration */ diff --git a/arch/arm/src/lpc43xx/lpc43_ssp.c b/arch/arm/src/lpc43xx/lpc43_ssp.c index 49a4673a7d..8fbc2ad792 100644 --- a/arch/arm/src/lpc43xx/lpc43_ssp.c +++ b/arch/arm/src/lpc43xx/lpc43_ssp.c @@ -348,7 +348,7 @@ static uint32_t ssp_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) divisor = priv->sspbasefreq / frequency; - /* "In master mode, CPSDVSRmin = 2 or larger (even numbers only)" */ + /* "In master mode, CPSDVSRmin = 2 or larger (even numbers only)" */ if (divisor < 2) { @@ -409,7 +409,7 @@ static void ssp_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) /* Yes... Set CR0 appropriately */ regval = ssp_getreg(priv, LPC43_SSP_CR0_OFFSET); - regval &= ~(SSP_CR0_CPOL|SSP_CR0_CPHA); + regval &= ~(SSP_CR0_CPOL | SSP_CR0_CPHA); switch (mode) { @@ -425,7 +425,7 @@ static void ssp_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) break; case SPIDEV_MODE3: /* CPOL=1; CPHA=1 */ - regval |= (SSP_CR0_CPOL|SSP_CR0_CPHA); + regval |= (SSP_CR0_CPOL | SSP_CR0_CPHA); break; default: @@ -840,7 +840,7 @@ FAR struct spi_dev_s *lpc43_sspinitialize(int port) /* Configure 8-bit SPI mode */ - ssp_putreg(priv, LPC43_SSP_CR0_OFFSET, SSP_CR0_DSS_8BIT|SSP_CR0_FRF_SPI); + ssp_putreg(priv, LPC43_SSP_CR0_OFFSET, SSP_CR0_DSS_8BIT | SSP_CR0_FRF_SPI); /* Disable the SSP and all interrupts (we'll poll for all data) */ diff --git a/arch/arm/src/lpc43xx/lpc43_start.c b/arch/arm/src/lpc43xx/lpc43_start.c index 0f3163881e..80ffb581ee 100644 --- a/arch/arm/src/lpc43xx/lpc43_start.c +++ b/arch/arm/src/lpc43xx/lpc43_start.c @@ -1,6 +1,5 @@ /**************************************************************************** * arch/arm/src/lpc43xx/lpc43_start.c - * arch/arm/src/chip/lpc43_start.c * * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -357,5 +356,5 @@ void __start(void) /* Shouldn't get here */ - for (;;); + for (; ; ); } diff --git a/arch/arm/src/lpc43xx/lpc43_timerisr.c b/arch/arm/src/lpc43xx/lpc43_timerisr.c index 12f3be8388..2b728f7fb4 100644 --- a/arch/arm/src/lpc43xx/lpc43_timerisr.c +++ b/arch/arm/src/lpc43xx/lpc43_timerisr.c @@ -142,7 +142,7 @@ void up_timer_initialize(void) /* Enable SysTick interrupts */ - putreg32((NVIC_SYSTICK_CTRL_CLKSOURCE|NVIC_SYSTICK_CTRL_TICKINT| + putreg32((NVIC_SYSTICK_CTRL_CLKSOURCE | NVIC_SYSTICK_CTRL_TICKINT | NVIC_SYSTICK_CTRL_ENABLE), NVIC_SYSTICK_CTRL); /* And enable the timer interrupt */ diff --git a/arch/arm/src/lpc43xx/lpc43_uart.c b/arch/arm/src/lpc43xx/lpc43_uart.c index 95c5aeb904..c0775265c2 100644 --- a/arch/arm/src/lpc43xx/lpc43_uart.c +++ b/arch/arm/src/lpc43xx/lpc43_uart.c @@ -232,15 +232,17 @@ void lpc43_lowsetup(void) /* Clear fifos */ - putreg32(UART_FCR_RXRST|UART_FCR_TXRST, CONSOLE_BASE+LPC43_UART_FCR_OFFSET); + putreg32(UART_FCR_RXRST | UART_FCR_TXRST, + CONSOLE_BASE + LPC43_UART_FCR_OFFSET); /* Set trigger */ - putreg32(UART_FCR_FIFOEN|UART_FCR_RXTRIGGER_8, CONSOLE_BASE+LPC43_UART_FCR_OFFSET); + putreg32(UART_FCR_FIFOEN | UART_FCR_RXTRIGGER_8, + CONSOLE_BASE + LPC43_UART_FCR_OFFSET); /* Set up the LCR */ - putreg32(CONSOLE_LCR_VALUE, CONSOLE_BASE+LPC43_UART_LCR_OFFSET); + putreg32(CONSOLE_LCR_VALUE, CONSOLE_BASE + LPC43_UART_LCR_OFFSET); /* Set the BAUD divisor */ @@ -248,8 +250,8 @@ void lpc43_lowsetup(void) /* Configure the FIFOs */ - putreg32(UART_FCR_RXTRIGGER_8|UART_FCR_TXRST|UART_FCR_RXRST|UART_FCR_FIFOEN, - CONSOLE_BASE+LPC43_UART_FCR_OFFSET); + putreg32(UART_FCR_RXTRIGGER_8 | UART_FCR_TXRST | UART_FCR_RXRST | + UART_FCR_FIFOEN, CONSOLE_BASE + LPC43_UART_FCR_OFFSET); #endif #endif /* HAVE_UART */ } diff --git a/arch/arm/src/lpc43xx/lpc43_usb0dev.c b/arch/arm/src/lpc43xx/lpc43_usb0dev.c index 90344a4898..849f90626e 100644 --- a/arch/arm/src/lpc43xx/lpc43_usb0dev.c +++ b/arch/arm/src/lpc43xx/lpc43_usb0dev.c @@ -527,20 +527,20 @@ static uint32_t lpc43_getreg(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ @@ -1054,15 +1054,13 @@ static void lpc43_ep0configure(struct lpc43_usbdev_s *priv) /* Enable ep0 IN and ep0 OUT */ g_qh[LPC43_EP0_OUT].capability = (DQH_CAPABILITY_MAX_PACKET(CONFIG_USBDEV_EP0_MAXSIZE) | - DQH_CAPABILITY_IOS | - DQH_CAPABILITY_ZLT); + DQH_CAPABILITY_IOS | DQH_CAPABILITY_ZLT); - g_qh[LPC43_EP0_IN ].capability = (DQH_CAPABILITY_MAX_PACKET(CONFIG_USBDEV_EP0_MAXSIZE) | - DQH_CAPABILITY_IOS | - DQH_CAPABILITY_ZLT); + g_qh[LPC43_EP0_IN].capability = (DQH_CAPABILITY_MAX_PACKET(CONFIG_USBDEV_EP0_MAXSIZE) | + DQH_CAPABILITY_IOS | DQH_CAPABILITY_ZLT); g_qh[LPC43_EP0_OUT].currdesc = DTD_NEXTDESC_INVALID; - g_qh[LPC43_EP0_IN ].currdesc = DTD_NEXTDESC_INVALID; + g_qh[LPC43_EP0_IN].currdesc = DTD_NEXTDESC_INVALID; /* Enable EP0 */ @@ -1752,7 +1750,7 @@ static int lpc43_usbinterrupt(int irq, FAR void *context) if (disr & USBDEV_USBSTS_URI) { - usbtrace(TRACE_INTDECODE(LPC43_TRACEINTID_DEVRESET),0); + usbtrace(TRACE_INTDECODE(LPC43_TRACEINTID_DEVRESET), 0); lpc43_usbreset(priv); @@ -1766,7 +1764,7 @@ static int lpc43_usbinterrupt(int irq, FAR void *context) if (!priv->suspended && (disr & USBDEV_USBSTS_SLI) != 0) { - usbtrace(TRACE_INTDECODE(LPC43_TRACEINTID_SUSPENDED),0); + usbtrace(TRACE_INTDECODE(LPC43_TRACEINTID_SUSPENDED), 0); /* Inform the Class driver of the suspend event */ @@ -1785,7 +1783,7 @@ static int lpc43_usbinterrupt(int irq, FAR void *context) else if (priv->suspended && (disr & USBDEV_USBSTS_SLI) == 0) { - usbtrace(TRACE_INTDECODE(LPC43_TRACEINTID_RESUMED),0); + usbtrace(TRACE_INTDECODE(LPC43_TRACEINTID_RESUMED), 0); /* Inform the Class driver of the resume event */ diff --git a/arch/arm/src/lpc43xx/lpc43_userspace.c b/arch/arm/src/lpc43xx/lpc43_userspace.c index 822381b249..43ded6b4ab 100644 --- a/arch/arm/src/lpc43xx/lpc43_userspace.c +++ b/arch/arm/src/lpc43xx/lpc43_userspace.c @@ -87,8 +87,8 @@ void lpc43_userspace(void) DEBUGASSERT(USERSPACE->us_bssstart != 0 && USERSPACE->us_bssend != 0 && USERSPACE->us_bssstart <= USERSPACE->us_bssend); - dest = (uint8_t*)USERSPACE->us_bssstart; - end = (uint8_t*)USERSPACE->us_bssend; + dest = (uint8_t *)USERSPACE->us_bssstart; + end = (uint8_t *)USERSPACE->us_bssend; while (dest != end) { @@ -101,9 +101,9 @@ void lpc43_userspace(void) USERSPACE->us_datastart != 0 && USERSPACE->us_dataend != 0 && USERSPACE->us_datastart <= USERSPACE->us_dataend); - src = (uint8_t*)USERSPACE->us_datasource; - dest = (uint8_t*)USERSPACE->us_datastart; - end = (uint8_t*)USERSPACE->us_dataend; + src = (uint8_t *)USERSPACE->us_datasource; + dest = (uint8_t *)USERSPACE->us_datastart; + end = (uint8_t *)USERSPACE->us_dataend; while (dest != end) { diff --git a/arch/arm/src/moxart/moxart_16550.c b/arch/arm/src/moxart/moxart_16550.c index d2008f945c..1078e920f3 100644 --- a/arch/arm/src/moxart/moxart_16550.c +++ b/arch/arm/src/moxart/moxart_16550.c @@ -98,7 +98,7 @@ int uart_ioctl(struct file *filep, int cmd, unsigned long arg) { struct inode *inode = filep->f_inode; struct uart_dev_s *dev = inode->i_private; - struct u16550_s *priv = (struct u16550_s*)dev->priv; + struct u16550_s *priv = (struct u16550_s *)dev->priv; int ret = -ENOTTY; uint32_t vmode; unsigned int opmode; diff --git a/arch/arm/src/moxart/moxart_systemreset.c b/arch/arm/src/moxart/moxart_systemreset.c index de671edb23..6e3e670472 100644 --- a/arch/arm/src/moxart/moxart_systemreset.c +++ b/arch/arm/src/moxart/moxart_systemreset.c @@ -76,7 +76,7 @@ void up_systemreset(void) /* Wait for the reset */ - for (;;); + for (; ; ); } /**************************************************************************** diff --git a/arch/arm/src/nuc1xx/nuc_irq.c b/arch/arm/src/nuc1xx/nuc_irq.c index e10c65effe..8e2b4a2c90 100644 --- a/arch/arm/src/nuc1xx/nuc_irq.c +++ b/arch/arm/src/nuc1xx/nuc_irq.c @@ -59,7 +59,7 @@ /* Get a 32-bit version of the default priority */ #define DEFPRIORITY32 \ - (NVIC_SYSH_PRIORITY_DEFAULT << 24 | NVIC_SYSH_PRIORITY_DEFAULT << 16 |\ + (NVIC_SYSH_PRIORITY_DEFAULT << 24 | NVIC_SYSH_PRIORITY_DEFAULT << 16 | \ NVIC_SYSH_PRIORITY_DEFAULT << 8 | NVIC_SYSH_PRIORITY_DEFAULT) /**************************************************************************** diff --git a/arch/arm/src/nuc1xx/nuc_lowputc.c b/arch/arm/src/nuc1xx/nuc_lowputc.c index e9248ac780..be949b2c9a 100644 --- a/arch/arm/src/nuc1xx/nuc_lowputc.c +++ b/arch/arm/src/nuc1xx/nuc_lowputc.c @@ -161,7 +161,7 @@ void nuc_lowsetup(void) #ifdef CONFIG_NUC_UART0 #ifdef CONFIG_UART0_FLOWCONTROL - regval |= (GCR_GPB_MFP0 | GCR_GPB_MFP1 | GCR_GPB_MFP2| GCR_GPB_MFP3); + regval |= (GCR_GPB_MFP0 | GCR_GPB_MFP1 | GCR_GPB_MFP2 | GCR_GPB_MFP3); #else regval |= (GCR_GPB_MFP0 | GCR_GPB_MFP1); #endif @@ -174,7 +174,7 @@ void nuc_lowsetup(void) #ifdef CONFIG_NUC_UART1 #ifdef CONFIG_UART1_FLOWCONTROL - regval |= (GCR_GPB_MFP4 | GCR_GPB_MFP5 | GCR_GPB_MFP6| GCR_GPB_MFP7) + regval |= (GCR_GPB_MFP4 | GCR_GPB_MFP5 | GCR_GPB_MFP6 | GCR_GPB_MFP7) #else regval |= (GCR_GPB_MFP4 | GCR_GPB_MFP5); #endif @@ -365,7 +365,7 @@ void nuc_setbaud(uintptr_t base, uint32_t baud) regval = getreg32(base + NUC_UART_BAUD_OFFSET); - /* Mode 0: Source Clock mod 16 < 3 => Using Divider X = 16 */ + /* Mode 0: Source Clock mod 16 < 3 => Using Divider X = 16 */ clksperbit = (NUC_UART_CLK + (baud >> 1)) / baud; if ((clksperbit & 15) < 3) diff --git a/arch/arm/src/nuc1xx/nuc_serial.c b/arch/arm/src/nuc1xx/nuc_serial.c index 8fe9c6f14e..d31bcf3bed 100644 --- a/arch/arm/src/nuc1xx/nuc_serial.c +++ b/arch/arm/src/nuc1xx/nuc_serial.c @@ -449,7 +449,7 @@ static void up_rxto_enable(struct nuc_dev_s *priv) static int up_setup(struct uart_dev_s *dev) { #ifndef CONFIG_SUPPRESS_UART_CONFIG - struct nuc_dev_s *priv = (struct nuc_dev_s*)dev->priv; + struct nuc_dev_s *priv = (struct nuc_dev_s *)dev->priv; uint32_t regval; /* Reset the TX FIFO */ @@ -542,7 +542,7 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct nuc_dev_s *priv = (struct nuc_dev_s*)dev->priv; + struct nuc_dev_s *priv = (struct nuc_dev_s *)dev->priv; up_disableuartint(priv, NULL); } @@ -563,7 +563,7 @@ static void up_shutdown(struct uart_dev_s *dev) static int up_attach(struct uart_dev_s *dev) { - struct nuc_dev_s *priv = (struct nuc_dev_s*)dev->priv; + struct nuc_dev_s *priv = (struct nuc_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ */ @@ -571,11 +571,11 @@ static int up_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, up_interrupt); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the UART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the UART + */ - up_enable_irq(priv->irq); + up_enable_irq(priv->irq); } return ret; @@ -593,7 +593,7 @@ static int up_attach(struct uart_dev_s *dev) static void up_detach(struct uart_dev_s *dev) { - struct nuc_dev_s *priv = (struct nuc_dev_s*)dev->priv; + struct nuc_dev_s *priv = (struct nuc_dev_s *)dev->priv; up_disable_irq(priv->irq); irq_detach(priv->irq); } @@ -644,7 +644,7 @@ static int up_interrupt(int irq, void *context) { PANIC(); } - priv = (struct nuc_dev_s*)dev->priv; + priv = (struct nuc_dev_s *)dev->priv; /* Loop until there are no characters to be transferred or, * until we have been looping for a long time. @@ -700,7 +700,7 @@ static int up_interrupt(int irq, void *context) * data in the RX FIFO when we entered the interrupt handler? */ - else if ((priv->ier & (UART_IER_RTO_IEN|UART_IER_RDA_IEN)) == UART_IER_RDA_IEN && !rxfe) + else if ((priv->ier & (UART_IER_RTO_IEN | UART_IER_RDA_IEN)) == UART_IER_RDA_IEN && !rxfe) { /* We are receiving data and the RX timeout is not enabled. * Set the RX FIFO threshold so that RX interrupts will only be @@ -757,7 +757,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) { struct inode *inode = filep->f_inode; struct uart_dev_s *dev = inode->i_private; - struct nuc_dev_s *priv = (struct nuc_dev_s*)dev->priv; + struct nuc_dev_s *priv = (struct nuc_dev_s *)dev->priv; int ret = OK; switch (cmd) @@ -765,7 +765,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct nuc_dev_s *user = (struct nuc_dev_s*)arg; + struct nuc_dev_s *user = (struct nuc_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -786,7 +786,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TERMIOS case TCGETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; if (!termiosp) { @@ -806,7 +806,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) case TCSETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; uint32_t lcr; /* Holds current values of line control register */ uint16_t dl; /* Divisor latch */ @@ -853,7 +853,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) static int up_receive(struct uart_dev_s *dev, uint32_t *status) { - struct nuc_dev_s *priv = (struct nuc_dev_s*)dev->priv; + struct nuc_dev_s *priv = (struct nuc_dev_s *)dev->priv; uint32_t rbr; *status = up_serialin(priv, NUC_UART_FSR_OFFSET); @@ -871,7 +871,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct nuc_dev_s *priv = (struct nuc_dev_s*)dev->priv; + struct nuc_dev_s *priv = (struct nuc_dev_s *)dev->priv; if (enable) { @@ -929,7 +929,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) static bool up_rxavailable(struct uart_dev_s *dev) { - struct nuc_dev_s *priv = (struct nuc_dev_s*)dev->priv; + struct nuc_dev_s *priv = (struct nuc_dev_s *)dev->priv; return ((up_serialin(priv, NUC_UART_FSR_OFFSET) & UART_FSR_RX_EMPTY) == 0); } @@ -943,7 +943,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { - struct nuc_dev_s *priv = (struct nuc_dev_s*)dev->priv; + struct nuc_dev_s *priv = (struct nuc_dev_s *)dev->priv; up_serialout(priv, NUC_UART_THR_OFFSET, (uint32_t)ch); } @@ -957,7 +957,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct nuc_dev_s *priv = (struct nuc_dev_s*)dev->priv; + struct nuc_dev_s *priv = (struct nuc_dev_s *)dev->priv; if (enable) { @@ -993,7 +993,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) static bool up_txready(struct uart_dev_s *dev) { - struct nuc_dev_s *priv = (struct nuc_dev_s*)dev->priv; + struct nuc_dev_s *priv = (struct nuc_dev_s *)dev->priv; uint32_t regval; int depth; @@ -1012,7 +1012,7 @@ static bool up_txready(struct uart_dev_s *dev) static bool up_txempty(struct uart_dev_s *dev) { - struct nuc_dev_s *priv = (struct nuc_dev_s*)dev->priv; + struct nuc_dev_s *priv = (struct nuc_dev_s *)dev->priv; return ((up_serialin(priv, NUC_UART_FSR_OFFSET) & UART_FSR_TE_FLAG) != 0); } @@ -1079,7 +1079,7 @@ void up_serialinit(void) int up_putc(int ch) { #ifdef HAVE_CONSOLE - struct nuc_dev_s *priv = (struct nuc_dev_s*)CONSOLE_DEV.priv; + struct nuc_dev_s *priv = (struct nuc_dev_s *)CONSOLE_DEV.priv; uint32_t ier; up_disableuartint(priv, &ier); #endif diff --git a/arch/arm/src/nuc1xx/nuc_start.c b/arch/arm/src/nuc1xx/nuc_start.c index e7cf1b4b1f..3cbb5becde 100644 --- a/arch/arm/src/nuc1xx/nuc_start.c +++ b/arch/arm/src/nuc1xx/nuc_start.c @@ -174,5 +174,5 @@ void __start(void) /* Shoulnd't get here */ - for (;;); + for (; ; ); } diff --git a/arch/arm/src/nuc1xx/nuc_userspace.c b/arch/arm/src/nuc1xx/nuc_userspace.c index 2ace6184b7..e0fc09cbcd 100644 --- a/arch/arm/src/nuc1xx/nuc_userspace.c +++ b/arch/arm/src/nuc1xx/nuc_userspace.c @@ -86,8 +86,8 @@ void nuc_userspace(void) DEBUGASSERT(USERSPACE->us_bssstart != 0 && USERSPACE->us_bssend != 0 && USERSPACE->us_bssstart <= USERSPACE->us_bssend); - dest = (uint8_t*)USERSPACE->us_bssstart; - end = (uint8_t*)USERSPACE->us_bssend; + dest = (uint8_t *)USERSPACE->us_bssstart; + end = (uint8_t *)USERSPACE->us_bssend; while (dest != end) { @@ -100,9 +100,9 @@ void nuc_userspace(void) USERSPACE->us_datastart != 0 && USERSPACE->us_dataend != 0 && USERSPACE->us_datastart <= USERSPACE->us_dataend); - src = (uint8_t*)USERSPACE->us_datasource; - dest = (uint8_t*)USERSPACE->us_datastart; - end = (uint8_t*)USERSPACE->us_dataend; + src = (uint8_t *)USERSPACE->us_datasource; + dest = (uint8_t *)USERSPACE->us_datastart; + end = (uint8_t *)USERSPACE->us_dataend; while (dest != end) { diff --git a/arch/arm/src/sam34/sam4l_clockconfig.c b/arch/arm/src/sam34/sam4l_clockconfig.c index 17e04acda0..657f0b919d 100644 --- a/arch/arm/src/sam34/sam4l_clockconfig.c +++ b/arch/arm/src/sam34/sam4l_clockconfig.c @@ -1067,9 +1067,9 @@ static inline void sam_flash_config(uint32_t cpuclock, uint32_t psm, bool fastwk } } - /* The is below the threshold that requires one wait state. But we - * have to check a few more things. - */ + /* The is below the threshold that requires one wait state. But we + * have to check a few more things. + */ else { diff --git a/arch/arm/src/sam34/sam4l_periphclks.c b/arch/arm/src/sam34/sam4l_periphclks.c index b344992f33..9230b0f711 100644 --- a/arch/arm/src/sam34/sam4l_periphclks.c +++ b/arch/arm/src/sam34/sam4l_periphclks.c @@ -530,14 +530,14 @@ void sam_pba_disableperipheral(uint32_t bitset) sam_hsb_disableperipheral(PM_HSBMASK_APBA); } - /* Disable PBA UART divided clock if none of the UARTS are in use */ + /* Disable PBA UART divided clock if none of the UARTS are in use */ if ((getreg32(SAM_PM_PBAMASK) & PM_PBAMASK_UARTS) == 0) { sam_pba_disabledivmask(PM_PBADIVMASK_CLK_USART); } - /* Disable PBA TIMER divided clocks if none of the UARTS are in use */ + /* Disable PBA TIMER divided clocks if none of the UARTS are in use */ if ((getreg32(SAM_PM_PBAMASK) & PM_PBAMASK_TIMERS) == 0) { diff --git a/arch/arm/src/sam34/sam_aes.c b/arch/arm/src/sam34/sam_aes.c index b39c8f45aa..29634e69c7 100644 --- a/arch/arm/src/sam34/sam_aes.c +++ b/arch/arm/src/sam34/sam_aes.c @@ -100,15 +100,15 @@ static void aes_memcpy(void *out, const void *in, size_t size) { size_t i; size_t wcount = size / 4; - for (i = 0; i < wcount; i++, out = (uint8_t*)out + 4, in = (uint8_t*)in + 4) + for (i = 0; i < wcount; i++, out = (uint8_t *)out + 4, in = (uint8_t *)in + 4) { - *(uint32_t*)out = *(uint32_t*)in; + *(uint32_t *)out = *(uint32_t *)in; } } static void aes_encryptblock(void *out, const void *in) { - aes_memcpy((void*)SAM_AES_IDATAR, in, AES_BLOCK_SIZE); + aes_memcpy((void *)SAM_AES_IDATAR, in, AES_BLOCK_SIZE); putreg32(AES_CR_START, SAM_AES_CR); @@ -116,7 +116,7 @@ static void aes_encryptblock(void *out, const void *in) if (out) { - aes_memcpy(out, (void*)SAM_AES_ODATAR, AES_BLOCK_SIZE); + aes_memcpy(out, (void *)SAM_AES_ODATAR, AES_BLOCK_SIZE); } } @@ -193,10 +193,10 @@ int aes_cypher(void *out, const void *in, uint32_t size, const void *iv, return res; } - aes_memcpy((void*)SAM_AES_KEYWR, key, keysize); + aes_memcpy((void *)SAM_AES_KEYWR, key, keysize); if (iv) { - aes_memcpy((void*)SAM_AES_IVR, iv, AES_BLOCK_SIZE); + aes_memcpy((void *)SAM_AES_IVR, iv, AES_BLOCK_SIZE); } while (size) @@ -204,7 +204,7 @@ int aes_cypher(void *out, const void *in, uint32_t size, const void *iv, if ((mode & AES_MODE_MAC) == 0) { aes_encryptblock(out, in); - out = (char*)out + AES_BLOCK_SIZE; + out = (char *)out + AES_BLOCK_SIZE; } else if (size == AES_BLOCK_SIZE) { @@ -215,7 +215,7 @@ int aes_cypher(void *out, const void *in, uint32_t size, const void *iv, aes_encryptblock(NULL, in); } - in = (char*)in + AES_BLOCK_SIZE; + in = (char *)in + AES_BLOCK_SIZE; size -= AES_BLOCK_SIZE; } diff --git a/arch/arm/src/sam34/sam_allocateheap.c b/arch/arm/src/sam34/sam_allocateheap.c index 8c40a7d584..0f0b981ee4 100644 --- a/arch/arm/src/sam34/sam_allocateheap.c +++ b/arch/arm/src/sam34/sam_allocateheap.c @@ -231,7 +231,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) /* Return the user-space heap settings */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)ubase; + *heap_start = (FAR void *)ubase; *heap_size = usize; /* Allow user-mode access to the user heap memory */ @@ -242,7 +242,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) /* Return the heap settings */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)g_idle_topstack; + *heap_start = (FAR void *)g_idle_topstack; *heap_size = CONFIG_RAM_END - g_idle_topstack; #endif } @@ -286,7 +286,7 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size) * that was not dedicated to the user heap). */ - *heap_start = (FAR void*)USERSPACE->us_bssend; + *heap_start = (FAR void *)USERSPACE->us_bssend; *heap_size = ubase - (uintptr_t)USERSPACE->us_bssend; } #endif @@ -314,7 +314,7 @@ void up_addregion(void) /* Add the region */ - kumm_addregion((FAR void*)SAM_INTSRAM1_BASE, SAM34_SRAM1_SIZE); + kumm_addregion((FAR void *)SAM_INTSRAM1_BASE, SAM34_SRAM1_SIZE); #endif /* HAVE_SRAM1_REGION */ @@ -334,7 +334,7 @@ void up_addregion(void) /* Add the region */ - kumm_addregion((FAR void*)SAM_NFCSRAM_BASE, SAM34_NFCSRAM_SIZE); + kumm_addregion((FAR void *)SAM_NFCSRAM_BASE, SAM34_NFCSRAM_SIZE); #endif /* HAVE_NFCSRAM_REGION */ @@ -345,7 +345,7 @@ void up_addregion(void) /* Add the region */ - kumm_addregion((FAR void*)SAM_EXTCS0_BASE, CONFIG_SAM34_EXTSRAM0SIZE); + kumm_addregion((FAR void *)SAM_EXTCS0_BASE, CONFIG_SAM34_EXTSRAM0SIZE); #endif /* HAVE_EXTSRAM0_REGION */ @@ -356,7 +356,7 @@ void up_addregion(void) /* Add the region */ - kumm_addregion((FAR void*)SAM_EXTCS1_BASE, CONFIG_SAM34_EXTSRAM1SIZE); + kumm_addregion((FAR void *)SAM_EXTCS1_BASE, CONFIG_SAM34_EXTSRAM1SIZE); #endif /* HAVE_EXTSRAM0_REGION */ @@ -367,7 +367,7 @@ void up_addregion(void) /* Add the region */ - kumm_addregion((FAR void*)SAM_EXTCS2_BASE, CONFIG_SAM34_EXTSRAM2SIZE); + kumm_addregion((FAR void *)SAM_EXTCS2_BASE, CONFIG_SAM34_EXTSRAM2SIZE); #endif /* HAVE_EXTSRAM0_REGION */ @@ -378,7 +378,7 @@ void up_addregion(void) /* Add the region */ - kumm_addregion((FAR void*)SAM_EXTCS3_BASE, CONFIG_SAM34_EXTSRAM3SIZE); + kumm_addregion((FAR void *)SAM_EXTCS3_BASE, CONFIG_SAM34_EXTSRAM3SIZE); #endif /* HAVE_EXTSRAM0_REGION */ } diff --git a/arch/arm/src/sam34/sam_clockconfig.c b/arch/arm/src/sam34/sam_clockconfig.c index 66e37d09e3..3dce96b02e 100644 --- a/arch/arm/src/sam34/sam_clockconfig.c +++ b/arch/arm/src/sam34/sam_clockconfig.c @@ -151,7 +151,7 @@ static inline void sam_supcsetup(void) { uint32_t delay; - putreg32((SUPC_CR_XTALSEL|SUPR_CR_KEY), SAM_SUPC_CR); + putreg32((SUPC_CR_XTALSEL | SUPR_CR_KEY), SAM_SUPC_CR); for (delay = 0; (getreg32(SAM_SUPC_SR) & SUPC_SR_OSCSEL) == 0 && delay < UINT32_MAX; delay++); @@ -310,19 +310,19 @@ static inline void sam_enabledefaultmaster(void) /* Set default master: SRAM0 -> Cortex-M3 System */ regval = getreg32(SAM_MATRIX_SCFG0); - regval |= (MATRIX_SCFG0_FIXEDDEFMSTR_ARMS|MATRIX_SCFG_DEFMSTRTYPE_FIXED); + regval |= (MATRIX_SCFG0_FIXEDDEFMSTR_ARMS | MATRIX_SCFG_DEFMSTRTYPE_FIXED); putreg32(regval, SAM_MATRIX_SCFG0); /* Set default master: SRAM1 -> Cortex-M3 System */ regval = getreg32(SAM_MATRIX_SCFG1); - regval |= (MATRIX_SCFG1_FIXEDDEFMSTR_ARMS|MATRIX_SCFG_DEFMSTRTYPE_FIXED); + regval |= (MATRIX_SCFG1_FIXEDDEFMSTR_ARMS | MATRIX_SCFG_DEFMSTRTYPE_FIXED); putreg32(regval, SAM_MATRIX_SCFG1); /* Set default master: Internal flash0 -> Cortex-M3 Instruction/Data */ regval = getreg32(SAM_MATRIX_SCFG3); - regval |= (MATRIX_SCFG3_FIXEDDEFMSTR_ARMC|MATRIX_SCFG_DEFMSTRTYPE_FIXED); + regval |= (MATRIX_SCFG3_FIXEDDEFMSTR_ARMC | MATRIX_SCFG_DEFMSTRTYPE_FIXED); putreg32(regval, SAM_MATRIX_SCFG3); } diff --git a/arch/arm/src/sam34/sam_dmac.c b/arch/arm/src/sam34/sam_dmac.c index d9f31eb52d..28c4c5ecc4 100644 --- a/arch/arm/src/sam34/sam_dmac.c +++ b/arch/arm/src/sam34/sam_dmac.c @@ -1307,7 +1307,7 @@ static int sam_dmainterrupt(int irq, void *context) if ((regval & DMAC_EBC_ERR(chndx)) != 0) { - /* Yes... Terminate the transfer with an error? */ + /* Yes... Terminate the transfer with an error? */ sam_dmaterminate(dmach, -EIO); } @@ -1315,7 +1315,7 @@ static int sam_dmainterrupt(int irq, void *context) /* Is the transfer complete? */ else if ((regval & DMAC_EBC_CBTC(chndx)) != 0) - { + { /* Yes.. Terminate the transfer with success */ sam_dmaterminate(dmach, OK); diff --git a/arch/arm/src/sam34/sam_emac.c b/arch/arm/src/sam34/sam_emac.c index abb2f4a8f1..afb7406c88 100644 --- a/arch/arm/src/sam34/sam_emac.c +++ b/arch/arm/src/sam34/sam_emac.c @@ -1268,7 +1268,7 @@ static void sam_receive(struct sam_emac_s *priv) */ if (priv->dev.d_len > 0) - { + { /* Update the Ethernet header with the correct MAC address */ #ifdef CONFIG_NET_IPv4 @@ -2434,7 +2434,7 @@ static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac) if (regval == 0 && sam_getreg(priv, regaddr2) == 0) { - /* Yes.. disable all address matching */ + /* Yes.. disable all address matching */ regval = sam_getreg(priv, SAM_EMAC_NCFGR); regval &= ~(EMAC_NCFGR_UNIHEN | EMAC_NCFGR_MTIHEN); @@ -3110,7 +3110,7 @@ static int sam_autonegotiate(struct sam_emac_s *priv) /* Check AutoNegotiate complete */ timeout = 0; - for (;;) + for (; ; ) { ret = sam_phyread(priv, priv->phyaddr, MII_MSR, &msr); if (ret < 0) @@ -3429,14 +3429,14 @@ static void sam_txreset(struct sam_emac_s *priv) priv->txtail = 0; for (ndx = 0; ndx < CONFIG_SAM34_EMAC_NTXBUFFERS; ndx++) - { - bufaddr = (uint32_t)(&(txbuffer[ndx * EMAC_TX_UNITSIZE])); + { + bufaddr = (uint32_t)(&(txbuffer[ndx * EMAC_TX_UNITSIZE])); - /* Set the buffer address and mark the descriptor as in used by firmware */ + /* Set the buffer address and mark the descriptor as in used by firmware */ - txdesc[ndx].addr = bufaddr; - txdesc[ndx].status = EMACTXD_STA_USED; - } + txdesc[ndx].addr = bufaddr; + txdesc[ndx].status = EMACTXD_STA_USED; + } /* Mark the final descriptor in the list */ @@ -3482,17 +3482,17 @@ static void sam_rxreset(struct sam_emac_s *priv) priv->rxndx = 0; for (ndx = 0; ndx < CONFIG_SAM34_EMAC_NRXBUFFERS; ndx++) - { - bufaddr = (uintptr_t)(&(rxbuffer[ndx * EMAC_RX_UNITSIZE])); - DEBUGASSERT((bufaddr & ~EMACRXD_ADDR_MASK) == 0); + { + bufaddr = (uintptr_t)(&(rxbuffer[ndx * EMAC_RX_UNITSIZE])); + DEBUGASSERT((bufaddr & ~EMACRXD_ADDR_MASK) == 0); - /* Set the buffer address and remove EMACRXD_ADDR_OWNER and - * EMACRXD_ADDR_WRAP. - */ + /* Set the buffer address and remove EMACRXD_ADDR_OWNER and + * EMACRXD_ADDR_WRAP. + */ - rxdesc[ndx].addr = bufaddr; - rxdesc[ndx].status = 0; - } + rxdesc[ndx].addr = bufaddr; + rxdesc[ndx].status = 0; + } /* Mark the final descriptor in the list */ @@ -3703,7 +3703,7 @@ static int sam_emac_configure(struct sam_emac_s *priv) sam_emac_enableclk(); - /* Disable TX, RX, clear statistics. Disable all interrupts. */ + /* Disable TX, RX, clear statistics. Disable all interrupts. */ sam_putreg(priv, SAM_EMAC_NCR, EMAC_NCR_CLRSTAT); sam_putreg(priv, SAM_EMAC_IDR, EMAC_INT_ALL); @@ -3793,17 +3793,17 @@ void up_netinitialize(void) /* Initialize the driver structure */ memset(priv, 0, sizeof(struct sam_emac_s)); - priv->dev.d_ifup = sam_ifup; /* I/F up (new IP address) callback */ - priv->dev.d_ifdown = sam_ifdown; /* I/F down callback */ - priv->dev.d_txavail = sam_txavail; /* New TX data callback */ + priv->dev.d_ifup = sam_ifup; /* I/F up (new IP address) callback */ + priv->dev.d_ifdown = sam_ifdown; /* I/F down callback */ + priv->dev.d_txavail = sam_txavail; /* New TX data callback */ #ifdef CONFIG_NET_IGMP - priv->dev.d_addmac = sam_addmac; /* Add multicast MAC address */ - priv->dev.d_rmmac = sam_rmmac; /* Remove multicast MAC address */ + priv->dev.d_addmac = sam_addmac; /* Add multicast MAC address */ + priv->dev.d_rmmac = sam_rmmac; /* Remove multicast MAC address */ #endif #ifdef CONFIG_NETDEV_PHY_IOCTL - priv->dev.d_ioctl = sam_ioctl; /* Support PHY ioctl() calls */ + priv->dev.d_ioctl = sam_ioctl; /* Support PHY ioctl() calls */ #endif - priv->dev.d_private = (void*)&g_emac; /* Used to recover private state from dev */ + priv->dev.d_private = (void *)&g_emac; /* Used to recover private state from dev */ /* Create a watchdog for timing polling for and timing of transmissions */ @@ -3814,7 +3814,7 @@ void up_netinitialize(void) return; } - priv->txtimeout = wd_create(); /* Create TX timeout timer */ + priv->txtimeout = wd_create(); /* Create TX timeout timer */ if (!priv->txtimeout) { nlldbg("ERROR: Failed to create periodic poll timer\n"); diff --git a/arch/arm/src/sam34/sam_gpioirq.c b/arch/arm/src/sam34/sam_gpioirq.c index ef6df44985..4367e81463 100644 --- a/arch/arm/src/sam34/sam_gpioirq.c +++ b/arch/arm/src/sam34/sam_gpioirq.c @@ -441,10 +441,10 @@ void sam_gpioirqenable(int irq) if (sam_irqbase(irq, &base, &pin) == OK) { - /* Clear (all) pending interrupts and enable this pin interrupt */ + /* Clear (all) pending interrupts and enable this pin interrupt */ - //(void)getreg32(base + SAM_PIO_ISR_OFFSET); - putreg32((1 << pin), base + SAM_PIO_IER_OFFSET); + //(void)getreg32(base + SAM_PIO_ISR_OFFSET); + putreg32((1 << pin), base + SAM_PIO_IER_OFFSET); } } @@ -463,9 +463,9 @@ void sam_gpioirqdisable(int irq) if (sam_irqbase(irq, &base, &pin) == OK) { - /* Disable this pin interrupt */ + /* Disable this pin interrupt */ - putreg32((1 << pin), base + SAM_PIO_IDR_OFFSET); + putreg32((1 << pin), base + SAM_PIO_IDR_OFFSET); } } diff --git a/arch/arm/src/sam34/sam_hsmci.c b/arch/arm/src/sam34/sam_hsmci.c index 4e7db3cf75..0a5548cb97 100644 --- a/arch/arm/src/sam34/sam_hsmci.c +++ b/arch/arm/src/sam34/sam_hsmci.c @@ -1042,7 +1042,7 @@ static void sam_dmacallback(DMA_HANDLE handle, void *arg, int result) priv->dmabusy = false; - sam_xfrsample((struct sam_dev_s*)arg, SAMPLENDX_DMA_CALLBACK); + sam_xfrsample((struct sam_dev_s *)arg, SAMPLENDX_DMA_CALLBACK); } #endif @@ -1250,7 +1250,7 @@ static int sam_interrupt(int irq, void *context) /* Loop while there are pending interrupts. */ - for (;;) + for (; ; ) { /* Check the HSMCI status register. Mask out all bits that don't * correspond to enabled interrupts. (This depends on the fact that @@ -1283,13 +1283,13 @@ static int sam_interrupt(int irq, void *context) { /* Yes.. Terminate with a timeout. */ - sam_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_TIMEOUT); + sam_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_TIMEOUT); } else { /* No.. Terminate with an I/O error. */ - sam_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_ERROR); + sam_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_ERROR); } } else @@ -1327,25 +1327,27 @@ static int sam_interrupt(int irq, void *context) { /* Yes.. signal a timeout error */ - wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE|SDIOWAIT_TIMEOUT; + wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE | + SDIOWAIT_TIMEOUT; } else { /* No.. signal some generic I/O error */ - wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE|SDIOWAIT_ERROR; + wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE | + SDIOWAIT_ERROR; } } else { /* The Command-Response sequence ended with no error */ - wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE; + wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE; } - /* Yes.. Is there a thread waiting for this event set? */ + /* Yes.. Is there a thread waiting for this event set? */ - wkupevent &= priv->waitevents; + wkupevent &= priv->waitevents; if (wkupevent != 0) { /* Yes.. wake the thread up */ @@ -1650,13 +1652,13 @@ static int sam_attach(FAR struct sdio_dev_s *dev) static int sam_sendcmd(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t arg) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; uint32_t regval; uint32_t cmdidx; sam_cmdsampleinit(); - /* Set the HSMCI Argument value */ + /* Set the HSMCI Argument value */ putreg32(arg, SAM_HSMCI_ARGR); @@ -1824,7 +1826,7 @@ static void sam_blocksetup(FAR struct sdio_dev_s *dev, unsigned int blocklen, static int sam_cancel(FAR struct sdio_dev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; /* Disable all transfer- and event- related interrupts */ @@ -1883,7 +1885,7 @@ static int sam_cancel(FAR struct sdio_dev_s *dev) static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; uint32_t sr; uint32_t pending; int32_t timeout; @@ -1913,7 +1915,7 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) /* Then wait for the response (or timeout) */ - for (;;) + for (; ; ) { /* Did a Command-Response sequence termination evernt occur? */ @@ -1938,14 +1940,16 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) { /* Yes.. return a timeout error */ - priv->wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE|SDIOWAIT_TIMEOUT; + priv->wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE | + SDIOWAIT_TIMEOUT; return -ETIMEDOUT; } else { /* No.. return some generic I/O error */ - priv->wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE|SDIOWAIT_ERROR; + priv->wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE | + SDIOWAIT_ERROR; return -EIO; } } @@ -1953,7 +1957,7 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) { /* The Command-Response sequence ended with no error */ - priv->wkupevent = SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE; + priv->wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE; return OK; } } @@ -1993,7 +1997,7 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) static int sam_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *rshort) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; int ret = OK; /* These responses could have CRC errors: @@ -2079,7 +2083,7 @@ static int sam_recvshort(FAR struct sdio_dev_s *dev, static int sam_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlong[4]) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; int ret = OK; /* R2 CID, CSD register (136-bit) @@ -2135,7 +2139,7 @@ static int sam_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlong static int sam_recvnotimpl(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *rnotimpl) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; priv->wkupevent = 0; return -ENOSYS; } @@ -2178,7 +2182,7 @@ static int sam_recvnotimpl(FAR struct sdio_dev_s *dev, static void sam_waitenable(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; uint32_t waitmask; DEBUGASSERT(priv != NULL); @@ -2192,7 +2196,7 @@ static void sam_waitenable(FAR struct sdio_dev_s *dev, */ waitmask = 0; - if ((eventset & (SDIOWAIT_CMDDONE|SDIOWAIT_RESPONSEDONE)) != 0) + if ((eventset & (SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE)) != 0) { waitmask |= priv->cmdrmask; } @@ -2237,7 +2241,7 @@ static void sam_waitenable(FAR struct sdio_dev_s *dev, static sdio_eventset_t sam_eventwait(FAR struct sdio_dev_s *dev, uint32_t timeout) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; sdio_eventset_t wkupevent = 0; int ret; @@ -2278,8 +2282,8 @@ static sdio_eventset_t sam_eventwait(FAR struct sdio_dev_s *dev, 1, (uint32_t)priv); if (ret != OK) { - fdbg("ERROR: wd_start failed: %d\n", ret); - } + fdbg("ERROR: wd_start failed: %d\n", ret); + } } /* Loop until the event (or the timeout occurs). Race conditions are avoided @@ -2288,7 +2292,7 @@ static sdio_eventset_t sam_eventwait(FAR struct sdio_dev_s *dev, * may have already occurred before this function was called! */ - for (;;) + for (; ; ) { /* Wait for an event in event set to occur. If this the event has already * occurred, then the semaphore will already have been incremented and @@ -2342,7 +2346,7 @@ static sdio_eventset_t sam_eventwait(FAR struct sdio_dev_s *dev, static void sam_callbackenable(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; fvdbg("eventset: %02x\n", eventset); DEBUGASSERT(priv != NULL); @@ -2376,7 +2380,7 @@ static void sam_callbackenable(FAR struct sdio_dev_s *dev, static int sam_registercallback(FAR struct sdio_dev_s *dev, worker_t callback, void *arg) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; /* Disable callbacks and register this callback and is argument */ @@ -2572,7 +2576,7 @@ static int sam_dmasendsetup(FAR struct sdio_dev_s *dev, static void sam_callback(void *arg) { - struct sam_dev_s *priv = (struct sam_dev_s*)arg; + struct sam_dev_s *priv = (struct sam_dev_s *)arg; /* Is a callback registered? */ @@ -2589,8 +2593,8 @@ static void sam_callback(void *arg) /* Media is present. Is the media inserted event enabled? */ if ((priv->cbevents & SDIOMEDIA_INSERTED) == 0) - { - /* No... return without performing the callback */ + { + /* No... return without performing the callback */ return; } diff --git a/arch/arm/src/sam34/sam_irq.c b/arch/arm/src/sam34/sam_irq.c index 6624c0378a..efc2ad38f5 100644 --- a/arch/arm/src/sam34/sam_irq.c +++ b/arch/arm/src/sam34/sam_irq.c @@ -62,9 +62,9 @@ /* Get a 32-bit version of the default priority */ #define DEFPRIORITY32 \ - (NVIC_SYSH_PRIORITY_DEFAULT << 24 |\ - NVIC_SYSH_PRIORITY_DEFAULT << 16 |\ - NVIC_SYSH_PRIORITY_DEFAULT << 8 |\ + (NVIC_SYSH_PRIORITY_DEFAULT << 24 | \ + NVIC_SYSH_PRIORITY_DEFAULT << 16 | \ + NVIC_SYSH_PRIORITY_DEFAULT << 8 | \ NVIC_SYSH_PRIORITY_DEFAULT) /* Given the address of a NVIC ENABLE register, this is the offset to @@ -310,8 +310,8 @@ static int sam_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit, else { - *regaddr = NVIC_SYSHCON; - if (irq == SAM_IRQ_MEMFAULT) + *regaddr = NVIC_SYSHCON; + if (irq == SAM_IRQ_MEMFAULT) { *bit = NVIC_SYSHCON_MEMFAULTENA; } diff --git a/arch/arm/src/sam34/sam_lowputc.c b/arch/arm/src/sam34/sam_lowputc.c index 54cda81b40..11548c6ef5 100644 --- a/arch/arm/src/sam34/sam_lowputc.c +++ b/arch/arm/src/sam34/sam_lowputc.c @@ -283,7 +283,7 @@ void up_lowputc(char ch) #ifdef HAVE_CONSOLE irqstate_t flags; - for (;;) + for (; ; ) { /* Wait for the transmitter to be available */ diff --git a/arch/arm/src/sam34/sam_rtc.c b/arch/arm/src/sam34/sam_rtc.c index 405a3d40ca..1ad734789b 100644 --- a/arch/arm/src/sam34/sam_rtc.c +++ b/arch/arm/src/sam34/sam_rtc.c @@ -415,7 +415,7 @@ int up_rtcinitialize(void) #endif #if defined(CONFIG_RTC_HIRES) && defined(CONFIG_SAM34_RTT) - /* Using the RTT for subsecond ticks. */ + /* Using the RTT for subsecond ticks. */ sam_rtt_enableclk(); diff --git a/arch/arm/src/sam34/sam_rtt.c b/arch/arm/src/sam34/sam_rtt.c index 577f15ea9a..5a7415f6f2 100644 --- a/arch/arm/src/sam34/sam_rtt.c +++ b/arch/arm/src/sam34/sam_rtt.c @@ -223,20 +223,20 @@ static uint32_t sam34_getreg(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ @@ -317,7 +317,7 @@ static int sam34_interrupt(int irq, FAR void *context) */ lateticks = vr - priv->val; - if (lateticks <= (priv->clkticks>>1)) + if (lateticks <= (priv->clkticks >> 1)) { priv->clkticks -= lateticks; } diff --git a/arch/arm/src/sam34/sam_serial.c b/arch/arm/src/sam34/sam_serial.c index 1b2a00e56d..b5381015d7 100644 --- a/arch/arm/src/sam34/sam_serial.c +++ b/arch/arm/src/sam34/sam_serial.c @@ -692,7 +692,7 @@ static void up_disableallints(struct up_dev_s *priv, uint32_t *imr) static int up_setup(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; #ifndef CONFIG_SUPPRESS_UART_CONFIG uint32_t regval; uint32_t imr; @@ -818,7 +818,7 @@ static int up_setup(struct uart_dev_s *dev) /* Enable receiver & transmitter */ - up_serialout(priv, SAM_UART_CR_OFFSET, (UART_CR_RXEN|UART_CR_TXEN)); + up_serialout(priv, SAM_UART_CR_OFFSET, (UART_CR_RXEN | UART_CR_TXEN)); up_restoreusartint(priv, imr); #endif @@ -837,12 +837,13 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Reset and disable receiver and transmitter */ up_serialout(priv, SAM_UART_CR_OFFSET, - (UART_CR_RSTRX|UART_CR_RSTTX|UART_CR_RXDIS|UART_CR_TXDIS)); + (UART_CR_RSTRX | UART_CR_RSTTX | UART_CR_RXDIS | + UART_CR_TXDIS)); /* Disable all interrupts */ @@ -866,7 +867,7 @@ static void up_shutdown(struct uart_dev_s *dev) static int up_attach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ */ @@ -874,11 +875,11 @@ static int up_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, up_interrupt); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the USART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the USART + */ - up_enable_irq(priv->irq); + up_enable_irq(priv->irq); } return ret; } @@ -895,7 +896,7 @@ static int up_attach(struct uart_dev_s *dev) static void up_detach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disable_irq(priv->irq); irq_detach(priv->irq); } @@ -967,7 +968,7 @@ static int up_interrupt(int irq, void *context) PANIC(); } - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; /* Loop until there are no characters to be transferred or, until we have * been looping for a long time. @@ -990,10 +991,10 @@ static int up_interrupt(int irq, void *context) if ((pending & UART_INT_RXRDY) != 0) { - /* Received data ready... process incoming bytes */ + /* Received data ready... process incoming bytes */ - uart_recvchars(dev); - handled = true; + uart_recvchars(dev); + handled = true; } /* Handle outgoing, transmit bytes. TXRDY: There is no character in the @@ -1002,10 +1003,10 @@ static int up_interrupt(int irq, void *context) if ((pending & UART_INT_TXRDY) != 0) { - /* Transmit data register empty ... process outgoing bytes */ + /* Transmit data register empty ... process outgoing bytes */ - uart_xmitchars(dev); - handled = true; + uart_xmitchars(dev); + handled = true; } } @@ -1033,7 +1034,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct up_dev_s *user = (struct up_dev_s*)arg; + struct up_dev_s *user = (struct up_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -1049,7 +1050,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TERMIOS case TCGETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (!termiosp) @@ -1106,7 +1107,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) case TCSETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t baud; uint32_t imr; @@ -1225,7 +1226,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) static int up_receive(struct uart_dev_s *dev, uint32_t *status) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Return the error information in the saved status */ @@ -1247,7 +1248,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { @@ -1275,7 +1276,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) static bool up_rxavailable(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, SAM_UART_SR_OFFSET) & UART_INT_RXRDY) != 0); } @@ -1289,7 +1290,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_serialout(priv, SAM_UART_THR_OFFSET, (uint32_t)ch); } @@ -1303,7 +1304,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -1344,7 +1345,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) static bool up_txready(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, SAM_UART_SR_OFFSET) & UART_INT_TXRDY) != 0); } @@ -1358,7 +1359,7 @@ static bool up_txready(struct uart_dev_s *dev) static bool up_txempty(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, SAM_UART_SR_OFFSET) & UART_INT_TXEMPTY) != 0); } diff --git a/arch/arm/src/sam34/sam_spi.c b/arch/arm/src/sam34/sam_spi.c index 709330e7ff..706178c925 100644 --- a/arch/arm/src/sam34/sam_spi.c +++ b/arch/arm/src/sam34/sam_spi.c @@ -1302,8 +1302,8 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, if (spics->nbits > 8) { - rxptr16 = (uint16_t*)rxbuffer; - txptr16 = (uint16_t*)txbuffer; + rxptr16 = (uint16_t *)rxbuffer; + txptr16 = (uint16_t *)txbuffer; rxptr8 = NULL; txptr8 = NULL; } @@ -1311,8 +1311,8 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, { rxptr16 = NULL; txptr16 = NULL; - rxptr8 = (uint8_t*)rxbuffer; - txptr8 = (uint8_t*)txbuffer; + rxptr8 = (uint8_t *)rxbuffer; + txptr8 = (uint8_t *)txbuffer; } /* Make sure that any previous transfer is flushed from the hardware */ @@ -1823,7 +1823,7 @@ struct spi_dev_s *up_spiinitialize(int port) } #endif - /* Select the SPI operations */ + /* Select the SPI operations */ #if defined(CONFIG_SAM34_SPI0) && defined(CONFIG_SAM34_SPI1) spics->spidev.ops = spino ? &g_spi1ops : &g_spi0ops; diff --git a/arch/arm/src/sam34/sam_start.c b/arch/arm/src/sam34/sam_start.c index 7b754c2a32..dc1d449808 100644 --- a/arch/arm/src/sam34/sam_start.c +++ b/arch/arm/src/sam34/sam_start.c @@ -67,7 +67,7 @@ static inline void sam_fpuconfig(void); #endif #ifdef CONFIG_STACK_COLORATION static void go_os_start(void *pv, unsigned int nbytes) - __attribute__ ((naked,no_instrument_function,noreturn)); + __attribute__ ((naked, no_instrument_function, noreturn)); #endif #ifdef CONFIG_ARMV7M_STACKCHECK @@ -339,6 +339,6 @@ void __start(void) /* Shouldn't get here */ - for (;;); + for (; ; ); #endif } diff --git a/arch/arm/src/sam34/sam_tc.c b/arch/arm/src/sam34/sam_tc.c index 881dff0c0e..4ab135da3c 100644 --- a/arch/arm/src/sam34/sam_tc.c +++ b/arch/arm/src/sam34/sam_tc.c @@ -205,20 +205,20 @@ static uint32_t sam34_getreg(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ diff --git a/arch/arm/src/sam34/sam_timerisr.c b/arch/arm/src/sam34/sam_timerisr.c index 9efd73a6ad..6ebdc2ffd4 100644 --- a/arch/arm/src/sam34/sam_timerisr.c +++ b/arch/arm/src/sam34/sam_timerisr.c @@ -171,7 +171,8 @@ void up_timer_initialize(void) /* Enable SysTick interrupts */ - putreg32((NVIC_SYSTICK_CTRL_CLKSOURCE|NVIC_SYSTICK_CTRL_TICKINT|NVIC_SYSTICK_CTRL_ENABLE), NVIC_SYSTICK_CTRL); + putreg32((NVIC_SYSTICK_CTRL_CLKSOURCE | NVIC_SYSTICK_CTRL_TICKINT | + NVIC_SYSTICK_CTRL_ENABLE), NVIC_SYSTICK_CTRL); /* And enable the timer interrupt */ diff --git a/arch/arm/src/sam34/sam_udp.c b/arch/arm/src/sam34/sam_udp.c index 2ff77f237c..bc78542d17 100644 --- a/arch/arm/src/sam34/sam_udp.c +++ b/arch/arm/src/sam34/sam_udp.c @@ -3008,7 +3008,7 @@ static struct usbdev_req_s *sam_ep_allocreq(struct usbdev_ep_s *ep) static void sam_ep_freereq(struct usbdev_ep_s *ep, struct usbdev_req_s *req) { - struct sam_req_s *privreq = (struct sam_req_s*)req; + struct sam_req_s *privreq = (struct sam_req_s *)req; #ifdef CONFIG_DEBUG if (!ep || !req) diff --git a/arch/arm/src/sam34/sam_userspace.c b/arch/arm/src/sam34/sam_userspace.c index 7443e602f6..a399d84a72 100644 --- a/arch/arm/src/sam34/sam_userspace.c +++ b/arch/arm/src/sam34/sam_userspace.c @@ -87,8 +87,8 @@ void sam_userspace(void) DEBUGASSERT(USERSPACE->us_bssstart != 0 && USERSPACE->us_bssend != 0 && USERSPACE->us_bssstart <= USERSPACE->us_bssend); - dest = (uint8_t*)USERSPACE->us_bssstart; - end = (uint8_t*)USERSPACE->us_bssend; + dest = (uint8_t *)USERSPACE->us_bssstart; + end = (uint8_t *)USERSPACE->us_bssend; while (dest != end) { @@ -101,9 +101,9 @@ void sam_userspace(void) USERSPACE->us_datastart != 0 && USERSPACE->us_dataend != 0 && USERSPACE->us_datastart <= USERSPACE->us_dataend); - src = (uint8_t*)USERSPACE->us_datasource; - dest = (uint8_t*)USERSPACE->us_datastart; - end = (uint8_t*)USERSPACE->us_dataend; + src = (uint8_t *)USERSPACE->us_datasource; + dest = (uint8_t *)USERSPACE->us_datastart; + end = (uint8_t *)USERSPACE->us_dataend; while (dest != end) { diff --git a/arch/arm/src/sam34/sam_wdt.c b/arch/arm/src/sam34/sam_wdt.c index f34289af4f..eebb503785 100644 --- a/arch/arm/src/sam34/sam_wdt.c +++ b/arch/arm/src/sam34/sam_wdt.c @@ -207,20 +207,20 @@ static uint32_t sam34_getreg(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ diff --git a/arch/arm/src/sama5/sam_allocateheap.c b/arch/arm/src/sama5/sam_allocateheap.c index 0922556ed4..33e4fe1c6a 100644 --- a/arch/arm/src/sama5/sam_allocateheap.c +++ b/arch/arm/src/sama5/sam_allocateheap.c @@ -259,7 +259,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)&_ebss; + *heap_start = (FAR void *)&_ebss; *heap_size = SAMA5_PRIMARY_HEAP_END - (size_t)&_ebss; #else @@ -268,7 +268,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)g_idle_topstack; + *heap_start = (FAR void *)g_idle_topstack; *heap_size = SAMA5_PRIMARY_HEAP_END - g_idle_topstack; #endif } diff --git a/arch/arm/src/sama5/sam_boot.c b/arch/arm/src/sama5/sam_boot.c index 8459bd2c13..58cae33824 100644 --- a/arch/arm/src/sama5/sam_boot.c +++ b/arch/arm/src/sama5/sam_boot.c @@ -277,9 +277,9 @@ static void sam_copyvectorblock(void) * 0xffff0000) */ - src = (uint32_t*)&_vector_start; - end = (uint32_t*)&_vector_end; - dest = (uint32_t*)SAM_VECTOR_VSRAM; + src = (uint32_t *)&_vector_start; + end = (uint32_t *)&_vector_end; + dest = (uint32_t *)SAM_VECTOR_VSRAM; while (src < end) { diff --git a/arch/arm/src/sama5/sam_can.c b/arch/arm/src/sama5/sam_can.c index 9c242e123c..36893a1a38 100644 --- a/arch/arm/src/sama5/sam_can.c +++ b/arch/arm/src/sama5/sam_can.c @@ -397,20 +397,20 @@ static uint32_t can_getreg(FAR struct sam_can_s *priv, int offset) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (priv->count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (priv->count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", priv->count - 3); - } + lldbg("[repeats %d more times]\n", priv->count - 3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - priv->regaddr = regaddr; - priv->regval = regval; - priv->count = 1; + priv->regaddr = regaddr; + priv->regval = regval; + priv->count = 1; } /* Show the register value read */ diff --git a/arch/arm/src/sama5/sam_dbgu.c b/arch/arm/src/sama5/sam_dbgu.c index 2474cc11a8..e232d03009 100644 --- a/arch/arm/src/sama5/sam_dbgu.c +++ b/arch/arm/src/sama5/sam_dbgu.c @@ -290,11 +290,11 @@ static int dbgu_attach(struct uart_dev_s *dev) ret = irq_attach(SAM_IRQ_DBGU, dbgu_interrupt); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the DBGU - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the DBGU + */ - up_enable_irq(SAM_IRQ_DBGU); + up_enable_irq(SAM_IRQ_DBGU); } return ret; @@ -331,7 +331,7 @@ static void dbgu_detach(struct uart_dev_s *dev) static int dbgu_interrupt(int irq, void *context) { struct uart_dev_s *dev = &g_dbgu_port; - struct dbgu_dev_s *priv = (struct dbgu_dev_s*)dev->priv; + struct dbgu_dev_s *priv = (struct dbgu_dev_s *)dev->priv; uint32_t pending; uint32_t imr; int passes; @@ -358,10 +358,10 @@ static int dbgu_interrupt(int irq, void *context) if ((pending & DBGU_INT_RXRDY) != 0) { - /* Received data ready... process incoming bytes */ + /* Received data ready... process incoming bytes */ - uart_recvchars(dev); - handled = true; + uart_recvchars(dev); + handled = true; } /* Handle outgoing, transmit bytes. XRDY: There is no character in the @@ -370,10 +370,10 @@ static int dbgu_interrupt(int irq, void *context) if ((pending & DBGU_INT_TXRDY) != 0) { - /* Transmit data register empty ... process outgoing bytes */ + /* Transmit data register empty ... process outgoing bytes */ - uart_xmitchars(dev); - handled = true; + uart_xmitchars(dev); + handled = true; } } @@ -401,15 +401,15 @@ static int dbgu_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct dbgu_dev_s *user = (struct dbgu_dev_s*)arg; - if (!user) - { - ret = -EINVAL; - } - else - { - memcpy(user, dev, sizeof(struct dbgu_dev_s)); - } + struct dbgu_dev_s *user = (struct dbgu_dev_s *)arg; + if (!user) + { + ret = -EINVAL; + } + else + { + memcpy(user, dev, sizeof(struct dbgu_dev_s)); + } } break; #endif @@ -434,7 +434,7 @@ static int dbgu_ioctl(struct file *filep, int cmd, unsigned long arg) static int dbgu_receive(struct uart_dev_s *dev, uint32_t *status) { - struct dbgu_dev_s *priv = (struct dbgu_dev_s*)dev->priv; + struct dbgu_dev_s *priv = (struct dbgu_dev_s *)dev->priv; /* Return the error information in the saved status */ diff --git a/arch/arm/src/sama5/sam_dmac.c b/arch/arm/src/sama5/sam_dmac.c index 5230ba3ff6..645ec3b031 100644 --- a/arch/arm/src/sama5/sam_dmac.c +++ b/arch/arm/src/sama5/sam_dmac.c @@ -1895,7 +1895,7 @@ void sam_dmainitialize(struct sam_dmac_s *dmac) /* Enable the DMA controller */ - sam_putdmac(dmac,DMAC_EN_ENABLE, SAM_DMAC_EN_OFFSET); + sam_putdmac(dmac, DMAC_EN_ENABLE, SAM_DMAC_EN_OFFSET); /* Initialize semaphores */ @@ -2032,7 +2032,7 @@ DMA_HANDLE sam_dmachannel(uint8_t dmacno, uint32_t chflags) * disable register */ - sam_putdmac(dmac,DMAC_CHDR_DIS(chndx), SAM_DMAC_CHDR_OFFSET); + sam_putdmac(dmac, DMAC_CHDR_DIS(chndx), SAM_DMAC_CHDR_OFFSET); /* Set the DMA channel flags. */ diff --git a/arch/arm/src/sama5/sam_ehci.c b/arch/arm/src/sama5/sam_ehci.c index cf622bd039..47b98cb21c 100644 --- a/arch/arm/src/sama5/sam_ehci.c +++ b/arch/arm/src/sama5/sam_ehci.c @@ -3235,16 +3235,17 @@ static int sam_ehci_tophalf(int irq, FAR void *context) #ifdef CONFIG_SAMA5_OHCI static int sam_uhphs_interrupt(int irq, FAR void *context) { - int ohci; - int ehci; + int ohci; + int ehci; - /* Provide the interrupting event to both the EHCI and OHCI top half */ - ohci = sam_ohci_tophalf(irq, context); - ehci = sam_ehci_tophalf(irq, context); + /* Provide the interrupting event to both the EHCI and OHCI top half */ - /* Return OK only if both handlers returned OK */ + ohci = sam_ohci_tophalf(irq, context); + ehci = sam_ehci_tophalf(irq, context); - return ohci == OK ? ehci : ohci; + /* Return OK only if both handlers returned OK */ + + return ohci == OK ? ehci : ohci; } #endif @@ -3287,7 +3288,7 @@ static int sam_wait(FAR struct usbhost_connection_s *conn, */ flags = irqsave(); - for (;;) + for (; ; ) { /* Check for a change in the connection state on any root hub port */ diff --git a/arch/arm/src/sama5/sam_emaca.c b/arch/arm/src/sama5/sam_emaca.c index bb4af13a93..a6b01eb8d3 100644 --- a/arch/arm/src/sama5/sam_emaca.c +++ b/arch/arm/src/sama5/sam_emaca.c @@ -2115,7 +2115,7 @@ static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac) if (regval == 0 && sam_getreg(priv, regaddr2) == 0) { - /* Yes.. disable all address matching */ + /* Yes.. disable all address matching */ regval = sam_getreg(priv, SAM_EMAC_NCFGR); regval &= ~(EMAC_NCFGR_UNIHEN | EMAC_NCFGR_MTIHEN); @@ -2773,7 +2773,7 @@ static int sam_autonegotiate(struct sam_emac_s *priv) /* Check AutoNegotiate complete */ timeout = 0; - for (;;) + for (; ; ) { ret = sam_phyread(priv, priv->phyaddr, MII_MSR, &msr); if (ret < 0) @@ -3102,15 +3102,15 @@ static void sam_txreset(struct sam_emac_s *priv) priv->txtail = 0; for (ndx = 0; ndx < CONFIG_SAMA5_EMAC_NTXBUFFERS; ndx++) - { - bufaddr = (uint32_t)(&(txbuffer[ndx * EMAC_TX_UNITSIZE])); + { + bufaddr = (uint32_t)(&(txbuffer[ndx * EMAC_TX_UNITSIZE])); - /* Set the buffer address and mark the descriptor as in used by firmware */ + /* Set the buffer address and mark the descriptor as in used by firmware */ - physaddr = sam_physramaddr(bufaddr); - txdesc[ndx].addr = physaddr; - txdesc[ndx].status = EMACTXD_STA_USED; - } + physaddr = sam_physramaddr(bufaddr); + txdesc[ndx].addr = physaddr; + txdesc[ndx].status = EMACTXD_STA_USED; + } /* Mark the final descriptor in the list */ @@ -3164,18 +3164,18 @@ static void sam_rxreset(struct sam_emac_s *priv) priv->rxndx = 0; for (ndx = 0; ndx < CONFIG_SAMA5_EMAC_NRXBUFFERS; ndx++) - { - bufaddr = (uintptr_t)(&(rxbuffer[ndx * EMAC_RX_UNITSIZE])); - DEBUGASSERT((bufaddr & ~EMACRXD_ADDR_MASK) == 0); + { + bufaddr = (uintptr_t)(&(rxbuffer[ndx * EMAC_RX_UNITSIZE])); + DEBUGASSERT((bufaddr & ~EMACRXD_ADDR_MASK) == 0); - /* Set the buffer address and remove EMACRXD_ADDR_OWNER and - * EMACRXD_ADDR_WRAP. - */ + /* Set the buffer address and remove EMACRXD_ADDR_OWNER and + * EMACRXD_ADDR_WRAP. + */ - physaddr = sam_physramaddr(bufaddr); - rxdesc[ndx].addr = physaddr; - rxdesc[ndx].status = 0; - } + physaddr = sam_physramaddr(bufaddr); + rxdesc[ndx].addr = physaddr; + rxdesc[ndx].status = 0; + } /* Mark the final descriptor in the list */ @@ -3480,17 +3480,17 @@ int sam_emac_initialize(void) /* Initialize the driver structure */ memset(priv, 0, sizeof(struct sam_emac_s)); - priv->dev.d_ifup = sam_ifup; /* I/F up (new IP address) callback */ - priv->dev.d_ifdown = sam_ifdown; /* I/F down callback */ - priv->dev.d_txavail = sam_txavail; /* New TX data callback */ + priv->dev.d_ifup = sam_ifup; /* I/F up (new IP address) callback */ + priv->dev.d_ifdown = sam_ifdown; /* I/F down callback */ + priv->dev.d_txavail = sam_txavail; /* New TX data callback */ #ifdef CONFIG_NET_IGMP - priv->dev.d_addmac = sam_addmac; /* Add multicast MAC address */ - priv->dev.d_rmmac = sam_rmmac; /* Remove multicast MAC address */ + priv->dev.d_addmac = sam_addmac; /* Add multicast MAC address */ + priv->dev.d_rmmac = sam_rmmac; /* Remove multicast MAC address */ #endif #ifdef CONFIG_NETDEV_PHY_IOCTL - priv->dev.d_ioctl = sam_ioctl; /* Support PHY ioctl() calls */ + priv->dev.d_ioctl = sam_ioctl; /* Support PHY ioctl() calls */ #endif - priv->dev.d_private = (void*)&g_emac; /* Used to recover private state from dev */ + priv->dev.d_private = (void *)&g_emac; /* Used to recover private state from dev */ /* Create a watchdog for timing polling for and timing of transmissions */ @@ -3502,7 +3502,7 @@ int sam_emac_initialize(void) goto errout; } - priv->txtimeout = wd_create(); /* Create TX timeout timer */ + priv->txtimeout = wd_create(); /* Create TX timeout timer */ if (!priv->txtimeout) { ndbg("ERROR: Failed to create periodic poll timer\n"); diff --git a/arch/arm/src/sama5/sam_emacb.c b/arch/arm/src/sama5/sam_emacb.c index a8ae8b0b49..a84f3bf2e7 100644 --- a/arch/arm/src/sama5/sam_emacb.c +++ b/arch/arm/src/sama5/sam_emacb.c @@ -1517,15 +1517,15 @@ static int sam_recvframe(struct sam_emac_s *priv) priv->rxndx = rxndx; } - /* Process the next buffer */ + /* Process the next buffer */ - rxdesc = &priv->rxdesc[rxndx]; + rxdesc = &priv->rxdesc[rxndx]; - /* Invalidate the RX descriptor to force re-fetching from RAM */ + /* Invalidate the RX descriptor to force re-fetching from RAM */ - arch_invalidate_dcache((uintptr_t)rxdesc, - (uintptr_t)rxdesc + sizeof(struct emac_rxdesc_s)); - } + arch_invalidate_dcache((uintptr_t)rxdesc, + (uintptr_t)rxdesc + sizeof(struct emac_rxdesc_s)); + } /* No packet was found */ @@ -1636,7 +1636,7 @@ static void sam_receive(struct sam_emac_s *priv) */ if (priv->dev.d_len > 0) - { + { /* Update the Ethernet header with the correct MAC address */ #ifdef CONFIG_NET_IPv4 @@ -2860,7 +2860,7 @@ static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac) if (regval == 0 && sam_getreg(priv, regoffset2) == 0) { - /* Yes.. disable all address matching */ + /* Yes.. disable all address matching */ regval = sam_getreg(priv, SAM_EMAC_NCFGR_OFFSET); regval &= ~(EMAC_NCFGR_UNIHEN | EMAC_NCFGR_MTIHEN); @@ -3637,7 +3637,7 @@ static int sam_autonegotiate(struct sam_emac_s *priv) /* Check AutoNegotiate complete */ timeout = 0; - for (;;) + for (; ; ) { ret = sam_phyread(priv, priv->phyaddr, MII_MSR, &msr); if (ret < 0) @@ -3998,9 +3998,9 @@ static inline void sam_ethgpioconfig(struct sam_emac_s *priv) } else #endif - { - nvdbg("ERROR: emac=%d\n", priv->attr->emac); - } + { + nvdbg("ERROR: emac=%d\n", priv->attr->emac); + } } /**************************************************************************** @@ -4040,15 +4040,15 @@ static void sam_txreset(struct sam_emac_s *priv) priv->txtail = 0; for (ndx = 0; ndx < priv->attr->ntxbuffers; ndx++) - { - bufaddr = (uint32_t)(&(txbuffer[ndx * EMAC_TX_UNITSIZE])); + { + bufaddr = (uint32_t)(&(txbuffer[ndx * EMAC_TX_UNITSIZE])); - /* Set the buffer address and mark the descriptor as in used by firmware */ + /* Set the buffer address and mark the descriptor as in used by firmware */ - physaddr = sam_physramaddr(bufaddr); - txdesc[ndx].addr = physaddr; - txdesc[ndx].status = EMACTXD_STA_USED; - } + physaddr = sam_physramaddr(bufaddr); + txdesc[ndx].addr = physaddr; + txdesc[ndx].status = EMACTXD_STA_USED; + } /* Mark the final descriptor in the list */ @@ -4102,18 +4102,18 @@ static void sam_rxreset(struct sam_emac_s *priv) priv->rxndx = 0; for (ndx = 0; ndx < priv->attr->nrxbuffers; ndx++) - { - bufaddr = (uintptr_t)(&(rxbuffer[ndx * EMAC_RX_UNITSIZE])); - DEBUGASSERT((bufaddr & ~EMACRXD_ADDR_MASK) == 0); + { + bufaddr = (uintptr_t)(&(rxbuffer[ndx * EMAC_RX_UNITSIZE])); + DEBUGASSERT((bufaddr & ~EMACRXD_ADDR_MASK) == 0); - /* Set the buffer address and remove EMACRXD_ADDR_OWNER and - * EMACRXD_ADDR_WRAP. - */ + /* Set the buffer address and remove EMACRXD_ADDR_OWNER and + * EMACRXD_ADDR_WRAP. + */ - physaddr = sam_physramaddr(bufaddr); - rxdesc[ndx].addr = physaddr; - rxdesc[ndx].status = 0; - } + physaddr = sam_physramaddr(bufaddr); + rxdesc[ndx].addr = physaddr; + rxdesc[ndx].status = 0; + } /* Mark the final descriptor in the list */ diff --git a/arch/arm/src/sama5/sam_flexcom_serial.c b/arch/arm/src/sama5/sam_flexcom_serial.c index 97d11e0dbf..d377fdae56 100644 --- a/arch/arm/src/sama5/sam_flexcom_serial.c +++ b/arch/arm/src/sama5/sam_flexcom_serial.c @@ -558,7 +558,7 @@ static int flexus_interrupt(struct uart_dev_s *dev) bool handled; DEBUGASSERT(dev != NULL && dev->priv != NULL); - priv = (struct flexus_dev_s*)dev->priv; + priv = (struct flexus_dev_s *)dev->priv; /* Loop until there are no characters to be transferred or, until we have * been looping for a long time. @@ -581,10 +581,10 @@ static int flexus_interrupt(struct uart_dev_s *dev) if ((pending & FLEXUS_INT_RXRDY) != 0) { - /* Received data ready... process incoming bytes */ + /* Received data ready... process incoming bytes */ - uart_recvchars(dev); - handled = true; + uart_recvchars(dev); + handled = true; } /* Handle outgoing, transmit bytes. XRDY: There is no character in the @@ -593,10 +593,10 @@ static int flexus_interrupt(struct uart_dev_s *dev) if ((pending & FLEXUS_INT_TXRDY) != 0) { - /* Transmit data register empty ... process outgoing bytes */ + /* Transmit data register empty ... process outgoing bytes */ - uart_xmitchars(dev); - handled = true; + uart_xmitchars(dev); + handled = true; } } @@ -655,7 +655,7 @@ static int flexus4_interrupt(int irq, void *context) static int flexus_setup(struct uart_dev_s *dev) { - struct flexus_dev_s *priv = (struct flexus_dev_s*)dev->priv; + struct flexus_dev_s *priv = (struct flexus_dev_s *)dev->priv; #ifndef CONFIG_SUPPRESS_UART_CONFIG uint32_t regval; @@ -768,7 +768,7 @@ static int flexus_setup(struct uart_dev_s *dev) static void flexus_shutdown(struct uart_dev_s *dev) { - struct flexus_dev_s *priv = (struct flexus_dev_s*)dev->priv; + struct flexus_dev_s *priv = (struct flexus_dev_s *)dev->priv; /* Reset and disable receiver and transmitter */ @@ -798,7 +798,7 @@ static void flexus_shutdown(struct uart_dev_s *dev) static int flexus_attach(struct uart_dev_s *dev) { - struct flexus_dev_s *priv = (struct flexus_dev_s*)dev->priv; + struct flexus_dev_s *priv = (struct flexus_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ */ @@ -806,11 +806,11 @@ static int flexus_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, priv->handler); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the USART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the USART + */ - up_enable_irq(priv->irq); + up_enable_irq(priv->irq); } return ret; @@ -828,7 +828,7 @@ static int flexus_attach(struct uart_dev_s *dev) static void flexus_detach(struct uart_dev_s *dev) { - struct flexus_dev_s *priv = (struct flexus_dev_s*)dev->priv; + struct flexus_dev_s *priv = (struct flexus_dev_s *)dev->priv; up_disable_irq(priv->irq); irq_detach(priv->irq); } @@ -854,7 +854,7 @@ static int flexus_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct flexus_dev_s *user = (struct flexus_dev_s*)arg; + struct flexus_dev_s *user = (struct flexus_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -870,8 +870,8 @@ static int flexus_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TERMIOS case TCGETS: { - struct termios *termiosp = (struct termios*)arg; - struct flexus_dev_s *priv = (struct flexus_dev_s *)dev->priv; + struct termios *termiosp = (struct termios *)arg; + struct flexus_dev_s *priv = (struct flexus_dev_s *)dev->priv; if (!termiosp) { @@ -927,8 +927,8 @@ static int flexus_ioctl(struct file *filep, int cmd, unsigned long arg) case TCSETS: { - struct termios *termiosp = (struct termios*)arg; - struct flexus_dev_s *priv = (struct flexus_dev_s *)dev->priv; + struct termios *termiosp = (struct termios *)arg; + struct flexus_dev_s *priv = (struct flexus_dev_s *)dev->priv; uint32_t baud; uint32_t imr; uint8_t parity; @@ -1046,7 +1046,7 @@ static int flexus_ioctl(struct file *filep, int cmd, unsigned long arg) static int flexus_receive(struct uart_dev_s *dev, uint32_t *status) { - struct flexus_dev_s *priv = (struct flexus_dev_s*)dev->priv; + struct flexus_dev_s *priv = (struct flexus_dev_s *)dev->priv; /* Return the error information in the saved status */ @@ -1068,7 +1068,7 @@ static int flexus_receive(struct uart_dev_s *dev, uint32_t *status) static void flexus_rxint(struct uart_dev_s *dev, bool enable) { - struct flexus_dev_s *priv = (struct flexus_dev_s*)dev->priv; + struct flexus_dev_s *priv = (struct flexus_dev_s *)dev->priv; if (enable) { @@ -1096,7 +1096,7 @@ static void flexus_rxint(struct uart_dev_s *dev, bool enable) static bool flexus_rxavailable(struct uart_dev_s *dev) { - struct flexus_dev_s *priv = (struct flexus_dev_s*)dev->priv; + struct flexus_dev_s *priv = (struct flexus_dev_s *)dev->priv; return ((flexus_serialin(priv, SAM_FLEXUS_CSR_OFFSET) & FLEXUS_INT_RXRDY) != 0); } @@ -1110,7 +1110,7 @@ static bool flexus_rxavailable(struct uart_dev_s *dev) static void flexus_send(struct uart_dev_s *dev, int ch) { - struct flexus_dev_s *priv = (struct flexus_dev_s*)dev->priv; + struct flexus_dev_s *priv = (struct flexus_dev_s *)dev->priv; flexus_serialout(priv, SAM_FLEXUS_THR_OFFSET, (uint32_t)ch); } @@ -1124,7 +1124,7 @@ static void flexus_send(struct uart_dev_s *dev, int ch) static void flexus_txint(struct uart_dev_s *dev, bool enable) { - struct flexus_dev_s *priv = (struct flexus_dev_s*)dev->priv; + struct flexus_dev_s *priv = (struct flexus_dev_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -1165,7 +1165,7 @@ static void flexus_txint(struct uart_dev_s *dev, bool enable) static bool flexus_txready(struct uart_dev_s *dev) { - struct flexus_dev_s *priv = (struct flexus_dev_s*)dev->priv; + struct flexus_dev_s *priv = (struct flexus_dev_s *)dev->priv; return ((flexus_serialin(priv, SAM_FLEXUS_CSR_OFFSET) & FLEXUS_INT_TXRDY) != 0); } @@ -1179,7 +1179,7 @@ static bool flexus_txready(struct uart_dev_s *dev) static bool flexus_txempty(struct uart_dev_s *dev) { - struct flexus_dev_s *priv = (struct flexus_dev_s*)dev->priv; + struct flexus_dev_s *priv = (struct flexus_dev_s *)dev->priv; return ((flexus_serialin(priv, SAM_FLEXUS_CSR_OFFSET) & FLEXUS_INT_TXEMPTY) != 0); } diff --git a/arch/arm/src/sama5/sam_gmac.c b/arch/arm/src/sama5/sam_gmac.c index ce6eaeb69b..0313f5b6bb 100644 --- a/arch/arm/src/sama5/sam_gmac.c +++ b/arch/arm/src/sama5/sam_gmac.c @@ -1093,7 +1093,7 @@ static int sam_recvframe(struct sam_gmac_s *priv) arch_invalidate_dcache((uintptr_t)rxdesc, (uintptr_t)rxdesc + sizeof(struct gmac_rxdesc_s)); - } + } /* No packet was found */ @@ -1204,7 +1204,7 @@ static void sam_receive(struct sam_gmac_s *priv) */ if (priv->dev.d_len > 0) - { + { /* Update the Ethernet header with the correct MAC address */ #ifdef CONFIG_NET_IPv4 @@ -1685,9 +1685,9 @@ static int sam_ifup(struct net_driver_s *dev) return ret; } #else - /* Just force the configured link speed */ + /* Just force the configured link speed */ - sam_linkspeed(priv); + sam_linkspeed(priv); #endif /* Enable normal MAC operation */ @@ -2070,7 +2070,7 @@ static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac) if (regval == 0 && sam_getreg(priv, regaddr2) == 0) { - /* Yes.. disable all address matching */ + /* Yes.. disable all address matching */ regval = sam_getreg(priv, SAM_GMAC_NCFGR); regval &= ~(GMAC_NCFGR_UNIHEN | GMAC_NCFGR_MTIHEN); @@ -2778,7 +2778,7 @@ static int sam_autonegotiate(struct sam_gmac_s *priv) /* Wait for autonegotion to complete */ timeout = 0; - for (;;) + for (; ; ) { ret = sam_phyread(priv, priv->phyaddr, GMII_MSR, &phyval); if (ret < 0) @@ -2813,7 +2813,7 @@ static int sam_autonegotiate(struct sam_gmac_s *priv) linkmode = 0; /* 10Base-T Half-Duplex */ timeout = 0; - for (;;) + for (; ; ) { ret = sam_phyread(priv, priv->phyaddr, GMII_1000BTSR, &btsr); if (ret < 0) @@ -3212,18 +3212,18 @@ static void sam_rxreset(struct sam_gmac_s *priv) priv->rxndx = 0; for (ndx = 0; ndx < CONFIG_SAMA5_GMAC_NRXBUFFERS; ndx++) - { - bufaddr = (uintptr_t)(&(rxbuffer[ndx * GMAC_RX_UNITSIZE])); - DEBUGASSERT((bufaddr & ~GMACRXD_ADDR_MASK) == 0); + { + bufaddr = (uintptr_t)(&(rxbuffer[ndx * GMAC_RX_UNITSIZE])); + DEBUGASSERT((bufaddr & ~GMACRXD_ADDR_MASK) == 0); - /* Set the buffer address and remove GMACRXD_ADDR_OWNER and - * GMACRXD_ADDR_WRAP. - */ + /* Set the buffer address and remove GMACRXD_ADDR_OWNER and + * GMACRXD_ADDR_WRAP. + */ - physaddr = sam_physramaddr(bufaddr); - rxdesc[ndx].addr = physaddr; - rxdesc[ndx].status = 0; - } + physaddr = sam_physramaddr(bufaddr); + rxdesc[ndx].addr = physaddr; + rxdesc[ndx].status = 0; + } /* Mark the final descriptor in the list */ @@ -3552,17 +3552,17 @@ int sam_gmac_initialize(void) /* Initialize the driver structure */ memset(priv, 0, sizeof(struct sam_gmac_s)); - priv->dev.d_ifup = sam_ifup; /* I/F up (new IP address) callback */ - priv->dev.d_ifdown = sam_ifdown; /* I/F down callback */ - priv->dev.d_txavail = sam_txavail; /* New TX data callback */ + priv->dev.d_ifup = sam_ifup; /* I/F up (new IP address) callback */ + priv->dev.d_ifdown = sam_ifdown; /* I/F down callback */ + priv->dev.d_txavail = sam_txavail; /* New TX data callback */ #ifdef CONFIG_NET_IGMP - priv->dev.d_addmac = sam_addmac; /* Add multicast MAC address */ - priv->dev.d_rmmac = sam_rmmac; /* Remove multicast MAC address */ + priv->dev.d_addmac = sam_addmac; /* Add multicast MAC address */ + priv->dev.d_rmmac = sam_rmmac; /* Remove multicast MAC address */ #endif #ifdef CONFIG_NETDEV_PHY_IOCTL - priv->dev.d_ioctl = sam_ioctl; /* Support PHY ioctl() calls */ + priv->dev.d_ioctl = sam_ioctl; /* Support PHY ioctl() calls */ #endif - priv->dev.d_private = (void*)&g_gmac; /* Used to recover private state from dev */ + priv->dev.d_private = (void *)&g_gmac; /* Used to recover private state from dev */ /* Create a watchdog for timing polling for and timing of transmisstions */ @@ -3574,7 +3574,7 @@ int sam_gmac_initialize(void) goto errout; } - priv->txtimeout = wd_create(); /* Create TX timeout timer */ + priv->txtimeout = wd_create(); /* Create TX timeout timer */ if (!priv->txtimeout) { nlldbg("ERROR: Failed to create periodic poll timer\n"); diff --git a/arch/arm/src/sama5/sam_hsmci.c b/arch/arm/src/sama5/sam_hsmci.c index d90176cb8a..84a654f151 100644 --- a/arch/arm/src/sama5/sam_hsmci.c +++ b/arch/arm/src/sama5/sam_hsmci.c @@ -1509,7 +1509,7 @@ static int sam_hsmci_interrupt(struct sam_dev_s *priv) /* Loop while there are pending interrupts. */ - for (;;) + for (; ; ) { /* Check the HSMCI status register. Mask out all bits that don't * correspond to enabled interrupts. (This depends on the fact that @@ -1634,9 +1634,9 @@ static int sam_hsmci_interrupt(struct sam_dev_s *priv) wkupevent = SDIOWAIT_CMDDONE | SDIOWAIT_RESPONSEDONE; } - /* Yes.. Is there a thread waiting for this event set? */ + /* Yes.. Is there a thread waiting for this event set? */ - wkupevent &= priv->waitevents; + wkupevent &= priv->waitevents; if (wkupevent != 0) { /* Yes.. wake the thread up */ @@ -1849,10 +1849,10 @@ static void sam_clock(FAR struct sdio_dev_s *dev, enum sdio_clock_e rate) regval = sam_getreg(priv, SAM_HSMCI_MR_OFFSET); regval &= ~(HSMCI_MR_CLKDIV_MASK | HSMCI_MR_PWSDIV_MASK | HSMCI_MR_CLKODD); - /* These clock devisor values that must be defined in the board-specific - * board.h header file: HSMCI_INIT_CLKDIV, HSMCI_MMCXFR_CLKDIV, - * HSMCI_SDXFR_CLKDIV, and HSMCI_SDWIDEXFR_CLKDIV. - */ + /* These clock devisor values that must be defined in the board-specific + * board.h header file: HSMCI_INIT_CLKDIV, HSMCI_MMCXFR_CLKDIV, + * HSMCI_SDXFR_CLKDIV, and HSMCI_SDWIDEXFR_CLKDIV. + */ switch (rate) { @@ -1988,13 +1988,13 @@ static int sam_attach(FAR struct sdio_dev_s *dev) static int sam_sendcmd(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t arg) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; uint32_t regval; uint32_t cmdidx; sam_cmdsampleinit(priv); - /* Set the HSMCI Argument value */ + /* Set the HSMCI Argument value */ sam_putreg(priv, arg, SAM_HSMCI_ARGR_OFFSET); @@ -2182,7 +2182,7 @@ static int sam_recvsetup(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, /* Save the destination buffer information for use by the interrupt handler */ - priv->buffer = (uint32_t*)buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = buflen; /* And enable interrupts */ @@ -2287,7 +2287,7 @@ static int sam_sendsetup(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer, static int sam_cancel(FAR struct sdio_dev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; /* Disable all transfer- and event- related interrupts */ @@ -2340,7 +2340,7 @@ static int sam_cancel(FAR struct sdio_dev_s *dev) static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; uint32_t sr; uint32_t pending; int32_t timeout; @@ -2370,7 +2370,7 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) /* Then wait for the response (or timeout) */ - for (;;) + for (; ; ) { /* Did a Command-Response sequence termination evernt occur? */ @@ -2452,7 +2452,7 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) static int sam_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *rshort) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; int ret = OK; /* These responses could have CRC errors: @@ -2538,17 +2538,17 @@ static int sam_recvshort(FAR struct sdio_dev_s *dev, static int sam_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlong[4]) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; int ret = OK; - /* R2 CID, CSD register (136-bit) - * 135 0 Start bit - * 134 0 Transmission bit (0=from card) - * 133:128 bit5 - bit0 Reserved - * 127:1 bit127 - bit1 127-bit CID or CSD register - * (including internal CRC) - * 0 1 End bit - */ + /* R2 CID, CSD register (136-bit) + * 135 0 Start bit + * 134 0 Transmission bit (0=from card) + * 133:128 bit5 - bit0 Reserved + * 127:1 bit127 - bit1 127-bit CID or CSD register + * (including internal CRC) + * 0 1 End bit + */ #ifdef CONFIG_DEBUG /* Check that R1 is the correct response to this command */ @@ -2594,7 +2594,7 @@ static int sam_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlong static int sam_recvnotimpl(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *rnotimpl) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; priv->wkupevent = 0; return -ENOSYS; } @@ -2637,7 +2637,7 @@ static int sam_recvnotimpl(FAR struct sdio_dev_s *dev, static void sam_waitenable(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; uint32_t waitmask; DEBUGASSERT(priv != NULL); @@ -2696,7 +2696,7 @@ static void sam_waitenable(FAR struct sdio_dev_s *dev, static sdio_eventset_t sam_eventwait(FAR struct sdio_dev_s *dev, uint32_t timeout) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; sdio_eventset_t wkupevent = 0; int ret; @@ -2756,7 +2756,7 @@ static sdio_eventset_t sam_eventwait(FAR struct sdio_dev_s *dev, * may have already occurred before this function was called! */ - for (;;) + for (; ; ) { /* Wait for an event in event set to occur. If this the event has already * occurred, then the semaphore will already have been incremented and @@ -2810,7 +2810,7 @@ static sdio_eventset_t sam_eventwait(FAR struct sdio_dev_s *dev, static void sam_callbackenable(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; fvdbg("eventset: %02x\n", eventset); DEBUGASSERT(priv != NULL); @@ -2844,7 +2844,7 @@ static void sam_callbackenable(FAR struct sdio_dev_s *dev, static int sam_registercallback(FAR struct sdio_dev_s *dev, worker_t callback, void *arg) { - struct sam_dev_s *priv = (struct sam_dev_s*)dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; /* Disable callbacks and register this callback and is argument */ @@ -2949,7 +2949,7 @@ static int sam_dmarecvsetup(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, paddr += sizeof(uint32_t); maddr += blocksize; - } + } /* Enable DMA handshaking */ @@ -3045,7 +3045,7 @@ static int sam_dmasendsetup(FAR struct sdio_dev_s *dev, paddr += sizeof(uint32_t); maddr += blocksize; - } + } /* Enable DMA handshaking */ @@ -3088,7 +3088,7 @@ static int sam_dmasendsetup(FAR struct sdio_dev_s *dev, static void sam_callback(void *arg) { - struct sam_dev_s *priv = (struct sam_dev_s*)arg; + struct sam_dev_s *priv = (struct sam_dev_s *)arg; irqstate_t flags; int ret; @@ -3108,8 +3108,8 @@ static void sam_callback(void *arg) /* Media is present. Is the media inserted event enabled? */ if ((priv->cbevents & SDIOMEDIA_INSERTED) == 0) - { - /* No... return without performing the callback */ + { + /* No... return without performing the callback */ return; } @@ -3135,7 +3135,7 @@ static void sam_callback(void *arg) /* This function is called either from (1) the context of the calling * thread or from the the context of (2) card detection logic. The * caller may or may not have interrupts disabled (we have them - & disabled here!). + * disabled here!). * * So to minimize the possibility of recursive behavior and to assure * that callback is always performed outside of the interrupt handling diff --git a/arch/arm/src/sama5/sam_lcd.c b/arch/arm/src/sama5/sam_lcd.c index 9ea92e0451..c41d880d54 100644 --- a/arch/arm/src/sama5/sam_lcd.c +++ b/arch/arm/src/sama5/sam_lcd.c @@ -1409,7 +1409,7 @@ static int sam_setclut(struct sam_layer_s *layer, end = offset + len; if (end > (layer->offset + layer->nclut)) { - layer->nclut = end - layer->offset;offset + layer->nclut = end - layer->offset; } /* Get the offset address to the first CLUT entry to modify */ @@ -3041,7 +3041,7 @@ void fb_uninitialize(void) void sam_lcdclear(nxgl_mxpixel_t color) { #if SAMA5_LCDC_BASE_BPP == 16 - uint16_t *dest = (uint16_t*)LAYER_BASE.framebuffer; + uint16_t *dest = (uint16_t *)LAYER_BASE.framebuffer; int i; gvdbg("Clearing display: BPP=16 color=%04x framebuffer=%08x size=%d\n", @@ -3052,7 +3052,7 @@ void sam_lcdclear(nxgl_mxpixel_t color) *dest++ = (uint16_t)color; } #elif SAMA5_LCDC_BASE_BPP == 24 - uint8_t *dest = (uint8_t*)LAYER_BASE.framebuffer; + uint8_t *dest = (uint8_t *)LAYER_BASE.framebuffer; uint8_t r; uint8_t g; uint8_t b; @@ -3072,7 +3072,7 @@ void sam_lcdclear(nxgl_mxpixel_t color) *dest++ = r; } #elif SAMA5_LCDC_BASE_BPP == 32 - uint32_t *dest = (uint32_t*)LAYER_BASE.framebuffer; + uint32_t *dest = (uint32_t *)LAYER_BASE.framebuffer; int i; gvdbg("Clearing display: BPP=32 color=%08x framebuffer=%08x size=%d\n", diff --git a/arch/arm/src/sama5/sam_lowputc.c b/arch/arm/src/sama5/sam_lowputc.c index e169ce59e1..c0413c259f 100644 --- a/arch/arm/src/sama5/sam_lowputc.c +++ b/arch/arm/src/sama5/sam_lowputc.c @@ -241,7 +241,7 @@ void up_lowputc(char ch) #if defined(SAMA5_HAVE_UART_CONSOLE) || defined(SAMA5_HAVE_USART_CONSOLE) irqstate_t flags; - for (;;) + for (; ; ) { /* Wait for the transmitter to be available */ @@ -269,7 +269,7 @@ void up_lowputc(char ch) #elif defined(SAMA5_HAVE_FLEXCOM_CONSOLE) irqstate_t flags; - for (;;) + for (; ; ) { /* Wait for the transmitter to be available */ @@ -297,7 +297,7 @@ void up_lowputc(char ch) #elif defined(CONFIG_SAMA5_DBGU_CONSOLE) irqstate_t flags; - for (;;) + for (; ; ) { /* Wait for the transmitter to be available */ diff --git a/arch/arm/src/sama5/sam_nand.c b/arch/arm/src/sama5/sam_nand.c index c6d5e8e1d3..3a5e90afc7 100644 --- a/arch/arm/src/sama5/sam_nand.c +++ b/arch/arm/src/sama5/sam_nand.c @@ -1098,11 +1098,11 @@ static int hsmc_interrupt(int irq, void *context) nand_putreg(SAM_HSMC_IDR, HSMC_NFCINT_CMDDONE); } - /* If set to one, the RBEDGE0 flag indicates that an edge has been detected - * on the Ready/Busy Line x. Depending on the EDGE CTRL field located in the - * SMC_CFG register, only rising or falling edge is detected. This flag is - * reset after the status read. - */ + /* If set to one, the RBEDGE0 flag indicates that an edge has been detected + * on the Ready/Busy Line x. Depending on the EDGE CTRL field located in the + * SMC_CFG register, only rising or falling edge is detected. This flag is + * reset after the status read. + */ if (g_nand.rbedge && (imr & HSMC_NFCINT_RBEDGE0) != 0) { @@ -2267,7 +2267,7 @@ static int nand_writepage_noecc(struct sam_nandcs_s *priv, off_t block, { nand_nfc_cleale(priv, HSMC_CLE_WRITE_EN | HSMC_ALE_COL_EN | HSMC_ALE_ROW_EN, - COMMAND_WRITE_1,0, pagesize, rowaddr); + COMMAND_WRITE_1, 0, pagesize, rowaddr); ret = nand_write(priv, (uint8_t *)spare, sparesize, 0); if (ret < 0) diff --git a/arch/arm/src/sama5/sam_ohci.c b/arch/arm/src/sama5/sam_ohci.c index acb5492519..986a29f891 100644 --- a/arch/arm/src/sama5/sam_ohci.c +++ b/arch/arm/src/sama5/sam_ohci.c @@ -704,7 +704,7 @@ static struct sam_ed_s *sam_edalloc(void) ed = (struct sam_ed_s *)g_edfree; if (ed) { - g_edfree = ((struct sam_list_s*)ed)->flink; + g_edfree = ((struct sam_list_s *)ed)->flink; } return ed; @@ -755,7 +755,7 @@ static struct sam_gtd_s *sam_tdalloc(void) ret = (struct sam_gtd_s *)g_tdfree; if (ret) { - g_tdfree = ((struct sam_list_s*)ret)->flink; + g_tdfree = ((struct sam_list_s *)ret)->flink; } irqrestore(flags); @@ -800,7 +800,7 @@ static uint8_t *sam_tballoc(void) uint8_t *ret = (uint8_t *)g_tbfree; if (ret) { - g_tbfree = ((struct sam_list_s*)ret)->flink; + g_tbfree = ((struct sam_list_s *)ret)->flink; } return ret; @@ -2025,10 +2025,10 @@ static void sam_rhsc_bottomhalf(void) rhport->connected = false; - /* Set the port speed to the default (FULL). We cannot - * yet free the function address. That has to be done - * by the class when responds to the disconnection. - */ + /* Set the port speed to the default (FULL). We cannot + * yet free the function address. That has to be done + * by the class when responds to the disconnection. + */ rhport->hport.hport.speed = USB_SPEED_FULL; @@ -2341,7 +2341,7 @@ static int sam_wait(struct usbhost_connection_s *conn, */ flags = irqsave(); - for (;;) + for (; ; ) { /* Check for a change in the connection state on any root hub port */ @@ -2697,7 +2697,7 @@ static int sam_epalloc(struct usbhost_driver_s *drvr, /* Configure the endpoint descriptor. */ - memset((void*)ed, 0, sizeof(struct sam_ed_s)); + memset((void *)ed, 0, sizeof(struct sam_ed_s)); ed->hw.ctrl = (uint32_t)(hport->funcaddr) << ED_CONTROL_FA_SHIFT | (uint32_t)(epdesc->addr) << ED_CONTROL_EN_SHIFT | @@ -3114,7 +3114,7 @@ static int sam_ctrlin(struct usbhost_driver_s *drvr, usbhost_ep_t ep0, sam_takesem(&g_ohci.exclsem); len = sam_getle16(req->len); - ret = sam_ctrltd(rhport, eplist, GTD_STATUS_DP_SETUP, (uint8_t*)req, + ret = sam_ctrltd(rhport, eplist, GTD_STATUS_DP_SETUP, (uint8_t *)req, USB_SIZEOF_CTRLREQ); if (ret == OK) { @@ -3163,14 +3163,14 @@ static int sam_ctrlout(struct usbhost_driver_s *drvr, usbhost_ep_t ep0, sam_takesem(&g_ohci.exclsem); len = sam_getle16(req->len); - ret = sam_ctrltd(rhport, eplist, GTD_STATUS_DP_SETUP, (uint8_t*)req, + ret = sam_ctrltd(rhport, eplist, GTD_STATUS_DP_SETUP, (uint8_t *)req, USB_SIZEOF_CTRLREQ); if (ret == OK) { if (len) { ret = sam_ctrltd(rhport, eplist, GTD_STATUS_DP_OUT, - (uint8_t*)buffer, len); + (uint8_t *)buffer, len); } if (ret == OK) @@ -3193,7 +3193,7 @@ static int sam_ctrlout(struct usbhost_driver_s *drvr, usbhost_ep_t ep0, * Input Parameters: * rhport - Internal driver root hub port state structure. * eplist - The internal representation of the device endpoint on which - * to perform the transfer. + * to perform the transfer. * buffer - A buffer containing the data to be sent (OUT endpoint) or received * (IN endpoint). buffer must have been allocated using DRVR_ALLOC * buflen - The length of the data to be sent or received. @@ -3973,7 +3973,7 @@ struct usbhost_connection_s *sam_ohci_initialize(int controller) /* Initialize all the HCCA to 0 */ - memset((void*)&g_hcca, 0, sizeof(struct ohci_hcca_s)); + memset((void *)&g_hcca, 0, sizeof(struct ohci_hcca_s)); arch_clean_dcache((uint32_t)&g_hcca, (uint32_t)&g_hcca + sizeof(struct ohci_hcca_s)); diff --git a/arch/arm/src/sama5/sam_pioirq.c b/arch/arm/src/sama5/sam_pioirq.c index de4eec38ad..2d9950168e 100644 --- a/arch/arm/src/sama5/sam_pioirq.c +++ b/arch/arm/src/sama5/sam_pioirq.c @@ -406,57 +406,57 @@ void sam_pioirq(pio_pinset_t pinset) regval = getreg32(base + SAM_PIO_ISLR_OFFSET); if ((pinset & PIO_INT_SECURE) != 0) - { - /* Yes.. make sure that the corresponding bit in ISLR is cleared */ + { + /* Yes.. make sure that the corresponding bit in ISLR is cleared */ - regval &= ~pin; - } - else - { - /* Yes.. make sure that the corresponding bit in ISLR is set */ + regval &= ~pin; + } + else + { + /* Yes.. make sure that the corresponding bit in ISLR is set */ - regval |= pin; - } + regval |= pin; + } - putreg32(regval, base + SAM_PIO_ISLR_OFFSET); + putreg32(regval, base + SAM_PIO_ISLR_OFFSET); #endif - /* Are any additional interrupt modes selected? */ + /* Are any additional interrupt modes selected? */ - if ((pinset & _PIO_INT_AIM) != 0) - { - /* Yes.. Enable additional interrupt mode */ + if ((pinset & _PIO_INT_AIM) != 0) + { + /* Yes.. Enable additional interrupt mode */ - putreg32(pin, base + SAM_PIO_AIMER_OFFSET); + putreg32(pin, base + SAM_PIO_AIMER_OFFSET); - /* Level or edge detected interrupt? */ + /* Level or edge detected interrupt? */ - if ((pinset & _PIO_INT_LEVEL) != 0) - { - putreg32(pin, base + SAM_PIO_LSR_OFFSET); /* Level */ - } - else - { - putreg32(pin, base + SAM_PIO_ESR_OFFSET); /* Edge */ - } + if ((pinset & _PIO_INT_LEVEL) != 0) + { + putreg32(pin, base + SAM_PIO_LSR_OFFSET); /* Level */ + } + else + { + putreg32(pin, base + SAM_PIO_ESR_OFFSET); /* Edge */ + } /* High level/rising edge or low level /falling edge? */ - if ((pinset & _PIO_INT_RH) != 0) - { - putreg32(pin, base + SAM_PIO_REHLSR_OFFSET); /* High level/Rising edge */ - } - else - { - putreg32(pin, base + SAM_PIO_FELLSR_OFFSET); /* Low level/Falling edge */ - } - } - else - { - /* No.. Disable additional interrupt mode */ + if ((pinset & _PIO_INT_RH) != 0) + { + putreg32(pin, base + SAM_PIO_REHLSR_OFFSET); /* High level/Rising edge */ + } + else + { + putreg32(pin, base + SAM_PIO_FELLSR_OFFSET); /* Low level/Falling edge */ + } + } + else + { + /* No.. Disable additional interrupt mode */ - putreg32(pin, base + SAM_PIO_AIMDR_OFFSET); - } + putreg32(pin, base + SAM_PIO_AIMDR_OFFSET); + } #if defined(SAM_PIO_ISLR_OFFSET) /* Disable writing to PIO registers */ @@ -480,10 +480,10 @@ void sam_pioirqenable(int irq) if (sam_irqbase(irq, &base, &pin) == OK) { - /* Clear (all) pending interrupts and enable this pin interrupt */ + /* Clear (all) pending interrupts and enable this pin interrupt */ - //(void)getreg32(base + SAM_PIO_ISR_OFFSET); - putreg32((1 << pin), base + SAM_PIO_IER_OFFSET); + //(void)getreg32(base + SAM_PIO_ISR_OFFSET); + putreg32((1 << pin), base + SAM_PIO_IER_OFFSET); } } @@ -502,9 +502,9 @@ void sam_pioirqdisable(int irq) if (sam_irqbase(irq, &base, &pin) == OK) { - /* Disable this pin interrupt */ + /* Disable this pin interrupt */ - putreg32((1 << pin), base + SAM_PIO_IDR_OFFSET); + putreg32((1 << pin), base + SAM_PIO_IDR_OFFSET); } } diff --git a/arch/arm/src/sama5/sam_pmecc.c b/arch/arm/src/sama5/sam_pmecc.c index b1f24333ab..8dfee40e3a 100644 --- a/arch/arm/src/sama5/sam_pmecc.c +++ b/arch/arm/src/sama5/sam_pmecc.c @@ -493,11 +493,11 @@ static uint32_t pmecc_getsigma(void) /* Check if one operand of the multiplier is null, its index is -1 */ - else if (g_pmecc.desc.smu[i+1][k] && si[ 2 * (i - 1) + 3 - k]) + else if (g_pmecc.desc.smu[i + 1][k] && si[2 * (i - 1) + 3 - k]) { dmu[i + 1] = - g_pmecc.desc.alphato[(g_pmecc.desc.indexof[g_pmecc.desc.smu[ i + 1 ][ k ]] + - g_pmecc.desc.indexof[si[ 2 * (i - 1) + 3 - k]]) % g_pmecc.desc.nn] ^ dmu[ i + 1]; + g_pmecc.desc.alphato[(g_pmecc.desc.indexof[g_pmecc.desc.smu[i + 1][k]] + + g_pmecc.desc.indexof[si[2 * (i - 1) + 3 - k]]) % g_pmecc.desc.nn] ^ dmu[i + 1]; } } } @@ -635,24 +635,24 @@ static uint32_t pmecc_errorcorrection(uintptr_t sectorbase, fdbg("Correct error bit @[Byte %d, Bit %d]\n", (int)bytepos, (int)bitpos); - if (*(uint8_t*)(sectorbase + bytepos) & (1 << bitpos)) + if (*(uint8_t *)(sectorbase + bytepos) & (1 << bitpos)) { - *(uint8_t*)(sectorbase + bytepos) &= (0xff ^ (1 << bitpos)); + *(uint8_t *)(sectorbase + bytepos) &= (0xff ^ (1 << bitpos)); } else { - *(uint8_t*)(sectorbase + bytepos) |= (1 << bitpos); + *(uint8_t *)(sectorbase + bytepos) |= (1 << bitpos); } } else { - if (*(uint8_t*)(sectorbase + bytepos + eccsize) & (1 << bitpos)) + if (*(uint8_t *)(sectorbase + bytepos + eccsize) & (1 << bitpos)) { - *(uint8_t*)(sectorbase + bytepos + eccsize) &= (0xff ^ (1 << bitpos)); + *(uint8_t *)(sectorbase + bytepos + eccsize) &= (0xff ^ (1 << bitpos)); } else { - *(uint8_t*)(sectorbase + bytepos + eccsize) |= (1 << bitpos); + *(uint8_t *)(sectorbase + bytepos + eccsize) |= (1 << bitpos); } } } @@ -1442,8 +1442,8 @@ void pmecc_buildgf(uint32_t mm, int16_t *indexof, int16_t *alphato) /* Second * * Build elements from 0 to mm - 1. Very easy because degree is less than - * mm so it is just a logical shift ! (only the remainder) - */ + * mm so it is just a logical shift ! (only the remainder) + */ mask = 1; for (i = 0; i < mm; i++) diff --git a/arch/arm/src/sama5/sam_serial.c b/arch/arm/src/sama5/sam_serial.c index f007e69810..fb384e0a29 100644 --- a/arch/arm/src/sama5/sam_serial.c +++ b/arch/arm/src/sama5/sam_serial.c @@ -998,7 +998,7 @@ static int up_interrupt(struct uart_dev_s *dev) bool handled; DEBUGASSERT(dev != NULL && dev->priv != NULL); - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; /* Loop until there are no characters to be transferred or, until we have * been looping for a long time. @@ -1021,10 +1021,10 @@ static int up_interrupt(struct uart_dev_s *dev) if ((pending & UART_INT_RXRDY) != 0) { - /* Received data ready... process incoming bytes */ + /* Received data ready... process incoming bytes */ - uart_recvchars(dev); - handled = true; + uart_recvchars(dev); + handled = true; } /* Handle outgoing, transmit bytes. XRDY: There is no character in the @@ -1033,10 +1033,10 @@ static int up_interrupt(struct uart_dev_s *dev) if ((pending & UART_INT_TXRDY) != 0) { - /* Transmit data register empty ... process outgoing bytes */ + /* Transmit data register empty ... process outgoing bytes */ - uart_xmitchars(dev); - handled = true; + uart_xmitchars(dev); + handled = true; } } @@ -1115,7 +1115,7 @@ static int up_usart4_interrupt(int irq, void *context) static int up_setup(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; #ifndef CONFIG_SUPPRESS_UART_CONFIG uint32_t regval; @@ -1259,7 +1259,7 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Reset and disable receiver and transmitter */ @@ -1289,7 +1289,7 @@ static void up_shutdown(struct uart_dev_s *dev) static int up_attach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ */ @@ -1297,11 +1297,11 @@ static int up_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, priv->handler); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the USART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the USART + */ - up_enable_irq(priv->irq); + up_enable_irq(priv->irq); } return ret; @@ -1319,7 +1319,7 @@ static int up_attach(struct uart_dev_s *dev) static void up_detach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disable_irq(priv->irq); irq_detach(priv->irq); } @@ -1345,7 +1345,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct up_dev_s *user = (struct up_dev_s*)arg; + struct up_dev_s *user = (struct up_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -1361,7 +1361,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TERMIOS case TCGETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (!termiosp) @@ -1418,7 +1418,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) case TCSETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t baud; uint32_t imr; @@ -1537,7 +1537,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) static int up_receive(struct uart_dev_s *dev, uint32_t *status) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Return the error information in the saved status */ @@ -1559,7 +1559,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { @@ -1587,7 +1587,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) static bool up_rxavailable(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, SAM_UART_SR_OFFSET) & UART_INT_RXRDY) != 0); } @@ -1601,7 +1601,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_serialout(priv, SAM_UART_THR_OFFSET, (uint32_t)ch); } @@ -1615,7 +1615,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -1656,7 +1656,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) static bool up_txready(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, SAM_UART_SR_OFFSET) & UART_INT_TXRDY) != 0); } @@ -1670,7 +1670,7 @@ static bool up_txready(struct uart_dev_s *dev) static bool up_txempty(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, SAM_UART_SR_OFFSET) & UART_INT_TXEMPTY) != 0); } diff --git a/arch/arm/src/sama5/sam_serialinit.c b/arch/arm/src/sama5/sam_serialinit.c index 0e2bd8eeb3..59c25ed285 100644 --- a/arch/arm/src/sama5/sam_serialinit.c +++ b/arch/arm/src/sama5/sam_serialinit.c @@ -101,7 +101,7 @@ void up_serialinit(void) flexus_serialinit(); #endif -/* Register the DBGU as well */ + /* Register the DBGU as well */ #ifdef CONFIG_SAMA5_DBGU sam_dbgu_register(); diff --git a/arch/arm/src/sama5/sam_spi.c b/arch/arm/src/sama5/sam_spi.c index 0cba1bf66d..812120d04c 100644 --- a/arch/arm/src/sama5/sam_spi.c +++ b/arch/arm/src/sama5/sam_spi.c @@ -1284,8 +1284,8 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, { struct sam_spics_s *spics = (struct sam_spics_s *)dev; struct sam_spidev_s *spi = spi_device(spics); - uint8_t *rxptr = (uint8_t*)rxbuffer; - uint8_t *txptr = (uint8_t*)txbuffer; + uint8_t *rxptr = (uint8_t *)rxbuffer; + uint8_t *txptr = (uint8_t *)txbuffer; uint32_t pcs; uint32_t data; @@ -1754,7 +1754,7 @@ struct spi_dev_s *up_spiinitialize(int port) } #endif - /* Select the SPI operations */ + /* Select the SPI operations */ #if defined(CONFIG_SAMA5_SPI0) && defined(CONFIG_SAMA5_SPI1) spics->spidev.ops = spino ? &g_spi1ops : &g_spi0ops; diff --git a/arch/arm/src/sama5/sam_ssc.c b/arch/arm/src/sama5/sam_ssc.c index bc5fa8fe4e..c04e23d3d5 100644 --- a/arch/arm/src/sama5/sam_ssc.c +++ b/arch/arm/src/sama5/sam_ssc.c @@ -3359,7 +3359,7 @@ static void ssc1_configure(struct sam_ssc_s *priv) #if defined(CONFIG_SAMA5_SSC1_TX_TKOUTPUT_CONT) priv->txout = SSC_CLKOUT_CONT; /* Continuous */ #elif defined(CONFIG_SAMA5_SSC1_TX_TKOUTPUT_XFR) - priv->txout = SSC_CLKOUT_XFER;/* Only output clock during transfers */ + priv->txout = SSC_CLKOUT_XFER; /* Only output clock during transfers */ #else /* if defined(CONFIG_SAMA5_SSC1_TX_TKOUTPUT_NONE) */ priv->txout = SSC_CLKOUT_NONE; /* No output clock */ #endif diff --git a/arch/arm/src/sama5/sam_trng.c b/arch/arm/src/sama5/sam_trng.c index 0480d2e6e4..1be5585bc4 100644 --- a/arch/arm/src/sama5/sam_trng.c +++ b/arch/arm/src/sama5/sam_trng.c @@ -100,7 +100,7 @@ static const struct file_operations g_trngops = 0, /* seek */ 0 /* ioctl */ #ifndef CONFIG_DISABLE_POLL - ,0 /* poll */ + , 0 /* poll */ #endif }; @@ -130,7 +130,7 @@ static int sam_interrupt(int irq, void *context) * that we will loop here. */ - for (;;) + for (; ; ) { /* Read the random sample (before checking DATRDY -- but probably not * necessary) diff --git a/arch/arm/src/sama5/sam_tsd.c b/arch/arm/src/sama5/sam_tsd.c index 2f930effe6..818de96599 100644 --- a/arch/arm/src/sama5/sam_tsd.c +++ b/arch/arm/src/sama5/sam_tsd.c @@ -334,7 +334,7 @@ static int sam_tsd_sample(struct sam_tsd_s *priv, struct sam_sample_s *sample) /* First report -- next report will be a movement */ priv->sample.contact = CONTACT_MOVE; - } + } priv->penchange = false; ret = OK; @@ -399,7 +399,7 @@ static int sam_tsd_waitsample(struct sam_tsd_s *priv, struct sam_sample_s *sampl ivdbg("Sampled\n"); - /* Re-acquire the semaphore that manages mutually exclusive access to + /* Re-acquire the semaphore that manages mutually exclusive access to * the device structure. We may have to wait here. But we have our sample. * Interrupts and pre-emption will be re-enabled while we wait. */ @@ -571,15 +571,15 @@ static void sam_tsd_bottomhalf(void *arg) priv->sample.contact = CONTACT_UP; - /* Stop periodic trigger & enable pen */ + /* Stop periodic trigger & enable pen */ - sam_tsd_setaverage(priv, ADC_TSMR_TSAV_NOFILTER); - sam_tsd_debounce(priv, BOARD_TSD_DEBOUNCE); + sam_tsd_setaverage(priv, ADC_TSMR_TSAV_NOFILTER); + sam_tsd_debounce(priv, BOARD_TSD_DEBOUNCE); - regval = sam_adc_getreg(priv->adc, SAM_ADC_TRGR); - regval &= ~ADC_TRGR_TRGMOD_MASK; - regval |= ADC_TRGR_TRGMOD_PEN; - sam_adc_putreg(priv->adc, SAM_ADC_TRGR, regval); + regval = sam_adc_getreg(priv->adc, SAM_ADC_TRGR); + regval &= ~ADC_TRGR_TRGMOD_MASK; + regval |= ADC_TRGR_TRGMOD_PEN; + sam_adc_putreg(priv->adc, SAM_ADC_TRGR, regval); } /* It is a pen down event. If the last loss-of-contact event has not been @@ -697,7 +697,7 @@ static void sam_tsd_bottomhalf(void *arg) priv->threshx = x; priv->threshy = y; - /* Update the x/y position in the sample data */ + /* Update the x/y position in the sample data */ priv->sample.x = MIN(x, UINT16_MAX); priv->sample.y = MIN(y, UINT16_MAX); @@ -958,7 +958,7 @@ static ssize_t sam_tsd_read(struct file *filep, char *buffer, size_t len) { ret = -EAGAIN; goto errout; - } + } /* Wait for sample data */ @@ -990,10 +990,10 @@ static ssize_t sam_tsd_read(struct file *filep, char *buffer, size_t len) if (sample.contact == CONTACT_UP) { - /* Pen is now up. Is the positional data valid? This is important - * to know because the release will be sent to the window based on - * its last positional data. - */ + /* Pen is now up. Is the positional data valid? This is important + * to know because the release will be sent to the window based on + * its last positional data. + */ if (sample.valid) { @@ -1441,10 +1441,10 @@ static void sam_tsd_debounce(struct sam_tsd_s *priv, uint32_t time) div = 1000000000; while (div > 1 && (time % 10) == 0) - { + { time /= 10; div /= 10; - } + } clk = BOARD_ADCCLK_FREQUENCY; while (div > 1 && (clk % 10) == 0) diff --git a/arch/arm/src/sama5/sam_udphs.c b/arch/arm/src/sama5/sam_udphs.c index 6394c389b3..54aa82d63b 100644 --- a/arch/arm/src/sama5/sam_udphs.c +++ b/arch/arm/src/sama5/sam_udphs.c @@ -4557,7 +4557,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver) sam_pullup(&priv->usbdev, true); priv->usbdev.speed = USB_SPEED_FULL; - } + } return ret; } diff --git a/arch/arm/src/sama5/sam_wdt.c b/arch/arm/src/sama5/sam_wdt.c index cf4cda8110..7bac126f09 100644 --- a/arch/arm/src/sama5/sam_wdt.c +++ b/arch/arm/src/sama5/sam_wdt.c @@ -209,20 +209,20 @@ static uint32_t sam_getreg(uintptr_t regaddr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = regaddr; - preval = regval; - count = 1; + prevaddr = regaddr; + preval = regval; + count = 1; } /* Show the register value read */ diff --git a/arch/arm/src/sama5/sam_xdmac.c b/arch/arm/src/sama5/sam_xdmac.c index 2936dec8d9..69fed83d0c 100644 --- a/arch/arm/src/sama5/sam_xdmac.c +++ b/arch/arm/src/sama5/sam_xdmac.c @@ -1859,10 +1859,10 @@ static int sam_xdmac_interrupt(struct sam_xdmac_s *xdmac) if ((chpending & XDMAC_CHINT_ERRORS) != 0) { - /* Yes... Terminate the transfer with an error? */ + /* Yes... Terminate the transfer with an error? */ - dmalldbg("ERROR: DMA failed: %08x\n", chpending); - sam_dmaterminate(xdmach, -EIO); + dmalldbg("ERROR: DMA failed: %08x\n", chpending); + sam_dmaterminate(xdmach, -EIO); } /* Is the transfer complete? */ diff --git a/arch/arm/src/sama5/sama5d2x_memorymap.c b/arch/arm/src/sama5/sama5d2x_memorymap.c index 8eeb4b34ac..e73281cabd 100644 --- a/arch/arm/src/sama5/sama5d2x_memorymap.c +++ b/arch/arm/src/sama5/sama5d2x_memorymap.c @@ -81,7 +81,7 @@ const struct section_mapping_s g_section_mapping[] = * 0x0000:00000. VBAR == 0x0000:0000. * * This method is used when booting from ISRAM or NOR FLASH. In - & that case, vectors must lie at the beginning of NOFR FLASH. + * that case, vectors must lie at the beginning of NOFR FLASH. * * 3. Set the Cortex-A5 VBAR register so that the vector table address * is moved to a location other than 0x0000:0000. @@ -180,7 +180,7 @@ const struct section_mapping_s g_section_mapping[] = }, #endif -/* SAMA5 CS1-3 External Memories */ + /* SAMA5 CS1-3 External Memories */ #ifdef CONFIG_SAMA5_EBICS1 { SAM_EBICS1_PSECTION, SAM_EBICS1_VSECTION, @@ -251,13 +251,13 @@ const struct section_mapping_s g_section_mapping[] = SAM_PERIPHC_MMUFLAGS, SAM_PERIPHC_NSECTIONS }, -/* LCDC Framebuffer. This entry reprograms a part of one of the above - * regions, making it non-cacheable and non-buffereable. - * - * If SDRAM will be reconfigured, then we will defer setup of the framebuffer - * until after the SDRAM remapping (since the framebuffer problem resides) in - * SDRAM. - */ + /* LCDC Framebuffer. This entry reprograms a part of one of the above + * regions, making it non-cacheable and non-buffereable. + * + * If SDRAM will be reconfigured, then we will defer setup of the framebuffer + * until after the SDRAM remapping (since the framebuffer problem resides) in + * SDRAM. + */ #if defined(CONFIG_SAMA5_LCDC) && !defined(NEED_SDRAM_REMAPPING) { CONFIG_SAMA5_LCDC_FB_PBASE, CONFIG_SAMA5_LCDC_FB_VBASE, diff --git a/arch/arm/src/sama5/sama5d3x_memorymap.c b/arch/arm/src/sama5/sama5d3x_memorymap.c index f21b3c1312..229d2e8132 100644 --- a/arch/arm/src/sama5/sama5d3x_memorymap.c +++ b/arch/arm/src/sama5/sama5d3x_memorymap.c @@ -81,7 +81,7 @@ const struct section_mapping_s g_section_mapping[] = * 0x0000:00000. VBAR == 0x0000:0000. * * This method is used when booting from ISRAM or NOR FLASH. In - & that case, vectors must lie at the beginning of NOFR FLASH. + * that case, vectors must lie at the beginning of NOFR FLASH. * * 3. Set the Cortex-A5 VBAR register so that the vector table address * is moved to a location other than 0x0000:0000. @@ -177,7 +177,7 @@ const struct section_mapping_s g_section_mapping[] = }, #endif -/* SAMA5 CS1-3 External Memories */ + /* SAMA5 CS1-3 External Memories */ #ifdef CONFIG_SAMA5_EBICS1 { SAM_EBICS1_PSECTION, SAM_EBICS1_VSECTION, @@ -220,13 +220,13 @@ const struct section_mapping_s g_section_mapping[] = SAM_SYSC_MMUFLAGS, SAM_SYSC_NSECTIONS }, -/* LCDC Framebuffer. This entry reprograms a part of one of the above - * regions, making it non-cacheable and non-buffereable. - * - * If SDRAM will be reconfigured, then we will defer setup of the framebuffer - * until after the SDRAM remapping (since the framebuffer problem resides) in - * SDRAM. - */ + /* LCDC Framebuffer. This entry reprograms a part of one of the above + * regions, making it non-cacheable and non-buffereable. + * + * If SDRAM will be reconfigured, then we will defer setup of the framebuffer + * until after the SDRAM remapping (since the framebuffer problem resides) in + * SDRAM. + */ #if defined(CONFIG_SAMA5_LCDC) && !defined(NEED_SDRAM_REMAPPING) { CONFIG_SAMA5_LCDC_FB_PBASE, CONFIG_SAMA5_LCDC_FB_VBASE, diff --git a/arch/arm/src/sama5/sama5d4x_memorymap.c b/arch/arm/src/sama5/sama5d4x_memorymap.c index 3c3854e037..8d63ea70d5 100644 --- a/arch/arm/src/sama5/sama5d4x_memorymap.c +++ b/arch/arm/src/sama5/sama5d4x_memorymap.c @@ -81,7 +81,7 @@ const struct section_mapping_s g_section_mapping[] = * 0x0000:00000. VBAR == 0x0000:0000. * * This method is used when booting from ISRAM or NOR FLASH. In - & that case, vectors must lie at the beginning of NOFR FLASH. + * that case, vectors must lie at the beginning of NOFR FLASH. * * 3. Set the Cortex-A5 VBAR register so that the vector table address * is moved to a location other than 0x0000:0000. @@ -183,7 +183,7 @@ const struct section_mapping_s g_section_mapping[] = }, #endif -/* SAMA5 CS1-3 External Memories */ + /* SAMA5 CS1-3 External Memories */ #ifdef CONFIG_SAMA5_EBICS1 { SAM_EBICS1_PSECTION, SAM_EBICS1_VSECTION, @@ -224,13 +224,13 @@ const struct section_mapping_s g_section_mapping[] = SAM_PERIPHC_MMUFLAGS, SAM_PERIPHC_NSECTIONS }, -/* LCDC Framebuffer. This entry reprograms a part of one of the above - * regions, making it non-cacheable and non-buffereable. - * - * If SDRAM will be reconfigured, then we will defer setup of the framebuffer - * until after the SDRAM remapping (since the framebuffer problem resides) in - * SDRAM. - */ + /* LCDC Framebuffer. This entry reprograms a part of one of the above + * regions, making it non-cacheable and non-buffereable. + * + * If SDRAM will be reconfigured, then we will defer setup of the framebuffer + * until after the SDRAM remapping (since the framebuffer problem resides) in + * SDRAM. + */ #if defined(CONFIG_SAMA5_LCDC) && !defined(NEED_SDRAM_REMAPPING) { CONFIG_SAMA5_LCDC_FB_PBASE, CONFIG_SAMA5_LCDC_FB_VBASE, diff --git a/arch/arm/src/samdl/sam_dmac.c b/arch/arm/src/samdl/sam_dmac.c index b79b2f5778..0085b17396 100644 --- a/arch/arm/src/samdl/sam_dmac.c +++ b/arch/arm/src/samdl/sam_dmac.c @@ -122,7 +122,7 @@ static int sam_dmainterrupt(int irq, void *context); static struct dma_desc_s *sam_alloc_desc(struct sam_dmach_s *dmach); static struct dma_desc_s *sam_append_desc(struct sam_dmach_s *dmach, uint16_t btctrl, uint16_t btcnt, - uint32_t srcaddr,uint32_t dstaddr); + uint32_t srcaddr, uint32_t dstaddr); static void sam_free_desc(struct sam_dmach_s *dmach); static size_t sam_maxtransfer(struct sam_dmach_s *dmach); static uint16_t sam_bytes2beats(struct sam_dmach_s *dmach, size_t nbytes); @@ -153,7 +153,7 @@ static struct sam_dmach_s g_dmach[SAMDL_NDMACHAN]; */ static struct dma_desc_s g_base_desc[SAMDL_NDMACHAN] - __attribute__ ((section(".lpram"),aligned(16))); + __attribute__ ((section(".lpram"), aligned(16))); #define g_writeback_desc g_base_desc #if CONFIG_SAMDL_DMAC_NDESC > 0 @@ -162,7 +162,7 @@ static struct dma_desc_s g_base_desc[SAMDL_NDMACHAN] */ static struct dma_desc_s g_dma_desc[CONFIG_SAMDL_DMAC_NDESC] - __attribute__ ((section(".lpram"),aligned(16))); + __attribute__ ((section(".lpram"), aligned(16))); #endif /**************************************************************************** diff --git a/arch/arm/src/samdl/sam_serial.c b/arch/arm/src/samdl/sam_serial.c index ea8e9affc6..a3352796b2 100644 --- a/arch/arm/src/samdl/sam_serial.c +++ b/arch/arm/src/samdl/sam_serial.c @@ -557,7 +557,7 @@ static void sam_disableallints(struct sam_dev_s *priv) static int sam_interrupt(struct uart_dev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv;; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; uint8_t pending; uint8_t intflag; uint8_t inten; @@ -591,9 +591,9 @@ static int sam_interrupt(struct uart_dev_s *dev) if ((pending & USART_INT_DRE) != 0) { - /* Transmit data register empty ... process outgoing bytes */ + /* Transmit data register empty ... process outgoing bytes */ - uart_xmitchars(dev); + uart_xmitchars(dev); } return OK; @@ -729,11 +729,11 @@ static int sam_attach(struct uart_dev_s *dev) ret = irq_attach(config->irq, priv->handler); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the USART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the USART + */ - up_enable_irq(config->irq); + up_enable_irq(config->irq); } return ret; diff --git a/arch/arm/src/samdl/sam_spi.c b/arch/arm/src/samdl/sam_spi.c index afd51e98c4..cce36cf9e8 100644 --- a/arch/arm/src/samdl/sam_spi.c +++ b/arch/arm/src/samdl/sam_spi.c @@ -799,7 +799,7 @@ static void spi_dumpregs(struct sam_spidev_s *priv, const char *msg) #if 0 /* Not used */ static int spi_interrupt(struct sam_spidev_s *dev) { - struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv;; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; uint8_t pending; uint8_t intflag; uint8_t inten; @@ -832,7 +832,7 @@ static int spi_interrupt(struct sam_spidev_s *dev) if ((pending & SPI_INT_DRE) != 0) { - /* Transmit data register empty ... process outgoing bytes */ + /* Transmit data register empty ... process outgoing bytes */ #warning Missing logic } diff --git a/arch/arm/src/samdl/sam_start.c b/arch/arm/src/samdl/sam_start.c index ef2d81dc7f..e31a1b274d 100644 --- a/arch/arm/src/samdl/sam_start.c +++ b/arch/arm/src/samdl/sam_start.c @@ -174,5 +174,5 @@ void __start(void) /* Shoulnd't get here */ - for (;;); + for (; ; ); } diff --git a/arch/arm/src/samv7/sam_allocateheap.c b/arch/arm/src/samv7/sam_allocateheap.c index f092d0767f..65ba3f425f 100644 --- a/arch/arm/src/samv7/sam_allocateheap.c +++ b/arch/arm/src/samv7/sam_allocateheap.c @@ -293,7 +293,7 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size) * that was not dedicated to the user heap). */ - *heap_start = (FAR void*)USERSPACE->us_bssend; + *heap_start = (FAR void *)USERSPACE->us_bssend; *heap_size = ubase - (uintptr_t)USERSPACE->us_bssend; } #endif @@ -317,7 +317,7 @@ void up_addregion(void) /* Add the region */ - kumm_addregion((FAR void*)SAM_SDRAMCS_BASE, CONFIG_SAMV7_SDRAMSIZE); + kumm_addregion((FAR void *)SAM_SDRAMCS_BASE, CONFIG_SAMV7_SDRAMSIZE); #endif /* HAVE_SDRAM_REGION */ diff --git a/arch/arm/src/samv7/sam_emac.c b/arch/arm/src/samv7/sam_emac.c index 2807714af4..b7eab4a95c 100644 --- a/arch/arm/src/samv7/sam_emac.c +++ b/arch/arm/src/samv7/sam_emac.c @@ -1827,17 +1827,17 @@ static int sam_recvframe(struct sam_emac_s *priv, int qid) xfrq->rxndx = rxndx; } - /* Set-up to process the next fragment. Get the RX descriptor - * associated with the next fragment. - */ + /* Set-up to process the next fragment. Get the RX descriptor + * associated with the next fragment. + */ - rxdesc = &xfrq->rxdesc[rxndx]; + rxdesc = &xfrq->rxdesc[rxndx]; - /* Invalidate the RX descriptor to force re-fetching from RAM */ + /* Invalidate the RX descriptor to force re-fetching from RAM */ - arch_invalidate_dcache((uintptr_t)rxdesc, - (uintptr_t)rxdesc + sizeof(struct emac_rxdesc_s)); - } + arch_invalidate_dcache((uintptr_t)rxdesc, + (uintptr_t)rxdesc + sizeof(struct emac_rxdesc_s)); + } /* No packet was found */ @@ -1949,7 +1949,7 @@ static void sam_receive(struct sam_emac_s *priv, int qid) */ if (priv->dev.d_len > 0) - { + { /* Update the Ethernet header with the correct MAC address */ #ifdef CONFIG_NET_IPv4 @@ -3290,7 +3290,7 @@ static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac) if (regval == 0 && sam_getreg(priv, regoffset2) == 0) { - /* Yes.. disable all address matching */ + /* Yes.. disable all address matching */ regval = sam_getreg(priv, SAM_EMAC_NCFGR_OFFSET); regval &= ~(EMAC_NCFGR_UNIHEN | EMAC_NCFGR_MTIHEN); @@ -4072,7 +4072,7 @@ static int sam_autonegotiate(struct sam_emac_s *priv) /* Check AutoNegotiate complete */ timeout = 0; - for (;;) + for (; ; ) { ret = sam_phyread(priv, priv->phyaddr, MII_MSR, &msr); if (ret < 0) @@ -4446,9 +4446,9 @@ static inline void sam_ethgpioconfig(struct sam_emac_s *priv) } else #endif - { - nvdbg("ERROR: emac=%d\n", priv->attr->emac); - } + { + nvdbg("ERROR: emac=%d\n", priv->attr->emac); + } } /**************************************************************************** diff --git a/arch/arm/src/samv7/sam_gpioirq.c b/arch/arm/src/samv7/sam_gpioirq.c index d7e235c58b..8929d17577 100644 --- a/arch/arm/src/samv7/sam_gpioirq.c +++ b/arch/arm/src/samv7/sam_gpioirq.c @@ -398,10 +398,10 @@ void sam_gpioirqenable(int irq) if (sam_irqbase(irq, &base, &pin) == OK) { - /* Clear (all) pending interrupts and enable this pin interrupt */ + /* Clear (all) pending interrupts and enable this pin interrupt */ - //(void)getreg32(base + SAM_PIO_ISR_OFFSET); - putreg32((1 << pin), base + SAM_PIO_IER_OFFSET); + //(void)getreg32(base + SAM_PIO_ISR_OFFSET); + putreg32((1 << pin), base + SAM_PIO_IER_OFFSET); } } @@ -420,9 +420,9 @@ void sam_gpioirqdisable(int irq) if (sam_irqbase(irq, &base, &pin) == OK) { - /* Disable this pin interrupt */ + /* Disable this pin interrupt */ - putreg32((1 << pin), base + SAM_PIO_IDR_OFFSET); + putreg32((1 << pin), base + SAM_PIO_IDR_OFFSET); } } diff --git a/arch/arm/src/samv7/sam_hsmci.c b/arch/arm/src/samv7/sam_hsmci.c index 20db5da509..563c302adf 100644 --- a/arch/arm/src/samv7/sam_hsmci.c +++ b/arch/arm/src/samv7/sam_hsmci.c @@ -1441,7 +1441,7 @@ static int sam_hsmci_interrupt(struct sam_dev_s *priv) /* Loop while there are pending interrupts. */ - for (;;) + for (; ; ) { /* Check the HSMCI status register. Mask out all bits that don't * correspond to enabled interrupts. (This depends on the fact that @@ -1911,7 +1911,7 @@ static int sam_sendcmd(FAR struct sdio_dev_s *dev, sam_cmdsampleinit(priv); - /* Set the HSMCI Argument value */ + /* Set the HSMCI Argument value */ sam_putreg(priv, arg, SAM_HSMCI_ARGR_OFFSET); @@ -2287,7 +2287,7 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) /* Then wait for the response (or timeout) */ - for (;;) + for (; ; ) { /* Did a Command-Response sequence termination evernt occur? */ @@ -2648,7 +2648,7 @@ static sdio_eventset_t sam_eventwait(FAR struct sdio_dev_s *dev, if (!timeout) { - return SDIOWAIT_TIMEOUT; + return SDIOWAIT_TIMEOUT; } /* Start the watchdog timer. I am not sure why this is, but I am @@ -2677,7 +2677,7 @@ static sdio_eventset_t sam_eventwait(FAR struct sdio_dev_s *dev, * may have already occurred before this function was called! */ - for (;;) + for (; ; ) { /* Wait for an event in event set to occur. If this the event has already * occurred, then the semaphore will already have been incremented and @@ -2870,7 +2870,7 @@ static int sam_dmarecvsetup(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, regaddr += sizeof(uint32_t); memaddr += blocksize; - } + } /* Enable DMA handshaking */ @@ -2966,7 +2966,7 @@ static int sam_dmasendsetup(FAR struct sdio_dev_s *dev, regaddr += sizeof(uint32_t); memaddr += blocksize; - } + } /* Enable DMA handshaking */ @@ -3029,8 +3029,8 @@ static void sam_callback(void *arg) /* Media is present. Is the media inserted event enabled? */ if ((priv->cbevents & SDIOMEDIA_INSERTED) == 0) - { - /* No... return without performing the callback */ + { + /* No... return without performing the callback */ return; } @@ -3056,7 +3056,7 @@ static void sam_callback(void *arg) /* This function is called either from (1) the context of the calling * thread or from the the context of (2) card detection logic. The * caller may or may not have interrupts disabled (we have them - & disabled here!). + * disabled here!). * * So to minimize the possibility of recursive behavior and to assure * that callback is always performed outside of the interrupt handling diff --git a/arch/arm/src/samv7/sam_lowputc.c b/arch/arm/src/samv7/sam_lowputc.c index 52d167cd0f..1897cd17f8 100644 --- a/arch/arm/src/samv7/sam_lowputc.c +++ b/arch/arm/src/samv7/sam_lowputc.c @@ -208,7 +208,7 @@ void up_lowputc(char ch) #ifdef HAVE_SERIAL_CONSOLE irqstate_t flags; - for (;;) + for (; ; ) { /* Wait for the transmitter to be available */ diff --git a/arch/arm/src/samv7/sam_mcan.c b/arch/arm/src/samv7/sam_mcan.c index 5f729cbdb8..74f59877db 100644 --- a/arch/arm/src/samv7/sam_mcan.c +++ b/arch/arm/src/samv7/sam_mcan.c @@ -1202,20 +1202,20 @@ static uint32_t mcan_getreg(FAR struct sam_mcan_s *priv, int offset) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (priv->count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (priv->count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", priv->count - 3); - } + lldbg("[repeats %d more times]\n", priv->count - 3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - priv->regaddr = regaddr; - priv->regval = regval; - priv->count = 1; + priv->regaddr = regaddr; + priv->regval = regval; + priv->count = 1; } /* Show the register value read */ @@ -1440,7 +1440,7 @@ static void mcan_buffer_reserve(FAR struct sam_mcan_s *priv) * be incremented and, hence, to be too low. */ - for (;;) + for (; ; ) { /* Get the current queue status and semaphore count. */ @@ -3272,7 +3272,7 @@ static void mcan_interrupt(FAR struct can_dev_s *dev) * FIFO0. */ - for (;;) + for (; ; ) { /* Check if there is anything in RX FIFO1 */ diff --git a/arch/arm/src/samv7/sam_qspi.c b/arch/arm/src/samv7/sam_qspi.c index ff57917a68..e886d7356c 100644 --- a/arch/arm/src/samv7/sam_qspi.c +++ b/arch/arm/src/samv7/sam_qspi.c @@ -1788,7 +1788,7 @@ struct qspi_dev_s *sam_qspi_initialize(int intf) if (priv->candma) { - priv->dmach = sam_dmachannel(0,0); + priv->dmach = sam_dmachannel(0, 0); if (!priv->dmach) { qspidbg("ERROR: Failed to allocate the DMA channel\n"); diff --git a/arch/arm/src/samv7/sam_serial.c b/arch/arm/src/samv7/sam_serial.c index 352501a7d1..47f7d8e926 100644 --- a/arch/arm/src/samv7/sam_serial.c +++ b/arch/arm/src/samv7/sam_serial.c @@ -901,7 +901,7 @@ static int sam_setup(struct uart_dev_s *dev) /* Enable receiver & transmitter */ - sam_serialout(priv, SAM_UART_CR_OFFSET, (UART_CR_RXEN|UART_CR_TXEN)); + sam_serialout(priv, SAM_UART_CR_OFFSET, (UART_CR_RXEN | UART_CR_TXEN)); #endif return OK; @@ -923,7 +923,8 @@ static void sam_shutdown(struct uart_dev_s *dev) /* Reset and disable receiver and transmitter */ sam_serialout(priv, SAM_UART_CR_OFFSET, - (UART_CR_RSTRX|UART_CR_RSTTX|UART_CR_RXDIS|UART_CR_TXDIS)); + (UART_CR_RSTRX | UART_CR_RSTTX | UART_CR_RXDIS | + UART_CR_TXDIS)); /* Disable all interrupts */ @@ -955,11 +956,11 @@ static int sam_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, priv->handler); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the USART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the USART + */ - up_enable_irq(priv->irq); + up_enable_irq(priv->irq); } return ret; @@ -1025,10 +1026,10 @@ static int sam_interrupt(struct uart_dev_s *dev) if ((pending & UART_INT_RXRDY) != 0) { - /* Received data ready... process incoming bytes */ + /* Received data ready... process incoming bytes */ - uart_recvchars(dev); - handled = true; + uart_recvchars(dev); + handled = true; } /* Handle outgoing, transmit bytes. TXRDY: There is no character in the @@ -1037,10 +1038,10 @@ static int sam_interrupt(struct uart_dev_s *dev) if ((pending & UART_INT_TXRDY) != 0) { - /* Transmit data register empty ... process outgoing bytes */ + /* Transmit data register empty ... process outgoing bytes */ - uart_xmitchars(dev); - handled = true; + uart_xmitchars(dev); + handled = true; } } @@ -1150,8 +1151,8 @@ static int sam_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TERMIOS case TCGETS: { - struct termios *termiosp = (struct termios*)arg; - struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; + struct termios *termiosp = (struct termios *)arg; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; if (!termiosp) { @@ -1207,8 +1208,8 @@ static int sam_ioctl(struct file *filep, int cmd, unsigned long arg) case TCSETS: { - struct termios *termiosp = (struct termios*)arg; - struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; + struct termios *termiosp = (struct termios *)arg; + struct sam_dev_s *priv = (struct sam_dev_s *)dev->priv; uint32_t baud; uint32_t imr; uint8_t parity; diff --git a/arch/arm/src/samv7/sam_spi.c b/arch/arm/src/samv7/sam_spi.c index 7ab71ec3c4..a97ced37dd 100644 --- a/arch/arm/src/samv7/sam_spi.c +++ b/arch/arm/src/samv7/sam_spi.c @@ -1801,7 +1801,7 @@ FAR struct spi_dev_s *up_spiinitialize(int port) } #endif - /* Select the SPI operations */ + /* Select the SPI operations */ #if defined(CONFIG_SAMV7_SPI0_MASTER) && defined(CONFIG_SAMV7_SPI1_MASTER) spics->spidev.ops = spino ? &g_spi1ops : &g_spi0ops; diff --git a/arch/arm/src/samv7/sam_spi_slave.c b/arch/arm/src/samv7/sam_spi_slave.c index a156254b19..70ac3e0f9f 100644 --- a/arch/arm/src/samv7/sam_spi_slave.c +++ b/arch/arm/src/samv7/sam_spi_slave.c @@ -425,7 +425,7 @@ static int spi_interrupt(struct sam_spidev_s *priv) * execution. */ - for (;;) + for (; ; ) { /* Get the current set of pending/enabled interrupts */ diff --git a/arch/arm/src/samv7/sam_ssc.c b/arch/arm/src/samv7/sam_ssc.c index fb9fed1773..d2ce566d04 100644 --- a/arch/arm/src/samv7/sam_ssc.c +++ b/arch/arm/src/samv7/sam_ssc.c @@ -3333,7 +3333,7 @@ static void ssc1_configure(struct sam_ssc_s *priv) #if defined(CONFIG_SAMV7_SSC1_TX_TKOUTPUT_CONT) priv->txout = SSC_CLKOUT_CONT; /* Continuous */ #elif defined(CONFIG_SAMV7_SSC1_TX_TKOUTPUT_XFR) - priv->txout = SSC_CLKOUT_XFER;/* Only output clock during transfers */ + priv->txout = SSC_CLKOUT_XFER; /* Only output clock during transfers */ #else /* if defined(CONFIG_SAMV7_SSC1_TX_TKOUTPUT_NONE) */ priv->txout = SSC_CLKOUT_NONE; /* No output clock */ #endif diff --git a/arch/arm/src/samv7/sam_start.c b/arch/arm/src/samv7/sam_start.c index c587db5e75..ec12b7ef87 100644 --- a/arch/arm/src/samv7/sam_start.c +++ b/arch/arm/src/samv7/sam_start.c @@ -103,7 +103,7 @@ static inline void sam_fpuconfig(void); #endif #ifdef CONFIG_STACK_COLORATION static void go_os_start(void *pv, unsigned int nbytes) - __attribute__ ((naked,no_instrument_function,noreturn)); + __attribute__ ((naked, no_instrument_function, noreturn)); #endif /**************************************************************************** @@ -401,6 +401,6 @@ void __start(void) /* Shouldn't get here */ - for (;;); + for (; ; ); #endif } diff --git a/arch/arm/src/samv7/sam_xdmac.c b/arch/arm/src/samv7/sam_xdmac.c index a0b99f68bd..b65b2f6eef 100644 --- a/arch/arm/src/samv7/sam_xdmac.c +++ b/arch/arm/src/samv7/sam_xdmac.c @@ -1541,10 +1541,10 @@ static int sam_xdmac_interrupt(int irq, void *context) if ((chpending & XDMAC_CHINT_ERRORS) != 0) { - /* Yes... Terminate the transfer with an error? */ + /* Yes... Terminate the transfer with an error? */ - dmalldbg("ERROR: DMA failed: %08x\n", chpending); - sam_dmaterminate(xdmach, -EIO); + dmalldbg("ERROR: DMA failed: %08x\n", chpending); + sam_dmaterminate(xdmach, -EIO); } /* Is the transfer complete? */ From 53f6fd6e66d2daa78809d1f06fcf5f09117288b8 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 7 Oct 2015 13:45:15 -0600 Subject: [PATCH 27/33] STM32: Correct some spacing issues --- arch/arm/src/stm32/stm32_adc.c | 93 ++++---- arch/arm/src/stm32/stm32_aes.c | 2 +- arch/arm/src/stm32/stm32_allocateheap.c | 16 +- arch/arm/src/stm32/stm32_bbsram.c | 76 +++--- arch/arm/src/stm32/stm32_can.c | 91 +++---- arch/arm/src/stm32/stm32_dma2d.c | 26 +- arch/arm/src/stm32/stm32_eth.c | 53 +++-- arch/arm/src/stm32/stm32_flash.c | 2 +- arch/arm/src/stm32/stm32_i2c.c | 21 +- arch/arm/src/stm32/stm32_i2c_alt.c | 27 ++- arch/arm/src/stm32/stm32_irq.c | 10 +- arch/arm/src/stm32/stm32_iwdg.c | 31 +-- arch/arm/src/stm32/stm32_lowputc.c | 34 +-- arch/arm/src/stm32/stm32_ltdc.c | 74 +++--- arch/arm/src/stm32/stm32_otgfsdev.c | 297 +++++++++++------------ arch/arm/src/stm32/stm32_otgfshost.c | 59 ++--- arch/arm/src/stm32/stm32_otghsdev.c | 300 ++++++++++++------------ arch/arm/src/stm32/stm32_otghshost.c | 57 ++--- arch/arm/src/stm32/stm32_procfs_ccm.c | 2 +- arch/arm/src/stm32/stm32_pwm.c | 6 +- arch/arm/src/stm32/stm32_qencoder.c | 26 +- arch/arm/src/stm32/stm32_rng.c | 4 +- arch/arm/src/stm32/stm32_rtcc.c | 34 +-- arch/arm/src/stm32/stm32_sdio.c | 261 +++++++++++---------- arch/arm/src/stm32/stm32_serial.c | 90 +++---- arch/arm/src/stm32/stm32_spi.c | 34 +-- arch/arm/src/stm32/stm32_start.c | 4 +- arch/arm/src/stm32/stm32_timerisr.c | 9 +- arch/arm/src/stm32/stm32_usbdev.c | 44 ++-- arch/arm/src/stm32/stm32_userspace.c | 10 +- arch/arm/src/stm32/stm32_wwdg.c | 29 +-- arch/arm/src/stm32/stm32f10xxx_dma.c | 12 +- arch/arm/src/stm32/stm32f10xxx_rcc.c | 124 +++++----- arch/arm/src/stm32/stm32f20xxx_dma.c | 22 +- arch/arm/src/stm32/stm32f20xxx_rcc.c | 26 +- arch/arm/src/stm32/stm32f30xxx_i2c.c | 41 ++-- arch/arm/src/stm32/stm32f30xxx_rcc.c | 118 +++++----- arch/arm/src/stm32/stm32f37xxx_rcc.c | 122 +++++----- arch/arm/src/stm32/stm32f40xxx_dma.c | 22 +- arch/arm/src/stm32/stm32f40xxx_rcc.c | 28 +-- arch/arm/src/stm32/stm32f42xxx_rcc.c | 26 +- arch/arm/src/stm32/stm32f44xxx_rcc.c | 22 +- arch/arm/src/stm32/stm32l15xxx_rcc.c | 8 +- 43 files changed, 1209 insertions(+), 1184 deletions(-) diff --git a/arch/arm/src/stm32/stm32_adc.c b/arch/arm/src/stm32/stm32_adc.c index 0e72ead540..a2ad492f0d 100644 --- a/arch/arm/src/stm32/stm32_adc.c +++ b/arch/arm/src/stm32/stm32_adc.c @@ -311,8 +311,8 @@ static struct stm32_dev_s g_adcpriv1 = static struct adc_dev_s g_adcdev1 = { - .ad_ops = &g_adcops, - .ad_priv= &g_adcpriv1, + .ad_ops = &g_adcops, + .ad_priv = &g_adcpriv1, }; #endif @@ -345,8 +345,8 @@ static struct stm32_dev_s g_adcpriv2 = static struct adc_dev_s g_adcdev2 = { - .ad_ops = &g_adcops, - .ad_priv= &g_adcpriv2, + .ad_ops = &g_adcops, + .ad_priv = &g_adcpriv2, }; #endif @@ -379,8 +379,8 @@ static struct stm32_dev_s g_adcpriv3 = static struct adc_dev_s g_adcdev3 = { - .ad_ops = &g_adcops, - .ad_priv= &g_adcpriv3, + .ad_ops = &g_adcops, + .ad_priv = &g_adcpriv3, }; #endif @@ -515,20 +515,20 @@ static void adc_tim_dumpregs(struct stm32_dev_s *priv, FAR const char *msg) tim_getreg(priv, STM32_GTIM_CCR3_OFFSET), tim_getreg(priv, STM32_GTIM_CCR4_OFFSET)); # ifndef CONFIG_STM32_STM32L15XX - if (priv->tbase == STM32_TIM1_BASE || priv->tbase == STM32_TIM8_BASE) - { - avdbg(" RCR: %04x BDTR: %04x DCR: %04x DMAR: %04x\n", - tim_getreg(priv, STM32_ATIM_RCR_OFFSET), - tim_getreg(priv, STM32_ATIM_BDTR_OFFSET), - tim_getreg(priv, STM32_ATIM_DCR_OFFSET), - tim_getreg(priv, STM32_ATIM_DMAR_OFFSET)); - } - else - { - avdbg(" DCR: %04x DMAR: %04x\n", - tim_getreg(priv, STM32_GTIM_DCR_OFFSET), - tim_getreg(priv, STM32_GTIM_DMAR_OFFSET)); - } + if (priv->tbase == STM32_TIM1_BASE || priv->tbase == STM32_TIM8_BASE) + { + avdbg(" RCR: %04x BDTR: %04x DCR: %04x DMAR: %04x\n", + tim_getreg(priv, STM32_ATIM_RCR_OFFSET), + tim_getreg(priv, STM32_ATIM_BDTR_OFFSET), + tim_getreg(priv, STM32_ATIM_DCR_OFFSET), + tim_getreg(priv, STM32_ATIM_DMAR_OFFSET)); + } + else + { + avdbg(" DCR: %04x DMAR: %04x\n", + tim_getreg(priv, STM32_GTIM_DCR_OFFSET), + tim_getreg(priv, STM32_GTIM_DMAR_OFFSET)); + } # endif #endif } @@ -857,7 +857,7 @@ static int adc_timinit(FAR struct stm32_dev_s *priv) ccmr1 |= ocmode1; ccmr2 |= ocmode2; - /* Reset the output polarity level of all channels (selects high polarity)*/ + /* Reset the output polarity level of all channels (selects high polarity) */ ccer &= ~(ATIM_CCER_CC1P | ATIM_CCER_CC2P | ATIM_CCER_CC3P | ATIM_CCER_CC4P); @@ -1302,15 +1302,15 @@ static void adc_write_sample_time_registers(FAR struct adc_dev_s *dev) uint8_t i, shift; /* Sampling time individually for each channel - * 000: 4 cycles - * 001: 9 cycles - * 010: 16 cycles - * 011: 24 cycles - * 100: 48 cycles - * 101: 96 cycles - * 110: 192 cycles - * 111: 384 cycles - selected for all channels - */ + * 000: 4 cycles + * 001: 9 cycles + * 010: 16 cycles + * 011: 24 cycles + * 100: 48 cycles + * 101: 96 cycles + * 110: 192 cycles + * 111: 384 cycles - selected for all channels + */ for (i = 0, shift = 0; i < 32; i++) { @@ -1369,7 +1369,7 @@ static void adc_write_sample_time_registers(FAR struct adc_dev_s *dev) #ifdef ADC_HAVE_DMA static void adc_dmaconvcallback(DMA_HANDLE handle, uint8_t isr, void *arg) { - FAR struct adc_dev_s *dev = (FAR struct adc_dev_s*) arg; + FAR struct adc_dev_s *dev = (FAR struct adc_dev_s *)arg; FAR struct stm32_dev_s *priv = dev->ad_priv; uint32_t regval; int i; @@ -1562,9 +1562,10 @@ static void adc_reset(FAR struct adc_dev_s *dev) #if ADC_MAX_SAMPLES == 1 /* Select on first indexed channel for backward compatibility. */ - adc_set_ch_idx(dev,0); + + adc_set_ch_idx(dev, 0); #else - adc_set_ch(dev,0); + adc_set_ch(dev, 0); #endif /* ADC CCR configuration */ @@ -1643,10 +1644,10 @@ static void adc_reset(FAR struct adc_dev_s *dev) #ifdef ADC_HAVE_TIMER ret = adc_timinit(priv); - if (ret!=OK) - { + if (ret != OK) + { adbg("Error initializing the timers\n"); - } + } #elif !defined(CONFIG_ADC_NO_STARTUP_CONV) #ifdef CONFIG_STM32_STM32F10XX @@ -2280,9 +2281,9 @@ static int adc_set_ch(FAR struct adc_dev_s *dev, uint8_t ch) regval = adc_getreg(priv, STM32_ADC_SQR1_OFFSET) & ADC_SQR1_RESERVED; for (i = 24, offset = 0; i < priv->nchannels && i < 28; i++, offset += 5) - { - regval |= (uint32_t)priv->chanlist[i] << offset; - } + { + regval |= (uint32_t)priv->chanlist[i] << offset; + } #else priv->nchannels = priv->cchannels; @@ -2316,7 +2317,7 @@ static int adc_set_ch(FAR struct adc_dev_s *dev, uint8_t ch) { if ((uint32_t)priv->chanlist[i] == ch) { - ret = adc_set_ch_idx(dev,i); + ret = adc_set_ch_idx(dev, i); if (ret < 0) { break; @@ -2335,7 +2336,7 @@ static int adc_set_ch(FAR struct adc_dev_s *dev, uint8_t ch) ret = -ENODEV; } - return ret; + return ret; } /**************************************************************************** @@ -2382,7 +2383,7 @@ static int adc_ioctl(FAR struct adc_dev_s *dev, int cmd, unsigned long arg) case IO_ENABLE_DISABLE_JEOCIE: case IO_ENABLE_DISABLE_OVRIE: case IO_ENABLE_DISABLE_ALL_INTS: - adc_ioc_change_ints(dev, cmd, *(bool*)arg); + adc_ioc_change_ints(dev, cmd, *(bool *)arg); break; case IO_START_CONV: @@ -2396,7 +2397,7 @@ static int adc_ioctl(FAR struct adc_dev_s *dev, int cmd, unsigned long arg) return ret; } - ret = adc_set_ch(dev,ch); + ret = adc_set_ch(dev, ch); if (ret < 0) { set_errno(-ret); @@ -2828,9 +2829,9 @@ struct adc_dev_s *stm32_adcinitialize(int intf, const uint8_t *chanlist, } else #endif - { - DEBUGASSERT(priv->nchannels <= ADC_MAX_CHANNELS_NODMA); - } + { + DEBUGASSERT(priv->nchannels <= ADC_MAX_CHANNELS_NODMA); + } priv->cchannels = cchannels; diff --git a/arch/arm/src/stm32/stm32_aes.c b/arch/arm/src/stm32/stm32_aes.c index e2882264b2..facf86c452 100644 --- a/arch/arm/src/stm32/stm32_aes.c +++ b/arch/arm/src/stm32/stm32_aes.c @@ -157,7 +157,7 @@ static void aes_encryptblock(void *block_out, const void *block_in) in++; putreg32(*in, STM32_AES_DINR); - while(!(getreg32(STM32_AES_SR) & AES_SR_CCF)) + while (!(getreg32(STM32_AES_SR) & AES_SR_CCF)) ; aes_ccfc(); diff --git a/arch/arm/src/stm32/stm32_allocateheap.c b/arch/arm/src/stm32/stm32_allocateheap.c index 7e3b2fa701..8350b859e1 100644 --- a/arch/arm/src/stm32/stm32_allocateheap.c +++ b/arch/arm/src/stm32/stm32_allocateheap.c @@ -512,12 +512,12 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) /* Return the user-space heap settings */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)ubase; + *heap_start = (FAR void *)ubase; *heap_size = usize; /* Colorize the heap for debug */ - up_heap_color((FAR void*)ubase, usize); + up_heap_color((FAR void *)ubase, usize); /* Allow user-mode access to the user heap memory */ @@ -527,7 +527,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) /* Return the heap settings */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)g_idle_topstack; + *heap_start = (FAR void *)g_idle_topstack; *heap_size = SRAM1_END - g_idle_topstack; /* Colorize the heap for debug */ @@ -575,7 +575,7 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size) * that was not dedicated to the user heap). */ - *heap_start = (FAR void*)USERSPACE->us_bssend; + *heap_start = (FAR void *)USERSPACE->us_bssend; *heap_size = ubase - (uintptr_t)USERSPACE->us_bssend; } #endif @@ -603,11 +603,11 @@ void up_addregion(void) /* Colorize the heap for debug */ - up_heap_color((FAR void*)SRAM2_START, SRAM2_END-SRAM2_START); + up_heap_color((FAR void *)SRAM2_START, SRAM2_END-SRAM2_START); /* Add the STM32F20xxx/STM32F40xxx CCM SRAM user heap region. */ - kumm_addregion((FAR void*)SRAM2_START, SRAM2_END-SRAM2_START); + kumm_addregion((FAR void *)SRAM2_START, SRAM2_END-SRAM2_START); #endif #ifdef CONFIG_STM32_FSMC_SRAM @@ -621,11 +621,11 @@ void up_addregion(void) /* Colorize the heap for debug */ - up_heap_color((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE); + up_heap_color((FAR void *)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE); /* Add the external FSMC SRAM user heap region. */ - kumm_addregion((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE); + kumm_addregion((FAR void *)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE); #endif } #endif diff --git a/arch/arm/src/stm32/stm32_bbsram.c b/arch/arm/src/stm32/stm32_bbsram.c index 78fe485e0d..507f5a4d4a 100644 --- a/arch/arm/src/stm32/stm32_bbsram.c +++ b/arch/arm/src/stm32/stm32_bbsram.c @@ -101,7 +101,7 @@ struct bbsramfh_s * starting at fileno */ uint8_t fileno; /* The minor number */ uint8_t dirty; /* Data has been written to the file */ - uint16_t len; /* Total Bytes in this file*/ + uint16_t len; /* Total Bytes in this file */ struct timespec lastwrite; /* Last write time */ uint8_t data[]; /* Data in the file */ }; @@ -119,13 +119,17 @@ struct stm32_bbsram_s static int stm32_bbsram_open(FAR struct file *filep); static int stm32_bbsram_close(FAR struct file *filep); -static off_t stm32_bbsram_seek(FAR struct file *filep, off_t offset, int whence); -static ssize_t stm32_bbsram_read(FAR struct file *, FAR char *, size_t); -static ssize_t stm32_bbsram_write(FAR struct file *, FAR const char *, size_t); -static int stm32_bbsram_ioctl(FAR struct file *filep, int cmd, unsigned long arg); +static off_t stm32_bbsram_seek(FAR struct file *filep, off_t offset, + int whence); +static ssize_t stm32_bbsram_read(FAR struct file *filep, FAR char *buffer, + size_t len); +static ssize_t stm32_bbsram_write(FAR struct file *filep, + FAR const char *buffer, size_t len); +static int stm32_bbsram_ioctl(FAR struct file *filep, int cmd, + unsigned long arg); #ifndef CONFIG_DISABLE_POLL static int stm32_bbsram_poll(FAR struct file *filep, FAR struct pollfd *fds, - bool setup); + bool setup); #endif #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS static int stm32_bbsram_unlink(FAR struct inode *inode); @@ -167,7 +171,7 @@ static struct stm32_bbsram_s g_bbsram[CONFIG_STM32_BBSRAM_FILES]; #if defined(CONFIG_BBSRAM_DEBUG) static void stm32_bbsram_rd(void) { - memcpy(&debug,(uint8_t*)STM32_BKPSRAM_BASE,sizeof debug); + memcpy(&debug, (uint8_t *)STM32_BKPSRAM_BASE, sizeof debug); } #endif @@ -179,7 +183,7 @@ static void stm32_bbsram_rd(void) static void stm32_bbsram_dump(FAR struct bbsramfh_s *bbf, char *op) { BBSRAM_DEBUG_READ(); - lldbg("%s:\n",op); + lldbg("%s:\n", op); lldbg(" File Address:0x%8x\n", bbf); lldbg(" crc:0x%8x\n", bbf->crc); lldbg(" fileno:%d\n", (int) bbf->fileno); @@ -287,7 +291,7 @@ static inline void stm32_bbsram_lock(void) static uint32_t stm32_bbsram_crc(FAR struct bbsramfh_s *pf) { - return crc32((uint8_t*)pf + BBSRAM_CRCED_OFFSET, BBSRAM_CRCED_SIZE(pf->len)); + return crc32((uint8_t *)pf + BBSRAM_CRCED_OFFSET, BBSRAM_CRCED_SIZE(pf->len)); } /**************************************************************************** @@ -335,7 +339,7 @@ static int stm32_bbsram_internal_close(FAR struct bbsramfh_s *bbf) (void)clock_gettime(CLOCK_REALTIME, &bbf->lastwrite); bbf->crc = stm32_bbsram_crc(bbf); - BBSRAM_DUMP(bbf,"close done"); + BBSRAM_DUMP(bbf, "close done"); return bbf->len; } @@ -357,7 +361,7 @@ static int stm32_bbsram_close(FAR struct file *filep) stm32_bbsram_semtake(bbr); - BBSRAM_DUMP(bbr->bbf,"close"); + BBSRAM_DUMP(bbr->bbf, "close"); if (bbr->refs == 0) { @@ -473,7 +477,7 @@ static ssize_t stm32_bbsram_read(FAR struct file *filep, FAR char *buffer, len = bbr->bbf->len - filep->f_pos; } - memcpy(buffer,&bbr->bbf->data[filep->f_pos], len); + memcpy(buffer, &bbr->bbf->data[filep->f_pos], len); filep->f_pos += len; stm32_bbsram_semgive(bbr); return len; @@ -520,12 +524,12 @@ static ssize_t stm32_bbsram_write(FAR struct file *filep, FAR const char *buffer ret = len; /* save number of bytes written */ stm32_bbsram_semtake(bbr); - BBSRAM_DUMP(bbr->bbf,"write"); + BBSRAM_DUMP(bbr->bbf, "write"); stm32_bbsram_unlock(); stm32_bbsram_internal_write(bbr->bbf, buffer, filep->f_pos, len); stm32_bbsram_lock(); filep->f_pos += len; - BBSRAM_DUMP(bbr->bbf,"write done"); + BBSRAM_DUMP(bbr->bbf, "write done"); stm32_bbsram_semgive(bbr); } @@ -543,7 +547,7 @@ static int stm32_bbsram_poll(FAR struct file *filep, FAR struct pollfd *fds, { if (setup) { - fds->revents |= (fds->events & (POLLIN|POLLOUT)); + fds->revents |= (fds->events & (POLLIN | POLLOUT)); if (fds->revents != 0) { sem_post(fds->sem); @@ -650,7 +654,7 @@ static int stm32_bbsram_probe(int *ent, struct stm32_bbsram_s pdev[]) for (i = 0; (i < CONFIG_STM32_BBSRAM_FILES) && ent[i] && (avail > 0); i++) { - /* Validate the actual allocations against what is in the BBSRAM*/ + /* Validate the actual allocations against what is in the BBSRAM */ size = ent[i]; @@ -680,11 +684,11 @@ static int stm32_bbsram_probe(int *ent, struct stm32_bbsram_s pdev[]) /* Not Valid so wipe the file in BBSRAM */ - memset((uint8_t*)pf, 0, alloc); + memset((uint8_t *)pf, 0, alloc); pf->fileno = i; pf->len = size; pf->crc = stm32_bbsram_crc(pf); - BBSRAM_DUMP(pf,"probe reset"); + BBSRAM_DUMP(pf, "probe reset"); } pdev[i].bbf = pf; @@ -769,8 +773,8 @@ int stm32_bbsraminitialize(char *devpath, int *sizes) fcnt = stm32_bbsram_probe(sizes, g_bbsram); - strncpy(path,devpath,sizeof(path)); - strcat(path,"%d"); + strncpy(path, devpath, sizeof(path)); + strcat(path, "%d"); for (i = 0; i < fcnt && ret >= OK; i++) { @@ -785,22 +789,22 @@ int stm32_bbsraminitialize(char *devpath, int *sizes) } /**************************************************************************** -* Function: stm32_bbsram_savepanic -* -* Description: -* Saves the panic context in a previously allocated BBSRAM file -* -* Parameters: -* fileno - the value returned by the ioctl STM32_BBSRAM_GETDESC_IOCTL -* context - Pointer to a any array of bytes to save -* length - The length of the data pointed to byt context -* -* Returned Value: -* Length saved or negated errno. -* -* Assumptions: -* -****************************************************************************/ + * Function: stm32_bbsram_savepanic + * + * Description: + * Saves the panic context in a previously allocated BBSRAM file + * + * Parameters: + * fileno - the value returned by the ioctl STM32_BBSRAM_GETDESC_IOCTL + * context - Pointer to a any array of bytes to save + * length - The length of the data pointed to byt context + * + * Returned Value: + * Length saved or negated errno. + * + * Assumptions: + * + ****************************************************************************/ #if defined(CONFIG_STM32_SAVE_CRASHDUMP) int stm32_bbsram_savepanic(int fileno, uint8_t *context, int length) diff --git a/arch/arm/src/stm32/stm32_can.c b/arch/arm/src/stm32/stm32_can.c index 57eb65b0e3..5bc7676fac 100644 --- a/arch/arm/src/stm32/stm32_can.c +++ b/arch/arm/src/stm32/stm32_can.c @@ -249,10 +249,11 @@ static uint32_t can_vgetreg(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return val; } } @@ -261,20 +262,20 @@ static uint32_t can_vgetreg(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ @@ -500,8 +501,8 @@ static void can_dumpfiltregs(struct stm32_can_s *priv, FAR const char *msg) for (i = 0; i < CAN_NFILTERS; i++) { lldbg(" F%dR1: %08x F%dR2: %08x\n", - i, getreg32(priv->base + STM32_CAN_FIR_OFFSET(i,1)), - i, getreg32(priv->base + STM32_CAN_FIR_OFFSET(i,2))); + i, getreg32(priv->base + STM32_CAN_FIR_OFFSET(i, 1)), + i, getreg32(priv->base + STM32_CAN_FIR_OFFSET(i, 2))); } } #endif @@ -883,22 +884,22 @@ static int can_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg) regval = tmp << CAN_TDLR_DATA0_SHIFT; if (dlc > 1) - { - tmp = (uint32_t)*ptr++; - regval |= tmp << CAN_TDLR_DATA1_SHIFT; + { + tmp = (uint32_t)*ptr++; + regval |= tmp << CAN_TDLR_DATA1_SHIFT; - if (dlc > 2) - { - tmp = (uint32_t)*ptr++; - regval |= tmp << CAN_TDLR_DATA2_SHIFT; + if (dlc > 2) + { + tmp = (uint32_t)*ptr++; + regval |= tmp << CAN_TDLR_DATA2_SHIFT; - if (dlc > 3) - { - tmp = (uint32_t)*ptr++; - regval |= tmp << CAN_TDLR_DATA3_SHIFT; - } - } - } + if (dlc > 3) + { + tmp = (uint32_t)*ptr++; + regval |= tmp << CAN_TDLR_DATA3_SHIFT; + } + } + } } can_putreg(priv, STM32_CAN_TDLR_OFFSET(txmb), regval); @@ -909,22 +910,22 @@ static int can_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg) regval = tmp << CAN_TDHR_DATA4_SHIFT; if (dlc > 5) - { - tmp = (uint32_t)*ptr++; - regval |= tmp << CAN_TDHR_DATA5_SHIFT; + { + tmp = (uint32_t)*ptr++; + regval |= tmp << CAN_TDHR_DATA5_SHIFT; - if (dlc > 6) - { - tmp = (uint32_t)*ptr++; - regval |= tmp << CAN_TDHR_DATA6_SHIFT; + if (dlc > 6) + { + tmp = (uint32_t)*ptr++; + regval |= tmp << CAN_TDHR_DATA6_SHIFT; - if (dlc > 7) - { - tmp = (uint32_t)*ptr++; - regval |= tmp << CAN_TDHR_DATA7_SHIFT; - } - } - } + if (dlc > 7) + { + tmp = (uint32_t)*ptr++; + regval |= tmp << CAN_TDHR_DATA7_SHIFT; + } + } + } } can_putreg(priv, STM32_CAN_TDHR_OFFSET(txmb), regval); @@ -1357,7 +1358,7 @@ static int can_bittiming(struct stm32_can_s *priv) ts1 = CONFIG_CAN_TSEG1; ts2 = CONFIG_CAN_TSEG2; brp = (tmp + (CAN_BIT_QUANTA/2)) / CAN_BIT_QUANTA; - DEBUGASSERT(brp >=1 && brp <= CAN_BTR_BRP_MAX); + DEBUGASSERT(brp >= 1 && brp <= CAN_BTR_BRP_MAX); } canllvdbg("TS1: %d TS2: %d BRP: %d\n", ts1, ts2, brp); diff --git a/arch/arm/src/stm32/stm32_dma2d.c b/arch/arm/src/stm32/stm32_dma2d.c index f9d510821b..02b93ee781 100644 --- a/arch/arm/src/stm32/stm32_dma2d.c +++ b/arch/arm/src/stm32/stm32_dma2d.c @@ -693,7 +693,7 @@ static int stm32_dma2d_pixelformat(uint8_t fmt, uint8_t *fmtmap) * A4 */ - switch(fmt) + switch (fmt) { #ifdef CONFIG_STM32_DMA2D_RGB565 case FB_FMT_RGB16_565: @@ -738,7 +738,7 @@ static int stm32_dma2d_bpp(uint8_t fmt, uint8_t *bpp) { gvdbg("fmt=%d, bpp=%p\n", fmt, bpp); - switch(fmt) + switch (fmt) { #ifdef CONFIG_STM32_DMA2D_RGB565 case FB_FMT_RGB16_565: @@ -1030,7 +1030,7 @@ static void stm32_dma2d_llnr(FAR struct stm32_dma2d_s *layer, gvdbg("pixel per line: %d, number of lines: %d\n", area->xres, area->yres); nlrreg = getreg32(STM32_DMA2D_NLR); - nlrreg = (DMA2D_NLR_PL(area->xres)|DMA2D_NLR_NL(area->yres)); + nlrreg = (DMA2D_NLR_PL(area->xres) | DMA2D_NLR_NL(area->yres)); putreg32(nlrreg, STM32_DMA2D_NLR); } @@ -1315,7 +1315,7 @@ static int stm32_dma2dsetclut(FAR struct dma2d_layer_s *layer, sem_post(priv->lock); return ret; - } + } #endif if (priv->fmt != DMA2D_PF_L8) @@ -1342,7 +1342,7 @@ static int stm32_dma2dsetclut(FAR struct dma2d_layer_s *layer, /* Update the layer clut entry */ #ifndef CONFIG_FB_TRANSPARENCY - uint8_t *clut888 = (uint8_t*)clut; + uint8_t *clut888 = (uint8_t *)clut; uint16_t offset = 3 * n; clut888[offset] = cmap->blue[n]; @@ -1431,7 +1431,7 @@ static int stm32_dma2dgetclut(FAR struct dma2d_layer_s *layer, for (n = cmap->first; n < cmap->len && n < STM32_DMA2D_NCLUT; n++) { #ifndef CONFIG_FB_TRANSPARENCY - uint8_t *clut888 = (uint8_t*)clut; + uint8_t *clut888 = (uint8_t *)clut; uint16_t offset = 3 * n; cmap->blue[n] = clut888[offset]; @@ -2155,9 +2155,9 @@ int up_dma2dinitialize(void) up_dma2duninitialize(); - /* Enable dma2d is done in rcc_enableahb1, see - * arch/arm/src/stm32/stm32f40xxx_rcc.c - */ + /* Enable dma2d is done in rcc_enableahb1, see + * arch/arm/src/stm32/stm32f40xxx_rcc.c + */ /* Initialize the DMA2D semaphore that enforces mutually exclusive access * to the driver @@ -2172,13 +2172,13 @@ int up_dma2dinitialize(void) #ifdef CONFIG_STM32_DMA2D_L8 /* Enable dma2d transfer and clut loading interrupts only */ - stm32_dma2d_control(DMA2D_CR_TCIE|DMA2D_CR_CTCIE, DMA2D_CR_TEIE| - DMA2D_CR_TWIE|DMA2D_CR_CAEIE||DMA2D_CR_CEIE); + stm32_dma2d_control(DMA2D_CR_TCIE | DMA2D_CR_CTCIE, DMA2D_CR_TEIE | + DMA2D_CR_TWIE | DMA2D_CR_CAEIE | DMA2D_CR_CEIE); #else /* Enable dma transfer interrupt only */ - stm32_dma2d_control(DMA2D_CR_TCIE, DMA2D_CR_TEIE|DMA2D_CR_TWIE| - DMA2D_CR_CAEIE|DMA2D_CR_CTCIE|DMA2D_CR_CEIE); + stm32_dma2d_control(DMA2D_CR_TCIE, DMA2D_CR_TEIE | DMA2D_CR_TWIE | + DMA2D_CR_CAEIE | DMA2D_CR_CTCIE | DMA2D_CR_CEIE); #endif /* Attach DMA2D interrupt vector */ diff --git a/arch/arm/src/stm32/stm32_eth.c b/arch/arm/src/stm32/stm32_eth.c index 90c6c93271..835ea58c74 100644 --- a/arch/arm/src/stm32/stm32_eth.c +++ b/arch/arm/src/stm32/stm32_eth.c @@ -541,7 +541,7 @@ */ #define ETH_DMAINT_NORMAL \ - (ETH_DMAINT_TI | ETH_DMAINT_TBUI |ETH_DMAINT_RI | ETH_DMAINT_ERI) + (ETH_DMAINT_TI | ETH_DMAINT_TBUI | ETH_DMAINT_RI | ETH_DMAINT_ERI) #define ETH_DMAINT_ABNORMAL \ (ETH_DMAINT_TPSI | ETH_DMAINT_TJTI | ETH_DMAINT_ROI | ETH_DMAINT_TUI | \ @@ -768,10 +768,11 @@ static uint32_t stm32_getreg(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return val; } } @@ -780,20 +781,20 @@ static uint32_t stm32_getreg(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ @@ -1534,7 +1535,7 @@ static int stm32_recvframe(FAR struct stm32_ethmac_s *priv) /* Check if this is an intermediate segment in the frame */ - else if (((rxdesc->rdes0 & ETH_RDES0_LS) == 0)&& + else if (((rxdesc->rdes0 & ETH_RDES0_LS) == 0) && ((rxdesc->rdes0 & ETH_RDES0_FS) == 0)) { priv->segments++; @@ -1586,14 +1587,14 @@ static int stm32_recvframe(FAR struct stm32_ethmac_s *priv) */ DEBUGASSERT(dev->d_buf == NULL); - dev->d_buf = (uint8_t*)rxcurr->rdes2; + dev->d_buf = (uint8_t *)rxcurr->rdes2; rxcurr->rdes2 = (uint32_t)buffer; /* Return success, remebering where we should re-start scanning * and resetting the segment scanning logic */ - priv->rxhead = (struct eth_rxdesc_s*)rxdesc->rdes3; + priv->rxhead = (struct eth_rxdesc_s *)rxdesc->rdes3; stm32_freesegment(priv, rxcurr, priv->segments); nllvdbg("rxhead: %p d_buf: %p d_len: %d\n", @@ -1614,7 +1615,7 @@ static int stm32_recvframe(FAR struct stm32_ethmac_s *priv) /* Try the next descriptor */ - rxdesc = (struct eth_rxdesc_s*)rxdesc->rdes3; + rxdesc = (struct eth_rxdesc_s *)rxdesc->rdes3; } /* We get here after all of the descriptors have been scanned or when rxdesc points @@ -1744,7 +1745,7 @@ static void stm32_receive(FAR struct stm32_ethmac_s *priv) */ if (priv->dev.d_len > 0) - { + { /* Update the Ethernet header with the correct MAC address */ #ifdef CONFIG_NET_IPv4 @@ -1856,7 +1857,7 @@ static void stm32_freeframe(FAR struct stm32_ethmac_s *priv) { /* Yes.. Free the buffer */ - stm32_freebuffer(priv, (uint8_t*)txdesc->tdes2); + stm32_freebuffer(priv, (uint8_t *)txdesc->tdes2); } /* In any event, make sure that TDES2 is nullified. */ @@ -1889,7 +1890,7 @@ static void stm32_freeframe(FAR struct stm32_ethmac_s *priv) /* Try the next descriptor in the TX chain */ - txdesc = (struct eth_txdesc_s*)txdesc->tdes3; + txdesc = (struct eth_txdesc_s *)txdesc->tdes3; } /* We get here if (1) there are still frames "in-flight". Remember @@ -2702,7 +2703,7 @@ static int stm32_addmac(struct net_driver_s *dev, FAR const uint8_t *mac) /* Add the MAC address to the hardware multicast hash table */ - crc = stm32_calcethcrc( mac, 6 ); + crc = stm32_calcethcrc(mac, 6); hashindex = (crc >> 26) & 0x3F; @@ -2759,7 +2760,7 @@ static int stm32_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac) /* Remove the MAC address to the hardware multicast hash table */ - crc = stm32_calcethcrc( mac, 6 ); + crc = stm32_calcethcrc(mac, 6); hashindex = (crc >> 26) & 0x3F; @@ -2779,7 +2780,7 @@ static int stm32_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac) /* If there is no address registered any more, delete multicast filtering */ - if (stm32_getreg(STM32_ETH_MACHTHR ) == 0 && + if (stm32_getreg(STM32_ETH_MACHTHR) == 0 && stm32_getreg(STM32_ETH_MACHTLR) == 0) { temp = stm32_getreg(STM32_ETH_MACFFR); @@ -4135,7 +4136,7 @@ int stm32_ethinitialize(int intf) #ifdef CONFIG_NETDEV_PHY_IOCTL priv->dev.d_ioctl = stm32_ioctl; /* Support PHY ioctl() calls */ #endif - priv->dev.d_private = (void*)g_stm32ethmac; /* Used to recover private state from dev */ + priv->dev.d_private = (void *)g_stm32ethmac; /* Used to recover private state from dev */ /* Create a watchdog for timing polling for and timing of transmisstions */ diff --git a/arch/arm/src/stm32/stm32_flash.c b/arch/arm/src/stm32/stm32_flash.c index 668b8667f4..56aa1f75ed 100644 --- a/arch/arm/src/stm32/stm32_flash.c +++ b/arch/arm/src/stm32/stm32_flash.c @@ -334,7 +334,7 @@ ssize_t up_progmem_write(size_t addr, const void *buf, size_t count) modifyreg32(STM32_FLASH_CR, FLASH_CR_PSIZE_MASK, FLASH_CR_PSIZE_X16); #endif - for (addr += STM32_FLASH_BASE; count; count-=2, hword++, addr+=2) + for (addr += STM32_FLASH_BASE; count; count -= 2, hword++, addr += 2) { /* Write half-word and wait to complete */ diff --git a/arch/arm/src/stm32/stm32_i2c.c b/arch/arm/src/stm32/stm32_i2c.c index 06a0c75a5a..da101cf4fd 100644 --- a/arch/arm/src/stm32/stm32_i2c.c +++ b/arch/arm/src/stm32/stm32_i2c.c @@ -1021,7 +1021,7 @@ static void stm32_i2c_setclock(FAR struct stm32_i2c_priv_s *priv, uint32_t frequ /* Set DUTY and fast speed bits */ - ccr |= (I2C_CCR_DUTY|I2C_CCR_FS); + ccr |= (I2C_CCR_DUTY | I2C_CCR_FS); #else /* Fast mode speed calculation with Tlow/Thigh = 2 */ @@ -1105,7 +1105,7 @@ static inline void stm32_i2c_clrstart(FAR struct stm32_i2c_priv_s *priv) */ stm32_i2c_modifyreg(priv, STM32_I2C_CR1_OFFSET, - I2C_CR1_START|I2C_CR1_STOP|I2C_CR1_PEC, 0); + I2C_CR1_START | I2C_CR1_STOP | I2C_CR1_PEC, 0); } /************************************************************************************ @@ -1261,11 +1261,11 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) else if ((status & I2C_SR1_ADD10) != 0) { - /* TODO: Finish 10-bit mode addressing. - * - * For now just clear ISR by writing to DR register. As we don't do - * 10 bit addressing this must be a spurious ISR - */ + /* TODO: Finish 10-bit mode addressing. + * + * For now just clear ISR by writing to DR register. As we don't do + * 10 bit addressing this must be a spurious ISR + */ stm32_i2c_putreg(priv, STM32_I2C_DR_OFFSET, 0); } @@ -1384,7 +1384,7 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || \ defined(CONFIG_STM32_STM32L15XX) - if (priv->dcnt <= 0 && (status & (I2C_SR1_BTF|I2C_SR1_RXNE)) != 0) + if (priv->dcnt <= 0 && (status & (I2C_SR1_BTF | I2C_SR1_RXNE)) != 0) #else if (priv->dcnt <= 0 && (status & I2C_SR1_BTF) != 0) #endif @@ -1938,9 +1938,10 @@ static int stm32_i2c_writeread(FAR struct i2c_dev_s *dev, }, { .addr = ((struct stm32_i2c_inst_s *)dev)->address, - .flags = ((struct stm32_i2c_inst_s *)dev)->flags | ((buflen>0) ? I2C_M_READ : I2C_M_NORESTART), + .flags = ((struct stm32_i2c_inst_s *)dev)->flags | + ((buflen > 0) ? I2C_M_READ : I2C_M_NORESTART), .buffer = buffer, - .length = (buflen>0) ? buflen : -buflen + .length = (buflen > 0) ? buflen : -buflen } }; diff --git a/arch/arm/src/stm32/stm32_i2c_alt.c b/arch/arm/src/stm32/stm32_i2c_alt.c index 592fb32909..5cf7d8e6f1 100644 --- a/arch/arm/src/stm32/stm32_i2c_alt.c +++ b/arch/arm/src/stm32/stm32_i2c_alt.c @@ -215,9 +215,9 @@ static const uint16_t I2CEVENT_NONE = 0; /* No events have occ static const uint16_t I2CEVENT_STATE_ERROR = 1000; /* No correct state detected, diver cannot handle state */ static const uint16_t I2CEVENT_ISR_SHUTDOWN = 1001; /* ISR gets shutdown */ static const uint16_t I2CEVENT_ISR_EMPTY_CALL = 1002; /* ISR gets called but no I2C logic comes into play */ -static const uint16_t I2CEVENT_MSG_HANDLING = 1003; /* Message Handling 1/1: advances the msg processing param = msgc*/ +static const uint16_t I2CEVENT_MSG_HANDLING = 1003; /* Message Handling 1/1: advances the msg processing param = msgc */ static const uint16_t I2CEVENT_POLL_DEV_NOT_RDY = 1004; /* During polled operation if device is not ready yet */ -static const uint16_t I2CEVENT_ISR_CALL = 1111; /* ISR called*/ +static const uint16_t I2CEVENT_ISR_CALL = 1111; /* ISR called */ static const uint16_t I2CEVENT_SENDADDR = 5; /* Start/Master bit set and address sent, param = priv->msgv->addr(EV5 in reference manual) */ static const uint16_t I2CEVENT_ADDR_HDL_READ_1 = 51; /* Read of length 1 address handling, param = 0 */ @@ -1029,7 +1029,7 @@ static void stm32_i2c_setclock(FAR struct stm32_i2c_priv_s *priv, uint32_t frequ /* Set DUTY and fast speed bits */ - ccr |= (I2C_CCR_DUTY|I2C_CCR_FS); + ccr |= (I2C_CCR_DUTY | I2C_CCR_FS); #else /* Fast mode speed calculation with Tlow/Thigh = 2 */ @@ -1113,7 +1113,7 @@ static inline void stm32_i2c_clrstart(FAR struct stm32_i2c_priv_s *priv) */ stm32_i2c_modifyreg(priv, STM32_I2C_CR1_OFFSET, - I2C_CR1_START|I2C_CR1_STOP|I2C_CR1_PEC, 0); + I2C_CR1_START | I2C_CR1_STOP | I2C_CR1_PEC, 0); } /************************************************************************************ @@ -1428,7 +1428,7 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) * received the address is valid and transmission can continue. */ - /* Check for NACK after an address*/ + /* Check for NACK after an address */ #ifndef CONFIG_I2C_POLLED /* When polling the i2c ISR it's not possible to determine when @@ -1475,7 +1475,7 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) } #endif - /* ACK in read mode, ACK in write mode is handled separately */ + /* ACK in read mode, ACK in write mode is handled separately */ else if ((priv->flags & I2C_M_READ) != 0 && (status & I2C_SR1_ADDR) != 0 && priv->check_addr_ACK) @@ -1545,8 +1545,8 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) * begin immediately after. */ - else if ((priv->flags & (I2C_M_READ)) == 0 && - (status & (I2C_SR1_ADDR | I2C_SR1_TXE)) != 0) + else if ((priv->flags & (I2C_M_READ)) == 0 && + (status & (I2C_SR1_ADDR | I2C_SR1_TXE)) != 0) { /* The has cleared(ADDR is set, ACK was received after the address) * or the transmit buffer is empty flag has been set(TxE) then we can @@ -1627,7 +1627,7 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) { /* Set condition to get to next message */ - priv->dcnt =- 1; + priv->dcnt = -1; stm32_i2c_traceevent(priv, I2CEVENT_WRITE_NO_RESTART, priv->dcnt); } else @@ -1674,7 +1674,7 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) else if ((priv->flags & (I2C_M_READ)) != 0 && (status & I2C_SR1_RXNE) != 0) { /* When read flag is set and the receive buffer is not empty - *(RXNE is set) then the driver can read from the data register. + * (RXNE is set) then the driver can read from the data register. */ i2cvdbg("Entering read mode dcnt = %i msgc = %i, status %i\n", @@ -1727,7 +1727,7 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) { /* If the shift register is still empty (i.e. BTF is low) * then do nothing and wait for it to fill in the next ISR. - *(should not happen in ISR mode, but if using polled mode + * (should not happen in ISR mode, but if using polled mode * this should be able to handle it). */ @@ -2382,9 +2382,10 @@ static int stm32_i2c_writeread(FAR struct i2c_dev_s *dev, }, { .addr = ((struct stm32_i2c_inst_s *)dev)->address, - .flags = ((struct stm32_i2c_inst_s *)dev)->flags | ((buflen>0) ? I2C_M_READ : I2C_M_NORESTART), + .flags = ((struct stm32_i2c_inst_s *)dev)->flags | + ((buflen > 0) ? I2C_M_READ : I2C_M_NORESTART), .buffer = buffer, - .length = (buflen>0) ? buflen : -buflen + .length = (buflen > 0) ? buflen : -buflen } }; diff --git a/arch/arm/src/stm32/stm32_irq.c b/arch/arm/src/stm32/stm32_irq.c index c3cc59fc8b..0013a2e622 100644 --- a/arch/arm/src/stm32/stm32_irq.c +++ b/arch/arm/src/stm32/stm32_irq.c @@ -60,9 +60,9 @@ /* Get a 32-bit version of the default priority */ #define DEFPRIORITY32 \ - (NVIC_SYSH_PRIORITY_DEFAULT << 24 |\ - NVIC_SYSH_PRIORITY_DEFAULT << 16 |\ - NVIC_SYSH_PRIORITY_DEFAULT << 8 |\ + (NVIC_SYSH_PRIORITY_DEFAULT << 24 | \ + NVIC_SYSH_PRIORITY_DEFAULT << 16 | \ + NVIC_SYSH_PRIORITY_DEFAULT << 8 | \ NVIC_SYSH_PRIORITY_DEFAULT) /* Given the address of a NVIC ENABLE register, this is the offset to @@ -271,8 +271,8 @@ static int stm32_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit, else { - *regaddr = NVIC_SYSHCON; - if (irq == STM32_IRQ_MEMFAULT) + *regaddr = NVIC_SYSHCON; + if (irq == STM32_IRQ_MEMFAULT) { *bit = NVIC_SYSHCON_MEMFAULTENA; } diff --git a/arch/arm/src/stm32/stm32_iwdg.c b/arch/arm/src/stm32/stm32_iwdg.c index cb4207ecc8..76dc1d539e 100644 --- a/arch/arm/src/stm32/stm32_iwdg.c +++ b/arch/arm/src/stm32/stm32_iwdg.c @@ -213,10 +213,11 @@ static uint16_t stm32_getreg(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return val; } } @@ -225,20 +226,20 @@ static uint16_t stm32_getreg(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ @@ -301,7 +302,7 @@ static inline void stm32_setprescaler(FAR struct stm32_lowerhalf_s *priv) */ #ifndef CONFIG_STM32_IWDG_ONETIMESETUP - while ((stm32_getreg(STM32_IWDG_SR) & (IWDG_SR_PVU|IWDG_SR_RVU)) != 0); + while ((stm32_getreg(STM32_IWDG_SR) & (IWDG_SR_PVU | IWDG_SR_RVU)) != 0); #endif /* Set the prescaler */ diff --git a/arch/arm/src/stm32/stm32_lowputc.c b/arch/arm/src/stm32/stm32_lowputc.c index 33520b5bc6..70390d4855 100644 --- a/arch/arm/src/stm32/stm32_lowputc.c +++ b/arch/arm/src/stm32/stm32_lowputc.c @@ -232,13 +232,13 @@ # if defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F37XX) # define USART_CR1_CLRBITS\ - (USART_CR1_UESM | USART_CR1_RE | USART_CR1_TE | USART_CR1_PS |\ - USART_CR1_PCE |USART_CR1_WAKE | USART_CR1_M | USART_CR1_MME |\ - USART_CR1_OVER8 | USART_CR1_DEDT_MASK | USART_CR1_DEAT_MASK |\ + (USART_CR1_UESM | USART_CR1_RE | USART_CR1_TE | USART_CR1_PS | \ + USART_CR1_PCE | USART_CR1_WAKE | USART_CR1_M | USART_CR1_MME | \ + USART_CR1_OVER8 | USART_CR1_DEDT_MASK | USART_CR1_DEAT_MASK | \ USART_CR1_ALLINTS) # else # define USART_CR1_CLRBITS\ - (USART_CR1_M | USART_CR1_PCE |USART_CR1_PS | USART_CR1_TE |\ + (USART_CR1_M | USART_CR1_PCE | USART_CR1_PS | USART_CR1_TE | \ USART_CR1_RE | USART_CR1_ALLINTS) # endif @@ -254,15 +254,15 @@ # if defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F37XX) # define USART_CR2_CLRBITS \ - (USART_CR2_ADDM7 | USART_CR2_LBDL | USART_CR2_LBDIE | USART_CR2_LBCL |\ - USART_CR2_CPHA | USART_CR2_CPOL | USART_CR2_CLKEN | USART_CR2_STOP_MASK |\ - USART_CR2_LINEN | USART_CR2_RXINV | USART_CR2_TXINV | USART_CR2_DATAINV |\ - USART_CR2_MSBFIRST | USART_CR2_ABREN | USART_CR2_ABRMOD_MASK |\ + (USART_CR2_ADDM7 | USART_CR2_LBDL | USART_CR2_LBDIE | USART_CR2_LBCL | \ + USART_CR2_CPHA | USART_CR2_CPOL | USART_CR2_CLKEN | USART_CR2_STOP_MASK | \ + USART_CR2_LINEN | USART_CR2_RXINV | USART_CR2_TXINV | USART_CR2_DATAINV | \ + USART_CR2_MSBFIRST | USART_CR2_ABREN | USART_CR2_ABRMOD_MASK | \ USART_CR2_RTOEN | USART_CR2_ADD8_MASK) # else # define USART_CR2_CLRBITS \ - (USART_CR2_STOP_MASK|USART_CR2_CLKEN|USART_CR2_CPOL|USART_CR2_CPHA|\ - USART_CR2_LBCL|USART_CR2_LBDIE) + (USART_CR2_STOP_MASK | USART_CR2_CLKEN | USART_CR2_CPOL | USART_CR2_CPHA | \ + USART_CR2_LBCL | USART_CR2_LBDIE) # endif # define USART_CR2_SETBITS USART_CR2_STOP2_VALUE @@ -271,14 +271,14 @@ # if defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F37XX) # define USART_CR3_CLRBITS \ - (USART_CR3_EIE | USART_CR3_IREN | USART_CR3_IRLP | USART_CR3_HDSEL |\ - USART_CR3_NACK | USART_CR3_SCEN | USART_CR3_DMAR | USART_CR3_DMAT |\ - USART_CR3_RTSE | USART_CR3_CTSE | USART_CR3_CTSIE | USART_CR1_ONEBIT |\ - USART_CR1_OVRDIS | USART_CR1_DDRE | USART_CR1_DEM | USART_CR1_DEP |\ + (USART_CR3_EIE | USART_CR3_IREN | USART_CR3_IRLP | USART_CR3_HDSEL | \ + USART_CR3_NACK | USART_CR3_SCEN | USART_CR3_DMAR | USART_CR3_DMAT | \ + USART_CR3_RTSE | USART_CR3_CTSE | USART_CR3_CTSIE | USART_CR1_ONEBIT | \ + USART_CR1_OVRDIS | USART_CR1_DDRE | USART_CR1_DEM | USART_CR1_DEP | \ USART_CR1_SCARCNT_MASK | USART_CR1_WUS_MASK | USART_CR1_WUFIE) # else # define USART_CR3_CLRBITS \ - (USART_CR3_CTSIE|USART_CR3_CTSE|USART_CR3_RTSE|USART_CR3_EIE) + (USART_CR3_CTSIE | USART_CR3_CTSE | USART_CR3_RTSE | USART_CR3_EIE) # endif # define USART_CR3_SETBITS 0 @@ -555,7 +555,7 @@ void stm32_lowsetup(void) /* Enable Rx, Tx, and the USART */ cr = getreg32(STM32_CONSOLE_BASE + STM32_USART_CR1_OFFSET); - cr |= (USART_CR1_UE|USART_CR1_TE|USART_CR1_RE); + cr |= (USART_CR1_UE | USART_CR1_TE | USART_CR1_RE); putreg32(cr, STM32_CONSOLE_BASE + STM32_USART_CR1_OFFSET); #endif /* HAVE_CONSOLE && !CONFIG_SUPPRESS_UART_CONFIG */ @@ -634,7 +634,7 @@ void stm32_lowsetup(void) /* Enable Rx, Tx, and the USART */ - cr |= (USART_CR1_UE|USART_CR1_TE|USART_CR1_RE); + cr |= (USART_CR1_UE | USART_CR1_TE | USART_CR1_RE); putreg32(cr, STM32_CONSOLE_BASE + STM32_USART_CR1_OFFSET); #endif /* HAVE_CONSOLE && !CONFIG_SUPPRESS_UART_CONFIG */ diff --git a/arch/arm/src/stm32/stm32_ltdc.c b/arch/arm/src/stm32/stm32_ltdc.c index c54c1bc1a3..4a710c22ce 100644 --- a/arch/arm/src/stm32/stm32_ltdc.c +++ b/arch/arm/src/stm32/stm32_ltdc.c @@ -469,7 +469,7 @@ enum stm32_layer_e { - LTDC_LAYER_L1 = 0, /* LCD Layer 1*/ + LTDC_LAYER_L1 = 0, /* LCD Layer 1 */ LTDC_LAYER_L2, /* LCD Layer 2 */ }; @@ -579,7 +579,7 @@ static void stm32_ltdc_lblendmode(FAR struct stm32_layer_s *layer, #ifdef STM32_LAYER_CLUT_SIZE static void stm32_ltdc_lclut(FAR struct stm32_layer_s *layer, FAR const struct fb_cmap_s *cmap); -static void stm32_ltdc_lclutenable(FAR struct stm32_layer_s* layer, +static void stm32_ltdc_lclutenable(FAR struct stm32_layer_s *layer, bool enable); #endif static void stm32_ltdc_linit(int lid); @@ -687,7 +687,8 @@ static const struct fb_vtable_s g_vtable = .getvideoinfo = stm32_getvideoinfo, .getplaneinfo = stm32_getplaneinfo #ifdef STM32_LAYER_CLUT_SIZE - ,.getcmap = stm32_getcmap, + , + .getcmap = stm32_getcmap, .putcmap = stm32_putcmap #endif }; @@ -744,12 +745,13 @@ static struct stm32_ltdcdev_s g_ltdc = .nplanes = 1 } #ifdef STM32_LTDC_L1CMAP - ,.clut = &g_clut[LTDC_L1CLUT_OFFSET] + , .clut = &g_clut[LTDC_L1CLUT_OFFSET] #endif } } #ifdef CONFIG_STM32_LTDC_L2 - ,.layer[LTDC_LAYER_L2] = + , + .layer[LTDC_LAYER_L2] = { .state = { @@ -769,7 +771,7 @@ static struct stm32_ltdcdev_s g_ltdc = .nplanes = 1 } #ifdef STM32_LTDC_L2CMAP - ,.clut = &g_clut[LTDC_L2CLUT_OFFSET] + , .clut = &g_clut[LTDC_L2CLUT_OFFSET] #endif } } @@ -782,7 +784,7 @@ static const uint32_t stm32_fmt_layer_t[LTDC_NLAYERS] = { STM32_LTDC_L1PFCR_PF #ifdef CONFIG_STM32_LTDC_L2 - ,STM32_LTDC_L2PFCR_PF + , STM32_LTDC_L2PFCR_PF #endif }; @@ -1297,7 +1299,7 @@ static void stm32_global_configure(void) /* Enable register reload interrupt only */ - stm32_ltdc_irqctrl(LTDC_IER_RRIE,LTDC_IER_TERRIE|LTDC_IER_FUIE|LTDC_IER_LIE); + stm32_ltdc_irqctrl(LTDC_IER_RRIE, LTDC_IER_TERRIE | LTDC_IER_FUIE | LTDC_IER_LIE); /* Configure line interrupt */ @@ -1383,7 +1385,7 @@ static void stm32_lcd_enable(bool enable) ****************************************************************************/ #ifdef STM32_LAYER_CLUT_SIZE -static void stm32_ltdc_lclutenable(FAR struct stm32_layer_s* layer, bool enable) +static void stm32_ltdc_lclutenable(FAR struct stm32_layer_s *layer, bool enable) { uint32_t regval; @@ -1879,7 +1881,7 @@ static void stm32_ltdc_lclut(FAR struct stm32_layer_s *layer, { /* Update the layer clut entry */ #ifndef CONFIG_FB_TRANSPARENCY - uint8_t *clut888 = (uint8_t*)clut; + uint8_t *clut888 = (uint8_t *)clut; uint16_t offset = 3 * n; clut888[offset] = cmap->blue[n]; @@ -1978,7 +1980,7 @@ static void stm32_ltdc_lclear(FAR struct stm32_layer_s *layer, #if STM32_LTDC_L1_BPP == 8 || STM32_LTDC_L2_BPP == 8 if (priv->pinfo.bpp == 8) { - uint8_t *dest = (uint8_t*)priv->pinfo.fbmem; + uint8_t *dest = (uint8_t *)priv->pinfo.fbmem; int i; gvdbg("Clearing display: BPP=%d color=%04x framebuffer=%08x size=%d\n", @@ -1996,7 +1998,7 @@ static void stm32_ltdc_lclear(FAR struct stm32_layer_s *layer, #if STM32_LTDC_L1_BPP == 16 || STM32_LTDC_L2_BPP == 16 if (priv->pinfo.bpp == 16) { - uint16_t *dest = (uint16_t*)priv->pinfo.fbmem; + uint16_t *dest = (uint16_t *)priv->pinfo.fbmem; int i; gvdbg("Clearing display: BPP=%d color=%04x framebuffer=%08x size=%d\n", @@ -2014,7 +2016,7 @@ static void stm32_ltdc_lclear(FAR struct stm32_layer_s *layer, #if STM32_LTDC_L1_BPP == 24 || STM32_LTDC_L2_BPP == 24 if (priv->pinfo.bpp == 24) { - uint8_t *dest = (uint8_t*)priv->pinfo.fbmem; + uint8_t *dest = (uint8_t *)priv->pinfo.fbmem; uint8_t r; uint8_t g; uint8_t b; @@ -2041,7 +2043,7 @@ static void stm32_ltdc_lclear(FAR struct stm32_layer_s *layer, #if STM32_LTDC_L1_BPP == 32 || STM32_LTDC_L2_BPP == 32 if (priv->pinfo.bpp == 32) { - uint32_t *dest = (uint32_t*)priv->pinfo.fbmem; + uint32_t *dest = (uint32_t *)priv->pinfo.fbmem; int i; gvdbg("Clearing display: BPP=%d color=%04x framebuffer=%08x size=%d\n", @@ -2192,9 +2194,9 @@ static int stm32_getvideoinfo(struct fb_vtable_s *vtable, { FAR struct ltdc_layer_s *ltdc; #ifdef CONFIG_STM32_LTDC_L2 - ltdc = (FAR struct ltdc_layer_s*)&LAYER_L2; + ltdc = (FAR struct ltdc_layer_s *)&LAYER_L2; #else - ltdc = (FAR struct ltdc_layer_s*)&LAYER_L1; + ltdc = (FAR struct ltdc_layer_s *)&LAYER_L1; #endif return stm32_lgetvideoinfo(ltdc, vinfo); } @@ -2227,9 +2229,9 @@ static int stm32_getplaneinfo(struct fb_vtable_s *vtable, int planeno, { FAR struct ltdc_layer_s *ltdc; #ifdef CONFIG_STM32_LTDC_L2 - ltdc = (FAR struct ltdc_layer_s*)&LAYER_L2; + ltdc = (FAR struct ltdc_layer_s *)&LAYER_L2; #else - ltdc = (FAR struct ltdc_layer_s*)&LAYER_L1; + ltdc = (FAR struct ltdc_layer_s *)&LAYER_L1; #endif return stm32_lgetplaneinfo(ltdc, planeno, pinfo); } @@ -2259,9 +2261,9 @@ static int stm32_getcmap(struct fb_vtable_s *vtable, struct fb_cmap_s *cmap) { #ifdef CONFIG_STM32_LTDC_L2 - return stm32_getclut((FAR struct ltdc_layer_s*)&LAYER_L2, cmap); + return stm32_getclut((FAR struct ltdc_layer_s *)&LAYER_L2, cmap); #else - return stm32_getclut((FAR struct ltdc_layer_s*)&LAYER_L1, cmap); + return stm32_getclut((FAR struct ltdc_layer_s *)&LAYER_L1, cmap); #endif } @@ -2285,9 +2287,9 @@ static int stm32_putcmap(struct fb_vtable_s *vtable, const struct fb_cmap_s *cmap) { #ifdef CONFIG_STM32_LTDC_L2 - return stm32_setclut((FAR struct ltdc_layer_s*)&LAYER_L2, cmap); + return stm32_setclut((FAR struct ltdc_layer_s *)&LAYER_L2, cmap); #else - return stm32_setclut((FAR struct ltdc_layer_s*)&LAYER_L1, cmap); + return stm32_setclut((FAR struct ltdc_layer_s *)&LAYER_L1, cmap); #endif } #endif /* STM32_LAYER_CLUT_SIZE */ @@ -2446,8 +2448,7 @@ static int stm32_getclut(struct ltdc_layer_s *layer, { sem_wait(priv->state.lock); #ifdef CONFIG_STM32_DMA2D - /* - * Note! We share the same color lookup table with the dma2d driver and + /* Note! We share the same color lookup table with the dma2d driver and * the getclut implementation works in the same way. * To prevent redundant code we simply call the getclut function of the * dma2d interface. @@ -2479,7 +2480,7 @@ static int stm32_getclut(struct ltdc_layer_s *layer, for (n = cmap->first; n < cmap->len && n < STM32_LTDC_NCLUT; n++) { # ifndef CONFIG_FB_TRANSPARENCY - uint8_t *clut888 = (uint8_t*)clut; + uint8_t *clut888 = (uint8_t *)clut; uint16_t offset = 3 * n; cmap->blue[n] = clut888[offset]; @@ -2534,7 +2535,8 @@ static int stm32_getclut(struct ltdc_layer_s *layer, * ****************************************************************************/ -static int stm32_getlid(FAR struct ltdc_layer_s *layer, int *lid, uint32_t flag) +static int stm32_getlid(FAR struct ltdc_layer_s *layer, int *lid, + uint32_t flag) { FAR struct stm32_layer_s *priv = (FAR struct stm32_layer_s *)layer; @@ -2863,10 +2865,10 @@ static int stm32_setblendmode(FAR struct ltdc_layer_s *layer, uint32_t mode) /* Disable colorkeying by default */ - priv->operation &=~ LTDC_LAYER_ENABLECOLORKEY; + priv->operation &= ~LTDC_LAYER_ENABLECOLORKEY; - if (blendmode & (LTDC_BLEND_ALPHA|LTDC_BLEND_PIXELALPHA| - LTDC_BLEND_ALPHAINV|LTDC_BLEND_PIXELALPHAINV)) + if (blendmode & (LTDC_BLEND_ALPHA | LTDC_BLEND_PIXELALPHA | + LTDC_BLEND_ALPHAINV | LTDC_BLEND_PIXELALPHAINV)) { /* Enable any alpha blending */ @@ -2929,8 +2931,8 @@ static int stm32_setblendmode(FAR struct ltdc_layer_s *layer, uint32_t mode) if (ret == OK) { priv->state.blendmode = mode; - priv->operation |= (LTDC_LAYER_SETBLENDMODE| - LTDC_LAYER_SETALPHAVALUE| + priv->operation |= (LTDC_LAYER_SETBLENDMODE | + LTDC_LAYER_SETALPHAVALUE | LTDC_LAYER_SETCOLORKEY); } @@ -3214,9 +3216,9 @@ static int stm32_update(FAR struct ltdc_layer_s *layer, uint32_t mode) * settings restored during the next update (non flip) operation */ - active->operation |= (LTDC_LAYER_SETBLENDMODE| - LTDC_LAYER_ENABLE| - LTDC_LAYER_SETCOLOR| + active->operation |= (LTDC_LAYER_SETBLENDMODE | + LTDC_LAYER_ENABLE | + LTDC_LAYER_SETCOLOR | LTDC_LAYER_SETENABLE); /* Change layer activity */ @@ -3543,8 +3545,8 @@ void stm32_ltdcuninitialize(void) { /* Disable all ltdc interrupts */ - stm32_ltdc_irqctrl(0, LTDC_IER_RRIE|LTDC_IER_TERRIE| - LTDC_IER_FUIE|LTDC_IER_LIE); + stm32_ltdc_irqctrl(0, LTDC_IER_RRIE | LTDC_IER_TERRIE | + LTDC_IER_FUIE | LTDC_IER_LIE); up_disable_irq(g_interrupt.irq); irq_detach(g_interrupt.irq); diff --git a/arch/arm/src/stm32/stm32_otgfsdev.c b/arch/arm/src/stm32/stm32_otgfsdev.c index 2cee02f8ac..c9afcb81c4 100644 --- a/arch/arm/src/stm32/stm32_otgfsdev.c +++ b/arch/arm/src/stm32/stm32_otgfsdev.c @@ -811,10 +811,11 @@ static uint32_t stm32_getreg(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return val; } } @@ -823,20 +824,20 @@ static uint32_t stm32_getreg(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ @@ -1228,10 +1229,10 @@ static void stm32_epin_request(FAR struct stm32_usbdev_s *priv, if (privreq->req.len == 0) { - /* The ZLP flag is set TRUE whenever we want to force the driver to - * send a zero-length-packet on the next pass through the loop (below). - * The flag is cleared whenever a packet is sent in the loop below. - */ + /* The ZLP flag is set TRUE whenever we want to force the driver to + * send a zero-length-packet on the next pass through the loop (below). + * The flag is cleared whenever a packet is sent in the loop below. + */ privep->zlp = true; } @@ -1669,7 +1670,7 @@ static void stm32_epout_request(FAR struct stm32_usbdev_s *priv, * read request is encountered. */ - for (;;) + for (; ; ) { /* Get a reference to the request at the head of the endpoint's request queue */ @@ -3127,133 +3128,133 @@ static inline void stm32_rxinterrupt(FAR struct stm32_usbdev_s *priv) if (epphy < STM32_NENDPOINTS) { - privep = &priv->epout[epphy]; + privep = &priv->epout[epphy]; - /* Handle the RX event according to the packet status field */ + /* Handle the RX event according to the packet status field */ - switch (regval & OTGFS_GRXSTSD_PKTSTS_MASK) - { - /* Global OUT NAK. This indicate that the global OUT NAK bit has taken - * effect. - * - * PKTSTS = Global OUT NAK, BCNT = 0, EPNUM = Don't Care, DPID = Don't - * Care. - */ - - case OTGFS_GRXSTSD_PKTSTS_OUTNAK: + switch (regval & OTGFS_GRXSTSD_PKTSTS_MASK) { - usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_OUTNAK), 0); + /* Global OUT NAK. This indicate that the global OUT NAK bit has taken + * effect. + * + * PKTSTS = Global OUT NAK, BCNT = 0, EPNUM = Don't Care, DPID = Don't + * Care. + */ + + case OTGFS_GRXSTSD_PKTSTS_OUTNAK: + { + usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_OUTNAK), 0); + } + break; + + /* OUT data packet received. + * + * PKTSTS = DataOUT, BCNT = size of the received data OUT packet, + * EPNUM = EPNUM on which the packet was received, DPID = Actual Data PID. + */ + + case OTGFS_GRXSTSD_PKTSTS_OUTRECVD: + { + usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_OUTRECVD), epphy); + bcnt = (regval & OTGFS_GRXSTSD_BCNT_MASK) >> OTGFS_GRXSTSD_BCNT_SHIFT; + if (bcnt > 0) + { + stm32_epout_receive(privep, bcnt); + } + } + break; + + /* OUT transfer completed. This indicates that an OUT data transfer for + * the specified OUT endpoint has completed. After this entry is popped + * from the receive FIFO, the core asserts a Transfer Completed interrupt + * on the specified OUT endpoint. + * + * PKTSTS = Data OUT Transfer Done, BCNT = 0, EPNUM = OUT EP Num on + * which the data transfer is complete, DPID = Don't Care. + */ + + case OTGFS_GRXSTSD_PKTSTS_OUTDONE: + { + usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_OUTDONE), epphy); + } + break; + + /* SETUP transaction completed. This indicates that the Setup stage for + * the specified endpoint has completed and the Data stage has started. + * After this entry is popped from the receive FIFO, the core asserts a + * Setup interrupt on the specified control OUT endpoint (triggers an + * interrupt). + * + * PKTSTS = Setup Stage Done, BCNT = 0, EPNUM = Control EP Num, + * DPID = Don't Care. + */ + + case OTGFS_GRXSTSD_PKTSTS_SETUPDONE: + { + usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_SETUPDONE), epphy); + } + break; + + /* SETUP data packet received. This indicates that a SETUP packet for the + * specified endpoint is now available for reading from the receive FIFO. + * + * PKTSTS = SETUP, BCNT = 8, EPNUM = Control EP Num, DPID = D0. + */ + + case OTGFS_GRXSTSD_PKTSTS_SETUPRECVD: + { + uint16_t datlen; + + usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_SETUPRECVD), epphy); + + /* Read EP0 setup data. NOTE: If multiple SETUP packets are received, + * the last one overwrites the previous setup packets and only that + * last SETUP packet will be processed. + */ + + stm32_rxfifo_read(&priv->epout[EP0], (FAR uint8_t *)&priv->ctrlreq, + USB_SIZEOF_CTRLREQ); + + /* Was this an IN or an OUT SETUP packet. If it is an OUT SETUP, + * then we need to wait for the completion of the data phase to + * process the setup command. If it is an IN SETUP packet, then + * we must processing the command BEFORE we enter the DATA phase. + * + * If the data associated with the OUT SETUP packet is zero length, + * then, of course, we don't need to wait. + */ + + datlen = GETUINT16(priv->ctrlreq.len); + if (USB_REQ_ISOUT(priv->ctrlreq.type) && datlen > 0) + { + /* Clear NAKSTS so that we can receive the data */ + + regval = stm32_getreg(STM32_OTGFS_DOEPCTL0); + regval |= OTGFS_DOEPCTL0_CNAK; + stm32_putreg(regval, STM32_OTGFS_DOEPCTL0); + + /* Wait for the data phase. */ + + priv->ep0state = EP0STATE_SETUP_OUT; + } + else + { + /* We can process the setup data as soon as SETUP done word is + * popped of the RxFIFO. + */ + + priv->ep0state = EP0STATE_SETUP_READY; + } + } + break; + + default: + { + usbtrace(TRACE_DEVERROR(STM32_TRACEERR_INVALIDPARMS), + (regval & OTGFS_GRXSTSD_PKTSTS_MASK) >> OTGFS_GRXSTSD_PKTSTS_SHIFT); + } + break; } - break; - - /* OUT data packet received. - * - * PKTSTS = DataOUT, BCNT = size of the received data OUT packet, - * EPNUM = EPNUM on which the packet was received, DPID = Actual Data PID. - */ - - case OTGFS_GRXSTSD_PKTSTS_OUTRECVD: - { - usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_OUTRECVD), epphy); - bcnt = (regval & OTGFS_GRXSTSD_BCNT_MASK) >> OTGFS_GRXSTSD_BCNT_SHIFT; - if (bcnt > 0) - { - stm32_epout_receive(privep, bcnt); - } - } - break; - - /* OUT transfer completed. This indicates that an OUT data transfer for - * the specified OUT endpoint has completed. After this entry is popped - * from the receive FIFO, the core asserts a Transfer Completed interrupt - * on the specified OUT endpoint. - * - * PKTSTS = Data OUT Transfer Done, BCNT = 0, EPNUM = OUT EP Num on - * which the data transfer is complete, DPID = Don't Care. - */ - - case OTGFS_GRXSTSD_PKTSTS_OUTDONE: - { - usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_OUTDONE), epphy); - } - break; - - /* SETUP transaction completed. This indicates that the Setup stage for - * the specified endpoint has completed and the Data stage has started. - * After this entry is popped from the receive FIFO, the core asserts a - * Setup interrupt on the specified control OUT endpoint (triggers an - * interrupt). - * - * PKTSTS = Setup Stage Done, BCNT = 0, EPNUM = Control EP Num, - * DPID = Don't Care. - */ - - case OTGFS_GRXSTSD_PKTSTS_SETUPDONE: - { - usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_SETUPDONE), epphy); - } - break; - - /* SETUP data packet received. This indicates that a SETUP packet for the - * specified endpoint is now available for reading from the receive FIFO. - * - * PKTSTS = SETUP, BCNT = 8, EPNUM = Control EP Num, DPID = D0. - */ - - case OTGFS_GRXSTSD_PKTSTS_SETUPRECVD: - { - uint16_t datlen; - - usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_SETUPRECVD), epphy); - - /* Read EP0 setup data. NOTE: If multiple SETUP packets are received, - * the last one overwrites the previous setup packets and only that - * last SETUP packet will be processed. - */ - - stm32_rxfifo_read(&priv->epout[EP0], (FAR uint8_t*)&priv->ctrlreq, - USB_SIZEOF_CTRLREQ); - - /* Was this an IN or an OUT SETUP packet. If it is an OUT SETUP, - * then we need to wait for the completion of the data phase to - * process the setup command. If it is an IN SETUP packet, then - * we must processing the command BEFORE we enter the DATA phase. - * - * If the data associated with the OUT SETUP packet is zero length, - * then, of course, we don't need to wait. - */ - - datlen = GETUINT16(priv->ctrlreq.len); - if (USB_REQ_ISOUT(priv->ctrlreq.type) && datlen > 0) - { - /* Clear NAKSTS so that we can receive the data */ - - regval = stm32_getreg(STM32_OTGFS_DOEPCTL0); - regval |= OTGFS_DOEPCTL0_CNAK; - stm32_putreg(regval, STM32_OTGFS_DOEPCTL0); - - /* Wait for the data phase. */ - - priv->ep0state = EP0STATE_SETUP_OUT; - } - else - { - /* We can process the setup data as soon as SETUP done word is - * popped of the RxFIFO. - */ - - priv->ep0state = EP0STATE_SETUP_READY; - } - } - break; - - default: - { - usbtrace(TRACE_DEVERROR(STM32_TRACEERR_INVALIDPARMS), - (regval & OTGFS_GRXSTSD_PKTSTS_MASK) >> OTGFS_GRXSTSD_PKTSTS_SHIFT); - } - break; - } } /* Enable the Rx Status Queue Level interrupt */ @@ -3474,9 +3475,9 @@ static inline void stm32_otginterrupt(FAR struct stm32_usbdev_s *priv) regval = stm32_getreg(STM32_OTGFS_GOTGINT); if ((regval & OTGFS_GOTGINT_SEDET) != 0) - { + { #warning "Missing logic" - } + } /* Clear OTG interrupt */ @@ -3514,7 +3515,7 @@ static int stm32_usbinterrupt(int irq, FAR void *context) * events. */ - for (;;) + for (; ; ) { /* Get the set of pending, un-masked interrupts */ @@ -3572,7 +3573,7 @@ static int stm32_usbinterrupt(int irq, FAR void *context) stm32_putreg(OTGFS_GINT_WKUP, STM32_OTGFS_GINTSTS); } - /* USB suspend interrupt */ + /* USB suspend interrupt */ if ((regval & OTGFS_GINT_USBSUSP) != 0) { @@ -4758,7 +4759,7 @@ static FAR struct usbdev_ep_s *stm32_ep_alloc(FAR struct usbdev_s *dev, irqrestore(flags); return in ? &priv->epin[epno].ep : &priv->epout[epno].ep; } - } + } /* We should not get here */ } @@ -4840,7 +4841,7 @@ static int stm32_wakeup(struct usbdev_s *dev) regval = stm32_getreg(STM32_OTGFS_DSTS); if ((regval & OTGFS_DSTS_SUSPSTS) != 0) { - /* Re-start the PHY clock and un-gate USB core clock (HCLK) */ + /* Re-start the PHY clock and un-gate USB core clock (HCLK) */ #ifdef CONFIG_USBDEV_LOWPOWER regval = stm32_getreg(STM32_OTGFS_PCGCCTL); diff --git a/arch/arm/src/stm32/stm32_otgfshost.c b/arch/arm/src/stm32/stm32_otgfshost.c index e4d83b5109..46aba7e752 100644 --- a/arch/arm/src/stm32/stm32_otgfshost.c +++ b/arch/arm/src/stm32/stm32_otgfshost.c @@ -73,8 +73,7 @@ * Pre-processor Definitions ****************************************************************************/ /* Configuration ***************************************************************/ -/* - * STM32 USB OTG FS Host Driver Support +/* STM32 USB OTG FS Host Driver Support * * Pre-requisites * @@ -730,14 +729,14 @@ static void stm32_chan_free(FAR struct stm32_usbhost_s *priv, int chidx) static inline void stm32_chan_freeall(FAR struct stm32_usbhost_s *priv) { - uint8_t chidx; + uint8_t chidx; - /* Free all host channels */ + /* Free all host channels */ - for (chidx = 2; chidx < STM32_NHOST_CHANNELS; chidx ++) - { - stm32_chan_free(priv, chidx); - } + for (chidx = 2; chidx < STM32_NHOST_CHANNELS; chidx ++) + { + stm32_chan_free(priv, chidx); + } } /**************************************************************************** @@ -1651,9 +1650,9 @@ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv, return ret; } - /* Get the elapsed time (in frames) */ + /* Get the elapsed time (in frames) */ - elapsed = clock_systimer() - start; + elapsed = clock_systimer() - start; } while (elapsed < STM32_SETUP_DELAY); @@ -1872,7 +1871,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx, if (ret < 0) { - usbhost_trace1(OTGFS_TRACE1_TRNSFRFAILED,ret); + usbhost_trace1(OTGFS_TRACE1_TRNSFRFAILED, ret); /* Check for a special case: If (1) the transfer was NAKed and (2) * no Tx FIFO empty or Rx FIFO not-empty event occurred, then we @@ -2117,7 +2116,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, ret = stm32_chan_waitsetup(priv, chan); if (ret < 0) { - usbhost_trace1(OTGFS_TRACE1_DEVDISCONN,0); + usbhost_trace1(OTGFS_TRACE1_DEVDISCONN, 0); return (ssize_t)ret; } @@ -2130,7 +2129,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, return (ssize_t)ret; } - /* Wait for the transfer to complete and get the result */ + /* Wait for the transfer to complete and get the result */ ret = stm32_chan_wait(priv, chan); @@ -2138,7 +2137,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, if (ret < 0) { - usbhost_trace1(OTGFS_TRACE1_TRNSFRFAILED,ret); + usbhost_trace1(OTGFS_TRACE1_TRNSFRFAILED, ret); /* Check for a special case: If (1) the transfer was NAKed and (2) * no Tx FIFO empty or Rx FIFO not-empty event occurred, then we @@ -2204,7 +2203,7 @@ static void stm32_out_next(FAR struct stm32_usbhost_s *priv, int result; int ret; - /* Is the full transfer complete? Did the last chunk transfer complete OK?*/ + /* Is the full transfer complete? Did the last chunk transfer complete OK? */ result = -(int)chan->result; if (chan->xfrd < chan->buflen && result == OK) @@ -2837,7 +2836,7 @@ static void stm32_gint_connected(FAR struct stm32_usbhost_s *priv) { /* Yes.. then now we are connected */ - usbhost_vtrace1(OTGFS_VTRACE1_CONNECTED,0); + usbhost_vtrace1(OTGFS_VTRACE1_CONNECTED, 0); priv->connected = true; priv->change = true; DEBUGASSERT(priv->smstate == SMSTATE_DETACHED); @@ -2869,16 +2868,16 @@ static void stm32_gint_disconnected(FAR struct stm32_usbhost_s *priv) { /* Yes.. then we no longer connected */ - usbhost_vtrace1(OTGFS_VTRACE1_DISCONNECTED,0); + usbhost_vtrace1(OTGFS_VTRACE1_DISCONNECTED, 0); /* Are we bound to a class driver? */ - if ( priv->rhport.hport.devclass) + if (priv->rhport.hport.devclass) { /* Yes.. Disconnect the class driver */ - CLASS_DISCONNECTED( priv->rhport.hport.devclass); - priv->rhport.hport.devclass = NULL; + CLASS_DISCONNECTED(priv->rhport.hport.devclass); + priv->rhport.hport.devclass = NULL; } /* Re-Initialize Host for new Enumeration */ @@ -2890,9 +2889,9 @@ static void stm32_gint_disconnected(FAR struct stm32_usbhost_s *priv) priv->rhport.hport.speed = USB_SPEED_FULL; - /* Notify any waiters that there is a change in the connection state */ + /* Notify any waiters that there is a change in the connection state */ - if (priv->pscwait) + if (priv->pscwait) { stm32_givesem(&priv->pscsem); priv->pscwait = false; @@ -3450,7 +3449,7 @@ static int stm32_gint_isr(int irq, FAR void *context) * little interrupt handling overhead. */ - for (;;) + for (; ; ) { /* Get the unmasked bits in the GINT status */ @@ -3741,7 +3740,7 @@ static int stm32_wait(FAR struct usbhost_connection_s *conn, /* Loop until a change in connection state is detected */ flags = irqsave(); - for (;;) + for (; ; ) { /* Is there a change in the connection state of the single root hub * port? @@ -3835,7 +3834,7 @@ static int stm32_rh_enumerate(FAR struct stm32_usbhost_s *priv, { /* No, return an error */ - usbhost_trace1(OTGFS_TRACE1_DEVDISCONN,0); + usbhost_trace1(OTGFS_TRACE1_DEVDISCONN, 0); return -ENODEV; } @@ -4333,7 +4332,7 @@ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, ret = stm32_ctrl_sendsetup(priv, ep0info, req); if (ret < 0) - { + { usbhost_trace1(OTGFS_TRACE1_SENDSETUP, -ret); continue; } @@ -4805,7 +4804,8 @@ static void stm32_portreset(FAR struct stm32_usbhost_s *priv) uint32_t regval; regval = stm32_getreg(STM32_OTGFS_HPRT); - regval &= ~(OTGFS_HPRT_PENA|OTGFS_HPRT_PCDET|OTGFS_HPRT_PENCHNG|OTGFS_HPRT_POCCHNG); + regval &= ~(OTGFS_HPRT_PENA | OTGFS_HPRT_PCDET | OTGFS_HPRT_PENCHNG | + OTGFS_HPRT_POCCHNG); regval |= OTGFS_HPRT_PRST; stm32_putreg(STM32_OTGFS_HPRT, regval); @@ -4922,7 +4922,8 @@ static void stm32_vbusdrive(FAR struct stm32_usbhost_s *priv, bool state) /* Turn on the Host port power. */ regval = stm32_getreg(STM32_OTGFS_HPRT); - regval &= ~(OTGFS_HPRT_PENA|OTGFS_HPRT_PCDET|OTGFS_HPRT_PENCHNG|OTGFS_HPRT_POCCHNG); + regval &= ~(OTGFS_HPRT_PENA | OTGFS_HPRT_PCDET | OTGFS_HPRT_PENCHNG | + OTGFS_HPRT_POCCHNG); if (((regval & OTGFS_HPRT_PPWR) == 0) && state) { @@ -5132,7 +5133,7 @@ static inline int stm32_hw_initialize(FAR struct stm32_usbhost_s *priv) * transceiver: "This bit is always 1 with write-only access" */ - regval = stm32_getreg(STM32_OTGFS_GUSBCFG);; + regval = stm32_getreg(STM32_OTGFS_GUSBCFG); regval |= OTGFS_GUSBCFG_PHYSEL; stm32_putreg(STM32_OTGFS_GUSBCFG, regval); diff --git a/arch/arm/src/stm32/stm32_otghsdev.c b/arch/arm/src/stm32/stm32_otghsdev.c index a69d4a7cd1..338f6616ad 100644 --- a/arch/arm/src/stm32/stm32_otghsdev.c +++ b/arch/arm/src/stm32/stm32_otghsdev.c @@ -811,10 +811,11 @@ static uint32_t stm32_getreg(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return val; } } @@ -823,20 +824,20 @@ static uint32_t stm32_getreg(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ @@ -1228,12 +1229,12 @@ static void stm32_epin_request(FAR struct stm32_usbdev_s *priv, if (privreq->req.len == 0) { - /* The ZLP flag is set TRUE whenever we want to force the driver to - * send a zero-length-packet on the next pass through the loop (below). - * The flag is cleared whenever a packet is sent in the loop below. - */ + /* The ZLP flag is set TRUE whenever we want to force the driver to + * send a zero-length-packet on the next pass through the loop (below). + * The flag is cleared whenever a packet is sent in the loop below. + */ - privep->zlp = true; + privep->zlp = true; } /* Add one more packet to the TxFIFO. We will wait for the transfer @@ -1669,7 +1670,7 @@ static void stm32_epout_request(FAR struct stm32_usbdev_s *priv, * read request is encountered. */ - for (;;) + for (; ; ) { /* Get a reference to the request at the head of the endpoint's request queue */ @@ -3127,133 +3128,133 @@ static inline void stm32_rxinterrupt(FAR struct stm32_usbdev_s *priv) if (epphy < STM32_NENDPOINTS) { - privep = &priv->epout[epphy]; + privep = &priv->epout[epphy]; - /* Handle the RX event according to the packet status field */ + /* Handle the RX event according to the packet status field */ - switch (regval & OTGHS_GRXSTSD_PKTSTS_MASK) - { - /* Global OUT NAK. This indicate that the global OUT NAK bit has taken - * effect. - * - * PKTSTS = Global OUT NAK, BCNT = 0, EPNUM = Don't Care, DPID = Don't - * Care. - */ - - case OTGHS_GRXSTSD_PKTSTS_OUTNAK: + switch (regval & OTGHS_GRXSTSD_PKTSTS_MASK) { - usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_OUTNAK), 0); + /* Global OUT NAK. This indicate that the global OUT NAK bit has taken + * effect. + * + * PKTSTS = Global OUT NAK, BCNT = 0, EPNUM = Don't Care, DPID = Don't + * Care. + */ + + case OTGHS_GRXSTSD_PKTSTS_OUTNAK: + { + usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_OUTNAK), 0); + } + break; + + /* OUT data packet received. + * + * PKTSTS = DataOUT, BCNT = size of the received data OUT packet, + * EPNUM = EPNUM on which the packet was received, DPID = Actual Data PID. + */ + + case OTGHS_GRXSTSD_PKTSTS_OUTRECVD: + { + usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_OUTRECVD), epphy); + bcnt = (regval & OTGHS_GRXSTSD_BCNT_MASK) >> OTGHS_GRXSTSD_BCNT_SHIFT; + if (bcnt > 0) + { + stm32_epout_receive(privep, bcnt); + } + } + break; + + /* OUT transfer completed. This indicates that an OUT data transfer for + * the specified OUT endpoint has completed. After this entry is popped + * from the receive FIFO, the core asserts a Transfer Completed interrupt + * on the specified OUT endpoint. + * + * PKTSTS = Data OUT Transfer Done, BCNT = 0, EPNUM = OUT EP Num on + * which the data transfer is complete, DPID = Don't Care. + */ + + case OTGHS_GRXSTSD_PKTSTS_OUTDONE: + { + usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_OUTDONE), epphy); + } + break; + + /* SETUP transaction completed. This indicates that the Setup stage for + * the specified endpoint has completed and the Data stage has started. + * After this entry is popped from the receive FIFO, the core asserts a + * Setup interrupt on the specified control OUT endpoint (triggers an + * interrupt). + * + * PKTSTS = Setup Stage Done, BCNT = 0, EPNUM = Control EP Num, + * DPID = Don't Care. + */ + + case OTGHS_GRXSTSD_PKTSTS_SETUPDONE: + { + usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_SETUPDONE), epphy); + } + break; + + /* SETUP data packet received. This indicates that a SETUP packet for the + * specified endpoint is now available for reading from the receive FIFO. + * + * PKTSTS = SETUP, BCNT = 8, EPNUM = Control EP Num, DPID = D0. + */ + + case OTGHS_GRXSTSD_PKTSTS_SETUPRECVD: + { + uint16_t datlen; + + usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_SETUPRECVD), epphy); + + /* Read EP0 setup data. NOTE: If multiple SETUP packets are received, + * the last one overwrites the previous setup packets and only that + * last SETUP packet will be processed. + */ + + stm32_rxfifo_read(&priv->epout[EP0], (FAR uint8_t *)&priv->ctrlreq, + USB_SIZEOF_CTRLREQ); + + /* Was this an IN or an OUT SETUP packet. If it is an OUT SETUP, + * then we need to wait for the completion of the data phase to + * process the setup command. If it is an IN SETUP packet, then + * we must processing the command BEFORE we enter the DATA phase. + * + * If the data associated with the OUT SETUP packet is zero length, + * then, of course, we don't need to wait. + */ + + datlen = GETUINT16(priv->ctrlreq.len); + if (USB_REQ_ISOUT(priv->ctrlreq.type) && datlen > 0) + { + /* Clear NAKSTS so that we can receive the data */ + + regval = stm32_getreg(STM32_OTGHS_DOEPCTL0); + regval |= OTGHS_DOEPCTL0_CNAK; + stm32_putreg(regval, STM32_OTGHS_DOEPCTL0); + + /* Wait for the data phase. */ + + priv->ep0state = EP0STATE_SETUP_OUT; + } + else + { + /* We can process the setup data as soon as SETUP done word is + * popped of the RxFIFO. + */ + + priv->ep0state = EP0STATE_SETUP_READY; + } + } + break; + + default: + { + usbtrace(TRACE_DEVERROR(STM32_TRACEERR_INVALIDPARMS), + (regval & OTGHS_GRXSTSD_PKTSTS_MASK) >> OTGHS_GRXSTSD_PKTSTS_SHIFT); + } + break; } - break; - - /* OUT data packet received. - * - * PKTSTS = DataOUT, BCNT = size of the received data OUT packet, - * EPNUM = EPNUM on which the packet was received, DPID = Actual Data PID. - */ - - case OTGHS_GRXSTSD_PKTSTS_OUTRECVD: - { - usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_OUTRECVD), epphy); - bcnt = (regval & OTGHS_GRXSTSD_BCNT_MASK) >> OTGHS_GRXSTSD_BCNT_SHIFT; - if (bcnt > 0) - { - stm32_epout_receive(privep, bcnt); - } - } - break; - - /* OUT transfer completed. This indicates that an OUT data transfer for - * the specified OUT endpoint has completed. After this entry is popped - * from the receive FIFO, the core asserts a Transfer Completed interrupt - * on the specified OUT endpoint. - * - * PKTSTS = Data OUT Transfer Done, BCNT = 0, EPNUM = OUT EP Num on - * which the data transfer is complete, DPID = Don't Care. - */ - - case OTGHS_GRXSTSD_PKTSTS_OUTDONE: - { - usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_OUTDONE), epphy); - } - break; - - /* SETUP transaction completed. This indicates that the Setup stage for - * the specified endpoint has completed and the Data stage has started. - * After this entry is popped from the receive FIFO, the core asserts a - * Setup interrupt on the specified control OUT endpoint (triggers an - * interrupt). - * - * PKTSTS = Setup Stage Done, BCNT = 0, EPNUM = Control EP Num, - * DPID = Don't Care. - */ - - case OTGHS_GRXSTSD_PKTSTS_SETUPDONE: - { - usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_SETUPDONE), epphy); - } - break; - - /* SETUP data packet received. This indicates that a SETUP packet for the - * specified endpoint is now available for reading from the receive FIFO. - * - * PKTSTS = SETUP, BCNT = 8, EPNUM = Control EP Num, DPID = D0. - */ - - case OTGHS_GRXSTSD_PKTSTS_SETUPRECVD: - { - uint16_t datlen; - - usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_SETUPRECVD), epphy); - - /* Read EP0 setup data. NOTE: If multiple SETUP packets are received, - * the last one overwrites the previous setup packets and only that - * last SETUP packet will be processed. - */ - - stm32_rxfifo_read(&priv->epout[EP0], (FAR uint8_t*)&priv->ctrlreq, - USB_SIZEOF_CTRLREQ); - - /* Was this an IN or an OUT SETUP packet. If it is an OUT SETUP, - * then we need to wait for the completion of the data phase to - * process the setup command. If it is an IN SETUP packet, then - * we must processing the command BEFORE we enter the DATA phase. - * - * If the data associated with the OUT SETUP packet is zero length, - * then, of course, we don't need to wait. - */ - - datlen = GETUINT16(priv->ctrlreq.len); - if (USB_REQ_ISOUT(priv->ctrlreq.type) && datlen > 0) - { - /* Clear NAKSTS so that we can receive the data */ - - regval = stm32_getreg(STM32_OTGHS_DOEPCTL0); - regval |= OTGHS_DOEPCTL0_CNAK; - stm32_putreg(regval, STM32_OTGHS_DOEPCTL0); - - /* Wait for the data phase. */ - - priv->ep0state = EP0STATE_SETUP_OUT; - } - else - { - /* We can process the setup data as soon as SETUP done word is - * popped of the RxFIFO. - */ - - priv->ep0state = EP0STATE_SETUP_READY; - } - } - break; - - default: - { - usbtrace(TRACE_DEVERROR(STM32_TRACEERR_INVALIDPARMS), - (regval & OTGHS_GRXSTSD_PKTSTS_MASK) >> OTGHS_GRXSTSD_PKTSTS_SHIFT); - } - break; - } } /* Enable the Rx Status Queue Level interrupt */ @@ -3474,9 +3475,9 @@ static inline void stm32_otginterrupt(FAR struct stm32_usbdev_s *priv) regval = stm32_getreg(STM32_OTGHS_GOTGINT); if ((regval & OTGHS_GOTGINT_SEDET) != 0) - { + { #warning "Missing logic" - } + } /* Clear OTG interrupt */ @@ -3514,7 +3515,7 @@ static int stm32_usbinterrupt(int irq, FAR void *context) * events. */ - for (;;) + for (; ; ) { /* Get the set of pending, un-masked interrupts */ @@ -3572,7 +3573,7 @@ static int stm32_usbinterrupt(int irq, FAR void *context) stm32_putreg(OTGHS_GINT_WKUP, STM32_OTGHS_GINTSTS); } - /* USB suspend interrupt */ + /* USB suspend interrupt */ if ((regval & OTGHS_GINT_USBSUSP) != 0) { @@ -4758,7 +4759,7 @@ static FAR struct usbdev_ep_s *stm32_ep_alloc(FAR struct usbdev_s *dev, irqrestore(flags); return in ? &priv->epin[epno].ep : &priv->epout[epno].ep; } - } + } /* We should not get here */ } @@ -4840,7 +4841,7 @@ static int stm32_wakeup(struct usbdev_s *dev) regval = stm32_getreg(STM32_OTGHS_DSTS); if ((regval & OTGHS_DSTS_SUSPSTS) != 0) { - /* Re-start the PHY clock and un-gate USB core clock (HCLK) */ + /* Re-start the PHY clock and un-gate USB core clock (HCLK) */ #ifdef CONFIG_USBDEV_LOWPOWER regval = stm32_getreg(STM32_OTGHS_PCGCCTL); @@ -5657,4 +5658,3 @@ int usbdev_unregister(struct usbdevclass_driver_s *driver) } #endif /* CONFIG_USBDEV && CONFIG_STM32_OTGHSDEV */ - diff --git a/arch/arm/src/stm32/stm32_otghshost.c b/arch/arm/src/stm32/stm32_otghshost.c index 3a909597ce..e5b1a3117c 100644 --- a/arch/arm/src/stm32/stm32_otghshost.c +++ b/arch/arm/src/stm32/stm32_otghshost.c @@ -73,8 +73,7 @@ * Pre-processor Definitions ****************************************************************************/ /* Configuration ***************************************************************/ -/* - * STM32 USB OTG HS Host Driver Support +/* STM32 USB OTG HS Host Driver Support * * Pre-requisites * @@ -730,14 +729,14 @@ static void stm32_chan_free(FAR struct stm32_usbhost_s *priv, int chidx) static inline void stm32_chan_freeall(FAR struct stm32_usbhost_s *priv) { - uint8_t chidx; + uint8_t chidx; - /* Free all host channels */ + /* Free all host channels */ - for (chidx = 2; chidx < STM32_NHOST_CHANNELS; chidx ++) - { - stm32_chan_free(priv, chidx); - } + for (chidx = 2; chidx < STM32_NHOST_CHANNELS; chidx ++) + { + stm32_chan_free(priv, chidx); + } } /**************************************************************************** @@ -1651,9 +1650,9 @@ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv, return ret; } - /* Get the elapsed time (in frames) */ + /* Get the elapsed time (in frames) */ - elapsed = clock_systimer() - start; + elapsed = clock_systimer() - start; } while (elapsed < STM32_SETUP_DELAY); @@ -1872,7 +1871,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx, if (ret < 0) { - usbhost_trace1(OTGHS_TRACE1_TRNSFRFAILED,ret); + usbhost_trace1(OTGHS_TRACE1_TRNSFRFAILED, ret); /* Check for a special case: If (1) the transfer was NAKed and (2) * no Tx FIFO empty or Rx FIFO not-empty event occurred, then we @@ -2117,7 +2116,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, ret = stm32_chan_waitsetup(priv, chan); if (ret < 0) { - usbhost_trace1(OTGHS_TRACE1_DEVDISCONN,0); + usbhost_trace1(OTGHS_TRACE1_DEVDISCONN, 0); return (ssize_t)ret; } @@ -2130,7 +2129,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, return (ssize_t)ret; } - /* Wait for the transfer to complete and get the result */ + /* Wait for the transfer to complete and get the result */ ret = stm32_chan_wait(priv, chan); @@ -2138,7 +2137,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, if (ret < 0) { - usbhost_trace1(OTGHS_TRACE1_TRNSFRFAILED,ret); + usbhost_trace1(OTGHS_TRACE1_TRNSFRFAILED, ret); /* Check for a special case: If (1) the transfer was NAKed and (2) * no Tx FIFO empty or Rx FIFO not-empty event occurred, then we @@ -2204,7 +2203,7 @@ static void stm32_out_next(FAR struct stm32_usbhost_s *priv, int result; int ret; - /* Is the full transfer complete? Did the last chunk transfer complete OK?*/ + /* Is the full transfer complete? Did the last chunk transfer complete OK? */ result = -(int)chan->result; if (chan->xfrd < chan->buflen && result == OK) @@ -2837,7 +2836,7 @@ static void stm32_gint_connected(FAR struct stm32_usbhost_s *priv) { /* Yes.. then now we are connected */ - usbhost_vtrace1(OTGHS_VTRACE1_CONNECTED,0); + usbhost_vtrace1(OTGHS_VTRACE1_CONNECTED, 0); priv->connected = true; priv->change = true; DEBUGASSERT(priv->smstate == SMSTATE_DETACHED); @@ -2869,15 +2868,15 @@ static void stm32_gint_disconnected(FAR struct stm32_usbhost_s *priv) { /* Yes.. then we no longer connected */ - usbhost_vtrace1(OTGHS_VTRACE1_DISCONNECTED,0); + usbhost_vtrace1(OTGHS_VTRACE1_DISCONNECTED, 0); /* Are we bound to a class driver? */ - if ( priv->rhport.hport.devclass) + if (priv->rhport.hport.devclass) { /* Yes.. Disconnect the class driver */ - CLASS_DISCONNECTED( priv->rhport.hport.devclass); + CLASS_DISCONNECTED(priv->rhport.hport.devclass); priv->rhport.hport.devclass = NULL; } @@ -2890,9 +2889,9 @@ static void stm32_gint_disconnected(FAR struct stm32_usbhost_s *priv) priv->rhport.hport.speed = USB_SPEED_FULL; - /* Notify any waiters that there is a change in the connection state */ + /* Notify any waiters that there is a change in the connection state */ - if (priv->pscwait) + if (priv->pscwait) { stm32_givesem(&priv->pscsem); priv->pscwait = false; @@ -3450,7 +3449,7 @@ static int stm32_gint_isr(int irq, FAR void *context) * little interrupt handling overhead. */ - for (;;) + for (; ; ) { /* Get the unmasked bits in the GINT status */ @@ -3741,7 +3740,7 @@ static int stm32_wait(FAR struct usbhost_connection_s *conn, /* Loop until a change in connection state is detected */ flags = irqsave(); - for (;;) + for (; ; ) { /* Is there a change in the connection state of the single root hub * port? @@ -3835,7 +3834,7 @@ static int stm32_rh_enumerate(FAR struct stm32_usbhost_s *priv, { /* No, return an error */ - usbhost_trace1(OTGHS_TRACE1_DEVDISCONN,0); + usbhost_trace1(OTGHS_TRACE1_DEVDISCONN, 0); return -ENODEV; } @@ -4333,7 +4332,7 @@ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, ret = stm32_ctrl_sendsetup(priv, ep0info, req); if (ret < 0) - { + { usbhost_trace1(OTGHS_TRACE1_SENDSETUP, -ret); continue; } @@ -4805,7 +4804,8 @@ static void stm32_portreset(FAR struct stm32_usbhost_s *priv) uint32_t regval; regval = stm32_getreg(STM32_OTGHS_HPRT); - regval &= ~(OTGHS_HPRT_PENA|OTGHS_HPRT_PCDET|OTGHS_HPRT_PENCHNG|OTGHS_HPRT_POCCHNG); + regval &= ~(OTGHS_HPRT_PENA | OTGHS_HPRT_PCDET | OTGHS_HPRT_PENCHNG | + OTGHS_HPRT_POCCHNG); regval |= OTGHS_HPRT_PRST; stm32_putreg(STM32_OTGHS_HPRT, regval); @@ -4922,7 +4922,8 @@ static void stm32_vbusdrive(FAR struct stm32_usbhost_s *priv, bool state) /* Turn on the Host port power. */ regval = stm32_getreg(STM32_OTGHS_HPRT); - regval &= ~(OTGHS_HPRT_PENA|OTGHS_HPRT_PCDET|OTGHS_HPRT_PENCHNG|OTGHS_HPRT_POCCHNG); + regval &= ~(OTGHS_HPRT_PENA | OTGHS_HPRT_PCDET | OTGHS_HPRT_PENCHNG | + OTGHS_HPRT_POCCHNG); if (((regval & OTGHS_HPRT_PPWR) == 0) && state) { @@ -5132,7 +5133,7 @@ static inline int stm32_hw_initialize(FAR struct stm32_usbhost_s *priv) * transceiver: "This bit is always 1 with write-only access" */ - regval = stm32_getreg(STM32_OTGHS_GUSBCFG);; + regval = stm32_getreg(STM32_OTGHS_GUSBCFG); regval |= OTGHS_GUSBCFG_PHYSEL; stm32_putreg(STM32_OTGHS_GUSBCFG, regval); diff --git a/arch/arm/src/stm32/stm32_procfs_ccm.c b/arch/arm/src/stm32/stm32_procfs_ccm.c index 927a102716..ee4d91624c 100644 --- a/arch/arm/src/stm32/stm32_procfs_ccm.c +++ b/arch/arm/src/stm32/stm32_procfs_ccm.c @@ -306,7 +306,7 @@ static int ccm_stat(const char *relpath, struct stat *buf) return -ENOENT; } - buf->st_mode = S_IFREG|S_IROTH|S_IRGRP|S_IRUSR; + buf->st_mode = S_IFREG | S_IROTH | S_IRGRP | S_IRUSR; buf->st_size = 0; buf->st_blksize = 0; buf->st_blocks = 0; diff --git a/arch/arm/src/stm32/stm32_pwm.c b/arch/arm/src/stm32/stm32_pwm.c index 622a87081b..2d914a1e8d 100644 --- a/arch/arm/src/stm32/stm32_pwm.c +++ b/arch/arm/src/stm32/stm32_pwm.c @@ -1308,13 +1308,13 @@ static int pwm_shutdown(FAR struct pwm_lowerhalf_s *dev) /* Then put the GPIO pin back to the default state */ - pincfg = priv->pincfg & (GPIO_PORT_MASK|GPIO_PIN_MASK); + pincfg = priv->pincfg & (GPIO_PORT_MASK | GPIO_PIN_MASK); #if defined(CONFIG_STM32_STM32F10XX) - pincfg |= (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT); + pincfg |= (GPIO_INPUT | GPIO_CNF_INFLOAT | GPIO_MODE_INPUT); #elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || \ defined(CONFIG_STM32_STM32L15XX) - pincfg |= (GPIO_INPUT|GPIO_FLOAT); + pincfg |= (GPIO_INPUT | GPIO_FLOAT); #else # error "Unrecognized STM32 chip" #endif diff --git a/arch/arm/src/stm32/stm32_qencoder.c b/arch/arm/src/stm32/stm32_qencoder.c index ea1b8e0854..d53c10857e 100644 --- a/arch/arm/src/stm32/stm32_qencoder.c +++ b/arch/arm/src/stm32/stm32_qencoder.c @@ -770,11 +770,11 @@ static int stm32_setup(FAR struct qe_lowerhalf_s *lower) #if defined(CONFIG_STM32_TIM1_QE) || defined(CONFIG_STM32_TIM8_QE) if (priv->config->timid == 1 || priv->config->timid == 8) - { - /* Clear the Repetition Counter value */ + { + /* Clear the Repetition Counter value */ - stm32_putreg16(priv, STM32_ATIM_RCR_OFFSET, 0); - } + stm32_putreg16(priv, STM32_ATIM_RCR_OFFSET, 0); + } #endif /* Generate an update event to reload the Prescaler @@ -807,7 +807,7 @@ static int stm32_setup(FAR struct qe_lowerhalf_s *lower) /* Select the Input IC1=TI1 and set the filter fSAMPLING=fDTS/4, N=6 */ - ccmr1 &= ~(GTIM_CCMR1_CC1S_MASK|GTIM_CCMR1_IC1F_MASK); + ccmr1 &= ~(GTIM_CCMR1_CC1S_MASK | GTIM_CCMR1_IC1F_MASK); ccmr1 |= GTIM_CCMR_CCS_CCIN1 << GTIM_CCMR1_CC1S_SHIFT; ccmr1 |= GTIM_CCMR_ICF_FDTSd46 << GTIM_CCMR1_IC1F_SHIFT; @@ -842,7 +842,7 @@ static int stm32_setup(FAR struct qe_lowerhalf_s *lower) /* Select the Input IC2=TI2 and set the filter fSAMPLING=fDTS/4, N=6 */ - ccmr1 &= ~(GTIM_CCMR1_CC2S_MASK|GTIM_CCMR1_IC2F_MASK); + ccmr1 &= ~(GTIM_CCMR1_CC2S_MASK | GTIM_CCMR1_IC2F_MASK); ccmr1 |= GTIM_CCMR_CCS_CCIN1 << GTIM_CCMR1_CC2S_SHIFT; ccmr1 |= GTIM_CCMR_ICF_FDTSd46 << GTIM_CCMR1_IC2F_SHIFT; @@ -1031,12 +1031,12 @@ static int stm32_shutdown(FAR struct qe_lowerhalf_s *lower) /* Put the TI1 GPIO pin back to its default state */ - pincfg = priv->config->ti1cfg & (GPIO_PORT_MASK|GPIO_PIN_MASK); + pincfg = priv->config->ti1cfg & (GPIO_PORT_MASK | GPIO_PIN_MASK); #if defined(CONFIG_STM32_STM32F10XX) - pincfg |= (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT); + pincfg |= (GPIO_INPUT | GPIO_CNF_INFLOAT | GPIO_MODE_INPUT); #elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) - pincfg |= (GPIO_INPUT|GPIO_FLOAT); + pincfg |= (GPIO_INPUT | GPIO_FLOAT); #else # error "Unrecognized STM32 chip" #endif @@ -1045,12 +1045,12 @@ static int stm32_shutdown(FAR struct qe_lowerhalf_s *lower) /* Put the TI2 GPIO pin back to its default state */ - pincfg = priv->config->ti2cfg & (GPIO_PORT_MASK|GPIO_PIN_MASK); + pincfg = priv->config->ti2cfg & (GPIO_PORT_MASK | GPIO_PIN_MASK); #if defined(CONFIG_STM32_STM32F10XX) - pincfg |= (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT); + pincfg |= (GPIO_INPUT | GPIO_CNF_INFLOAT | GPIO_MODE_INPUT); #elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) - pincfg |= (GPIO_INPUT|GPIO_FLOAT); + pincfg |= (GPIO_INPUT | GPIO_FLOAT); #else # error "Unrecognized STM32 chip" #endif @@ -1099,7 +1099,7 @@ static int stm32_position(FAR struct qe_lowerhalf_s *lower, int32_t *pos) #else /* Return the counter value */ - *pos = (int32_t)stm32_getreg32(priv, STM32_GTIM_CNT_OFFSET);; + *pos = (int32_t)stm32_getreg32(priv, STM32_GTIM_CNT_OFFSET); #endif return OK; } diff --git a/arch/arm/src/stm32/stm32_rng.c b/arch/arm/src/stm32/stm32_rng.c index 5a43bb5128..5726f43ef9 100644 --- a/arch/arm/src/stm32/stm32_rng.c +++ b/arch/arm/src/stm32/stm32_rng.c @@ -90,7 +90,7 @@ static const struct file_operations g_rngops = 0, /* seek */ 0 /* ioctl */ #ifndef CONFIG_DISABLE_POLL - ,0 /* poll */ + , 0 /* poll */ #endif }; @@ -193,7 +193,7 @@ static int stm32_interrupt(int irq, void *context) if (g_rngdev.rd_buflen >= 4) { g_rngdev.rd_buflen -= 4; - *(uint32_t*)&g_rngdev.rd_buf[g_rngdev.rd_buflen] = data; + *(uint32_t *)&g_rngdev.rd_buf[g_rngdev.rd_buflen] = data; } else { diff --git a/arch/arm/src/stm32/stm32_rtcc.c b/arch/arm/src/stm32/stm32_rtcc.c index 6f2294238c..acfbbf5735 100644 --- a/arch/arm/src/stm32/stm32_rtcc.c +++ b/arch/arm/src/stm32/stm32_rtcc.c @@ -557,7 +557,7 @@ static void rtc_resume(void) /* Clear the RTC alarm flags */ regval = getreg32(STM32_RTC_ISR); - regval &= ~(RTC_ISR_ALRAF|RTC_ISR_ALRBF); + regval &= ~(RTC_ISR_ALRAF | RTC_ISR_ALRBF); putreg32(regval, STM32_RTC_ISR); /* Clear the EXTI Line 17 Pending bit (Connected internally to RTC Alarm) */ @@ -688,27 +688,27 @@ int up_rtcinitialize(void) modifyreg32(STM32_RCC_XXX, RCC_XXX_YYYRST, 0); #if defined(CONFIG_RTC_HSECLOCK) - /* Change to the new clock as the input to the RTC block */ + /* Change to the new clock as the input to the RTC block */ - modifyreg32(STM32_RCC_XXX, RCC_XXX_RTCSEL_MASK, RCC_XXX_RTCSEL_HSE); + modifyreg32(STM32_RCC_XXX, RCC_XXX_RTCSEL_MASK, RCC_XXX_RTCSEL_HSE); #elif defined(CONFIG_RTC_LSICLOCK) - modifyreg32(STM32_RCC_XXX, RCC_XXX_RTCSEL_MASK, RCC_XXX_RTCSEL_LSI); + modifyreg32(STM32_RCC_XXX, RCC_XXX_RTCSEL_MASK, RCC_XXX_RTCSEL_LSI); #elif defined(CONFIG_RTC_LSECLOCK) - modifyreg32(STM32_RCC_XXX, RCC_XXX_RTCSEL_MASK, RCC_XXX_RTCSEL_LSE); + modifyreg32(STM32_RCC_XXX, RCC_XXX_RTCSEL_MASK, RCC_XXX_RTCSEL_LSE); #endif - putreg32(tr_bkp,STM32_RTC_TR); - putreg32(dr_bkp,STM32_RTC_DR); + putreg32(tr_bkp, STM32_RTC_TR); + putreg32(dr_bkp, STM32_RTC_DR); - /* Remember that the RTC is initialized */ + /* Remember that the RTC is initialized */ - putreg32(RTC_MAGIC, RTC_MAGIC_REG); + putreg32(RTC_MAGIC, RTC_MAGIC_REG); - /* Enable the RTC Clock by setting the RTCEN bit in the RCC register */ + /* Enable the RTC Clock by setting the RTCEN bit in the RCC register */ - modifyreg32(STM32_RCC_XXX, 0, RCC_XXX_RTCEN); + modifyreg32(STM32_RCC_XXX, 0, RCC_XXX_RTCEN); } } @@ -874,13 +874,13 @@ int up_rtc_getdatetime(FAR struct tm *tp) * register. */ - tmp = (tr & (RTC_TR_SU_MASK|RTC_TR_ST_MASK)) >> RTC_TR_SU_SHIFT; + tmp = (tr & (RTC_TR_SU_MASK | RTC_TR_ST_MASK)) >> RTC_TR_SU_SHIFT; tp->tm_sec = rtc_bcd2bin(tmp); - tmp = (tr & (RTC_TR_MNU_MASK|RTC_TR_MNT_MASK)) >> RTC_TR_MNU_SHIFT; + tmp = (tr & (RTC_TR_MNU_MASK | RTC_TR_MNT_MASK)) >> RTC_TR_MNU_SHIFT; tp->tm_min = rtc_bcd2bin(tmp); - tmp = (tr & (RTC_TR_HU_MASK|RTC_TR_HT_MASK)) >> RTC_TR_HU_SHIFT; + tmp = (tr & (RTC_TR_HU_MASK | RTC_TR_HT_MASK)) >> RTC_TR_HU_SHIFT; tp->tm_hour = rtc_bcd2bin(tmp); /* Now convert the RTC date to fields in struct tm format: @@ -893,13 +893,13 @@ int up_rtc_getdatetime(FAR struct tm *tp) * years 2000-2099? I'll assume so. */ - tmp = (dr & (RTC_DR_DU_MASK|RTC_DR_DT_MASK)) >> RTC_DR_DU_SHIFT; + tmp = (dr & (RTC_DR_DU_MASK | RTC_DR_DT_MASK)) >> RTC_DR_DU_SHIFT; tp->tm_mday = rtc_bcd2bin(tmp); - tmp = (dr & (RTC_DR_MU_MASK|RTC_DR_MT)) >> RTC_DR_MU_SHIFT; + tmp = (dr & (RTC_DR_MU_MASK | RTC_DR_MT)) >> RTC_DR_MU_SHIFT; tp->tm_mon = rtc_bcd2bin(tmp) - 1; - tmp = (dr & (RTC_DR_YU_MASK|RTC_DR_YT_MASK)) >> RTC_DR_YU_SHIFT; + tmp = (dr & (RTC_DR_YU_MASK | RTC_DR_YT_MASK)) >> RTC_DR_YU_SHIFT; tp->tm_year = rtc_bcd2bin(tmp) + 100; #if defined(CONFIG_TIME_EXTENDED) diff --git a/arch/arm/src/stm32/stm32_sdio.c b/arch/arm/src/stm32/stm32_sdio.c index 83e02dad7f..f0d42db95d 100644 --- a/arch/arm/src/stm32/stm32_sdio.c +++ b/arch/arm/src/stm32/stm32_sdio.c @@ -153,13 +153,13 @@ * SDIO_MMCXFR_CLKDIV, and SDIO_SDXFR_CLKDIV. */ -#define STM32_CLCKCR_INIT (SDIO_INIT_CLKDIV|SDIO_CLKCR_RISINGEDGE|\ +#define STM32_CLCKCR_INIT (SDIO_INIT_CLKDIV | SDIO_CLKCR_RISINGEDGE | \ SDIO_CLKCR_WIDBUS_D1) -#define SDIO_CLKCR_MMCXFR (SDIO_MMCXFR_CLKDIV|SDIO_CLKCR_RISINGEDGE|\ +#define SDIO_CLKCR_MMCXFR (SDIO_MMCXFR_CLKDIV | SDIO_CLKCR_RISINGEDGE | \ SDIO_CLKCR_WIDBUS_D1) -#define SDIO_CLCKR_SDXFR (SDIO_SDXFR_CLKDIV|SDIO_CLKCR_RISINGEDGE|\ +#define SDIO_CLCKR_SDXFR (SDIO_SDXFR_CLKDIV | SDIO_CLKCR_RISINGEDGE | \ SDIO_CLKCR_WIDBUS_D1) -#define SDIO_CLCKR_SDWIDEXFR (SDIO_SDXFR_CLKDIV|SDIO_CLKCR_RISINGEDGE|\ +#define SDIO_CLCKR_SDWIDEXFR (SDIO_SDXFR_CLKDIV | SDIO_CLKCR_RISINGEDGE | \ SDIO_CLKCR_WIDBUS_D4) /* Timing */ @@ -183,21 +183,21 @@ /* STM32 F1 channel configuration register (CCR) settings */ #if defined(CONFIG_STM32_STM32F10XX) -# define SDIO_RXDMA32_CONFIG (CONFIG_SDIO_DMAPRIO|DMA_CCR_MSIZE_32BITS|\ - DMA_CCR_PSIZE_32BITS|DMA_CCR_MINC) -# define SDIO_TXDMA32_CONFIG (CONFIG_SDIO_DMAPRIO|DMA_CCR_MSIZE_32BITS|\ - DMA_CCR_PSIZE_32BITS|DMA_CCR_MINC|DMA_CCR_DIR) +# define SDIO_RXDMA32_CONFIG (CONFIG_SDIO_DMAPRIO | DMA_CCR_MSIZE_32BITS | \ + DMA_CCR_PSIZE_32BITS | DMA_CCR_MINC) +# define SDIO_TXDMA32_CONFIG (CONFIG_SDIO_DMAPRIO | DMA_CCR_MSIZE_32BITS | \ + DMA_CCR_PSIZE_32BITS | DMA_CCR_MINC | DMA_CCR_DIR) /* STM32 F4 stream configuration register (SCR) settings. */ #elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) -# define SDIO_RXDMA32_CONFIG (DMA_SCR_PFCTRL|DMA_SCR_DIR_P2M|DMA_SCR_MINC|\ - DMA_SCR_PSIZE_32BITS|DMA_SCR_MSIZE_32BITS|\ - CONFIG_SDIO_DMAPRIO|DMA_SCR_PBURST_INCR4|\ +# define SDIO_RXDMA32_CONFIG (DMA_SCR_PFCTRL | DMA_SCR_DIR_P2M|DMA_SCR_MINC | \ + DMA_SCR_PSIZE_32BITS | DMA_SCR_MSIZE_32BITS | \ + CONFIG_SDIO_DMAPRIO | DMA_SCR_PBURST_INCR4 | \ DMA_SCR_MBURST_INCR4) -# define SDIO_TXDMA32_CONFIG (DMA_SCR_PFCTRL|DMA_SCR_DIR_M2P|DMA_SCR_MINC|\ - DMA_SCR_PSIZE_32BITS|DMA_SCR_MSIZE_32BITS|\ - CONFIG_SDIO_DMAPRIO|DMA_SCR_PBURST_INCR4|\ +# define SDIO_TXDMA32_CONFIG (DMA_SCR_PFCTRL | DMA_SCR_DIR_M2P | DMA_SCR_MINC | \ + DMA_SCR_PSIZE_32BITS | DMA_SCR_MSIZE_32BITS | \ + CONFIG_SDIO_DMAPRIO | DMA_SCR_PBURST_INCR4 | \ DMA_SCR_MBURST_INCR4) #else # error "Unknown STM32 DMA" @@ -223,41 +223,41 @@ /* Data transfer interrupt mask bits */ -#define SDIO_RECV_MASK (SDIO_MASK_DCRCFAILIE|SDIO_MASK_DTIMEOUTIE|\ - SDIO_MASK_DATAENDIE|SDIO_MASK_RXOVERRIE|\ - SDIO_MASK_RXFIFOHFIE|SDIO_MASK_STBITERRIE) -#define SDIO_SEND_MASK (SDIO_MASK_DCRCFAILIE|SDIO_MASK_DTIMEOUTIE|\ - SDIO_MASK_DATAENDIE|SDIO_MASK_TXUNDERRIE|\ - SDIO_MASK_TXFIFOHEIE|SDIO_MASK_STBITERRIE) -#define SDIO_DMARECV_MASK (SDIO_MASK_DCRCFAILIE|SDIO_MASK_DTIMEOUTIE|\ - SDIO_MASK_DATAENDIE|SDIO_MASK_RXOVERRIE|\ +#define SDIO_RECV_MASK (SDIO_MASK_DCRCFAILIE | SDIO_MASK_DTIMEOUTIE | \ + SDIO_MASK_DATAENDIE | SDIO_MASK_RXOVERRIE | \ + SDIO_MASK_RXFIFOHFIE | SDIO_MASK_STBITERRIE) +#define SDIO_SEND_MASK (SDIO_MASK_DCRCFAILIE | SDIO_MASK_DTIMEOUTIE | \ + SDIO_MASK_DATAENDIE | SDIO_MASK_TXUNDERRIE | \ + SDIO_MASK_TXFIFOHEIE | SDIO_MASK_STBITERRIE) +#define SDIO_DMARECV_MASK (SDIO_MASK_DCRCFAILIE | SDIO_MASK_DTIMEOUTIE | \ + SDIO_MASK_DATAENDIE | SDIO_MASK_RXOVERRIE | \ SDIO_MASK_STBITERRIE) -#define SDIO_DMASEND_MASK (SDIO_MASK_DCRCFAILIE|SDIO_MASK_DTIMEOUTIE|\ - SDIO_MASK_DATAENDIE|SDIO_MASK_TXUNDERRIE|\ +#define SDIO_DMASEND_MASK (SDIO_MASK_DCRCFAILIE | SDIO_MASK_DTIMEOUTIE | \ + SDIO_MASK_DATAENDIE | SDIO_MASK_TXUNDERRIE | \ SDIO_MASK_STBITERRIE) /* Event waiting interrupt mask bits */ #define SDIO_CMDDONE_STA (SDIO_STA_CMDSENT) -#define SDIO_RESPDONE_STA (SDIO_STA_CTIMEOUT|SDIO_STA_CCRCFAIL|\ +#define SDIO_RESPDONE_STA (SDIO_STA_CTIMEOUT | SDIO_STA_CCRCFAIL | \ SDIO_STA_CMDREND) #define SDIO_XFRDONE_STA (0) #define SDIO_CMDDONE_MASK (SDIO_MASK_CMDSENTIE) -#define SDIO_RESPDONE_MASK (SDIO_MASK_CCRCFAILIE|SDIO_MASK_CTIMEOUTIE|\ +#define SDIO_RESPDONE_MASK (SDIO_MASK_CCRCFAILIE | SDIO_MASK_CTIMEOUTIE | \ SDIO_MASK_CMDRENDIE) #define SDIO_XFRDONE_MASK (0) -#define SDIO_CMDDONE_ICR (SDIO_ICR_CMDSENTC|SDIO_ICR_DBCKENDC) -#define SDIO_RESPDONE_ICR (SDIO_ICR_CTIMEOUTC|SDIO_ICR_CCRCFAILC|\ - SDIO_ICR_CMDRENDC|SDIO_ICR_DBCKENDC) -#define SDIO_XFRDONE_ICR (SDIO_ICR_DATAENDC|SDIO_ICR_DCRCFAILC|\ - SDIO_ICR_DTIMEOUTC|SDIO_ICR_RXOVERRC|\ - SDIO_ICR_TXUNDERRC|SDIO_ICR_STBITERRC|\ +#define SDIO_CMDDONE_ICR (SDIO_ICR_CMDSENTC | SDIO_ICR_DBCKENDC) +#define SDIO_RESPDONE_ICR (SDIO_ICR_CTIMEOUTC | SDIO_ICR_CCRCFAILC | \ + SDIO_ICR_CMDRENDC | SDIO_ICR_DBCKENDC) +#define SDIO_XFRDONE_ICR (SDIO_ICR_DATAENDC | SDIO_ICR_DCRCFAILC | \ + SDIO_ICR_DTIMEOUTC | SDIO_ICR_RXOVERRC | \ + SDIO_ICR_TXUNDERRC | SDIO_ICR_STBITERRC | \ SDIO_ICR_DBCKENDC) -#define SDIO_WAITALL_ICR (SDIO_CMDDONE_ICR|SDIO_RESPDONE_ICR|\ - SDIO_XFRDONE_ICR|SDIO_ICR_DBCKENDC) +#define SDIO_WAITALL_ICR (SDIO_CMDDONE_ICR | SDIO_RESPDONE_ICR | \ + SDIO_XFRDONE_ICR | SDIO_ICR_DBCKENDC) /* Let's wait until we have both SDIO transfer complete and DMA complete. */ @@ -583,14 +583,14 @@ static inline void stm32_setclkcr(uint32_t clkcr) /* Clear CLKDIV, PWRSAV, BYPASS, WIDBUS, NEGEDGE, HWFC_EN bits */ - regval &= ~(SDIO_CLKCR_CLKDIV_MASK|SDIO_CLKCR_PWRSAV|SDIO_CLKCR_BYPASS| - SDIO_CLKCR_WIDBUS_MASK|SDIO_CLKCR_NEGEDGE|SDIO_CLKCR_HWFC_EN| + regval &= ~(SDIO_CLKCR_CLKDIV_MASK | SDIO_CLKCR_PWRSAV | SDIO_CLKCR_BYPASS | + SDIO_CLKCR_WIDBUS_MASK | SDIO_CLKCR_NEGEDGE | SDIO_CLKCR_HWFC_EN | SDIO_CLKCR_CLKEN); /* Replace with user provided settings */ - clkcr &= (SDIO_CLKCR_CLKDIV_MASK|SDIO_CLKCR_PWRSAV|SDIO_CLKCR_BYPASS| - SDIO_CLKCR_WIDBUS_MASK|SDIO_CLKCR_NEGEDGE|SDIO_CLKCR_HWFC_EN| + clkcr &= (SDIO_CLKCR_CLKDIV_MASK | SDIO_CLKCR_PWRSAV | SDIO_CLKCR_BYPASS | + SDIO_CLKCR_WIDBUS_MASK | SDIO_CLKCR_NEGEDGE | SDIO_CLKCR_HWFC_EN | SDIO_CLKCR_CLKEN); regval |= clkcr; @@ -638,8 +638,8 @@ static void stm32_configwaitints(struct stm32_dev_s *priv, uint32_t waitmask, waitmask &= !SDIOWAIT_WRCOMPLETE; - pinset = GPIO_SDIO_D0 & (GPIO_PORT_MASK|GPIO_PIN_MASK); - pinset |= (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI); + pinset = GPIO_SDIO_D0 & (GPIO_PORT_MASK | GPIO_PIN_MASK); + pinset |= (GPIO_INPUT | GPIO_FLOAT | GPIO_EXTI); /* Arm the SDIO_D Ready and install Isr */ @@ -895,7 +895,7 @@ static void stm32_dmacallback(DMA_HANDLE handle, uint8_t status, void *arg) * Transfer. */ - stm32_sample((struct stm32_dev_s*)arg, SAMPLENDX_DMA_CALLBACK); + stm32_sample((struct stm32_dev_s *)arg, SAMPLENDX_DMA_CALLBACK); /* Get the result of the DMA transfer */ @@ -950,10 +950,11 @@ static uint8_t stm32_log2(uint16_t value) DEBUGASSERT(value > 0); while (value != 1) - { - value >>= 1; - log2++; - } + { + value >>= 1; + log2++; + } + return log2; } @@ -979,9 +980,9 @@ static void stm32_dataconfig(uint32_t timeout, uint32_t dlen, uint32_t dctrl) */ regval = getreg32(STM32_SDIO_DCTRL); - regval &= ~(SDIO_DCTRL_DTDIR|SDIO_DCTRL_DTMODE|SDIO_DCTRL_DBLOCKSIZE_MASK); - dctrl &= (SDIO_DCTRL_DTDIR|SDIO_DCTRL_DTMODE|SDIO_DCTRL_DBLOCKSIZE_MASK); - regval |= (dctrl|SDIO_DCTRL_DTEN); + regval &= ~(SDIO_DCTRL_DTDIR | SDIO_DCTRL_DTMODE | SDIO_DCTRL_DBLOCKSIZE_MASK); + dctrl &= (SDIO_DCTRL_DTDIR | SDIO_DCTRL_DTMODE | SDIO_DCTRL_DBLOCKSIZE_MASK); + regval |= (dctrl | SDIO_DCTRL_DTEN); putreg32(regval, STM32_SDIO_DCTRL); } @@ -1006,8 +1007,8 @@ static void stm32_datadisable(void) /* Reset DCTRL DTEN, DTDIR, DTMODE, DMAEN, and DBLOCKSIZE fields */ regval = getreg32(STM32_SDIO_DCTRL); - regval &= ~(SDIO_DCTRL_DTEN|SDIO_DCTRL_DTDIR|SDIO_DCTRL_DTMODE| - SDIO_DCTRL_DMAEN|SDIO_DCTRL_DBLOCKSIZE_MASK); + regval &= ~(SDIO_DCTRL_DTEN | SDIO_DCTRL_DTDIR | SDIO_DCTRL_DTMODE | + SDIO_DCTRL_DMAEN | SDIO_DCTRL_DBLOCKSIZE_MASK); putreg32(regval, STM32_SDIO_DCTRL); } @@ -1049,27 +1050,27 @@ static void stm32_sendfifo(struct stm32_dev_s *priv) } else { - /* No.. transfer just the bytes remaining in the user buffer, - * padding with zero as necessary to extend to a full word. - */ + /* No.. transfer just the bytes remaining in the user buffer, + * padding with zero as necessary to extend to a full word. + */ - uint8_t *ptr = (uint8_t *)priv->remaining; - int i; + uint8_t *ptr = (uint8_t *)priv->remaining; + int i; - data.w = 0; - for (i = 0; i < (int)priv->remaining; i++) - { - data.b[i] = *ptr++; - } + data.w = 0; + for (i = 0; i < (int)priv->remaining; i++) + { + data.b[i] = *ptr++; + } - /* Now the transfer is finished */ + /* Now the transfer is finished */ - priv->remaining = 0; - } + priv->remaining = 0; + } - /* Put the word in the FIFO */ + /* Put the word in the FIFO */ - putreg32(data.w, STM32_SDIO_FIFO); + putreg32(data.w, STM32_SDIO_FIFO); } } @@ -1116,7 +1117,7 @@ static void stm32_recvfifo(struct stm32_dev_s *priv) { /* Transfer any trailing fractional word */ - uint8_t *ptr = (uint8_t*)priv->buffer; + uint8_t *ptr = (uint8_t *)priv->buffer; int i; for (i = 0; i < (int)priv->remaining; i++) @@ -1328,30 +1329,30 @@ static int stm32_interrupt(int irq, void *context) #ifdef CONFIG_SDIO_DMA if (!priv->dmamode) #endif - { - /* Is the RX FIFO half full or more? Is so then we must be - * processing a receive transaction. - */ - - if ((pending & SDIO_STA_RXFIFOHF) != 0) - { - /* Receive data from the RX FIFO */ - - stm32_recvfifo(priv); - } - - /* Otherwise, Is the transmit FIFO half empty or less? If so we must - * be processing a send transaction. NOTE: We can't be processing - * both! + { + /* Is the RX FIFO half full or more? Is so then we must be + * processing a receive transaction. */ - else if ((pending & SDIO_STA_TXFIFOHE) != 0) - { - /* Send data via the TX FIFO */ + if ((pending & SDIO_STA_RXFIFOHF) != 0) + { + /* Receive data from the RX FIFO */ - stm32_sendfifo(priv); - } - } + stm32_recvfifo(priv); + } + + /* Otherwise, Is the transmit FIFO half empty or less? If so we must + * be processing a send transaction. NOTE: We can't be processing + * both! + */ + + else if ((pending & SDIO_STA_TXFIFOHE) != 0) + { + /* Send data via the TX FIFO */ + + stm32_sendfifo(priv); + } + } /* Handle data end events */ @@ -1406,7 +1407,7 @@ static int stm32_interrupt(int irq, void *context) /* Terminate the transfer with an error */ flldbg("ERROR: Data block CRC failure, remaining: %d\n", priv->remaining); - stm32_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_ERROR); + stm32_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_ERROR); } /* Handle data timeout error */ @@ -1416,7 +1417,7 @@ static int stm32_interrupt(int irq, void *context) /* Terminate the transfer with an error */ flldbg("ERROR: Data timeout, remaining: %d\n", priv->remaining); - stm32_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_TIMEOUT); + stm32_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_TIMEOUT); } /* Handle RX FIFO overrun error */ @@ -1426,7 +1427,7 @@ static int stm32_interrupt(int irq, void *context) /* Terminate the transfer with an error */ flldbg("ERROR: RX FIFO overrun, remaining: %d\n", priv->remaining); - stm32_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_ERROR); + stm32_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_ERROR); } /* Handle TX FIFO underrun error */ @@ -1436,7 +1437,7 @@ static int stm32_interrupt(int irq, void *context) /* Terminate the transfer with an error */ flldbg("ERROR: TX FIFO underrun, remaining: %d\n", priv->remaining); - stm32_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_ERROR); + stm32_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_ERROR); } /* Handle start bit error */ @@ -1446,8 +1447,8 @@ static int stm32_interrupt(int irq, void *context) /* Terminate the transfer with an error */ flldbg("ERROR: Start bit, remaining: %d\n", priv->remaining); - stm32_endtransfer(priv, SDIOWAIT_TRANSFERDONE|SDIOWAIT_ERROR); - } + stm32_endtransfer(priv, SDIOWAIT_TRANSFERDONE | SDIOWAIT_ERROR); + } } /* Handle wait events *************************************************/ @@ -1465,7 +1466,7 @@ static int stm32_interrupt(int irq, void *context) { /* Yes.. wake the thread up */ - putreg32(SDIO_RESPDONE_ICR|SDIO_CMDDONE_ICR, STM32_SDIO_ICR); + putreg32(SDIO_RESPDONE_ICR | SDIO_CMDDONE_ICR, STM32_SDIO_ICR); stm32_endwait(priv, SDIOWAIT_RESPONSEDONE); } } @@ -1763,8 +1764,8 @@ static int stm32_sendcmd(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t arg) /* Clear CMDINDEX, WAITRESP, WAITINT, WAITPEND, and CPSMEN bits */ regval = getreg32(STM32_SDIO_CMD); - regval &= ~(SDIO_CMD_CMDINDEX_MASK|SDIO_CMD_WAITRESP_MASK| - SDIO_CMD_WAITINT|SDIO_CMD_WAITPEND|SDIO_CMD_CPSMEN); + regval &= ~(SDIO_CMD_CMDINDEX_MASK | SDIO_CMD_WAITRESP_MASK | + SDIO_CMD_WAITINT | SDIO_CMD_WAITPEND | SDIO_CMD_CPSMEN); /* Set WAITRESP bits */ @@ -1798,7 +1799,7 @@ static int stm32_sendcmd(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t arg) /* Write the SDIO CMD */ - putreg32(SDIO_RESPDONE_ICR|SDIO_CMDDONE_ICR, STM32_SDIO_ICR); + putreg32(SDIO_RESPDONE_ICR | SDIO_CMDDONE_ICR, STM32_SDIO_ICR); putreg32(regval, STM32_SDIO_CMD); return OK; } @@ -1841,7 +1842,7 @@ static int stm32_recvsetup(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, /* Save the destination buffer information for use by the interrupt handler */ - priv->buffer = (uint32_t*)buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = nbytes; #ifdef CONFIG_SDIO_DMA priv->dmamode = false; @@ -1850,7 +1851,7 @@ static int stm32_recvsetup(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, /* Then set up the SDIO data path */ dblocksize = stm32_log2(nbytes) << SDIO_DCTRL_DBLOCKSIZE_SHIFT; - stm32_dataconfig(SDIO_DTIMER_DATATIMEOUT, nbytes, dblocksize|SDIO_DCTRL_DTDIR); + stm32_dataconfig(SDIO_DTIMER_DATATIMEOUT, nbytes, dblocksize | SDIO_DCTRL_DTDIR); /* And enable interrupts */ @@ -1895,7 +1896,7 @@ static int stm32_sendsetup(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer /* Save the source buffer information for use by the interrupt handler */ - priv->buffer = (uint32_t*)buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = nbytes; #ifdef CONFIG_SDIO_DMA priv->dmamode = false; @@ -1932,7 +1933,7 @@ static int stm32_sendsetup(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer static int stm32_cancel(FAR struct sdio_dev_s *dev) { - struct stm32_dev_s *priv = (struct stm32_dev_s*)dev; + struct stm32_dev_s *priv = (struct stm32_dev_s *)dev; /* Disable all transfer- and event- related interrupts */ @@ -2137,7 +2138,7 @@ static int stm32_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t /* Clear all pending message completion events and return the R1/R6 response */ - putreg32(SDIO_RESPDONE_ICR|SDIO_CMDDONE_ICR, STM32_SDIO_ICR); + putreg32(SDIO_RESPDONE_ICR | SDIO_CMDDONE_ICR, STM32_SDIO_ICR); *rshort = getreg32(STM32_SDIO_RESP1); return ret; } @@ -2184,7 +2185,7 @@ static int stm32_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlo /* Return the long response */ - putreg32(SDIO_RESPDONE_ICR|SDIO_CMDDONE_ICR, STM32_SDIO_ICR); + putreg32(SDIO_RESPDONE_ICR | SDIO_CMDDONE_ICR, STM32_SDIO_ICR); if (rlong) { rlong[0] = getreg32(STM32_SDIO_RESP1); @@ -2200,14 +2201,14 @@ static int stm32_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *r uint32_t regval; int ret = OK; - /* R3 OCR (48-bit) - * 47 0 Start bit - * 46 0 Transmission bit (0=from card) - * 45:40 bit5 - bit0 Reserved - * 39:8 bit31 - bit0 32-bit OCR register - * 7:1 bit6 - bit0 Reserved - * 0 1 End bit - */ + /* R3 OCR (48-bit) + * 47 0 Start bit + * 46 0 Transmission bit (0=from card) + * 45:40 bit5 - bit0 Reserved + * 39:8 bit31 - bit0 32-bit OCR register + * 7:1 bit6 - bit0 Reserved + * 0 1 End bit + */ /* Check that this is the correct response to this command */ @@ -2233,7 +2234,7 @@ static int stm32_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *r } } - putreg32(SDIO_RESPDONE_ICR|SDIO_CMDDONE_ICR, STM32_SDIO_ICR); + putreg32(SDIO_RESPDONE_ICR | SDIO_CMDDONE_ICR, STM32_SDIO_ICR); if (rshort) { *rshort = getreg32(STM32_SDIO_RESP1); @@ -2245,7 +2246,7 @@ static int stm32_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *r static int stm32_recvnotimpl(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *rnotimpl) { - putreg32(SDIO_RESPDONE_ICR|SDIO_CMDDONE_ICR, STM32_SDIO_ICR); + putreg32(SDIO_RESPDONE_ICR | SDIO_CMDDONE_ICR, STM32_SDIO_ICR); return -ENOSYS; } @@ -2276,7 +2277,7 @@ static int stm32_recvnotimpl(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t static void stm32_waitenable(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset) { - struct stm32_dev_s *priv = (struct stm32_dev_s*)dev; + struct stm32_dev_s *priv = (struct stm32_dev_s *)dev; uint32_t waitmask; DEBUGASSERT(priv != NULL); @@ -2316,7 +2317,7 @@ static void stm32_waitenable(FAR struct sdio_dev_s *dev, /* Enable event-related interrupts */ putreg32(SDIO_WAITALL_ICR, STM32_SDIO_ICR); - } + } stm32_configwaitints(priv, waitmask, eventset, 0); } @@ -2345,7 +2346,7 @@ static void stm32_waitenable(FAR struct sdio_dev_s *dev, static sdio_eventset_t stm32_eventwait(FAR struct sdio_dev_s *dev, uint32_t timeout) { - struct stm32_dev_s *priv = (struct stm32_dev_s*)dev; + struct stm32_dev_s *priv = (struct stm32_dev_s *)dev; sdio_eventset_t wkupevent = 0; irqstate_t flags; int ret; @@ -2370,10 +2371,10 @@ static sdio_eventset_t stm32_eventwait(FAR struct sdio_dev_s *dev, if (!timeout) { - /* Then just tell the caller that we already timed out */ + /* Then just tell the caller that we already timed out */ - wkupevent = SDIOWAIT_TIMEOUT; - goto errout; + wkupevent = SDIOWAIT_TIMEOUT; + goto errout; } /* Start the watchdog timer */ @@ -2383,8 +2384,8 @@ static sdio_eventset_t stm32_eventwait(FAR struct sdio_dev_s *dev, 1, (uint32_t)priv); if (ret != OK) { - fdbg("ERROR: wd_start failed: %d\n", ret); - } + fdbg("ERROR: wd_start failed: %d\n", ret); + } } #if defined(CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE) @@ -2408,7 +2409,7 @@ static sdio_eventset_t stm32_eventwait(FAR struct sdio_dev_s *dev, * may have already occurred before this function was called! */ - for (;;) + for (; ; ) { /* Wait for an event in event set to occur. If this the event has already * occurred, then the semaphore will already have been incremented and @@ -2468,7 +2469,7 @@ errout: static void stm32_callbackenable(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset) { - struct stm32_dev_s *priv = (struct stm32_dev_s*)dev; + struct stm32_dev_s *priv = (struct stm32_dev_s *)dev; fvdbg("eventset: %02x\n", eventset); DEBUGASSERT(priv != NULL); @@ -2502,7 +2503,7 @@ static void stm32_callbackenable(FAR struct sdio_dev_s *dev, static int stm32_registercallback(FAR struct sdio_dev_s *dev, worker_t callback, void *arg) { - struct stm32_dev_s *priv = (struct stm32_dev_s*)dev; + struct stm32_dev_s *priv = (struct stm32_dev_s *)dev; /* Disable callbacks and register this callback and is argument */ @@ -2620,14 +2621,14 @@ static int stm32_dmarecvsetup(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, /* Save the destination buffer information for use by the interrupt handler */ - priv->buffer = (uint32_t*)buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = buflen; priv->dmamode = true; /* Then set up the SDIO data path */ dblocksize = stm32_log2(buflen) << SDIO_DCTRL_DBLOCKSIZE_SHIFT; - stm32_dataconfig(SDIO_DTIMER_DATATIMEOUT, buflen, dblocksize|SDIO_DCTRL_DTDIR); + stm32_dataconfig(SDIO_DTIMER_DATATIMEOUT, buflen, dblocksize | SDIO_DCTRL_DTDIR); /* Configure the RX DMA */ @@ -2689,7 +2690,7 @@ static int stm32_dmasendsetup(FAR struct sdio_dev_s *dev, /* Save the source buffer information for use by the interrupt handler */ - priv->buffer = (uint32_t*)buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = buflen; priv->dmamode = true; @@ -2737,7 +2738,7 @@ static int stm32_dmasendsetup(FAR struct sdio_dev_s *dev, static void stm32_callback(void *arg) { - struct stm32_dev_s *priv = (struct stm32_dev_s*)arg; + struct stm32_dev_s *priv = (struct stm32_dev_s *)arg; /* Is a callback registered? */ @@ -2754,8 +2755,8 @@ static void stm32_callback(void *arg) /* Media is present. Is the media inserted event enabled? */ if ((priv->cbevents & SDIOMEDIA_INSERTED) == 0) - { - /* No... return without performing the callback */ + { + /* No... return without performing the callback */ return; } diff --git a/arch/arm/src/stm32/stm32_serial.c b/arch/arm/src/stm32/stm32_serial.c index 58aa48c5e4..d9826631f2 100644 --- a/arch/arm/src/stm32/stm32_serial.c +++ b/arch/arm/src/stm32/stm32_serial.c @@ -311,7 +311,7 @@ struct up_dev_s const unsigned int rxdma_channel; /* DMA channel assigned */ #endif - int (* const vector)(int irq, void *context); /* Interrupt handler */ + int (*const vector)(int irq, void *context); /* Interrupt handler */ /* RX DMA state */ @@ -1197,31 +1197,31 @@ static void up_set_format(struct uart_dev_s *dev) * = 2 * usartdiv8 */ - /* Use oversamply by 8 only if the divisor is small. But what is small? */ + /* Use oversamply by 8 only if the divisor is small. But what is small? */ - cr1 = up_serialin(priv, STM32_USART_CR1_OFFSET); - if (usartdiv8 > 100) - { - /* Use usartdiv16 */ + cr1 = up_serialin(priv, STM32_USART_CR1_OFFSET); + if (usartdiv8 > 100) + { + /* Use usartdiv16 */ - brr = (usartdiv8 + 1) >> 1; + brr = (usartdiv8 + 1) >> 1; - /* Clear oversampling by 8 to enable oversampling by 16 */ + /* Clear oversampling by 8 to enable oversampling by 16 */ - cr1 &= ~USART_CR1_OVER8; - } - else - { - DEBUGASSERT(usartdiv8 >= 8); + cr1 &= ~USART_CR1_OVER8; + } + else + { + DEBUGASSERT(usartdiv8 >= 8); - /* Perform mysterious operations on bits 0-3 */ + /* Perform mysterious operations on bits 0-3 */ - brr = ((usartdiv8 & 0xfff0) | ((usartdiv8 & 0x000f) >> 1)); + brr = ((usartdiv8 & 0xfff0) | ((usartdiv8 & 0x000f) >> 1)); - /* Set oversampling by 8 */ + /* Set oversampling by 8 */ - cr1 |= USART_CR1_OVER8; - } + cr1 |= USART_CR1_OVER8; + } up_serialout(priv, STM32_USART_CR1_OFFSET, cr1); up_serialout(priv, STM32_USART_BRR_OFFSET, brr); @@ -1255,16 +1255,16 @@ static void up_set_format(struct uart_dev_s *dev) usartdiv32 = priv->apbclock / (priv->baud >> 1); - /* The mantissa part is then */ + /* The mantissa part is then */ - mantissa = usartdiv32 >> 5; - brr = mantissa << USART_BRR_MANT_SHIFT; + mantissa = usartdiv32 >> 5; + brr = mantissa << USART_BRR_MANT_SHIFT; - /* The fractional remainder (with rounding) */ + /* The fractional remainder (with rounding) */ - fraction = (usartdiv32 - (mantissa << 5) + 1) >> 1; - brr |= fraction << USART_BRR_FRAC_SHIFT; - up_serialout(priv, STM32_USART_BRR_OFFSET, brr); + fraction = (usartdiv32 - (mantissa << 5) + 1) >> 1; + brr |= fraction << USART_BRR_FRAC_SHIFT; + up_serialout(priv, STM32_USART_BRR_OFFSET, brr); #endif /* Configure parity mode */ @@ -1313,7 +1313,7 @@ static void up_set_format(struct uart_dev_s *dev) /* Configure hardware flow control */ regval = up_serialin(priv, STM32_USART_CR3_OFFSET); - regval &= ~(USART_CR3_CTSE|USART_CR3_RTSE); + regval &= ~(USART_CR3_CTSE | USART_CR3_RTSE); #if defined(CONFIG_SERIAL_IFLOWCONTROL) && !defined(CONFIG_STM32_FLOWCONTROL_BROKEN) if (priv->iflow && (priv->rts_gpio != 0)) @@ -1466,7 +1466,7 @@ static int up_setup(struct uart_dev_s *dev) config = (config & ~GPIO_MODE_MASK) | GPIO_OUTPUT; #endif stm32_configgpio(config); - } + } #endif #ifdef HAVE_RS485 @@ -1733,11 +1733,11 @@ static int up_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, priv->vector); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the USART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the USART + */ - up_enable_irq(priv->irq); + up_enable_irq(priv->irq); } return ret; } @@ -1836,17 +1836,17 @@ static int up_interrupt_common(struct up_dev_s *priv) if ((priv->sr & USART_SR_RXNE) != 0 && (priv->ie & USART_CR1_RXNEIE) != 0) { - /* Received data ready... process incoming bytes. NOTE the check for - * RXNEIE: We cannot call uart_recvchards of RX interrupts are disabled. - */ + /* Received data ready... process incoming bytes. NOTE the check for + * RXNEIE: We cannot call uart_recvchards of RX interrupts are disabled. + */ - uart_recvchars(&priv->dev); - handled = true; + uart_recvchars(&priv->dev); + handled = true; } - /* We may still have to read from the DR register to clear any pending - * error conditions. - */ + /* We may still have to read from the DR register to clear any pending + * error conditions. + */ else if ((priv->sr & (USART_SR_ORE | USART_SR_NE | USART_SR_FE)) != 0) { @@ -1874,10 +1874,10 @@ static int up_interrupt_common(struct up_dev_s *priv) if ((priv->sr & USART_SR_TXE) != 0 && (priv->ie & USART_CR1_TXEIE) != 0) { - /* Transmit data register empty ... process outgoing bytes */ + /* Transmit data register empty ... process outgoing bytes */ - uart_xmitchars(&priv->dev); - handled = true; + uart_xmitchars(&priv->dev); + handled = true; } } @@ -1962,7 +1962,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TERMIOS case TCGETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; if (!termiosp) { @@ -1994,7 +1994,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) case TCSETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; if (!termiosp) { @@ -2215,7 +2215,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static bool up_rxflowcontrol(struct uart_dev_s *dev, unsigned int nbuffered, bool upper) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; #if defined(CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS) && \ defined(CONFIG_STM32_FLOWCONTROL_BROKEN) diff --git a/arch/arm/src/stm32/stm32_spi.c b/arch/arm/src/stm32/stm32_spi.c index 278e9c8871..b7279ebab9 100644 --- a/arch/arm/src/stm32/stm32_spi.c +++ b/arch/arm/src/stm32/stm32_spi.c @@ -804,7 +804,7 @@ static void spi_dmarxsetup(FAR struct stm32_spidev_s *priv, FAR void *rxbuffer, rxbuffer = rxdummy; priv->rxccr = SPI_RXDMA8NULL_CONFIG; } - } + } /* Configure the RX DMA */ @@ -1016,7 +1016,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) setbits = SPI_CR1_FPCLCKd4; /* 001: fPCLK/4 */ actual = priv->spiclock >> 2; - } + } else if (frequency >= priv->spiclock >> 3) { /* Between fPCLCK/4 and fPCLCK/8, pick the slower */ @@ -1115,7 +1115,7 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) { case SPIDEV_MODE0: /* CPOL=0; CPHA=0 */ setbits = 0; - clrbits = SPI_CR1_CPOL|SPI_CR1_CPHA; + clrbits = SPI_CR1_CPOL | SPI_CR1_CPHA; break; case SPIDEV_MODE1: /* CPOL=0; CPHA=1 */ @@ -1129,7 +1129,7 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) break; case SPIDEV_MODE3: /* CPOL=1; CPHA=1 */ - setbits = SPI_CR1_CPOL|SPI_CR1_CPHA; + setbits = SPI_CR1_CPOL | SPI_CR1_CPHA; clrbits = 0; break; @@ -1189,11 +1189,11 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits) case 8: setbits = 0; - clrbits = SPI_CR1_DFF|SPI_CR1_LSBFIRST; + clrbits = SPI_CR1_DFF | SPI_CR1_LSBFIRST; break; case -16: - setbits = SPI_CR1_DFF|SPI_CR1_LSBFIRST; + setbits = SPI_CR1_DFF | SPI_CR1_LSBFIRST; clrbits = 0; break; @@ -1295,8 +1295,8 @@ static void spi_exchange_nodma(FAR struct spi_dev_s *dev, FAR const void *txbuff { /* 16-bit mode */ - const uint16_t *src = (const uint16_t*)txbuffer;; - uint16_t *dest = (uint16_t*)rxbuffer; + const uint16_t *src = (const uint16_t *)txbuffer; + uint16_t *dest = (uint16_t *)rxbuffer; uint16_t word; while (nwords-- > 0) @@ -1308,9 +1308,9 @@ static void spi_exchange_nodma(FAR struct spi_dev_s *dev, FAR const void *txbuff word = *src++; } else - { + { word = 0xffff; - } + } /* Exchange one word */ @@ -1328,8 +1328,8 @@ static void spi_exchange_nodma(FAR struct spi_dev_s *dev, FAR const void *txbuff { /* 8-bit mode */ - const uint8_t *src = (const uint8_t*)txbuffer;; - uint8_t *dest = (uint8_t*)rxbuffer; + const uint8_t *src = (const uint8_t *)txbuffer; + uint8_t *dest = (uint8_t *)rxbuffer; uint8_t word; while (nwords-- > 0) @@ -1341,9 +1341,9 @@ static void spi_exchange_nodma(FAR struct spi_dev_s *dev, FAR const void *txbuff word = *src++; } else - { + { word = 0xff; - } + } /* Exchange one word */ @@ -1503,9 +1503,9 @@ static void spi_portinitialize(FAR struct stm32_spidev_s *priv) * Two lines full duplex: BIDIMODE=0 BIDIOIE=(Don't care) and RXONLY=0 */ - clrbits = SPI_CR1_CPHA|SPI_CR1_CPOL|SPI_CR1_BR_MASK|SPI_CR1_LSBFIRST| - SPI_CR1_RXONLY|SPI_CR1_DFF|SPI_CR1_BIDIOE|SPI_CR1_BIDIMODE; - setbits = SPI_CR1_MSTR|SPI_CR1_SSI|SPI_CR1_SSM; + clrbits = SPI_CR1_CPHA | SPI_CR1_CPOL | SPI_CR1_BR_MASK | SPI_CR1_LSBFIRST | + SPI_CR1_RXONLY | SPI_CR1_DFF | SPI_CR1_BIDIOE | SPI_CR1_BIDIMODE; + setbits = SPI_CR1_MSTR | SPI_CR1_SSI | SPI_CR1_SSM; spi_modifycr1(priv, setbits, clrbits); #ifndef CONFIG_SPI_OWNBUS diff --git a/arch/arm/src/stm32/stm32_start.c b/arch/arm/src/stm32/stm32_start.c index 911e5139d6..65ff0398c6 100644 --- a/arch/arm/src/stm32/stm32_start.c +++ b/arch/arm/src/stm32/stm32_start.c @@ -67,7 +67,7 @@ static inline void stm32_fpuconfig(void); #endif #ifdef CONFIG_STACK_COLORATION static void go_os_start(void *pv, unsigned int nbytes) - __attribute__ ((naked,no_instrument_function,noreturn)); + __attribute__ ((naked, no_instrument_function, noreturn)); #endif /**************************************************************************** @@ -322,6 +322,6 @@ void __start(void) /* Shoulnd't get here */ - for (;;); + for (; ; ); #endif } diff --git a/arch/arm/src/stm32/stm32_timerisr.c b/arch/arm/src/stm32/stm32_timerisr.c index e4919c3847..b9c3fa1ab3 100644 --- a/arch/arm/src/stm32/stm32_timerisr.c +++ b/arch/arm/src/stm32/stm32_timerisr.c @@ -108,10 +108,10 @@ int up_timerisr(int irq, uint32_t *regs) { - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); - return 0; + sched_process_timer(); + return 0; } /**************************************************************************** @@ -156,7 +156,8 @@ void up_timer_initialize(void) /* Enable SysTick interrupts */ - putreg32((NVIC_SYSTICK_CTRL_CLKSOURCE|NVIC_SYSTICK_CTRL_TICKINT|NVIC_SYSTICK_CTRL_ENABLE), NVIC_SYSTICK_CTRL); + putreg32((NVIC_SYSTICK_CTRL_CLKSOURCE | NVIC_SYSTICK_CTRL_TICKINT | + NVIC_SYSTICK_CTRL_ENABLE), NVIC_SYSTICK_CTRL); /* And enable the timer interrupt */ diff --git a/arch/arm/src/stm32/stm32_usbdev.c b/arch/arm/src/stm32/stm32_usbdev.c index 0a82446b29..ecc65328f9 100644 --- a/arch/arm/src/stm32/stm32_usbdev.c +++ b/arch/arm/src/stm32/stm32_usbdev.c @@ -796,7 +796,7 @@ static void stm32_checksetup(void) static inline void stm32_seteptxcount(uint8_t epno, uint16_t count) { - volatile uint32_t *epaddr = (uint32_t*)STM32_USB_COUNT_TX(epno); + volatile uint32_t *epaddr = (uint32_t *)STM32_USB_COUNT_TX(epno); *epaddr = count; } @@ -806,7 +806,7 @@ static inline void stm32_seteptxcount(uint8_t epno, uint16_t count) static inline void stm32_seteptxaddr(uint8_t epno, uint16_t addr) { - volatile uint32_t *txaddr = (uint32_t*)STM32_USB_ADDR_TX(epno); + volatile uint32_t *txaddr = (uint32_t *)STM32_USB_ADDR_TX(epno); *txaddr = addr; } @@ -816,7 +816,7 @@ static inline void stm32_seteptxaddr(uint8_t epno, uint16_t addr) static inline uint16_t stm32_geteptxaddr(uint8_t epno) { - volatile uint32_t *txaddr = (uint32_t*)STM32_USB_ADDR_TX(epno); + volatile uint32_t *txaddr = (uint32_t *)STM32_USB_ADDR_TX(epno); return (uint16_t)*txaddr; } @@ -826,7 +826,7 @@ static inline uint16_t stm32_geteptxaddr(uint8_t epno) static void stm32_seteprxcount(uint8_t epno, uint16_t count) { - volatile uint32_t *epaddr = (uint32_t*)STM32_USB_COUNT_RX(epno); + volatile uint32_t *epaddr = (uint32_t *)STM32_USB_COUNT_RX(epno); uint32_t rxcount = 0; uint16_t nblocks; @@ -873,7 +873,7 @@ static void stm32_seteprxcount(uint8_t epno, uint16_t count) static inline uint16_t stm32_geteprxcount(uint8_t epno) { - volatile uint32_t *epaddr = (uint32_t*)STM32_USB_COUNT_RX(epno); + volatile uint32_t *epaddr = (uint32_t *)STM32_USB_COUNT_RX(epno); return (*epaddr) & USB_COUNT_RX_MASK; } @@ -883,7 +883,7 @@ static inline uint16_t stm32_geteprxcount(uint8_t epno) static inline void stm32_seteprxaddr(uint8_t epno, uint16_t addr) { - volatile uint32_t *rxaddr = (uint32_t*)STM32_USB_ADDR_RX(epno); + volatile uint32_t *rxaddr = (uint32_t *)STM32_USB_ADDR_RX(epno); *rxaddr = addr; } @@ -893,7 +893,7 @@ static inline void stm32_seteprxaddr(uint8_t epno, uint16_t addr) static inline uint16_t stm32_geteprxaddr(uint8_t epno) { - volatile uint32_t *rxaddr = (uint32_t*)STM32_USB_ADDR_RX(epno); + volatile uint32_t *rxaddr = (uint32_t *)STM32_USB_ADDR_RX(epno); return (uint16_t)*rxaddr; } @@ -1138,7 +1138,7 @@ static void stm32_copytopma(const uint8_t *buffer, uint16_t pma, uint16_t nbytes /* Copy loop. Source=user buffer, Dest=packet memory */ - dest = (uint16_t*)(STM32_USBRAM_BASE + ((uint32_t)pma << 1)); + dest = (uint16_t *)(STM32_USBRAM_BASE + ((uint32_t)pma << 1)); for (i = nwords; i != 0; i--) { /* Read two bytes and pack into on 16-bit word */ @@ -1168,12 +1168,12 @@ stm32_copyfrompma(uint8_t *buffer, uint16_t pma, uint16_t nbytes) /* Copy loop. Source=packet memory, Dest=user buffer */ - src = (uint32_t*)(STM32_USBRAM_BASE + ((uint32_t)pma << 1)); + src = (uint32_t *)(STM32_USBRAM_BASE + ((uint32_t)pma << 1)); for (i = nwords; i != 0; i--) { /* Copy 16-bits from packet memory to user buffer. */ - *(uint16_t*)buffer = *src++; + *(uint16_t *)buffer = *src++; /* Source address increments by 1*sizeof(uint32_t) = 4; Dest address * increments by 2*sizeof(uint8_t) = 2. @@ -1709,7 +1709,7 @@ static void stm32_setdevaddr(struct stm32_usbdev_s *priv, uint8_t value) /* Set the device address and enable function */ - stm32_putreg(value|USB_DADDR_EF, STM32_USB_DADDR); + stm32_putreg(value | USB_DADDR_EF, STM32_USB_DADDR); } /**************************************************************************** @@ -1755,9 +1755,12 @@ static void stm32_ep0setup(struct stm32_usbdev_s *priv) if (priv->ep0state != EP0STATE_SETUP_READY) { /* Not the data phase */ - /* Get a 32-bit PMA address and use that to get the 8-byte setup request */ + /* Get a 32-bit PMA address and use that to get the 8-byte setup + * request + */ - stm32_copyfrompma((uint8_t*)&priv->ctrl, stm32_geteprxaddr(EP0), USB_SIZEOF_CTRLREQ); + stm32_copyfrompma((uint8_t *)&priv->ctrl, stm32_geteprxaddr(EP0), + USB_SIZEOF_CTRLREQ); /* And extract the little-endian 16-bit values to host order */ @@ -2506,7 +2509,7 @@ static int stm32_lpinterrupt(int irq, void *context) * interrupts. */ - stm32_setimask(priv, USB_CNTR_SUSPM, USB_CNTR_ESOFM|USB_CNTR_WKUPM); + stm32_setimask(priv, USB_CNTR_SUSPM, USB_CNTR_ESOFM | USB_CNTR_WKUPM); stm32_putreg(~USB_CNTR_SUSPM, STM32_USB_ISTR); } @@ -2589,7 +2592,7 @@ static void stm32_suspend(struct stm32_usbdev_s *priv) * interrupt. Clear any pending WKUP interrupt. */ - stm32_setimask(priv, USB_CNTR_WKUPM, USB_CNTR_ESOFM|USB_CNTR_SUSPM); + stm32_setimask(priv, USB_CNTR_WKUPM, USB_CNTR_ESOFM | USB_CNTR_SUSPM); stm32_putreg(~USB_ISTR_WKUP, STM32_USB_ISTR); /* Set the FSUSP bit in the CNTR register. This activates suspend mode @@ -2698,7 +2701,7 @@ static void stm32_esofpoll(struct stm32_usbdev_s *priv) * the WKUP interrupt. Clear any pending WKUP interrupt. */ - stm32_setimask(priv, USB_CNTR_WKUPM, USB_CNTR_ESOFM|USB_CNTR_SUSPM); + stm32_setimask(priv, USB_CNTR_WKUPM, USB_CNTR_ESOFM | USB_CNTR_SUSPM); stm32_putreg(~USB_ISTR_WKUP, STM32_USB_ISTR); } break; @@ -2994,7 +2997,7 @@ static struct usbdev_req_s *stm32_epallocreq(struct usbdev_ep_s *ep) static void stm32_epfreereq(struct usbdev_ep_s *ep, struct usbdev_req_s *req) { - struct stm32_req_s *privreq = (struct stm32_req_s*)req; + struct stm32_req_s *privreq = (struct stm32_req_s *)req; #ifdef CONFIG_DEBUG if (!ep || !req) @@ -3454,7 +3457,7 @@ static int stm32_wakeup(struct usbdev_s *dev) * pending ESOF interrupt. */ - stm32_setimask(priv, USB_CNTR_ESOFM, USB_CNTR_WKUPM|USB_CNTR_SUSPM); + stm32_setimask(priv, USB_CNTR_ESOFM, USB_CNTR_WKUPM | USB_CNTR_SUSPM); stm32_putreg(~USB_ISTR_ESOF, STM32_USB_ISTR); irqrestore(flags); return OK; @@ -3686,7 +3689,7 @@ static void stm32_hwshutdown(struct stm32_usbdev_s *priv) /* Power down the USB controller */ - stm32_putreg(USB_CNTR_FRES|USB_CNTR_PDWN, STM32_USB_CNTR); + stm32_putreg(USB_CNTR_FRES | USB_CNTR_PDWN, STM32_USB_CNTR); } /**************************************************************************** @@ -3881,7 +3884,8 @@ int usbdev_register(struct usbdevclass_driver_s *driver) stm32_usbpullup(&priv->usbdev, true); priv->usbdev.speed = USB_SPEED_FULL; - } + } + return ret; } diff --git a/arch/arm/src/stm32/stm32_userspace.c b/arch/arm/src/stm32/stm32_userspace.c index 55dcc11224..9e3a537d08 100644 --- a/arch/arm/src/stm32/stm32_userspace.c +++ b/arch/arm/src/stm32/stm32_userspace.c @@ -87,8 +87,8 @@ void stm32_userspace(void) DEBUGASSERT(USERSPACE->us_bssstart != 0 && USERSPACE->us_bssend != 0 && USERSPACE->us_bssstart <= USERSPACE->us_bssend); - dest = (uint8_t*)USERSPACE->us_bssstart; - end = (uint8_t*)USERSPACE->us_bssend; + dest = (uint8_t *)USERSPACE->us_bssstart; + end = (uint8_t *)USERSPACE->us_bssend; while (dest != end) { @@ -101,9 +101,9 @@ void stm32_userspace(void) USERSPACE->us_datastart != 0 && USERSPACE->us_dataend != 0 && USERSPACE->us_datastart <= USERSPACE->us_dataend); - src = (uint8_t*)USERSPACE->us_datasource; - dest = (uint8_t*)USERSPACE->us_datastart; - end = (uint8_t*)USERSPACE->us_dataend; + src = (uint8_t *)USERSPACE->us_datasource; + dest = (uint8_t *)USERSPACE->us_datastart; + end = (uint8_t *)USERSPACE->us_dataend; while (dest != end) { diff --git a/arch/arm/src/stm32/stm32_wwdg.c b/arch/arm/src/stm32/stm32_wwdg.c index 1880c75257..e4759ee983 100644 --- a/arch/arm/src/stm32/stm32_wwdg.c +++ b/arch/arm/src/stm32/stm32_wwdg.c @@ -197,10 +197,11 @@ static uint16_t stm32_getreg(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return val; } } @@ -209,20 +210,20 @@ static uint16_t stm32_getreg(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ diff --git a/arch/arm/src/stm32/stm32f10xxx_dma.c b/arch/arm/src/stm32/stm32f10xxx_dma.c index 67bfd12991..258967d27a 100644 --- a/arch/arm/src/stm32/stm32f10xxx_dma.c +++ b/arch/arm/src/stm32/stm32f10xxx_dma.c @@ -502,10 +502,12 @@ void stm32_dmasetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr, */ regval = dmachan_getreg(dmach, STM32_DMACHAN_CCR_OFFSET); - regval &= ~(DMA_CCR_MEM2MEM|DMA_CCR_PL_MASK|DMA_CCR_MSIZE_MASK|DMA_CCR_PSIZE_MASK| - DMA_CCR_MINC|DMA_CCR_PINC|DMA_CCR_CIRC|DMA_CCR_DIR); - ccr &= (DMA_CCR_MEM2MEM|DMA_CCR_PL_MASK|DMA_CCR_MSIZE_MASK|DMA_CCR_PSIZE_MASK| - DMA_CCR_MINC|DMA_CCR_PINC|DMA_CCR_CIRC|DMA_CCR_DIR); + regval &= ~(DMA_CCR_MEM2MEM | DMA_CCR_PL_MASK | DMA_CCR_MSIZE_MASK | + DMA_CCR_PSIZE_MASK | DMA_CCR_MINC | DMA_CCR_PINC | DMA_CCR_CIRC | + DMA_CCR_DIR); + ccr &= (DMA_CCR_MEM2MEM | DMA_CCR_PL_MASK | DMA_CCR_MSIZE_MASK | + DMA_CCR_PSIZE_MASK | DMA_CCR_MINC | DMA_CCR_PINC | DMA_CCR_CIRC | + DMA_CCR_DIR); regval |= ccr; dmachan_putreg(dmach, STM32_DMACHAN_CCR_OFFSET, regval); } @@ -556,7 +558,7 @@ void stm32_dmastart(DMA_HANDLE handle, dma_callback_t callback, * Interrupt Enable bit (TCIE) is set. */ - ccr |= (half ? (DMA_CCR_HTIE|DMA_CCR_TEIE) : (DMA_CCR_TCIE|DMA_CCR_TEIE)); + ccr |= (half ? (DMA_CCR_HTIE | DMA_CCR_TEIE) : (DMA_CCR_TCIE | DMA_CCR_TEIE)); } else { diff --git a/arch/arm/src/stm32/stm32f10xxx_rcc.c b/arch/arm/src/stm32/stm32f10xxx_rcc.c index 3d8a45822d..736b3ee7ef 100644 --- a/arch/arm/src/stm32/stm32f10xxx_rcc.c +++ b/arch/arm/src/stm32/stm32f10xxx_rcc.c @@ -71,7 +71,7 @@ static inline void rcc_reset(void) putreg32(0, STM32_RCC_APB2RSTR); /* Disable APB2 Peripheral Reset */ putreg32(0, STM32_RCC_APB1RSTR); /* Disable APB1 Peripheral Reset */ - putreg32(RCC_AHBENR_FLITFEN|RCC_AHBENR_SRAMEN, STM32_RCC_AHBENR); /* FLITF and SRAM Clock ON */ + putreg32(RCC_AHBENR_FLITFEN | RCC_AHBENR_SRAMEN, STM32_RCC_AHBENR); /* FLITF and SRAM Clock ON */ putreg32(0, STM32_RCC_APB2ENR); /* Disable APB2 Peripheral Clock */ putreg32(0, STM32_RCC_APB1ENR); /* Disable APB1 Peripheral Clock */ @@ -80,12 +80,12 @@ static inline void rcc_reset(void) putreg32(regval, STM32_RCC_CR); regval = getreg32(STM32_RCC_CFGR); /* Reset SW, HPRE, PPRE1, PPRE2, ADCPRE and MCO bits */ - regval &= ~(RCC_CFGR_SW_MASK|RCC_CFGR_HPRE_MASK|RCC_CFGR_PPRE1_MASK| - RCC_CFGR_PPRE2_MASK|RCC_CFGR_ADCPRE_MASK|RCC_CFGR_MCO_MASK); + regval &= ~(RCC_CFGR_SW_MASK | RCC_CFGR_HPRE_MASK | RCC_CFGR_PPRE1_MASK | + RCC_CFGR_PPRE2_MASK | RCC_CFGR_ADCPRE_MASK | RCC_CFGR_MCO_MASK); putreg32(regval, STM32_RCC_CFGR); regval = getreg32(STM32_RCC_CR); /* Reset HSEON, CSSON and PLLON bits */ - regval &= ~(RCC_CR_HSEON|RCC_CR_CSSON|RCC_CR_PLLON); + regval &= ~(RCC_CR_HSEON | RCC_CR_CSSON | RCC_CR_PLLON); putreg32(regval, STM32_RCC_CR); regval = getreg32(STM32_RCC_CR); /* Reset HSEBYP bit */ @@ -93,9 +93,9 @@ static inline void rcc_reset(void) putreg32(regval, STM32_RCC_CR); regval = getreg32(STM32_RCC_CFGR); /* Reset PLLSRC, PLLXTPRE, PLLMUL and USBPRE bits */ - regval &= ~(RCC_CFGR_PLLSRC|RCC_CFGR_PLLXTPRE|RCC_CFGR_PLLMUL_MASK + regval &= ~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMUL_MASK #ifndef CONFIG_STM32_VALUELINE - |RCC_CFGR_USBPRE + | RCC_CFGR_USBPRE #endif ); putreg32(regval, STM32_RCC_CFGR); @@ -129,7 +129,7 @@ static inline void rcc_enableahb(void) /* Always enable FLITF clock and SRAM clock */ - regval = RCC_AHBENR_FLITFEN|RCC_AHBENR_SRAMEN; + regval = RCC_AHBENR_FLITFEN | RCC_AHBENR_SRAMEN; #ifdef CONFIG_STM32_DMA1 /* DMA 1 clock enable */ @@ -403,25 +403,25 @@ static inline void rcc_enableapb2(void) regval = getreg32(STM32_RCC_APB2ENR); regval |= (RCC_APB2ENR_AFIOEN #if STM32_NGPIO > 0 - |RCC_APB2ENR_IOPAEN + | RCC_APB2ENR_IOPAEN #endif #if STM32_NGPIO > 16 - |RCC_APB2ENR_IOPBEN + | RCC_APB2ENR_IOPBEN #endif #if STM32_NGPIO > 32 - |RCC_APB2ENR_IOPCEN + | RCC_APB2ENR_IOPCEN #endif #if STM32_NGPIO > 48 - |RCC_APB2ENR_IOPDEN + | RCC_APB2ENR_IOPDEN #endif #if STM32_NGPIO > 64 - |RCC_APB2ENR_IOPEEN + | RCC_APB2ENR_IOPEEN #endif #if STM32_NGPIO > 80 - |RCC_APB2ENR_IOPFEN + | RCC_APB2ENR_IOPFEN #endif #if STM32_NGPIO > 96 - |RCC_APB2ENR_IOPGEN + | RCC_APB2ENR_IOPGEN #endif ); @@ -531,7 +531,7 @@ static void stm32_stdclockconfig(void) regval = getreg32(STM32_FLASH_ACR); regval &= ~FLASH_ACR_LATENCY_MASK; - regval |= (FLASH_ACR_LATENCY_2|FLASH_ACR_PRTFBE); + regval |= (FLASH_ACR_LATENCY_2 | FLASH_ACR_PRTFBE); putreg32(regval, STM32_FLASH_ACR); /* Set up PLL input scaling (with source = PLL2) */ @@ -675,92 +675,92 @@ static void stm32_stdclockconfig(void) # error STM32_CFGR_PLLXTPRE must match the LSB of STM32_CFGR2_PREDIV1 # endif - /* Set the HSE prescaler */ + /* Set the HSE prescaler */ - regval = STM32_CFGR2_PREDIV1; - putreg32(regval, STM32_RCC_CFGR2); + regval = STM32_CFGR2_PREDIV1; + putreg32(regval, STM32_RCC_CFGR2); # endif #endif - /* Value-line devices don't implement flash prefetch/waitstates */ + /* Value-line devices don't implement flash prefetch/waitstates */ #ifndef CONFIG_STM32_VALUELINE - /* Enable FLASH prefetch buffer and 2 wait states */ + /* Enable FLASH prefetch buffer and 2 wait states */ - regval = getreg32(STM32_FLASH_ACR); - regval &= ~FLASH_ACR_LATENCY_MASK; - regval |= (FLASH_ACR_LATENCY_2|FLASH_ACR_PRTFBE); - putreg32(regval, STM32_FLASH_ACR); + regval = getreg32(STM32_FLASH_ACR); + regval &= ~FLASH_ACR_LATENCY_MASK; + regval |= (FLASH_ACR_LATENCY_2 | FLASH_ACR_PRTFBE); + putreg32(regval, STM32_FLASH_ACR); #endif - /* Set the HCLK source/divider */ + /* Set the HCLK source/divider */ - regval = getreg32(STM32_RCC_CFGR); - regval &= ~RCC_CFGR_HPRE_MASK; - regval |= STM32_RCC_CFGR_HPRE; - putreg32(regval, STM32_RCC_CFGR); + regval = getreg32(STM32_RCC_CFGR); + regval &= ~RCC_CFGR_HPRE_MASK; + regval |= STM32_RCC_CFGR_HPRE; + putreg32(regval, STM32_RCC_CFGR); - /* Set the PCLK2 divider */ + /* Set the PCLK2 divider */ - regval = getreg32(STM32_RCC_CFGR); - regval &= ~RCC_CFGR_PPRE2_MASK; - regval |= STM32_RCC_CFGR_PPRE2; - putreg32(regval, STM32_RCC_CFGR); + regval = getreg32(STM32_RCC_CFGR); + regval &= ~RCC_CFGR_PPRE2_MASK; + regval |= STM32_RCC_CFGR_PPRE2; + putreg32(regval, STM32_RCC_CFGR); - /* Set the PCLK1 divider */ + /* Set the PCLK1 divider */ - regval = getreg32(STM32_RCC_CFGR); - regval &= ~RCC_CFGR_PPRE1_MASK; - regval |= STM32_RCC_CFGR_PPRE1; - putreg32(regval, STM32_RCC_CFGR); + regval = getreg32(STM32_RCC_CFGR); + regval &= ~RCC_CFGR_PPRE1_MASK; + regval |= STM32_RCC_CFGR_PPRE1; + putreg32(regval, STM32_RCC_CFGR); - /* If we are using the PLL, configure and start it */ + /* If we are using the PLL, configure and start it */ #if STM32_SYSCLK_SW == RCC_CFGR_SW_PLL - /* Set the PLL divider and multiplier */ + /* Set the PLL divider and multiplier */ - regval = getreg32(STM32_RCC_CFGR); - regval &= ~(RCC_CFGR_PLLSRC|RCC_CFGR_PLLXTPRE|RCC_CFGR_PLLMUL_MASK); - regval |= (STM32_CFGR_PLLSRC|STM32_CFGR_PLLXTPRE|STM32_CFGR_PLLMUL); - putreg32(regval, STM32_RCC_CFGR); + regval = getreg32(STM32_RCC_CFGR); + regval &= ~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMUL_MASK); + regval |= (STM32_CFGR_PLLSRC | STM32_CFGR_PLLXTPRE | STM32_CFGR_PLLMUL); + putreg32(regval, STM32_RCC_CFGR); - /* Enable the PLL */ + /* Enable the PLL */ - regval = getreg32(STM32_RCC_CR); - regval |= RCC_CR_PLLON; - putreg32(regval, STM32_RCC_CR); + regval = getreg32(STM32_RCC_CR); + regval |= RCC_CR_PLLON; + putreg32(regval, STM32_RCC_CR); - /* Wait until the PLL is ready */ + /* Wait until the PLL is ready */ - while ((getreg32(STM32_RCC_CR) & RCC_CR_PLLRDY) == 0); + while ((getreg32(STM32_RCC_CR) & RCC_CR_PLLRDY) == 0); #endif - /* Select the system clock source (probably the PLL) */ + /* Select the system clock source (probably the PLL) */ - regval = getreg32(STM32_RCC_CFGR); - regval &= ~RCC_CFGR_SW_MASK; - regval |= STM32_SYSCLK_SW; - putreg32(regval, STM32_RCC_CFGR); + regval = getreg32(STM32_RCC_CFGR); + regval &= ~RCC_CFGR_SW_MASK; + regval |= STM32_SYSCLK_SW; + putreg32(regval, STM32_RCC_CFGR); - /* Wait until the selected source is used as the system clock source */ + /* Wait until the selected source is used as the system clock source */ - while ((getreg32(STM32_RCC_CFGR) & RCC_CFGR_SWS_MASK) != STM32_SYSCLK_SWS); + while ((getreg32(STM32_RCC_CFGR) & RCC_CFGR_SWS_MASK) != STM32_SYSCLK_SWS); #if defined(CONFIG_STM32_IWDG) || defined(CONFIG_RTC_LSICLOCK) - /* Low speed internal clock source LSI */ + /* Low speed internal clock source LSI */ - stm32_rcc_enablelsi(); + stm32_rcc_enablelsi(); #endif #if defined(CONFIG_RTC_LSECLOCK) - /* Low speed external clock source LSE */ + /* Low speed external clock source LSE */ - stm32_rcc_enablelse(); + stm32_rcc_enablelse(); #endif } #endif diff --git a/arch/arm/src/stm32/stm32f20xxx_dma.c b/arch/arm/src/stm32/stm32f20xxx_dma.c index f6fc4818d2..b712e85112 100644 --- a/arch/arm/src/stm32/stm32f20xxx_dma.c +++ b/arch/arm/src/stm32/stm32f20xxx_dma.c @@ -679,7 +679,7 @@ void stm32_dmasetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr, */ regval = dmast_getreg(dmast, STM32_DMA_SCR_OFFSET); - regval &= ~(DMA_SCR_PL_MASK|DMA_SCR_CHSEL_MASK); + regval &= ~(DMA_SCR_PL_MASK | DMA_SCR_CHSEL_MASK); regval |= scr & DMA_SCR_PL_MASK; regval |= (uint32_t)dmast->channel << DMA_SCR_CHSEL_SHIFT; dmast_putreg(dmast, STM32_DMA_SCR_OFFSET, regval); @@ -721,16 +721,16 @@ void stm32_dmasetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr, */ regval = dmast_getreg(dmast, STM32_DMA_SCR_OFFSET); - regval &= ~(DMA_SCR_PFCTRL|DMA_SCR_DIR_MASK|DMA_SCR_PINC|DMA_SCR_MINC| - DMA_SCR_PSIZE_MASK|DMA_SCR_MSIZE_MASK|DMA_SCR_PINCOS| - DMA_SCR_CIRC|DMA_SCR_DBM|DMA_SCR_CT| - DMA_SCR_PBURST_MASK|DMA_SCR_MBURST_MASK); - scr &= (DMA_SCR_PFCTRL|DMA_SCR_DIR_MASK|DMA_SCR_PINC|DMA_SCR_MINC| - DMA_SCR_PSIZE_MASK|DMA_SCR_MSIZE_MASK|DMA_SCR_PINCOS| - DMA_SCR_DBM|DMA_SCR_CIRC| - DMA_SCR_PBURST_MASK|DMA_SCR_MBURST_MASK); + regval &= ~(DMA_SCR_PFCTRL | DMA_SCR_DIR_MASK | DMA_SCR_PINC | DMA_SCR_MINC | + DMA_SCR_PSIZE_MASK | DMA_SCR_MSIZE_MASK | DMA_SCR_PINCOS | + DMA_SCR_CIRC | DMA_SCR_DBM | DMA_SCR_CT | + DMA_SCR_PBURST_MASK | DMA_SCR_MBURST_MASK); + scr &= (DMA_SCR_PFCTRL | DMA_SCR_DIR_MASK | DMA_SCR_PINC | DMA_SCR_MINC | + DMA_SCR_PSIZE_MASK | DMA_SCR_MSIZE_MASK | DMA_SCR_PINCOS | + DMA_SCR_DBM | DMA_SCR_CIRC | + DMA_SCR_PBURST_MASK | DMA_SCR_MBURST_MASK); regval |= scr; - dmast->nonstop = (scr & (DMA_SCR_DBM|DMA_SCR_CIRC)) != 0; + dmast->nonstop = (scr & (DMA_SCR_DBM | DMA_SCR_CIRC)) != 0; dmast_putreg(dmast, STM32_DMA_SCR_OFFSET, regval); } @@ -775,7 +775,7 @@ void stm32_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg, bool * Interrupt Enable bit (TCIE) is set. */ - scr |= (half ? (DMA_SCR_HTIE|DMA_SCR_TEIE) : (DMA_SCR_TCIE|DMA_SCR_TEIE)); + scr |= (half ? (DMA_SCR_HTIE | DMA_SCR_TEIE) : (DMA_SCR_TCIE | DMA_SCR_TEIE)); } else { diff --git a/arch/arm/src/stm32/stm32f20xxx_rcc.c b/arch/arm/src/stm32/stm32f20xxx_rcc.c index 6ad500070d..ed6e0fed31 100644 --- a/arch/arm/src/stm32/stm32f20xxx_rcc.c +++ b/arch/arm/src/stm32/stm32f20xxx_rcc.c @@ -88,7 +88,7 @@ static inline void rcc_reset(void) /* Reset HSEON, CSSON and PLLON bits */ regval = getreg32(STM32_RCC_CR); - regval &= ~(RCC_CR_HSEON|RCC_CR_CSSON|RCC_CR_PLLON); + regval &= ~(RCC_CR_HSEON | RCC_CR_CSSON | RCC_CR_PLLON); putreg32(regval, STM32_RCC_CR); /* Reset PLLCFGR register to reset default */ @@ -124,33 +124,33 @@ static inline void rcc_enableahb1(void) regval = getreg32(STM32_RCC_AHB1ENR); - /* Enable GPIOA, GPIOB, .... GPIOI*/ + /* Enable GPIOA, GPIOB, .... GPIOI */ #if STM32_NGPIO > 0 regval |= (RCC_AHB1ENR_GPIOAEN #if STM32_NGPIO > 16 - |RCC_AHB1ENR_GPIOBEN + | RCC_AHB1ENR_GPIOBEN #endif #if STM32_NGPIO > 32 - |RCC_AHB1ENR_GPIOCEN + | RCC_AHB1ENR_GPIOCEN #endif #if STM32_NGPIO > 48 - |RCC_AHB1ENR_GPIODEN + | RCC_AHB1ENR_GPIODEN #endif #if STM32_NGPIO > 64 - |RCC_AHB1ENR_GPIOEEN + | RCC_AHB1ENR_GPIOEEN #endif #if STM32_NGPIO > 80 - |RCC_AHB1ENR_GPIOFEN + | RCC_AHB1ENR_GPIOFEN #endif #if STM32_NGPIO > 96 - |RCC_AHB1ENR_GPIOGEN + | RCC_AHB1ENR_GPIOGEN #endif #if STM32_NGPIO > 112 - |RCC_AHB1ENR_GPIOHEN + | RCC_AHB1ENR_GPIOHEN #endif #if STM32_NGPIO > 128 - |RCC_AHB1ENR_GPIOIEN + | RCC_AHB1ENR_GPIOIEN #endif ); #endif @@ -182,7 +182,7 @@ static inline void rcc_enableahb1(void) #ifdef CONFIG_STM32_ETHMAC /* Ethernet MAC clocking */ - regval |= (RCC_AHB1ENR_ETHMACEN|RCC_AHB1ENR_ETHMACTXEN|RCC_AHB1ENR_ETHMACRXEN); + regval |= (RCC_AHB1ENR_ETHMACEN | RCC_AHB1ENR_ETHMACTXEN | RCC_AHB1ENR_ETHMACRXEN); #ifdef CONFIG_STM32_ETH_PTP /* Precision Time Protocol (PTP) */ @@ -195,7 +195,7 @@ static inline void rcc_enableahb1(void) #ifdef CONFIG_STM32_OTGHS /* USB OTG HS */ - regval |= (RCC_AHB1ENR_OTGHSEN|RCC_AHB1ENR_OTGHSULPIEN); + regval |= (RCC_AHB1ENR_OTGHSEN | RCC_AHB1ENR_OTGHSULPIEN); #endif putreg32(regval, STM32_RCC_AHB1ENR); /* Enable peripherals */ @@ -624,7 +624,7 @@ static void stm32_stdclockconfig(void) /* Set the PLL dividers and multipliers to configure the main PLL */ - regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN |STM32_PLLCFG_PLLP | + regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN | STM32_PLLCFG_PLLP | RCC_PLLCFG_PLLSRC_HSE | STM32_PLLCFG_PLLQ); putreg32(regval, STM32_RCC_PLLCFG); diff --git a/arch/arm/src/stm32/stm32f30xxx_i2c.c b/arch/arm/src/stm32/stm32f30xxx_i2c.c index 1acc78d16c..3fafd055ec 100644 --- a/arch/arm/src/stm32/stm32f30xxx_i2c.c +++ b/arch/arm/src/stm32/stm32f30xxx_i2c.c @@ -894,9 +894,9 @@ static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv) sr = stm32_i2c_getreg(priv, STM32_I2C_ISR_OFFSET); if ((sr & I2C_INT_TIMEOUT) != 0) - { - return; - } + { + return; + } /* Calculate the elapsed time */ @@ -924,7 +924,7 @@ static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv) static inline void stm32_i2c_sem_post(FAR struct i2c_dev_s *dev) { - sem_post( &((struct stm32_i2c_inst_s *)dev)->priv->sem_excl ); + sem_post(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); } /************************************************************************************ @@ -1138,10 +1138,10 @@ static void stm32_i2c_setclock(FAR struct stm32_i2c_priv_s *priv, uint32_t frequ } uint32_t timingr = - (presc << I2C_TIMINGR_PRESC_SHIFT)| - (s_time << I2C_TIMINGR_SCLDEL_SHIFT)| - (h_time << I2C_TIMINGR_SDADEL_SHIFT)| - (scl_h_period << I2C_TIMINGR_SCLH_SHIFT)| + (presc << I2C_TIMINGR_PRESC_SHIFT) | + (s_time << I2C_TIMINGR_SCLDEL_SHIFT) | + (h_time << I2C_TIMINGR_SDADEL_SHIFT) | + (scl_h_period << I2C_TIMINGR_SCLH_SHIFT) | (scl_l_period << I2C_TIMINGR_SCLL_SHIFT); stm32_i2c_putreg32(priv, STM32_I2C_TIMINGR_OFFSET, timingr); @@ -1233,7 +1233,7 @@ static inline void stm32_i2c_clrstart(FAR struct stm32_i2c_priv_s *priv) /* TODO check PEC (32 bit separate reg) */ stm32_i2c_modifyreg32(priv, STM32_I2C_CR2_OFFSET, - I2C_CR2_START|I2C_CR2_STOP, 0); + I2C_CR2_START | I2C_CR2_STOP, 0); } /************************************************************************************ @@ -1397,7 +1397,7 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) stm32_i2c_traceevent(priv, I2CEVENT_REITBUFEN, 0); stm32_i2c_enableinterrupts(priv); } - else if ((priv->dcnt == 0) && (priv->msgc==0)) + else if ((priv->dcnt == 0) && (priv->msgc == 0)) { stm32_i2c_traceevent(priv, I2CEVENT_DISITBUFEN, 0); stm32_i2c_disableinterrupts(priv); @@ -1459,7 +1459,7 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) * and wake it up. */ - sem_post( &priv->sem_isr ); + sem_post(&priv->sem_isr); priv->intstate = INTSTATE_DONE; } #else @@ -1494,7 +1494,7 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) * and wake it up. */ - sem_post( &priv->sem_isr ); + sem_post(&priv->sem_isr); priv->intstate = INTSTATE_DONE; } #else @@ -1937,9 +1937,10 @@ static int stm32_i2c_writeread(FAR struct i2c_dev_s *dev, }, { .addr = ((struct stm32_i2c_inst_s *)dev)->address, - .flags = ((struct stm32_i2c_inst_s *)dev)->flags | ((buflen>0) ? I2C_M_READ : I2C_M_NORESTART), + .flags = ((struct stm32_i2c_inst_s *)dev)->flags | + ((buflen > 0) ? I2C_M_READ : I2C_M_NORESTART), .buffer = buffer, - .length = (buflen>0) ? buflen : -buflen + .length = (buflen > 0) ? buflen : -buflen } }; @@ -1988,7 +1989,7 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port) #if STM32_PCLK1_FREQUENCY < 2000000 # warning STM32_I2C_INIT: Peripheral clock must be at least 2 MHz to support 100 kHz operation. - return NULL; + return NULL; #endif /* Get I2C private structure */ @@ -2016,7 +2017,7 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port) /* Allocate instance */ - if (!(inst = kmm_malloc( sizeof(struct stm32_i2c_inst_s)))) + if (!(inst = kmm_malloc(sizeof(struct stm32_i2c_inst_s)))) { return NULL; } @@ -2037,8 +2038,8 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port) if ((volatile int)priv->refs++ == 0) { - stm32_i2c_sem_init( (struct i2c_dev_s *)inst ); - stm32_i2c_init( priv ); + stm32_i2c_sem_init((struct i2c_dev_s *)inst); + stm32_i2c_init(priv); } irqrestore(irqs); @@ -2079,11 +2080,11 @@ int up_i2cuninitialize(FAR struct i2c_dev_s * dev) /* Disable power and other HW resource (GPIO's) */ - stm32_i2c_deinit( ((struct stm32_i2c_inst_s *)dev)->priv ); + stm32_i2c_deinit(((struct stm32_i2c_inst_s *)dev)->priv); /* Release unused resources */ - stm32_i2c_sem_destroy( (struct i2c_dev_s *)dev ); + stm32_i2c_sem_destroy((struct i2c_dev_s *)dev); kmm_free(dev); return OK; diff --git a/arch/arm/src/stm32/stm32f30xxx_rcc.c b/arch/arm/src/stm32/stm32f30xxx_rcc.c index 7ae25e0995..6da5b9c03b 100644 --- a/arch/arm/src/stm32/stm32f30xxx_rcc.c +++ b/arch/arm/src/stm32/stm32f30xxx_rcc.c @@ -93,7 +93,7 @@ static inline void rcc_reset(void) putreg32(0, STM32_RCC_CFGR2); /* Reset fCK source for all U[S]ARTs to PCLK */ regval = getreg32(STM32_RCC_CR); /* Reset HSEON, CSSON and PLLON bits */ - regval &= ~(RCC_CR_HSEON|RCC_CR_CSSON|RCC_CR_PLLON); + regval &= ~(RCC_CR_HSEON | RCC_CR_CSSON | RCC_CR_PLLON); putreg32(regval, STM32_RCC_CR); regval = getreg32(STM32_RCC_CR); /* Reset HSEBYP bit */ @@ -578,98 +578,98 @@ static void stm32_stdclockconfig(void) # error STM32_CFGR_PLLXTPRE must match the LSB of STM32_CFGR2_PREDIV1 # endif - /* Set the HSE prescaler */ + /* Set the HSE prescaler */ - regval = STM32_CFGR2_PREDIV1; - putreg32(regval, STM32_RCC_CFGR2); + regval = STM32_CFGR2_PREDIV1; + putreg32(regval, STM32_RCC_CFGR2); # endif #endif #ifndef CONFIG_STM32_VALUELINE - /* Value-line devices don't implement flash prefetch/waitstates */ - /* Enable FLASH prefetch buffer and 2 wait states */ + /* Value-line devices don't implement flash prefetch/waitstates */ + /* Enable FLASH prefetch buffer and 2 wait states */ - regval = getreg32(STM32_FLASH_ACR); - regval &= ~FLASH_ACR_LATENCY_MASK; - regval |= (FLASH_ACR_LATENCY_2|FLASH_ACR_PRTFBE); - putreg32(regval, STM32_FLASH_ACR); + regval = getreg32(STM32_FLASH_ACR); + regval &= ~FLASH_ACR_LATENCY_MASK; + regval |= (FLASH_ACR_LATENCY_2 | FLASH_ACR_PRTFBE); + putreg32(regval, STM32_FLASH_ACR); #endif - /* Set the HCLK source/divider */ + /* Set the HCLK source/divider */ - regval = getreg32(STM32_RCC_CFGR); - regval &= ~RCC_CFGR_HPRE_MASK; - regval |= STM32_RCC_CFGR_HPRE; - putreg32(regval, STM32_RCC_CFGR); + regval = getreg32(STM32_RCC_CFGR); + regval &= ~RCC_CFGR_HPRE_MASK; + regval |= STM32_RCC_CFGR_HPRE; + putreg32(regval, STM32_RCC_CFGR); - /* Set the PCLK2 divider */ + /* Set the PCLK2 divider */ - regval = getreg32(STM32_RCC_CFGR); - regval &= ~RCC_CFGR_PPRE2_MASK; - regval |= STM32_RCC_CFGR_PPRE2; - putreg32(regval, STM32_RCC_CFGR); + regval = getreg32(STM32_RCC_CFGR); + regval &= ~RCC_CFGR_PPRE2_MASK; + regval |= STM32_RCC_CFGR_PPRE2; + putreg32(regval, STM32_RCC_CFGR); - /* Set the PCLK1 divider */ + /* Set the PCLK1 divider */ - regval = getreg32(STM32_RCC_CFGR); - regval &= ~RCC_CFGR_PPRE1_MASK; - regval |= STM32_RCC_CFGR_PPRE1; - putreg32(regval, STM32_RCC_CFGR); + regval = getreg32(STM32_RCC_CFGR); + regval &= ~RCC_CFGR_PPRE1_MASK; + regval |= STM32_RCC_CFGR_PPRE1; + putreg32(regval, STM32_RCC_CFGR); #if STM32_SYSCLK_SW == RCC_CFGR_SW_PLL - /* If we are using the PLL, configure and start it */ - /* Set the PLL divider and multiplier */ + /* If we are using the PLL, configure and start it */ + /* Set the PLL divider and multiplier */ - regval = getreg32(STM32_RCC_CFGR); - regval &= ~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMUL_MASK); - regval |= (STM32_CFGR_PLLSRC | STM32_CFGR_PLLXTPRE | STM32_CFGR_PLLMUL); - putreg32(regval, STM32_RCC_CFGR); + regval = getreg32(STM32_RCC_CFGR); + regval &= ~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMUL_MASK); + regval |= (STM32_CFGR_PLLSRC | STM32_CFGR_PLLXTPRE | STM32_CFGR_PLLMUL); + putreg32(regval, STM32_RCC_CFGR); - /* Enable the PLL */ + /* Enable the PLL */ - regval = getreg32(STM32_RCC_CR); - regval |= RCC_CR_PLLON; - putreg32(regval, STM32_RCC_CR); + regval = getreg32(STM32_RCC_CR); + regval |= RCC_CR_PLLON; + putreg32(regval, STM32_RCC_CR); - /* Wait until the PLL is ready */ + /* Wait until the PLL is ready */ - while ((getreg32(STM32_RCC_CR) & RCC_CR_PLLRDY) == 0); + while ((getreg32(STM32_RCC_CR) & RCC_CR_PLLRDY) == 0); #endif - /* Select the system clock source (probably the PLL) */ + /* Select the system clock source (probably the PLL) */ - regval = getreg32(STM32_RCC_CFGR); - regval &= ~RCC_CFGR_SW_MASK; - regval |= STM32_SYSCLK_SW; - putreg32(regval, STM32_RCC_CFGR); + regval = getreg32(STM32_RCC_CFGR); + regval &= ~RCC_CFGR_SW_MASK; + regval |= STM32_SYSCLK_SW; + putreg32(regval, STM32_RCC_CFGR); - /* Wait until the selected source is used as the system clock source */ + /* Wait until the selected source is used as the system clock source */ - while ((getreg32(STM32_RCC_CFGR) & RCC_CFGR_SWS_MASK) != STM32_SYSCLK_SWS); + while ((getreg32(STM32_RCC_CFGR) & RCC_CFGR_SWS_MASK) != STM32_SYSCLK_SWS); #if defined(CONFIG_STM32_IWDG) || defined(CONFIG_RTC_LSICLOCK) - /* Low speed internal clock source LSI */ - /* - * TODO: There is another case where the LSI needs to - * be enabled: if the MCO pin selects LSI as source. - */ + /* Low speed internal clock source LSI + * + * TODO: There is another case where the LSI needs to + * be enabled: if the MCO pin selects LSI as source. + */ - stm32_rcc_enablelsi(); + stm32_rcc_enablelsi(); #endif #if defined(CONFIG_RTC_LSECLOCK) - /* Low speed external clock source LSE - * - * TODO: There is another case where the LSE needs to - * be enabled: if the MCO pin selects LSE as source. - * - * TODO: There is another case where the LSE needs to - * be enabled: if USARTx selects LSE as source. - */ + /* Low speed external clock source LSE + * + * TODO: There is another case where the LSE needs to + * be enabled: if the MCO pin selects LSE as source. + * + * TODO: There is another case where the LSE needs to + * be enabled: if USARTx selects LSE as source. + */ - stm32_rcc_enablelse(); + stm32_rcc_enablelse(); #endif } #endif diff --git a/arch/arm/src/stm32/stm32f37xxx_rcc.c b/arch/arm/src/stm32/stm32f37xxx_rcc.c index 280915a4fd..02fa9fd930 100644 --- a/arch/arm/src/stm32/stm32f37xxx_rcc.c +++ b/arch/arm/src/stm32/stm32f37xxx_rcc.c @@ -92,7 +92,7 @@ static inline void rcc_reset(void) putreg32(0, STM32_RCC_CFGR2); /* Reset fCK source for all U[S]ARTs to PCLK */ regval = getreg32(STM32_RCC_CR); /* Reset HSEON, CSSON and PLLON bits */ - regval &= ~(RCC_CR_HSEON|RCC_CR_CSSON|RCC_CR_PLLON); + regval &= ~(RCC_CR_HSEON | RCC_CR_CSSON | RCC_CR_PLLON); putreg32(regval, STM32_RCC_CR); regval = getreg32(STM32_RCC_CR); /* Reset HSEBYP bit */ @@ -473,97 +473,97 @@ static void stm32_stdclockconfig(void) # error STM32_CFGR_PLLXTPRE must match the LSB of STM32_CFGR2_PREDIV1 # endif - /* Set the HSE prescaler */ + /* Set the HSE prescaler */ - regval = STM32_CFGR2_PREDIV1; - putreg32(regval, STM32_RCC_CFGR2); + regval = STM32_CFGR2_PREDIV1; + putreg32(regval, STM32_RCC_CFGR2); # endif - /* Enable FLASH prefetch buffer and 2 wait states */ + /* Enable FLASH prefetch buffer and 2 wait states */ - regval = getreg32(STM32_FLASH_ACR); - regval &= ~FLASH_ACR_LATENCY_MASK; - regval |= (FLASH_ACR_LATENCY_2|FLASH_ACR_PRTFBE); - putreg32(regval, STM32_FLASH_ACR); + regval = getreg32(STM32_FLASH_ACR); + regval &= ~FLASH_ACR_LATENCY_MASK; + regval |= (FLASH_ACR_LATENCY_2 | FLASH_ACR_PRTFBE); + putreg32(regval, STM32_FLASH_ACR); - /* Set the HCLK source/divider */ + /* Set the HCLK source/divider */ - regval = getreg32(STM32_RCC_CFGR); - regval &= ~RCC_CFGR_HPRE_MASK; - regval |= STM32_RCC_CFGR_HPRE; - putreg32(regval, STM32_RCC_CFGR); + regval = getreg32(STM32_RCC_CFGR); + regval &= ~RCC_CFGR_HPRE_MASK; + regval |= STM32_RCC_CFGR_HPRE; + putreg32(regval, STM32_RCC_CFGR); - /* Set the PCLK2 divider */ + /* Set the PCLK2 divider */ - regval = getreg32(STM32_RCC_CFGR); - regval &= ~RCC_CFGR_PPRE2_MASK; - regval |= STM32_RCC_CFGR_PPRE2; - putreg32(regval, STM32_RCC_CFGR); + regval = getreg32(STM32_RCC_CFGR); + regval &= ~RCC_CFGR_PPRE2_MASK; + regval |= STM32_RCC_CFGR_PPRE2; + putreg32(regval, STM32_RCC_CFGR); - /* Set the PCLK1 divider */ + /* Set the PCLK1 divider */ - regval = getreg32(STM32_RCC_CFGR); - regval &= ~RCC_CFGR_PPRE1_MASK; - regval |= STM32_RCC_CFGR_PPRE1; - putreg32(regval, STM32_RCC_CFGR); + regval = getreg32(STM32_RCC_CFGR); + regval &= ~RCC_CFGR_PPRE1_MASK; + regval |= STM32_RCC_CFGR_PPRE1; + putreg32(regval, STM32_RCC_CFGR); #if STM32_SYSCLK_SW == RCC_CFGR_SW_PLL - /* If we are using the PLL, configure and start it */ - /* Set the PLL divider and multiplier */ + /* If we are using the PLL, configure and start it */ + /* Set the PLL divider and multiplier */ - regval = getreg32(STM32_RCC_CFGR); - regval &= ~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMUL_MASK); - regval |= (STM32_CFGR_PLLSRC | STM32_CFGR_PLLXTPRE | STM32_CFGR_PLLMUL); - putreg32(regval, STM32_RCC_CFGR); + regval = getreg32(STM32_RCC_CFGR); + regval &= ~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMUL_MASK); + regval |= (STM32_CFGR_PLLSRC | STM32_CFGR_PLLXTPRE | STM32_CFGR_PLLMUL); + putreg32(regval, STM32_RCC_CFGR); - /* Enable the PLL */ + /* Enable the PLL */ - regval = getreg32(STM32_RCC_CR); - regval |= RCC_CR_PLLON; - putreg32(regval, STM32_RCC_CR); + regval = getreg32(STM32_RCC_CR); + regval |= RCC_CR_PLLON; + putreg32(regval, STM32_RCC_CR); - /* Wait until the PLL is ready */ + /* Wait until the PLL is ready */ - while ((getreg32(STM32_RCC_CR) & RCC_CR_PLLRDY) == 0); + while ((getreg32(STM32_RCC_CR) & RCC_CR_PLLRDY) == 0); #endif - /* Select the system clock source (probably the PLL) */ + /* Select the system clock source (probably the PLL) */ - regval = getreg32(STM32_RCC_CFGR); - regval &= ~RCC_CFGR_SW_MASK; - regval |= STM32_SYSCLK_SW; - putreg32(regval, STM32_RCC_CFGR); + regval = getreg32(STM32_RCC_CFGR); + regval &= ~RCC_CFGR_SW_MASK; + regval |= STM32_SYSCLK_SW; + putreg32(regval, STM32_RCC_CFGR); - /* Wait until the selected source is used as the system clock source */ + /* Wait until the selected source is used as the system clock source */ - while ((getreg32(STM32_RCC_CFGR) & RCC_CFGR_SWS_MASK) != STM32_SYSCLK_SWS); + while ((getreg32(STM32_RCC_CFGR) & RCC_CFGR_SWS_MASK) != STM32_SYSCLK_SWS); #if defined(CONFIG_STM32_IWDG) || defined(CONFIG_RTC_LSICLOCK) - /* Low speed internal clock source LSI - * - * TODO: There is another case where the LSI needs to - * be enabled: if the MCO pin selects LSI as source. - */ + /* Low speed internal clock source LSI + * + * TODO: There is another case where the LSI needs to + * be enabled: if the MCO pin selects LSI as source. + */ - stm32_rcc_enablelsi(); + stm32_rcc_enablelsi(); #endif #if defined(CONFIG_RTC_LSECLOCK) - /* Low speed external clock source LSE - * - * TODO: There is another case where the LSE needs to - * be enabled: if the MCO pin selects LSE as source. - * - * TODO: There is another case where the LSE needs to - * be enabled: if USART1-2-3 selects LSE as source. - * - * TODO: There is another case where the LSE needs to - * be enabled: if CEC selects LSE as source. - */ + /* Low speed external clock source LSE + * + * TODO: There is another case where the LSE needs to + * be enabled: if the MCO pin selects LSE as source. + * + * TODO: There is another case where the LSE needs to + * be enabled: if USART1-2-3 selects LSE as source. + * + * TODO: There is another case where the LSE needs to + * be enabled: if CEC selects LSE as source. + */ - stm32_rcc_enablelse(); + stm32_rcc_enablelse(); #endif } #endif diff --git a/arch/arm/src/stm32/stm32f40xxx_dma.c b/arch/arm/src/stm32/stm32f40xxx_dma.c index 1859bd34b2..2c4265ebf1 100644 --- a/arch/arm/src/stm32/stm32f40xxx_dma.c +++ b/arch/arm/src/stm32/stm32f40xxx_dma.c @@ -682,7 +682,7 @@ void stm32_dmasetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr, */ regval = dmast_getreg(dmast, STM32_DMA_SCR_OFFSET); - regval &= ~(DMA_SCR_PL_MASK|DMA_SCR_CHSEL_MASK); + regval &= ~(DMA_SCR_PL_MASK | DMA_SCR_CHSEL_MASK); regval |= scr & DMA_SCR_PL_MASK; regval |= (uint32_t)dmast->channel << DMA_SCR_CHSEL_SHIFT; dmast_putreg(dmast, STM32_DMA_SCR_OFFSET, regval); @@ -724,14 +724,14 @@ void stm32_dmasetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr, */ regval = dmast_getreg(dmast, STM32_DMA_SCR_OFFSET); - regval &= ~(DMA_SCR_PFCTRL|DMA_SCR_DIR_MASK|DMA_SCR_PINC|DMA_SCR_MINC| - DMA_SCR_PSIZE_MASK|DMA_SCR_MSIZE_MASK|DMA_SCR_PINCOS| - DMA_SCR_CIRC|DMA_SCR_DBM|DMA_SCR_CT| - DMA_SCR_PBURST_MASK|DMA_SCR_MBURST_MASK); - scr &= (DMA_SCR_PFCTRL|DMA_SCR_DIR_MASK|DMA_SCR_PINC|DMA_SCR_MINC| - DMA_SCR_PSIZE_MASK|DMA_SCR_MSIZE_MASK|DMA_SCR_PINCOS| - DMA_SCR_DBM|DMA_SCR_CIRC| - DMA_SCR_PBURST_MASK|DMA_SCR_MBURST_MASK); + regval &= ~(DMA_SCR_PFCTRL | DMA_SCR_DIR_MASK | DMA_SCR_PINC | DMA_SCR_MINC | + DMA_SCR_PSIZE_MASK | DMA_SCR_MSIZE_MASK | DMA_SCR_PINCOS | + DMA_SCR_CIRC | DMA_SCR_DBM | DMA_SCR_CT | + DMA_SCR_PBURST_MASK | DMA_SCR_MBURST_MASK); + scr &= (DMA_SCR_PFCTRL | DMA_SCR_DIR_MASK | DMA_SCR_PINC | DMA_SCR_MINC | + DMA_SCR_PSIZE_MASK | DMA_SCR_MSIZE_MASK | DMA_SCR_PINCOS | + DMA_SCR_DBM | DMA_SCR_CIRC | + DMA_SCR_PBURST_MASK | DMA_SCR_MBURST_MASK); regval |= scr; dmast_putreg(dmast, STM32_DMA_SCR_OFFSET, regval); } @@ -773,7 +773,7 @@ void stm32_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg, bool * interrupt at the halfway point. */ - if ((scr & (DMA_SCR_DBM|DMA_SCR_CIRC)) == 0) + if ((scr & (DMA_SCR_DBM | DMA_SCR_CIRC)) == 0) { /* Once half of the bytes are transferred, the half-transfer flag (HTIF) is * set and an interrupt is generated if the Half-Transfer Interrupt Enable @@ -782,7 +782,7 @@ void stm32_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg, bool * Interrupt Enable bit (TCIE) is set. */ - scr |= (half ? (DMA_SCR_HTIE|DMA_SCR_TEIE) : (DMA_SCR_TCIE|DMA_SCR_TEIE)); + scr |= (half ? (DMA_SCR_HTIE | DMA_SCR_TEIE) : (DMA_SCR_TCIE | DMA_SCR_TEIE)); } else { diff --git a/arch/arm/src/stm32/stm32f40xxx_rcc.c b/arch/arm/src/stm32/stm32f40xxx_rcc.c index f0e16f4079..6b62df5e33 100644 --- a/arch/arm/src/stm32/stm32f40xxx_rcc.c +++ b/arch/arm/src/stm32/stm32f40xxx_rcc.c @@ -96,7 +96,7 @@ static inline void rcc_reset(void) /* Reset HSION, HSEON, CSSON and PLLON bits */ regval = getreg32(STM32_RCC_CR); - regval &= ~(RCC_CR_HSION|RCC_CR_HSEON|RCC_CR_CSSON|RCC_CR_PLLON); + regval &= ~(RCC_CR_HSION | RCC_CR_HSEON | RCC_CR_CSSON | RCC_CR_PLLON); putreg32(regval, STM32_RCC_CR); /* Reset PLLCFGR register to reset default */ @@ -132,33 +132,33 @@ static inline void rcc_enableahb1(void) regval = getreg32(STM32_RCC_AHB1ENR); - /* Enable GPIOA, GPIOB, .... GPIOI*/ + /* Enable GPIOA, GPIOB, .... GPIOI */ #if STM32_NGPIO > 0 regval |= (RCC_AHB1ENR_GPIOAEN #if STM32_NGPIO > 16 - |RCC_AHB1ENR_GPIOBEN + | RCC_AHB1ENR_GPIOBEN #endif #if STM32_NGPIO > 32 - |RCC_AHB1ENR_GPIOCEN + | RCC_AHB1ENR_GPIOCEN #endif #if STM32_NGPIO > 48 - |RCC_AHB1ENR_GPIODEN + | RCC_AHB1ENR_GPIODEN #endif #if STM32_NGPIO > 64 - |RCC_AHB1ENR_GPIOEEN + | RCC_AHB1ENR_GPIOEEN #endif #if STM32_NGPIO > 80 - |RCC_AHB1ENR_GPIOFEN + | RCC_AHB1ENR_GPIOFEN #endif #if STM32_NGPIO > 96 - |RCC_AHB1ENR_GPIOGEN + | RCC_AHB1ENR_GPIOGEN #endif #if STM32_NGPIO > 112 - |RCC_AHB1ENR_GPIOHEN + | RCC_AHB1ENR_GPIOHEN #endif #if STM32_NGPIO > 128 - |RCC_AHB1ENR_GPIOIEN + | RCC_AHB1ENR_GPIOIEN #endif ); #endif @@ -196,7 +196,7 @@ static inline void rcc_enableahb1(void) #ifdef CONFIG_STM32_ETHMAC /* Ethernet MAC clocking */ - regval |= (RCC_AHB1ENR_ETHMACEN|RCC_AHB1ENR_ETHMACTXEN|RCC_AHB1ENR_ETHMACRXEN); + regval | = (RCC_AHB1ENR_ETHMACEN | RCC_AHB1ENR_ETHMACTXEN | RCC_AHB1ENR_ETHMACRXEN); #ifdef CONFIG_STM32_ETH_PTP /* Precision Time Protocol (PTP) */ @@ -705,10 +705,10 @@ static void stm32_stdclockconfig(void) /* Set the PLL dividers and multipliers to configure the main PLL */ #ifdef STM32_BOARD_USEHSI - regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN |STM32_PLLCFG_PLLP | + regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN | STM32_PLLCFG_PLLP | RCC_PLLCFG_PLLSRC_HSI | STM32_PLLCFG_PLLQ); #else /* if STM32_BOARD_USEHSE */ - regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN |STM32_PLLCFG_PLLP | + regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN | STM32_PLLCFG_PLLP | RCC_PLLCFG_PLLSRC_HSE | STM32_PLLCFG_PLLQ); #endif putreg32(regval, STM32_RCC_PLLCFG); @@ -806,7 +806,7 @@ static inline void rcc_itm_syslog(void) { /* Enable SWO output */ - modifyreg32(STM32_DBGMCU_CR, DBGMCU_CR_TRACEMODE_MASK, DBGMCU_CR_ASYNCH|\ + modifyreg32(STM32_DBGMCU_CR, DBGMCU_CR_TRACEMODE_MASK, DBGMCU_CR_ASYNCH | DBGMCU_CR_TRACEIOEN); itm_syslog_initialize(); diff --git a/arch/arm/src/stm32/stm32f42xxx_rcc.c b/arch/arm/src/stm32/stm32f42xxx_rcc.c index b6082e44e7..d2bfe480a2 100644 --- a/arch/arm/src/stm32/stm32f42xxx_rcc.c +++ b/arch/arm/src/stm32/stm32f42xxx_rcc.c @@ -93,7 +93,7 @@ static inline void rcc_reset(void) /* Reset HSION, HSEON, CSSON and PLLON bits */ regval = getreg32(STM32_RCC_CR); - regval &= ~(RCC_CR_HSION|RCC_CR_HSEON|RCC_CR_CSSON|RCC_CR_PLLON); + regval &= ~(RCC_CR_HSION | RCC_CR_HSEON | RCC_CR_CSSON | RCC_CR_PLLON); putreg32(regval, STM32_RCC_CR); /* Reset PLLCFGR register to reset default */ @@ -129,33 +129,33 @@ static inline void rcc_enableahb1(void) regval = getreg32(STM32_RCC_AHB1ENR); - /* Enable GPIOA, GPIOB, .... GPIOI*/ + /* Enable GPIOA, GPIOB, .... GPIOI */ #if STM32_NGPIO > 0 regval |= (RCC_AHB1ENR_GPIOAEN #if STM32_NGPIO > 16 - |RCC_AHB1ENR_GPIOBEN + | RCC_AHB1ENR_GPIOBEN #endif #if STM32_NGPIO > 32 - |RCC_AHB1ENR_GPIOCEN + | RCC_AHB1ENR_GPIOCEN #endif #if STM32_NGPIO > 48 - |RCC_AHB1ENR_GPIODEN + | RCC_AHB1ENR_GPIODEN #endif #if STM32_NGPIO > 64 - |RCC_AHB1ENR_GPIOEEN + | RCC_AHB1ENR_GPIOEEN #endif #if STM32_NGPIO > 80 - |RCC_AHB1ENR_GPIOFEN + | RCC_AHB1ENR_GPIOFEN #endif #if STM32_NGPIO > 96 - |RCC_AHB1ENR_GPIOGEN + | RCC_AHB1ENR_GPIOGEN #endif #if STM32_NGPIO > 112 - |RCC_AHB1ENR_GPIOHEN + | RCC_AHB1ENR_GPIOHEN #endif #if STM32_NGPIO > 128 - |RCC_AHB1ENR_GPIOIEN + | RCC_AHB1ENR_GPIOIEN #endif ); #endif @@ -193,7 +193,7 @@ static inline void rcc_enableahb1(void) #ifdef CONFIG_STM32_ETHMAC /* Ethernet MAC clocking */ - regval |= (RCC_AHB1ENR_ETHMACEN|RCC_AHB1ENR_ETHMACTXEN|RCC_AHB1ENR_ETHMACRXEN); + regval |= (RCC_AHB1ENR_ETHMACEN | RCC_AHB1ENR_ETHMACTXEN | RCC_AHB1ENR_ETHMACRXEN); #ifdef CONFIG_STM32_ETH_PTP /* Precision Time Protocol (PTP) */ @@ -703,10 +703,10 @@ static void stm32_stdclockconfig(void) /* Set the PLL dividers and multipliers to configure the main PLL */ #ifdef STM32_BOARD_USEHSI - regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN |STM32_PLLCFG_PLLP | + regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN | STM32_PLLCFG_PLLP | RCC_PLLCFG_PLLSRC_HSI | STM32_PLLCFG_PLLQ); #else /* if STM32_BOARD_USEHSE */ - regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN |STM32_PLLCFG_PLLP | + regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN | STM32_PLLCFG_PLLP | RCC_PLLCFG_PLLSRC_HSE | STM32_PLLCFG_PLLQ); #endif putreg32(regval, STM32_RCC_PLLCFG); diff --git a/arch/arm/src/stm32/stm32f44xxx_rcc.c b/arch/arm/src/stm32/stm32f44xxx_rcc.c index e0b396e917..9316457580 100644 --- a/arch/arm/src/stm32/stm32f44xxx_rcc.c +++ b/arch/arm/src/stm32/stm32f44xxx_rcc.c @@ -93,7 +93,7 @@ static inline void rcc_reset(void) /* Reset HSION, HSEON, CSSON and PLLON bits */ regval = getreg32(STM32_RCC_CR); - regval &= ~(RCC_CR_HSION|RCC_CR_HSEON|RCC_CR_CSSON|RCC_CR_PLLON); + regval &= ~(RCC_CR_HSION | RCC_CR_HSEON | RCC_CR_CSSON | RCC_CR_PLLON); putreg32(regval, STM32_RCC_CR); /* Reset PLLCFGR register to reset default */ @@ -129,30 +129,30 @@ static inline void rcc_enableahb1(void) regval = getreg32(STM32_RCC_AHB1ENR); - /* Enable GPIOA, GPIOB, .... GPIOI*/ + /* Enable GPIOA, GPIOB, .... GPIOI */ #if STM32_NGPIO > 0 regval |= (RCC_AHB1ENR_GPIOAEN #if STM32_NGPIO > 16 - |RCC_AHB1ENR_GPIOBEN + | RCC_AHB1ENR_GPIOBEN #endif #if STM32_NGPIO > 32 - |RCC_AHB1ENR_GPIOCEN + | RCC_AHB1ENR_GPIOCEN #endif #if STM32_NGPIO > 48 - |RCC_AHB1ENR_GPIODEN + | RCC_AHB1ENR_GPIODEN #endif #if STM32_NGPIO > 64 - |RCC_AHB1ENR_GPIOEEN + | RCC_AHB1ENR_GPIOEEN #endif #if STM32_NGPIO > 80 - |RCC_AHB1ENR_GPIOFEN + | RCC_AHB1ENR_GPIOFEN #endif #if STM32_NGPIO > 96 - |RCC_AHB1ENR_GPIOGEN + | RCC_AHB1ENR_GPIOGEN #endif #if STM32_NGPIO > 112 - |RCC_AHB1ENR_GPIOHEN + | RCC_AHB1ENR_GPIOHEN #endif ); #endif @@ -635,10 +635,10 @@ static void stm32_stdclockconfig(void) /* Set the PLL dividers and multipliers to configure the main PLL */ #ifdef STM32_BOARD_USEHSI - regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN |STM32_PLLCFG_PLLP | + regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN | STM32_PLLCFG_PLLP | RCC_PLLCFG_PLLSRC_HSI | STM32_PLLCFG_PLLQ | STM32_PLLCFG_PLLR); #else /* if STM32_BOARD_USEHSE */ - regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN |STM32_PLLCFG_PLLP | + regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN | STM32_PLLCFG_PLLP | RCC_PLLCFG_PLLSRC_HSE | STM32_PLLCFG_PLLQ | STM32_PLLCFG_PLLR); #endif putreg32(regval, STM32_RCC_PLLCFG); diff --git a/arch/arm/src/stm32/stm32l15xxx_rcc.c b/arch/arm/src/stm32/stm32l15xxx_rcc.c index ac4d6246a6..51a163d99a 100644 --- a/arch/arm/src/stm32/stm32l15xxx_rcc.c +++ b/arch/arm/src/stm32/stm32l15xxx_rcc.c @@ -51,7 +51,7 @@ #define HSERDY_TIMEOUT (100 * CONFIG_BOARD_LOOPSPERMSEC) -/* HSE divisor to yield ~1MHz RTC clock (valid for HSE = 8MHz)*/ +/* HSE divisor to yield ~1MHz RTC clock (valid for HSE = 8MHz) */ #define HSE_DIVISOR RCC_CR_RTCPRE_HSEd8 @@ -573,7 +573,7 @@ static void stm32_stdclockconfig(void) regval |= HSE_DIVISOR; putreg32(regval, STM32_RCC_CR); - /* Restore the previous state of the DBP bit */ + /* Restore the previous state of the DBP bit */ putreg32(regval, STM32_PWR_CR); @@ -711,8 +711,8 @@ static void stm32_stdclockconfig(void) #if defined(CONFIG_STM32_IWDG) || \ defined(CONFIG_RTC_LSICLOCK) || defined(CONFIG_LCD_LSICLOCK) - /* Low speed internal clock source LSI */ - /* + /* Low speed internal clock source LSI + * * TODO: There is another case where the LSI needs to * be enabled: if the MCO pin selects LSI as source. */ From 7dbfae87ec28883bb7b9f283839bc462c3c0b26c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 7 Oct 2015 13:58:11 -0600 Subject: [PATCH 28/33] STM32 F7: Correct some spacing issues --- arch/arm/src/stm32f7/stm32_allocateheap.c | 16 +++---- arch/arm/src/stm32f7/stm32_dma.c | 6 +-- arch/arm/src/stm32f7/stm32_ethernet.c | 51 ++++++++++++----------- arch/arm/src/stm32f7/stm32_irq.c | 10 ++--- arch/arm/src/stm32f7/stm32_lowputc.c | 18 ++++---- arch/arm/src/stm32f7/stm32_procfs_dtcm.c | 2 +- arch/arm/src/stm32f7/stm32_serial.c | 40 +++++++++--------- arch/arm/src/stm32f7/stm32_start.c | 4 +- arch/arm/src/stm32f7/stm32_userspace.c | 10 ++--- arch/arm/src/stm32f7/stm32f74xx75xx_rcc.c | 8 ++-- 10 files changed, 83 insertions(+), 82 deletions(-) diff --git a/arch/arm/src/stm32f7/stm32_allocateheap.c b/arch/arm/src/stm32f7/stm32_allocateheap.c index df02bd3563..628a83ff4f 100644 --- a/arch/arm/src/stm32f7/stm32_allocateheap.c +++ b/arch/arm/src/stm32f7/stm32_allocateheap.c @@ -241,12 +241,12 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) /* Return the user-space heap settings */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)ubase; + *heap_start = (FAR void *)ubase; *heap_size = usize; /* Colorize the heap for debug */ - up_heap_color((FAR void*)ubase, usize); + up_heap_color((FAR void *)ubase, usize); /* Allow user-mode access to the user heap memory */ @@ -256,7 +256,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) /* Return the heap settings */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)g_idle_topstack; + *heap_start = (FAR void *)g_idle_topstack; *heap_size = SRAM1_END - g_idle_topstack; /* Colorize the heap for debug */ @@ -304,7 +304,7 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size) * that was not dedicated to the user heap). */ - *heap_start = (FAR void*)USERSPACE->us_bssend; + *heap_start = (FAR void *)USERSPACE->us_bssend; *heap_size = ubase - (uintptr_t)USERSPACE->us_bssend; } #endif @@ -331,11 +331,11 @@ void up_addregion(void) /* Colorize the heap for debug */ - up_heap_color((FAR void*)SRAM2_START, SRAM2_END-SRAM2_START); + up_heap_color((FAR void *)SRAM2_START, SRAM2_END-SRAM2_START); /* Add the STM32F20xxx/STM32F40xxx SRAM2 user heap region. */ - kumm_addregion((FAR void*)SRAM2_START, SRAM2_END-SRAM2_START); + kumm_addregion((FAR void *)SRAM2_START, SRAM2_END-SRAM2_START); #ifdef CONFIG_STM32F7_FSMC_SRAM #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_MM_KERNEL_HEAP) @@ -348,11 +348,11 @@ void up_addregion(void) /* Colorize the heap for debug */ - up_heap_color((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE); + up_heap_color((FAR void *)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE); /* Add the external FSMC SRAM user heap region. */ - kumm_addregion((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE); + kumm_addregion((FAR void *)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE); #endif } #endif diff --git a/arch/arm/src/stm32f7/stm32_dma.c b/arch/arm/src/stm32f7/stm32_dma.c index 798a5965bf..6bc5344098 100644 --- a/arch/arm/src/stm32f7/stm32_dma.c +++ b/arch/arm/src/stm32f7/stm32_dma.c @@ -683,7 +683,7 @@ void stm32_dmasetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr, */ regval = dmast_getreg(dmast, STM32_DMA_SCR_OFFSET); - regval &= ~(DMA_SCR_PL_MASK|DMA_SCR_CHSEL_MASK); + regval &= ~(DMA_SCR_PL_MASK | DMA_SCR_CHSEL_MASK); regval |= scr & DMA_SCR_PL_MASK; regval |= (uint32_t)dmast->channel << DMA_SCR_CHSEL_SHIFT; dmast_putreg(dmast, STM32_DMA_SCR_OFFSET, regval); @@ -775,7 +775,7 @@ void stm32_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg, bool * interrupt at the halfway point. */ - if ((scr & (DMA_SCR_DBM|DMA_SCR_CIRC)) == 0) + if ((scr & (DMA_SCR_DBM | DMA_SCR_CIRC)) == 0) { /* Once half of the bytes are transferred, the half-transfer flag (HTIF) is * set and an interrupt is generated if the Half-Transfer Interrupt Enable @@ -784,7 +784,7 @@ void stm32_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg, bool * Interrupt Enable bit (TCIE) is set. */ - scr |= (half ? (DMA_SCR_HTIE|DMA_SCR_TEIE) : (DMA_SCR_TCIE|DMA_SCR_TEIE)); + scr |= (half ? (DMA_SCR_HTIE | DMA_SCR_TEIE) : (DMA_SCR_TCIE | DMA_SCR_TEIE)); } else { diff --git a/arch/arm/src/stm32f7/stm32_ethernet.c b/arch/arm/src/stm32f7/stm32_ethernet.c index 5cd46247dc..768a79979d 100644 --- a/arch/arm/src/stm32f7/stm32_ethernet.c +++ b/arch/arm/src/stm32f7/stm32_ethernet.c @@ -549,7 +549,7 @@ */ #define ETH_DMAINT_NORMAL \ - (ETH_DMAINT_TI | ETH_DMAINT_TBUI |ETH_DMAINT_RI | ETH_DMAINT_ERI) + (ETH_DMAINT_TI | ETH_DMAINT_TBUI | ETH_DMAINT_RI | ETH_DMAINT_ERI) #define ETH_DMAINT_ABNORMAL \ (ETH_DMAINT_TPSI | ETH_DMAINT_TJTI | ETH_DMAINT_ROI | ETH_DMAINT_TUI | \ @@ -815,10 +815,11 @@ static uint32_t stm32_getreg(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } + return val; } } @@ -827,20 +828,20 @@ static uint32_t stm32_getreg(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ @@ -1624,7 +1625,7 @@ static int stm32_recvframe(struct stm32_ethmac_s *priv) /* Check if this is an intermediate segment in the frame */ - else if (((rxdesc->rdes0 & ETH_RDES0_LS) == 0)&& + else if (((rxdesc->rdes0 & ETH_RDES0_LS) == 0) && ((rxdesc->rdes0 & ETH_RDES0_FS) == 0)) { priv->segments++; @@ -1676,7 +1677,7 @@ static int stm32_recvframe(struct stm32_ethmac_s *priv) */ DEBUGASSERT(dev->d_buf == NULL); - dev->d_buf = (uint8_t*)rxcurr->rdes2; + dev->d_buf = (uint8_t *)rxcurr->rdes2; rxcurr->rdes2 = (uint32_t)buffer; /* Make sure that the modified RX descriptor is written to @@ -1703,7 +1704,7 @@ static int stm32_recvframe(struct stm32_ethmac_s *priv) nllvdbg("rxhead: %p d_buf: %p d_len: %d\n", priv->rxhead, dev->d_buf, dev->d_len); - /* Return success*/ + /* Return success */ return OK; } @@ -1726,7 +1727,7 @@ static int stm32_recvframe(struct stm32_ethmac_s *priv) arch_invalidate_dcache((uintptr_t)rxdesc, (uintptr_t)rxdesc + sizeof(struct eth_rxdesc_s)); - } + } /* We get here after all of the descriptors have been scanned or when rxdesc points * to the first descriptor owned by the DMA. Remember where we left off. @@ -1845,7 +1846,7 @@ static void stm32_receive(struct stm32_ethmac_s *priv) */ if (priv->dev.d_len > 0) - { + { /* Update the Ethernet header with the correct MAC address */ #ifdef CONFIG_NET_IPv4 @@ -1962,7 +1963,7 @@ static void stm32_freeframe(struct stm32_ethmac_s *priv) { /* Yes.. Free the buffer */ - stm32_freebuffer(priv, (uint8_t*)txdesc->tdes2); + stm32_freebuffer(priv, (uint8_t *)txdesc->tdes2); } /* In any event, make sure that TDES2 is nullified. */ @@ -2819,7 +2820,7 @@ static int stm32_addmac(struct net_driver_s *dev, const uint8_t *mac) /* Add the MAC address to the hardware multicast hash table */ - crc = stm32_calcethcrc( mac, 6 ); + crc = stm32_calcethcrc(mac, 6); hashindex = (crc >> 26) & 0x3F; @@ -2876,7 +2877,7 @@ static int stm32_rmmac(struct net_driver_s *dev, const uint8_t *mac) /* Remove the MAC address to the hardware multicast hash table */ - crc = stm32_calcethcrc( mac, 6 ); + crc = stm32_calcethcrc(mac, 6); hashindex = (crc >> 26) & 0x3F; @@ -2896,7 +2897,7 @@ static int stm32_rmmac(struct net_driver_s *dev, const uint8_t *mac) /* If there is no address registered any more, delete multicast filtering */ - if (stm32_getreg(STM32_ETH_MACHTHR ) == 0 && + if (stm32_getreg(STM32_ETH_MACHTHR) == 0 && stm32_getreg(STM32_ETH_MACHTLR) == 0) { temp = stm32_getreg(STM32_ETH_MACFFR); @@ -4258,7 +4259,7 @@ int stm32_ethinitialize(int intf) #ifdef CONFIG_NETDEV_PHY_IOCTL priv->dev.d_ioctl = stm32_ioctl; /* Support PHY ioctl() calls */ #endif - priv->dev.d_private = (void*)g_stm32ethmac; /* Used to recover private state from dev */ + priv->dev.d_private = (void *)g_stm32ethmac; /* Used to recover private state from dev */ priv->intf = intf; /* Remember the interface number */ /* Create a watchdog for timing polling for and timing of transmissions */ diff --git a/arch/arm/src/stm32f7/stm32_irq.c b/arch/arm/src/stm32f7/stm32_irq.c index 5936073662..15a690068d 100644 --- a/arch/arm/src/stm32f7/stm32_irq.c +++ b/arch/arm/src/stm32f7/stm32_irq.c @@ -64,9 +64,9 @@ /* Get a 32-bit version of the default priority */ #define DEFPRIORITY32 \ - (NVIC_SYSH_PRIORITY_DEFAULT << 24 |\ - NVIC_SYSH_PRIORITY_DEFAULT << 16 |\ - NVIC_SYSH_PRIORITY_DEFAULT << 8 |\ + (NVIC_SYSH_PRIORITY_DEFAULT << 24 | \ + NVIC_SYSH_PRIORITY_DEFAULT << 16 | \ + NVIC_SYSH_PRIORITY_DEFAULT << 8 | \ NVIC_SYSH_PRIORITY_DEFAULT) /* Given the address of a NVIC ENABLE register, this is the offset to @@ -344,8 +344,8 @@ static int stm32_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit, else { - *regaddr = NVIC_SYSHCON; - if (irq == STM32_IRQ_MEMFAULT) + *regaddr = NVIC_SYSHCON; + if (irq == STM32_IRQ_MEMFAULT) { *bit = NVIC_SYSHCON_MEMFAULTENA; } diff --git a/arch/arm/src/stm32f7/stm32_lowputc.c b/arch/arm/src/stm32f7/stm32_lowputc.c index 286178096e..603f2be713 100644 --- a/arch/arm/src/stm32f7/stm32_lowputc.c +++ b/arch/arm/src/stm32f7/stm32_lowputc.c @@ -248,10 +248,10 @@ # endif # define USART_CR2_CLRBITS \ - (USART_CR2_ADDM7 | USART_CR2_LBDL | USART_CR2_LBDIE | USART_CR2_LBCL |\ - USART_CR2_CPHA | USART_CR2_CPOL | USART_CR2_CLKEN | USART_CR2_STOP_MASK |\ - USART_CR2_LINEN | USART_CR2_RXINV | USART_CR2_TXINV | USART_CR2_DATAINV |\ - USART_CR2_MSBFIRST | USART_CR2_ABREN | USART_CR2_ABRMOD_MASK |\ + (USART_CR2_ADDM7 | USART_CR2_LBDL | USART_CR2_LBDIE | USART_CR2_LBCL | \ + USART_CR2_CPHA | USART_CR2_CPOL | USART_CR2_CLKEN | USART_CR2_STOP_MASK | \ + USART_CR2_LINEN | USART_CR2_RXINV | USART_CR2_TXINV | USART_CR2_DATAINV | \ + USART_CR2_MSBFIRST | USART_CR2_ABREN | USART_CR2_ABRMOD_MASK | \ USART_CR2_RTOEN | USART_CR2_ADD8_MASK) # define USART_CR2_SETBITS USART_CR2_STOP2_VALUE @@ -259,10 +259,10 @@ /* CR3 settings */ # define USART_CR3_CLRBITS \ - (USART_CR3_EIE | USART_CR3_IREN | USART_CR3_IRLP | USART_CR3_HDSEL |\ - USART_CR3_NACK | USART_CR3_SCEN | USART_CR3_DMAR | USART_CR3_DMAT |\ - USART_CR3_RTSE | USART_CR3_CTSE | USART_CR3_CTSIE | USART_CR1_ONEBIT |\ - USART_CR1_OVRDIS | USART_CR1_DDRE | USART_CR1_DEM | USART_CR1_DEP |\ + (USART_CR3_EIE | USART_CR3_IREN | USART_CR3_IRLP | USART_CR3_HDSEL | \ + USART_CR3_NACK | USART_CR3_SCEN | USART_CR3_DMAR | USART_CR3_DMAT | \ + USART_CR3_RTSE | USART_CR3_CTSE | USART_CR3_CTSIE | USART_CR1_ONEBIT | \ + USART_CR1_OVRDIS | USART_CR1_DDRE | USART_CR1_DEM | USART_CR1_DEP | \ USART_CR1_SCARCNT_MASK) # define USART_CR3_SETBITS 0 @@ -432,7 +432,7 @@ void stm32_lowsetup(void) /* Enable Rx, Tx, and the USART */ - cr |= (USART_CR1_UE|USART_CR1_TE|USART_CR1_RE); + cr |= (USART_CR1_UE | USART_CR1_TE | USART_CR1_RE); putreg32(cr, STM32_CONSOLE_BASE + STM32_USART_CR1_OFFSET); #endif /* HAVE_CONSOLE && !CONFIG_SUPPRESS_UART_CONFIG */ diff --git a/arch/arm/src/stm32f7/stm32_procfs_dtcm.c b/arch/arm/src/stm32f7/stm32_procfs_dtcm.c index 12b1e91565..14bffc4e34 100644 --- a/arch/arm/src/stm32f7/stm32_procfs_dtcm.c +++ b/arch/arm/src/stm32f7/stm32_procfs_dtcm.c @@ -312,7 +312,7 @@ static int dtcm_stat(const char *relpath, struct stat *buf) return -ENOENT; } - buf->st_mode = S_IFREG|S_IROTH|S_IRGRP|S_IRUSR; + buf->st_mode = S_IFREG | S_IROTH | S_IRGRP | S_IRUSR; buf->st_size = 0; buf->st_blksize = 0; buf->st_blocks = 0; diff --git a/arch/arm/src/stm32f7/stm32_serial.c b/arch/arm/src/stm32f7/stm32_serial.c index 028e45cbe3..fdc31dbc3e 100644 --- a/arch/arm/src/stm32f7/stm32_serial.c +++ b/arch/arm/src/stm32f7/stm32_serial.c @@ -264,7 +264,7 @@ struct up_dev_s const unsigned int rxdma_channel; /* DMA channel assigned */ #endif - int (* const vector)(int irq, void *context); /* Interrupt handler */ + int (*const vector)(int irq, void *context); /* Interrupt handler */ /* RX DMA state */ @@ -1244,7 +1244,7 @@ static void up_set_format(struct uart_dev_s *dev) /* Configure hardware flow control */ regval = up_serialin(priv, STM32_USART_CR3_OFFSET); - regval &= ~(USART_CR3_CTSE|USART_CR3_RTSE); + regval &= ~(USART_CR3_CTSE | USART_CR3_RTSE); #if defined(CONFIG_SERIAL_IFLOWCONTROL) && !defined(CONFIG_STM32F7_FLOWCONTROL_BROKEN) if (priv->iflow && (priv->rts_gpio != 0)) @@ -1397,7 +1397,7 @@ static int up_setup(struct uart_dev_s *dev) config = (config & ~GPIO_MODE_MASK) | GPIO_OUTPUT; #endif stm32_configgpio(config); - } + } #endif #ifdef HAVE_RS485 @@ -1665,9 +1665,9 @@ static int up_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, priv->vector); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the USART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the USART + */ up_enable_irq(priv->irq); } @@ -1768,17 +1768,17 @@ static int up_interrupt_common(struct up_dev_s *priv) if ((priv->sr & USART_ISR_RXNE) != 0 && (priv->ie & USART_CR1_RXNEIE) != 0) { - /* Received data ready... process incoming bytes. NOTE the check for - * RXNEIE: We cannot call uart_recvchards of RX interrupts are disabled. - */ + /* Received data ready... process incoming bytes. NOTE the check for + * RXNEIE: We cannot call uart_recvchards of RX interrupts are disabled. + */ - uart_recvchars(&priv->dev); - handled = true; + uart_recvchars(&priv->dev); + handled = true; } - /* We may still have to read from the DR register to clear any pending - * error conditions. - */ + /* We may still have to read from the DR register to clear any pending + * error conditions. + */ else if ((priv->sr & (USART_ISR_ORE | USART_ISR_NF | USART_ISR_FE)) != 0) { @@ -1794,10 +1794,10 @@ static int up_interrupt_common(struct up_dev_s *priv) if ((priv->sr & USART_ISR_TXE) != 0 && (priv->ie & USART_CR1_TXEIE) != 0) { - /* Transmit data register empty ... process outgoing bytes */ + /* Transmit data register empty ... process outgoing bytes */ - uart_xmitchars(&priv->dev); - handled = true; + uart_xmitchars(&priv->dev); + handled = true; } } @@ -1869,7 +1869,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TERMIOS case TCGETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; if (!termiosp) { @@ -1901,7 +1901,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) case TCSETS: { - struct termios *termiosp = (struct termios*)arg; + struct termios *termiosp = (struct termios *)arg; if (!termiosp) { @@ -2122,7 +2122,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static bool up_rxflowcontrol(struct uart_dev_s *dev, unsigned int nbuffered, bool upper) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; #if defined(CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS) && \ defined(CONFIG_STM32F7_FLOWCONTROL_BROKEN) diff --git a/arch/arm/src/stm32f7/stm32_start.c b/arch/arm/src/stm32f7/stm32_start.c index 5d9ecc9b09..b4f935a397 100644 --- a/arch/arm/src/stm32f7/stm32_start.c +++ b/arch/arm/src/stm32f7/stm32_start.c @@ -105,7 +105,7 @@ static inline void stm32_fpuconfig(void); #endif #ifdef CONFIG_STACK_COLORATION static void go_os_start(void *pv, unsigned int nbytes) - __attribute__ ((naked,no_instrument_function,noreturn)); + __attribute__ ((naked, no_instrument_function, noreturn)); #endif /**************************************************************************** @@ -400,6 +400,6 @@ void __start(void) /* Shouldn't get here */ - for (;;); + for (; ; ); #endif } diff --git a/arch/arm/src/stm32f7/stm32_userspace.c b/arch/arm/src/stm32f7/stm32_userspace.c index 03217a9019..8185db83b5 100644 --- a/arch/arm/src/stm32f7/stm32_userspace.c +++ b/arch/arm/src/stm32f7/stm32_userspace.c @@ -71,8 +71,8 @@ void stm32_userspace(void) DEBUGASSERT(USERSPACE->us_bssstart != 0 && USERSPACE->us_bssend != 0 && USERSPACE->us_bssstart <= USERSPACE->us_bssend); - dest = (uint8_t*)USERSPACE->us_bssstart; - end = (uint8_t*)USERSPACE->us_bssend; + dest = (uint8_t *)USERSPACE->us_bssstart; + end = (uint8_t *)USERSPACE->us_bssend; while (dest != end) { @@ -85,9 +85,9 @@ void stm32_userspace(void) USERSPACE->us_datastart != 0 && USERSPACE->us_dataend != 0 && USERSPACE->us_datastart <= USERSPACE->us_dataend); - src = (uint8_t*)USERSPACE->us_datasource; - dest = (uint8_t*)USERSPACE->us_datastart; - end = (uint8_t*)USERSPACE->us_dataend; + src = (uint8_t *)USERSPACE->us_datasource; + dest = (uint8_t *)USERSPACE->us_datastart; + end = (uint8_t *)USERSPACE->us_dataend; while (dest != end) { diff --git a/arch/arm/src/stm32f7/stm32f74xx75xx_rcc.c b/arch/arm/src/stm32f7/stm32f74xx75xx_rcc.c index dd7dbcbb93..1db43d2551 100644 --- a/arch/arm/src/stm32f7/stm32f74xx75xx_rcc.c +++ b/arch/arm/src/stm32f7/stm32f74xx75xx_rcc.c @@ -100,7 +100,7 @@ static inline void rcc_reset(void) /* Reset HSION, HSEON, CSSON and PLLON bits */ regval = getreg32(STM32_RCC_CR); - regval &= ~(RCC_CR_HSION|RCC_CR_HSEON|RCC_CR_CSSON|RCC_CR_PLLON); + regval &= ~(RCC_CR_HSION | RCC_CR_HSEON | RCC_CR_CSSON | RCC_CR_PLLON); putreg32(regval, STM32_RCC_CR); /* Reset PLLCFGR register to reset default */ @@ -136,7 +136,7 @@ static inline void rcc_enableahb1(void) regval = getreg32(STM32_RCC_AHB1ENR); - /* Enable GPIOA, GPIOB, .... GPIOI*/ + /* Enable GPIOA, GPIOB, .... GPIOI */ #if STM32F7_NGPIO > 0 regval |= (RCC_AHB1ENR_GPIOAEN @@ -757,10 +757,10 @@ static void stm32_stdclockconfig(void) /* Set the PLL dividers and multipliers to configure the main PLL */ #ifdef STM32_BOARD_USEHSI - regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN |STM32_PLLCFG_PLLP | + regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN | STM32_PLLCFG_PLLP | RCC_PLLCFG_PLLSRC_HSI | STM32_PLLCFG_PLLQ); #else /* if STM32_BOARD_USEHSE */ - regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN |STM32_PLLCFG_PLLP | + regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN | STM32_PLLCFG_PLLP | RCC_PLLCFG_PLLSRC_HSE | STM32_PLLCFG_PLLQ); #endif putreg32(regval, STM32_RCC_PLLCFG); From 4f2119b3f4b538b761d987fb23edd555386520a4 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 7 Oct 2015 14:22:01 -0600 Subject: [PATCH 29/33] STR7: Correct some spacing issues --- arch/arm/src/str71x/str71x_decodeirq.c | 4 +- arch/arm/src/str71x/str71x_lowputc.c | 25 +++++++----- arch/arm/src/str71x/str71x_prccu.c | 27 +++++++------ arch/arm/src/str71x/str71x_serial.c | 54 +++++++++++++------------- 4 files changed, 59 insertions(+), 51 deletions(-) diff --git a/arch/arm/src/str71x/str71x_decodeirq.c b/arch/arm/src/str71x/str71x_decodeirq.c index a87f5f059b..363590f266 100644 --- a/arch/arm/src/str71x/str71x_decodeirq.c +++ b/arch/arm/src/str71x/str71x_decodeirq.c @@ -108,13 +108,13 @@ void up_decodeirq(uint32_t *regs) if (irq < NR_IRQS) { - uint32_t* savestate; + uint32_t *savestate; /* Current regs non-zero indicates that we are processing an interrupt; * current_regs is also used to manage interrupt level context switches. */ - savestate = (uint32_t*)current_regs; + savestate = (uint32_t *)current_regs; current_regs = regs; /* Acknowledge the interrupt */ diff --git a/arch/arm/src/str71x/str71x_lowputc.c b/arch/arm/src/str71x/str71x_lowputc.c index 5262894e2d..e80429576f 100644 --- a/arch/arm/src/str71x/str71x_lowputc.c +++ b/arch/arm/src/str71x/str71x_lowputc.c @@ -126,14 +126,18 @@ # define STR71X_UART3_GPIO0_PC2BITS (0) #endif -#define STR71X_UART_GPIO0_MASK (STR71X_UART0_GPIO0_MASK |STR71X_UART1_GPIO0_MASK|\ - STR71X_UART2_GPIO0_MASK |STR71X_UART3_GPIO0_MASK) -#define STR71X_UART_GPIO0_PC0BITS (STR71X_UART0_GPIO0_PC0BITS|STR71X_UART1_GPIO0_PC0BITS|\ - STR71X_UART2_GPIO0_PC0BITS|STR71X_UART3_GPIO0_PC0BITS) -#define STR71X_UART_GPIO0_PC1BITS (STR71X_UART0_GPIO0_PC1BITS|STR71X_UART1_GPIO0_PC1BITS|\ - STR71X_UART2_GPIO0_PC1BITS|STR71X_UART3_GPIO0_PC1BITS) -#define STR71X_UART_GPIO0_PC2BITS (STR71X_UART0_GPIO0_PC2BITS|STR71X_UART1_GPIO0_PC2BITS|\ - STR71X_UART2_GPIO0_PC2BITS|STR71X_UART3_GPIO0_PC2BITS) +#define STR71X_UART_GPIO0_MASK \ + (STR71X_UART0_GPIO0_MASK | STR71X_UART1_GPIO0_MASK | \ + STR71X_UART2_GPIO0_MASK | STR71X_UART3_GPIO0_MASK) +#define STR71X_UART_GPIO0_PC0BITS \ + (STR71X_UART0_GPIO0_PC0BITS | STR71X_UART1_GPIO0_PC0BITS | \ + STR71X_UART2_GPIO0_PC0BITS | STR71X_UART3_GPIO0_PC0BITS) +#define STR71X_UART_GPIO0_PC1BITS \ + (STR71X_UART0_GPIO0_PC1BITS | STR71X_UART1_GPIO0_PC1BITS | \ + STR71X_UART2_GPIO0_PC1BITS | STR71X_UART3_GPIO0_PC1BITS) +#define STR71X_UART_GPIO0_PC2BITS \ + (STR71X_UART0_GPIO0_PC2BITS | STR71X_UART1_GPIO0_PC2BITS | \ + STR71X_UART2_GPIO0_PC2BITS | STR71X_UART3_GPIO0_PC2BITS) /* Select UART parameters for the selected console */ @@ -203,8 +207,9 @@ # define STR71X_UARTCR_STOP STR71X_UARTCR_STOPBIT10 #endif -#define STR71X_UARTCR_VALUE (STR71X_UARTCR_MODE|STR71X_UARTCR_PARITY|STR71X_UARTCR_STOP|\ - STR71X_UARTCR_RUN|STR71X_UARTCR_RXENABLE|STR71X_UARTCR_FIFOENABLE) +#define STR71X_UARTCR_VALUE \ + (STR71X_UARTCR_MODE | STR71X_UARTCR_PARITY | STR71X_UARTCR_STOP | \ + STR71X_UARTCR_RUN | STR71X_UARTCR_RXENABLE | STR71X_UARTCR_FIFOENABLE) /* Calculate BAUD rate from PCLK1: * diff --git a/arch/arm/src/str71x/str71x_prccu.c b/arch/arm/src/str71x/str71x_prccu.c index 74f7f8f0b2..0a6a5c3094 100644 --- a/arch/arm/src/str71x/str71x_prccu.c +++ b/arch/arm/src/str71x/str71x_prccu.c @@ -157,9 +157,10 @@ # define APB1EN_HDLC (0) #endif -#define APB1EN_ALL (APB1EN_I2C0|APB1EN_I2C1|APB1EN_UART0|APB1EN_UART1|\ - APB1EN_UART2|APB1EN_UART3|APB1EN_USB|APB1EN_CAN|\ - APB1EN_BSPI0|APB1EN_BSPI1|APB1EN_HDLC) +#define APB1EN_ALL \ + (APB1EN_I2C0 | APB1EN_I2C1 | APB1EN_UART0 | APB1EN_UART1 | \ + APB1EN_UART2 | APB1EN_UART3 | APB1EN_USB | APB1EN_CAN | \ + APB1EN_BSPI0 | APB1EN_BSPI1 | APB1EN_HDLC) /* APB2 Peripherals */ @@ -227,9 +228,10 @@ #define APB2EN_EIC (0) /* Interrupt controller always enabled */ -#define APB2EN_ALL (APB2EN_XTI|APB2EN_GPIO0|APB2EN_GPIO1|APB2EN_GPIO2|\ - APB2EN_ADC12|APB2EN_CKOUT|APB2EN_TIM0|APB2EN_TIM1|\ - APB2EN_TIM2|APB2EN_TIM3|APB2EN_RTC|APB2EN_EIC) +#define APB2EN_ALL \ + (APB2EN_XTI | APB2EN_GPIO0 | APB2EN_GPIO1 | APB2EN_GPIO2 | \ + APB2EN_ADC12 | APB2EN_CKOUT | APB2EN_TIM0 | APB2EN_TIM1 | \ + APB2EN_TIM2 | APB2EN_TIM3 | APB2EN_RTC | APB2EN_EIC) #if STR71X_PLL1OUT_MUL == 12 @@ -367,8 +369,8 @@ void str71x_prccuinit(void) */ reg16 = getreg16(STR71X_PCU_PDIVR); - reg16 &= ~(STR71X_PCUPDIVR_FACT1MASK|STR71X_PCUPDIVR_FACT2MASK); - reg16 |= (APB1DIV|APB2DIV); + reg16 &= ~(STR71X_PCUPDIVR_FACT1MASK | STR71X_PCUPDIVR_FACT2MASK); + reg16 |= (APB1DIV | APB2DIV); putreg16(reg16, STR71X_PCU_PDIVR); /* Configure the main system clock (MCLK) divider with value from board.h */ @@ -388,9 +390,10 @@ void str71x_prccuinit(void) */ #if STR71X_CLK2 > 3000000 - putreg32(PLL1MUL|PLL1DIV, STR71X_RCCU_PLL1CR); + putreg32(PLL1MUL | PLL1DIV, STR71X_RCCU_PLL1CR); #else - putreg32(PLL1MUL|PLL1DIV|STR71X_RCCUPLL1CR_FREFRANGE, STR71X_RCCU_PLL1CR); + putreg32(PLL1MUL | PLL1DIV | STR71X_RCCUPLL1CR_FREFRANGE, + STR71X_RCCU_PLL1CR); #endif /* Wait for the PLL to lock */ @@ -437,8 +440,8 @@ void str71x_prccuinit(void) #if defined(CONFIG_STR71X_HDLC) || (defined(CONFIG_STR71X_USB) && defined(STR71X_USBIN_PLL2)) reg16 = getreg16(STR71X_PCU_PLL2CR); - reg16 &= ~(STR71X_PCUPPL2CR_MXMASK|STR71X_PCUPPL2CR_DXMASK); - reg16 |= (PLL2MUL|PLL2DIV); + reg16 &= ~(STR71X_PCUPPL2CR_MXMASK | STR71X_PCUPPL2CR_DXMASK); + reg16 |= (PLL2MUL | PLL2DIV); /* Set the PLL2 FRQRNG bit according to the PLL2 input frequency */ diff --git a/arch/arm/src/str71x/str71x_serial.c b/arch/arm/src/str71x/str71x_serial.c index 54ac8e54e8..d36b1202ee 100644 --- a/arch/arm/src/str71x/str71x_serial.c +++ b/arch/arm/src/str71x/str71x_serial.c @@ -510,7 +510,7 @@ static inline void up_waittxnotfull(struct up_dev_s *priv) static int up_setup(struct uart_dev_s *dev) { #ifndef CONFIG_SUPPRESS_UART_CONFIG - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t divisor; uint32_t baud; uint16_t cr; @@ -523,7 +523,7 @@ static int up_setup(struct uart_dev_s *dev) /* Get mode setting */ - cr = STR71X_UARTCR_RUN|STR71X_UARTCR_RXENABLE|STR71X_UARTCR_FIFOENABLE; + cr = STR71X_UARTCR_RUN | STR71X_UARTCR_RXENABLE | STR71X_UARTCR_FIFOENABLE; if (priv->bits == 7) { @@ -592,7 +592,7 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disableuartint(priv, NULL); } @@ -613,7 +613,7 @@ static void up_shutdown(struct uart_dev_s *dev) static int up_attach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ */ @@ -621,16 +621,16 @@ static int up_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, up_interrupt); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the UART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the UART + */ - up_enable_irq(priv->irq); + up_enable_irq(priv->irq); #ifdef CONFIG_ARCH_IRQPRIO - /* Set the uart interrupt priority (the default value is one) */ + /* Set the uart interrupt priority (the default value is one) */ - up_prioritize_irq(priv->irq, CONFIG_UART_PRI); + up_prioritize_irq(priv->irq, CONFIG_UART_PRI); #endif } @@ -649,7 +649,7 @@ static int up_attach(struct uart_dev_s *dev) static void up_detach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disable_irq(priv->irq); irq_detach(priv->irq); } @@ -706,7 +706,7 @@ static int up_interrupt(int irq, void *context) PANIC(); } - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; DEBUGASSERT(priv && dev); /* Loop until there are no characters to be transferred or, @@ -727,10 +727,10 @@ static int up_interrupt(int irq, void *context) if ((priv->sr & RXAVAILABLE_BITS) != 0 && /* Data available in Rx FIFO */ (priv->ier & RXENABLE_BITS) != 0) /* Rx FIFO interrupts enabled */ { - /* Rx buffer not empty ... process incoming bytes */ + /* Rx buffer not empty ... process incoming bytes */ - uart_recvchars(dev); - handled = true; + uart_recvchars(dev); + handled = true; } /* Handle outgoing, transmit bytes */ @@ -738,10 +738,10 @@ static int up_interrupt(int irq, void *context) if ((priv->sr & STR71X_UARTSR_TF) == 0 && /* Tx FIFO not full */ (priv->ier & STR71X_UARTIER_THE) != 0) /* Tx Half empty interrupt enabled */ { - /* Tx FIFO not full ... process outgoing bytes */ + /* Tx FIFO not full ... process outgoing bytes */ - uart_xmitchars(dev); - handled = true; + uart_xmitchars(dev); + handled = true; } } @@ -769,7 +769,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct up_dev_s *user = (struct up_dev_s*)arg; + struct up_dev_s *user = (struct up_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -802,7 +802,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) static int up_receive(struct uart_dev_s *dev, uint32_t *status) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint16_t rxbufr; rxbufr = up_serialin(priv, STR71X_UART_RXBUFR_OFFSET); @@ -820,7 +820,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { /* Receive an interrupt when the Rx FIFO is half full (or if a timeout @@ -848,7 +848,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) static bool up_rxavailable(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, STR71X_UART_SR_OFFSET) & RXAVAILABLE_BITS) != 0); } @@ -862,7 +862,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_serialout(priv, STR71X_UART_TXBUFR_OFFSET, (uint16_t)ch); } @@ -876,7 +876,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { /* Set to receive an interrupt when the TX fifo is half emptied */ @@ -904,7 +904,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) static bool up_txready(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, STR71X_UART_SR_OFFSET) & STR71X_UARTSR_TF) == 0); } @@ -918,7 +918,7 @@ static bool up_txready(struct uart_dev_s *dev) static bool up_txempty(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, STR71X_UART_SR_OFFSET) & STR71X_UARTSR_TE) != 0); } @@ -1005,7 +1005,7 @@ void up_serialinit(void) int up_putc(int ch) { #ifdef HAVE_CONSOLE - struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; + struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; uint16_t ier; up_disableuartint(priv, &ier); From 20d87b38de85a6588b94e402a3116af502c56acf Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 7 Oct 2015 15:57:49 -0600 Subject: [PATCH 30/33] Tiva: Fix some cosmetic spacing issues --- arch/arm/src/tiva/lm3s_ethernet.c | 25 +++++----- arch/arm/src/tiva/tiva_adclib.c | 46 +++++++++--------- arch/arm/src/tiva/tiva_adclow.c | 56 ++++++++++++++-------- arch/arm/src/tiva/tiva_allocateheap.c | 6 +-- arch/arm/src/tiva/tiva_dumpgpio.c | 4 +- arch/arm/src/tiva/tiva_flash.c | 10 ++-- arch/arm/src/tiva/tiva_gpio.c | 2 +- arch/arm/src/tiva/tiva_i2c.c | 14 +++--- arch/arm/src/tiva/tiva_irq.c | 10 ++-- arch/arm/src/tiva/tiva_lowputc.c | 18 +++---- arch/arm/src/tiva/tiva_serial.c | 69 ++++++++++++++------------- arch/arm/src/tiva/tiva_ssi.c | 48 +++++++++---------- arch/arm/src/tiva/tiva_start.c | 2 +- arch/arm/src/tiva/tiva_syscontrol.c | 6 +-- arch/arm/src/tiva/tiva_timerisr.c | 9 ++-- arch/arm/src/tiva/tiva_timerlib.c | 26 +++++----- arch/arm/src/tiva/tiva_userspace.c | 10 ++-- arch/arm/src/tiva/tm4c_ethernet.c | 50 +++++++++---------- 18 files changed, 214 insertions(+), 197 deletions(-) diff --git a/arch/arm/src/tiva/lm3s_ethernet.c b/arch/arm/src/tiva/lm3s_ethernet.c index b355cb4664..f37ed15617 100644 --- a/arch/arm/src/tiva/lm3s_ethernet.c +++ b/arch/arm/src/tiva/lm3s_ethernet.c @@ -189,7 +189,7 @@ struct tiva_statistics_s uint32_t rx_ovrerrors; /* Number of Rx FIFO overrun errors */ uint32_t tx_int; /* Number of Tx interrupts received */ uint32_t tx_packets; /* Number of Tx packets queued */ - uint32_t tx_errors; /* Number of Tx errors (transmission error)*/ + uint32_t tx_errors; /* Number of Tx errors (transmission error) */ uint32_t tx_timeouts; /* Number of Tx timeout errors */ }; # define EMAC_STAT(priv,name) priv->ld_stat.name++ @@ -364,14 +364,14 @@ static void tiva_ethreset(struct tiva_driver_s *priv) flags = irqsave(); regval = getreg32(TIVA_SYSCON_RCGC2); - regval |= (SYSCON_RCGC2_EMAC0|SYSCON_RCGC2_EPHY0); + regval |= (SYSCON_RCGC2_EMAC0 | SYSCON_RCGC2_EPHY0); putreg32(regval, TIVA_SYSCON_RCGC2); nllvdbg("RCGC2: %08x\n", regval); /* Put the Ethernet controller into the reset state */ - regval = getreg32(TIVA_SYSCON_SRCR2); - regval |= (SYSCON_SRCR2_EMAC0|SYSCON_SRCR2_EPHY0); + regval = getreg32(TIVA_SYSCON_SRCR2); + regval |= (SYSCON_SRCR2_EMAC0 | SYSCON_SRCR2_EPHY0); putreg32(regval, TIVA_SYSCON_SRCR2); /* Wait just a bit. This is a much longer delay than necessary */ @@ -380,7 +380,7 @@ static void tiva_ethreset(struct tiva_driver_s *priv) /* Then take the Ethernet controller out of the reset state */ - regval &= ~(SYSCON_SRCR2_EMAC0|SYSCON_SRCR2_EPHY0); + regval &= ~(SYSCON_SRCR2_EMAC0 | SYSCON_SRCR2_EPHY0); putreg32(regval, TIVA_SYSCON_SRCR2); nllvdbg("SRCR2: %08x\n", regval); @@ -545,7 +545,7 @@ static int tiva_transmit(struct tiva_driver_s *priv) * buffer may be un-aligned. */ - tiva_ethout(priv, TIVA_MAC_DATA_OFFSET, *(uint32_t*)dbuf); + tiva_ethout(priv, TIVA_MAC_DATA_OFFSET, *(uint32_t *)dbuf); } /* Write the last, partial word in the FIFO */ @@ -756,7 +756,7 @@ static void tiva_receive(struct tiva_driver_s *priv) * buffer may be un-aligned. */ - *(uint32_t*)dbuf = tiva_ethin(priv, TIVA_MAC_DATA_OFFSET); + *(uint32_t *)dbuf = tiva_ethin(priv, TIVA_MAC_DATA_OFFSET); } /* Handle the last, partial word in the FIFO (0-3 bytes) and discard @@ -1016,7 +1016,7 @@ static int tiva_interrupt(int irq, FAR void *context) if ((ris & MAC_RIS_TXEMP) != 0) { - /* Handle the complete of the transmission */ + /* Handle the complete of the transmission */ EMAC_STAT(priv, tx_int); tiva_txdone(priv); @@ -1135,7 +1135,7 @@ static int tiva_ifup(struct net_driver_s *dev) nlldbg("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, - (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24 ); + (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); /* Enable and reset the Ethernet controller */ @@ -1289,7 +1289,7 @@ static int tiva_ifdown(struct net_driver_s *dev) nlldbg("Taking down: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, - (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24 ); + (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); /* Cancel the TX poll timer and TX timeout timers */ @@ -1489,7 +1489,8 @@ static inline int tiva_ethinitialize(int intf) #if TIVA_NETHCONTROLLERS > 1 # error "This debug check only works with one interface" #else - DEBUGASSERT((getreg32(TIVA_SYSCON_DC4) & (SYSCON_DC4_EMAC0|SYSCON_DC4_EPHY0)) == (SYSCON_DC4_EMAC0|SYSCON_DC4_EPHY0)); + DEBUGASSERT((getreg32(TIVA_SYSCON_DC4) & (SYSCON_DC4_EMAC0 | SYSCON_DC4_EPHY0)) == + (SYSCON_DC4_EMAC0 | SYSCON_DC4_EPHY0)); #endif DEBUGASSERT((unsigned)intf < TIVA_NETHCONTROLLERS); @@ -1503,7 +1504,7 @@ static inline int tiva_ethinitialize(int intf) priv->ld_dev.d_addmac = tiva_addmac; /* Add multicast MAC address */ priv->ld_dev.d_rmmac = tiva_rmmac; /* Remove multicast MAC address */ #endif - priv->ld_dev.d_private = (void*)priv; /* Used to recover private state from dev */ + priv->ld_dev.d_private = (void *)priv; /* Used to recover private state from dev */ /* Create a watchdog for timing polling for and timing of transmissions */ diff --git a/arch/arm/src/tiva/tiva_adclib.c b/arch/arm/src/tiva/tiva_adclib.c index 9254f03128..5487a51dba 100644 --- a/arch/arm/src/tiva/tiva_adclib.c +++ b/arch/arm/src/tiva/tiva_adclib.c @@ -77,8 +77,8 @@ ****************************************************************************/ #define CLOCK_CONFIG(div, src) \ - ( ((((div) << ADC_CC_CLKDIV_SHIFT) & ADC_CC_CLKDIV_MASK) | \ - ((src) & ADC_CC_CS_MASK)) & (ADC_CC_CLKDIV_MASK + ADC_CC_CS_MASK) ) + (((((div) << ADC_CC_CLKDIV_SHIFT) & ADC_CC_CLKDIV_MASK) | \ + ((src) & ADC_CC_CS_MASK)) & (ADC_CC_CLKDIV_MASK + ADC_CC_CS_MASK)) /**************************************************************************** * Private Types @@ -252,36 +252,36 @@ void tiva_adc_one_time_init(uint32_t clock, uint8_t sample_rate) void tiva_adc_configure(struct tiva_adc_cfg_s *cfg) { - uint8_t s; - uint8_t c; + uint8_t s; + uint8_t c; - avdbg("configure ADC%d...\n", cfg->adc); + avdbg("configure ADC%d...\n", cfg->adc); - /* Configure each SSE */ + /* Configure each SSE */ - for (s=0; s<4; ++s) - { - if (cfg->sse[s]) - { - tiva_adc_sse_cfg(cfg->adc, s, &cfg->ssecfg[s]); - } + for (s = 0; s < 4; ++s) + { + if (cfg->sse[s]) + { + tiva_adc_sse_cfg(cfg->adc, s, &cfg->ssecfg[s]); + } #ifdef CONFIG_DEBUG_ANALOG - else - { - avdbg("ADC%d SSE%d has no configuration\n", cfg->adc, s); - } + else + { + avdbg("ADC%d SSE%d has no configuration\n", cfg->adc, s); + } #endif - } + } - /* Configure each step */ + /* Configure each step */ - for (c=0; csteps; ++c) - { - tiva_adc_step_cfg(&cfg->stepcfg[c]); - } + for (c = 0; c < cfg->steps; ++c) + { + tiva_adc_step_cfg(&cfg->stepcfg[c]); + } #ifdef CONFIG_DEBUG_ANALOG - tiva_adc_dump_reg_cfg(cfg->adc, 0); + tiva_adc_dump_reg_cfg(cfg->adc, 0); #endif } diff --git a/arch/arm/src/tiva/tiva_adclow.c b/arch/arm/src/tiva/tiva_adclow.c index 3fe4772976..7b2f8e2d9d 100644 --- a/arch/arm/src/tiva/tiva_adclow.c +++ b/arch/arm/src/tiva/tiva_adclow.c @@ -116,7 +116,7 @@ */ #define ADC_TRIG_PWM_CFG(t) \ - (1<<(ADC_TSSEL_PS_SHIFT(ADC_TRIG_gen(t)))) + (1 << (ADC_TSSEL_PS_SHIFT(ADC_TRIG_gen(t)))) /* ADC support definitions **************************************************/ @@ -466,7 +466,7 @@ static void tiva_adc_shutdown(struct adc_dev_s *dev) struct tiva_adc_sse_s *sse; uint8_t s = 0; - for (s=0; s<4; ++s) + for (s = 0; s < 4; ++s) { } #endif @@ -496,7 +496,7 @@ static void tiva_adc_rxint(struct adc_dev_s *dev, bool enable) DEBUGASSERT(priv->ena); - for (s=0; s<4; ++s) + for (s = 0; s < 4; ++s) { trigger = tiva_adc_get_trigger(priv->devno, s); sse = g_sses[SSE_IDX(priv->devno, s)]; @@ -559,7 +559,7 @@ static int tiva_adc_ioctl(struct adc_dev_s *dev, int cmd, unsigned long arg) fifo_count = tiva_adc_sse_data(priv->devno, sse, buf); - for (i=0; idevno, sse, i), @@ -656,7 +656,7 @@ static void tiva_adc_read(void *arg) return; } - for (i=0; iadc, sse->num, i), @@ -743,7 +743,7 @@ static struct tiva_adc_s *tiva_adc_struct_init(struct tiva_adc_cfg_s *cfg) adc->ena = false; adc->devno = cfg->adc; - for (s=0; s<4; s++) + for (s = 0; s < 4; s++) { /* Only configure selected SSEs */ @@ -903,7 +903,7 @@ void tiva_adc_lock(FAR struct tiva_adc_s *priv, int sse) struct tiva_adc_sse_s *s = g_sses[SSE_IDX(priv->devno, sse)]; int ret; #ifdef CONFIG_DEBUG_ANALOG - uint16_t loop_count=0; + uint16_t loop_count = 0; #endif do @@ -958,21 +958,33 @@ static void tiva_adc_runtimeobj_ptrs(void) { # ifdef CONFIG_TIVA_ADC0 avdbg("ADC0 [struct] [global value] [array value]\n"); - avdbg(" adc_dev_s dev0=0x%08x g_devs[0]=0x%08x\n", &dev0, g_devs[0]); - avdbg(" tiva_adc_s adc0=0x%08x g_adcs[0]=0x%08x\n", &adc0, g_adcs[0]); - avdbg(" tiva_adc_sse_s sse0=0x%08x g_sses[0,0]=0x%08x\n", &sse00, g_sses[SSE_IDX(0,0)]); - avdbg(" tiva_adc_sse_s sse1=0x%08x g_sses[0,1]=0x%08x\n", &sse01, g_sses[SSE_IDX(0,1)]); - avdbg(" tiva_adc_sse_s sse2=0x%08x g_sses[0,2]=0x%08x\n", &sse02, g_sses[SSE_IDX(0,2)]); - avdbg(" tiva_adc_sse_s sse3=0x%08x g_sses[0,3]=0x%08x\n", &sse03, g_sses[SSE_IDX(0,3)]); + avdbg(" adc_dev_s dev0=0x%08x g_devs[0]=0x%08x\n", + &dev0, g_devs[0]); + avdbg(" tiva_adc_s adc0=0x%08x g_adcs[0]=0x%08x\n", + &adc0, g_adcs[0]); + avdbg(" tiva_adc_sse_s sse0=0x%08x g_sses[0,0]=0x%08x\n", + &sse00, g_sses[SSE_IDX(0, 0)]); + avdbg(" tiva_adc_sse_s sse1=0x%08x g_sses[0,1]=0x%08x\n", + &sse01, g_sses[SSE_IDX(0, 1)]); + avdbg(" tiva_adc_sse_s sse2=0x%08x g_sses[0,2]=0x%08x\n", + &sse02, g_sses[SSE_IDX(0, 2)]); + avdbg(" tiva_adc_sse_s sse3=0x%08x g_sses[0,3]=0x%08x\n", + &sse03, g_sses[SSE_IDX(0, 3)]); # endif # ifdef CONFIG_TIVA_ADC1 avdbg("ADC1 [struct] [global value] [array value]\n"); - avdbg(" adc_dev_s dev1=0x%08x g_devs[1]=0x%08x\n", &dev1, g_devs[1]); - avdbg(" tiva_adc_s adc1=0x%08x g_adcs[1]=0x%08x\n", &adc1, g_adcs[1]); - avdbg(" tiva_adc_sse_s sse0=0x%08x g_sses[1,0]=0x%08x\n", &sse10, g_sses[SSE_IDX(1,0)]); - avdbg(" tiva_adc_sse_s sse1=0x%08x g_sses[1,1]=0x%08x\n", &sse11, g_sses[SSE_IDX(1,1)]); - avdbg(" tiva_adc_sse_s sse2=0x%08x g_sses[1,2]=0x%08x\n", &sse12, g_sses[SSE_IDX(1,2)]); - avdbg(" tiva_adc_sse_s sse3=0x%08x g_sses[1,3]=0x%08x\n", &sse13, g_sses[SSE_IDX(1,3)]); + avdbg(" adc_dev_s dev1=0x%08x g_devs[1]=0x%08x\n", + &dev1, g_devs[1]); + avdbg(" tiva_adc_s adc1=0x%08x g_adcs[1]=0x%08x\n", + &adc1, g_adcs[1]); + avdbg(" tiva_adc_sse_s sse0=0x%08x g_sses[1,0]=0x%08x\n", + &sse10, g_sses[SSE_IDX(1, 0)]); + avdbg(" tiva_adc_sse_s sse1=0x%08x g_sses[1,1]=0x%08x\n", + &sse11, g_sses[SSE_IDX(1, 1)]); + avdbg(" tiva_adc_sse_s sse2=0x%08x g_sses[1,2]=0x%08x\n", + &sse12, g_sses[SSE_IDX(1, 2)]); + avdbg(" tiva_adc_sse_s sse3=0x%08x g_sses[1,3]=0x%08x\n", + &sse13, g_sses[SSE_IDX(1, 3)]); # endif } @@ -983,7 +995,8 @@ static void tiva_adc_runtimeobj_vals(void) # ifdef CONFIG_TIVA_ADC0 avdbg("ADC0 [0x%08x] cfg=%d ena=%d devno=%d\n", &adc0, adc0.cfg, adc0.ena, adc0.devno); - for (s=0; s<4; ++s) + + for (s = 0; s < 4; ++s) { sse = g_sses[SSE_IDX(0, s)]; avdbg("SSE%d [0x%08x] adc=%d cfg=%d ena=%d num=%d\n", @@ -993,7 +1006,8 @@ static void tiva_adc_runtimeobj_vals(void) # ifdef CONFIG_TIVA_ADC1 avdbg("ADC1 [0x%08x] cfg=%d ena=%d devno=%d\n", &adc1, adc1.cfg, adc1.ena, adc1.devno); - for (s=0; s<4; ++s) + + for (s = 0; s < 4; ++s) { sse = g_sses[SSE_IDX(1, s)]; avdbg("SSE%d [0x%08x] adc=%d cfg=%d ena=%d num=%d\n", diff --git a/arch/arm/src/tiva/tiva_allocateheap.c b/arch/arm/src/tiva/tiva_allocateheap.c index f5b47ddd89..4bca5ff2bd 100644 --- a/arch/arm/src/tiva/tiva_allocateheap.c +++ b/arch/arm/src/tiva/tiva_allocateheap.c @@ -132,7 +132,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) /* Return the user-space heap settings */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)ubase; + *heap_start = (FAR void *)ubase; *heap_size = usize; /* Allow user-mode access to the user heap memory */ @@ -143,7 +143,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) /* Return the heap settings */ board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)g_idle_topstack; + *heap_start = (FAR void *)g_idle_topstack; *heap_size = CONFIG_RAM_END - g_idle_topstack; #endif } @@ -187,7 +187,7 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size) * that was not dedicated to the user heap). */ - *heap_start = (FAR void*)USERSPACE->us_bssend; + *heap_start = (FAR void *)USERSPACE->us_bssend; *heap_size = ubase - (uintptr_t)USERSPACE->us_bssend; } #endif diff --git a/arch/arm/src/tiva/tiva_dumpgpio.c b/arch/arm/src/tiva/tiva_dumpgpio.c index f51f53d432..334f9ad2eb 100644 --- a/arch/arm/src/tiva/tiva_dumpgpio.c +++ b/arch/arm/src/tiva/tiva_dumpgpio.c @@ -170,10 +170,10 @@ int tiva_dumpgpio(uint32_t pinset, const char *msg) tiva_gpioport(port), pinset, base, msg); #ifdef TIVA_SYSCON_RCGCGPIO lldbg("RCGCGPIO: %08x (%s)\n", - rcgcgpio, enabled ? "enabled" : "disabled" ); + rcgcgpio, enabled ? "enabled" : "disabled"); #else lldbg(" RCGC2: %08x (%s)\n", - rcgc2, enabled ? "enabled" : "disabled" ); + rcgc2, enabled ? "enabled" : "disabled"); #endif /* Don't bother with the rest unless the port is enabled */ diff --git a/arch/arm/src/tiva/tiva_flash.c b/arch/arm/src/tiva/tiva_flash.c index fe463222cf..0dd70dd1dc 100644 --- a/arch/arm/src/tiva/tiva_flash.c +++ b/arch/arm/src/tiva/tiva_flash.c @@ -178,7 +178,7 @@ static ssize_t tiva_bread(FAR struct mtd_dev_s *dev, off_t startblock, size_t nb { DEBUGASSERT(startblock + nblocks <= TIVA_VIRTUAL_NPAGES); - memcpy(buf, (void*)(TIVA_VIRTUAL_BASE + startblock * TIVA_FLASH_PAGESIZE), + memcpy(buf, (void *)(TIVA_VIRTUAL_BASE + startblock * TIVA_FLASH_PAGESIZE), nblocks * TIVA_FLASH_PAGESIZE); return nblocks; @@ -195,8 +195,8 @@ static ssize_t tiva_bread(FAR struct mtd_dev_s *dev, off_t startblock, size_t nb static ssize_t tiva_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, FAR const uint8_t *buf) { - FAR uint32_t *src = (uint32_t*)buf; - FAR uint32_t *dst = (uint32_t*)(TIVA_VIRTUAL_BASE + startblock * TIVA_FLASH_PAGESIZE); + FAR uint32_t *src = (uint32_t *)buf; + FAR uint32_t *dst = (uint32_t *)(TIVA_VIRTUAL_BASE + startblock * TIVA_FLASH_PAGESIZE); int i; DEBUGASSERT(nblocks <= TIVA_VIRTUAL_NPAGES); @@ -236,7 +236,7 @@ static ssize_t tiva_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, { DEBUGASSERT(offset + nbytes < TIVA_VIRTUAL_NPAGES * TIVA_FLASH_PAGESIZE); - memcpy(buf, (void*)(TIVA_VIRTUAL_BASE + offset), nbytes); + memcpy(buf, (void *)(TIVA_VIRTUAL_BASE + offset), nbytes); return nbytes; } @@ -301,7 +301,7 @@ static int tiva_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) * this case altogether and simply return -ENOTTY. */ - *ppv = (void*)TIVA_VIRTUAL_BASE; + *ppv = (void *)TIVA_VIRTUAL_BASE; ret = OK; } } diff --git a/arch/arm/src/tiva/tiva_gpio.c b/arch/arm/src/tiva/tiva_gpio.c index c749ad23bb..112e6b33d9 100644 --- a/arch/arm/src/tiva/tiva_gpio.c +++ b/arch/arm/src/tiva/tiva_gpio.c @@ -506,7 +506,7 @@ static inline void tiva_gpiopadtype(uint32_t base, uint32_t pin, /* Set the pin type. */ - switch(padtype) + switch (padtype) { case GPIO_PADTYPE_STD: { diff --git a/arch/arm/src/tiva/tiva_i2c.c b/arch/arm/src/tiva/tiva_i2c.c index 9124993c0b..ddc3b7eebd 100644 --- a/arch/arm/src/tiva/tiva_i2c.c +++ b/arch/arm/src/tiva/tiva_i2c.c @@ -1327,12 +1327,12 @@ static int tiva_i2c_interrupt(struct tiva_i2c_priv_s *priv, uint32_t status) dr = tiva_i2c_getreg(priv, TIVA_I2CM_DR_OFFSET); - /* We check for msgc > 0 here as an unexpected interrupt with - * due to noise on the I2C cable can otherwise cause msgc to - * wrap causing memory overwrite - */ + /* We check for msgc > 0 here as an unexpected interrupt with + * due to noise on the I2C cable can otherwise cause msgc to + * wrap causing memory overwrite + */ - if (priv->msgc > 0 && priv->msgv != NULL) + if (priv->msgc > 0 && priv->msgv != NULL) { /* Was this the completion of an address or of the data portion * of the transfer? @@ -2051,8 +2051,8 @@ static int tiva_i2c_process(struct i2c_dev_s *dev, struct i2c_msg_s *msgv, int m * of a reset. */ - regval = tiva_i2c_getreg(priv, TIVA_I2CM_CS_OFFSET); - if ((regval & (I2CM_CS_BUSY | I2CM_CS_BUSBSY)) != 0) + regval = tiva_i2c_getreg(priv, TIVA_I2CM_CS_OFFSET); + if ((regval & (I2CM_CS_BUSY | I2CM_CS_BUSBSY)) != 0) { /* I2C Bus is for some reason busy. If I2CM_CS_BUSY then none of the * other bits are valid. diff --git a/arch/arm/src/tiva/tiva_irq.c b/arch/arm/src/tiva/tiva_irq.c index c9c9e15127..d399f8ac03 100644 --- a/arch/arm/src/tiva/tiva_irq.c +++ b/arch/arm/src/tiva/tiva_irq.c @@ -61,9 +61,9 @@ /* Get a 32-bit version of the default priority */ #define DEFPRIORITY32 \ - (NVIC_SYSH_PRIORITY_DEFAULT << 24 |\ - NVIC_SYSH_PRIORITY_DEFAULT << 16 |\ - NVIC_SYSH_PRIORITY_DEFAULT << 8 |\ + (NVIC_SYSH_PRIORITY_DEFAULT << 24 | \ + NVIC_SYSH_PRIORITY_DEFAULT << 16 | \ + NVIC_SYSH_PRIORITY_DEFAULT << 8 | \ NVIC_SYSH_PRIORITY_DEFAULT) /* Given the address of a NVIC ENABLE register, this is the offset to @@ -326,8 +326,8 @@ static int tiva_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit, else { - *regaddr = NVIC_SYSHCON; - if (irq == TIVA_IRQ_MEMFAULT) + *regaddr = NVIC_SYSHCON; + if (irq == TIVA_IRQ_MEMFAULT) { *bit = NVIC_SYSHCON_MEMFAULTENA; } diff --git a/arch/arm/src/tiva/tiva_lowputc.c b/arch/arm/src/tiva/tiva_lowputc.c index 192869c6eb..f97036bbde 100644 --- a/arch/arm/src/tiva/tiva_lowputc.c +++ b/arch/arm/src/tiva/tiva_lowputc.c @@ -237,11 +237,11 @@ void up_lowputc(char ch) #ifdef HAVE_SERIAL_CONSOLE /* Wait until the TX FIFO is not full */ - while ((getreg32(TIVA_CONSOLE_BASE+TIVA_UART_FR_OFFSET) & UART_FR_TXFF) != 0); + while ((getreg32(TIVA_CONSOLE_BASE + TIVA_UART_FR_OFFSET) & UART_FR_TXFF) != 0); /* Then send the character */ - putreg32((uint32_t)ch, TIVA_CONSOLE_BASE+TIVA_UART_DR_OFFSET); + putreg32((uint32_t)ch, TIVA_CONSOLE_BASE + TIVA_UART_DR_OFFSET); #endif } @@ -351,25 +351,25 @@ void up_lowsetup(void) /* Disable the UART by clearing the UARTEN bit in the UART CTL register */ - ctl = getreg32(TIVA_CONSOLE_BASE+TIVA_UART_CTL_OFFSET); + ctl = getreg32(TIVA_CONSOLE_BASE + TIVA_UART_CTL_OFFSET); ctl &= ~UART_CTL_UARTEN; - putreg32(ctl, TIVA_CONSOLE_BASE+TIVA_UART_CTL_OFFSET); + putreg32(ctl, TIVA_CONSOLE_BASE + TIVA_UART_CTL_OFFSET); /* Write the integer portion of the BRD to the UART IBRD register */ - putreg32(TIVA_BRDI, TIVA_CONSOLE_BASE+TIVA_UART_IBRD_OFFSET); + putreg32(TIVA_BRDI, TIVA_CONSOLE_BASE + TIVA_UART_IBRD_OFFSET); /* Write the fractional portion of the BRD to the UART FBRD register */ - putreg32(TIVA_DIVFRAC, TIVA_CONSOLE_BASE+TIVA_UART_FBRD_OFFSET); + putreg32(TIVA_DIVFRAC, TIVA_CONSOLE_BASE + TIVA_UART_FBRD_OFFSET); /* Write the desired serial parameters to the UART LCRH register */ - putreg32(UART_LCRH_VALUE, TIVA_CONSOLE_BASE+TIVA_UART_LCRH_OFFSET); + putreg32(UART_LCRH_VALUE, TIVA_CONSOLE_BASE + TIVA_UART_LCRH_OFFSET); /* Enable the UART by setting the UARTEN bit in the UART CTL register */ - ctl |= (UART_CTL_UARTEN|UART_CTL_TXE|UART_CTL_RXE); - putreg32(ctl, TIVA_CONSOLE_BASE+TIVA_UART_CTL_OFFSET); + ctl |= (UART_CTL_UARTEN | UART_CTL_TXE | UART_CTL_RXE); + putreg32(ctl, TIVA_CONSOLE_BASE + TIVA_UART_CTL_OFFSET); #endif } diff --git a/arch/arm/src/tiva/tiva_serial.c b/arch/arm/src/tiva/tiva_serial.c index 8fd78cf5e9..3d8f844b6d 100644 --- a/arch/arm/src/tiva/tiva_serial.c +++ b/arch/arm/src/tiva/tiva_serial.c @@ -719,7 +719,7 @@ static inline void up_waittxnotfull(struct up_dev_s *priv) static int up_setup(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t lcrh; uint32_t ctl; #ifndef CONFIG_SUPPRESS_UART_CONFIG @@ -812,7 +812,7 @@ static int up_setup(struct uart_dev_s *dev) lcrh |= UART_LCRH_PEN; break; case 2: - lcrh |= UART_LCRH_PEN|UART_LCRH_EPS; + lcrh |= UART_LCRH_PEN | UART_LCRH_EPS; break; } @@ -828,9 +828,10 @@ static int up_setup(struct uart_dev_s *dev) * any character is received. */ - up_serialout(priv, TIVA_UART_IFLS_OFFSET, UART_IFLS_TXIFLSEL_18th|UART_IFLS_RXIFLSEL_18th); + up_serialout(priv, TIVA_UART_IFLS_OFFSET, + UART_IFLS_TXIFLSEL_18th | UART_IFLS_RXIFLSEL_18th); - /* Flush the Rx and Tx FIFOs -- How do you do that?*/ + /* Flush the Rx and Tx FIFOs -- How do you do that? */ /* Enable Rx interrupts from the UART except for Tx interrupts. We don't want * Tx interrupts until we have something to send. We will check for serial @@ -838,7 +839,7 @@ static int up_setup(struct uart_dev_s *dev) * yet because the interrupt is still disabled at the interrupt controller. */ - up_serialout(priv, TIVA_UART_IM_OFFSET, UART_IM_RXIM|UART_IM_RTIM); + up_serialout(priv, TIVA_UART_IM_OFFSET, UART_IM_RXIM | UART_IM_RTIM); /* Enable the FIFOs */ @@ -853,7 +854,7 @@ static int up_setup(struct uart_dev_s *dev) #ifdef CONFIG_SUPPRESS_UART_CONFIG ctl = up_serialin(priv, TIVA_UART_CTL_OFFSET); #endif - ctl |= (UART_CTL_UARTEN|UART_CTL_TXE|UART_CTL_RXE); + ctl |= (UART_CTL_UARTEN | UART_CTL_TXE | UART_CTL_RXE); up_serialout(priv, TIVA_UART_CTL_OFFSET, ctl); /* Set up the cache IM value */ @@ -873,7 +874,7 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disableuartint(priv, NULL); } @@ -894,7 +895,7 @@ static void up_shutdown(struct uart_dev_s *dev) static int up_attach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; int ret; /* Attach and enable the IRQ */ @@ -902,12 +903,13 @@ static int up_attach(struct uart_dev_s *dev) ret = irq_attach(priv->irq, up_interrupt); if (ret == OK) { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the UART - */ + /* Enable the interrupt (RX and TX interrupts are still disabled + * in the UART + */ - up_enable_irq(priv->irq); + up_enable_irq(priv->irq); } + return ret; } @@ -923,7 +925,7 @@ static int up_attach(struct uart_dev_s *dev) static void up_detach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_disable_irq(priv->irq); irq_detach(priv->irq); } @@ -1009,7 +1011,7 @@ static int up_interrupt(int irq, void *context) PANIC(); } - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; /* Loop until there are no characters to be transferred or, * until we have been looping for a long time. @@ -1027,25 +1029,26 @@ static int up_interrupt(int irq, void *context) /* Handle incoming, receive bytes (with or without timeout) */ - if ((mis & (UART_MIS_RXMIS|UART_MIS_RTMIS)) != 0) + if ((mis & (UART_MIS_RXMIS | UART_MIS_RTMIS)) != 0) { - /* Rx buffer not empty ... process incoming bytes */ + /* Rx buffer not empty ... process incoming bytes */ - uart_recvchars(dev); - handled = true; + uart_recvchars(dev); + handled = true; } /* Handle outgoing, transmit bytes */ if ((mis & UART_MIS_TXMIS) != 0) { - /* Tx FIFO not full ... process outgoing bytes */ + /* Tx FIFO not full ... process outgoing bytes */ - uart_xmitchars(dev); - handled = true; + uart_xmitchars(dev); + handled = true; } } - return OK; + + return OK; } /**************************************************************************** @@ -1069,7 +1072,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { - struct up_dev_s *user = (struct up_dev_s*)arg; + struct up_dev_s *user = (struct up_dev_s *)arg; if (!user) { ret = -EINVAL; @@ -1102,7 +1105,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) static int up_receive(struct uart_dev_s *dev, uint32_t *status) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t rxd; /* Get the Rx byte + 4 bits of error information. Return those in status */ @@ -1125,7 +1128,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { /* Receive an interrupt when their is anything in the Rx FIFO (or an Rx @@ -1133,12 +1136,12 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) */ #ifndef CONFIG_SUPPRESS_SERIAL_INTS - priv->im |= (UART_IM_RXIM|UART_IM_RTIM); + priv->im |= (UART_IM_RXIM | UART_IM_RTIM); #endif } else { - priv->im &= ~(UART_IM_RXIM|UART_IM_RTIM); + priv->im &= ~(UART_IM_RXIM | UART_IM_RTIM); } up_serialout(priv, TIVA_UART_IM_OFFSET, priv->im); } @@ -1153,7 +1156,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) static bool up_rxavailable(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, TIVA_UART_FR_OFFSET) & UART_FR_RXFE) == 0); } @@ -1167,7 +1170,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_serialout(priv, TIVA_UART_DR_OFFSET, (uint32_t)ch); } @@ -1181,7 +1184,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -1226,7 +1229,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) static bool up_txready(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, TIVA_UART_FR_OFFSET) & UART_FR_TXFF) == 0); } @@ -1240,7 +1243,7 @@ static bool up_txready(struct uart_dev_s *dev) static bool up_txempty(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; return ((up_serialin(priv, TIVA_UART_FR_OFFSET) & UART_FR_TXFE) != 0); } @@ -1351,7 +1354,7 @@ void up_serialinit(void) int up_putc(int ch) { #ifdef HAVE_SERIAL_CONSOLE - struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; + struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; uint32_t im; up_disableuartint(priv, &im); diff --git a/arch/arm/src/tiva/tiva_ssi.c b/arch/arm/src/tiva/tiva_ssi.c index 6ee628226b..aba7bcf80c 100644 --- a/arch/arm/src/tiva/tiva_ssi.c +++ b/arch/arm/src/tiva/tiva_ssi.c @@ -548,18 +548,18 @@ static void ssi_txnull(struct tiva_ssidev_s *priv) static void ssi_txuint16(struct tiva_ssidev_s *priv) { - uint16_t *ptr = (uint16_t*)priv->txbuffer; + uint16_t *ptr = (uint16_t *)priv->txbuffer; ssivdbg("TX: %p->%04x\n", ptr, *ptr); ssi_putreg(priv, TIVA_SSI_DR_OFFSET, (uint32_t)(*ptr++)); - priv->txbuffer = (void*)ptr; + priv->txbuffer = (void *)ptr; } static void ssi_txuint8(struct tiva_ssidev_s *priv) { - uint8_t *ptr = (uint8_t*)priv->txbuffer; + uint8_t *ptr = (uint8_t *)priv->txbuffer; ssivdbg("TX: %p->%02x\n", ptr, *ptr); ssi_putreg(priv, TIVA_SSI_DR_OFFSET, (uint32_t)(*ptr++)); - priv->txbuffer = (void*)ptr; + priv->txbuffer = (void *)ptr; } /**************************************************************************** @@ -591,18 +591,18 @@ static void ssi_rxnull(struct tiva_ssidev_s *priv) static void ssi_rxuint16(struct tiva_ssidev_s *priv) { - uint16_t *ptr = (uint16_t*)priv->rxbuffer; + uint16_t *ptr = (uint16_t *)priv->rxbuffer; *ptr = (uint16_t)ssi_getreg(priv, TIVA_SSI_DR_OFFSET); ssivdbg("RX: %p<-%04x\n", ptr, *ptr); - priv->rxbuffer = (void*)(++ptr); + priv->rxbuffer = (void *)(++ptr); } static void ssi_rxuint8(struct tiva_ssidev_s *priv) { - uint8_t *ptr = (uint8_t*)priv->rxbuffer; + uint8_t *ptr = (uint8_t *)priv->rxbuffer; *ptr = (uint8_t)ssi_getreg(priv, TIVA_SSI_DR_OFFSET); ssivdbg("RX: %p<-%02x\n", ptr, *ptr); - priv->rxbuffer = (void*)(++ptr); + priv->rxbuffer = (void *)(++ptr); } /**************************************************************************** @@ -724,7 +724,7 @@ static int ssi_performtx(struct tiva_ssidev_s *priv) */ #ifdef CONFIG_DEBUG - regval |= (SSI_IM_TX|SSI_RIS_ROR); + regval |= (SSI_IM_TX | SSI_RIS_ROR); #else regval |= SSI_IM_TX; #endif @@ -735,7 +735,7 @@ static int ssi_performtx(struct tiva_ssidev_s *priv) * the transfer will be driven by Rx FIFO interrupts. */ - regval &= ~(SSI_IM_TX|SSI_RIS_ROR); + regval &= ~(SSI_IM_TX | SSI_RIS_ROR); } ssi_putreg(priv, TIVA_SSI_IM_OFFSET, regval); #endif /* CONFIG_SSI_POLLWAIT */ @@ -790,16 +790,16 @@ static inline void ssi_performrx(struct tiva_ssidev_s *priv) regval = ssi_getreg(priv, TIVA_SSI_IM_OFFSET); if (priv->ntxwords == 0 && priv->nrxwords < priv->nwords) { - /* There are no more outgoing words to send, but there are - * additional incoming words expected (I would think that this - * a real corner case, be we will handle it with an extra - * interrupt, probably an Rx timeout). - */ + /* There are no more outgoing words to send, but there are + * additional incoming words expected (I would think that this + * a real corner case, be we will handle it with an extra + * interrupt, probably an Rx timeout). + */ #ifdef CONFIG_DEBUG - regval |= (SSI_IM_RX|SSI_IM_RT|SSI_IM_ROR); + regval |= (SSI_IM_RX | SSI_IM_RT | SSI_IM_ROR); #else - regval |= (SSI_IM_RX|SSI_IM_RT); + regval |= (SSI_IM_RX | SSI_IM_RT); #endif } else @@ -808,7 +808,7 @@ static inline void ssi_performrx(struct tiva_ssidev_s *priv) * have received. Disable Rx FIFO interrupts. */ - regval &= ~(SSI_IM_RX|SSI_IM_RT); + regval &= ~(SSI_IM_RX | SSI_IM_RT); } ssi_putreg(priv, TIVA_SSI_IM_OFFSET, regval); #endif /* CONFIG_SSI_POLLWAIT */ @@ -849,8 +849,8 @@ static int ssi_transfer(struct tiva_ssidev_s *priv, const void *txbuffer, /* Set up to perform the transfer */ - priv->txbuffer = (uint8_t*)txbuffer; /* Source buffer */ - priv->rxbuffer = (uint8_t*)rxbuffer; /* Destination buffer */ + priv->txbuffer = (uint8_t *)txbuffer; /* Source buffer */ + priv->rxbuffer = (uint8_t *)rxbuffer; /* Destination buffer */ priv->ntxwords = nwords; /* Number of words left to send */ priv->nrxwords = 0; /* Number of words received */ priv->nwords = nwords; /* Total number of exchanges */ @@ -1300,7 +1300,7 @@ static void ssi_setmodeinternal(struct tiva_ssidev_s *priv, enum spi_mode_e mode break; case SPIDEV_MODE3: /* CPOL=1 CHPHA=1 */ - modebits = SSI_CR0_SPH|SSI_CR0_SPO; + modebits = SSI_CR0_SPH | SSI_CR0_SPO; break; default: @@ -1310,7 +1310,7 @@ static void ssi_setmodeinternal(struct tiva_ssidev_s *priv, enum spi_mode_e mode /* Then set the selected mode: Freescale SPI format, mode0-3 */ regval = ssi_getreg(priv, TIVA_SSI_CR0_OFFSET); - regval &= ~(SSI_CR0_FRF_MASK|SSI_CR0_SPH|SSI_CR0_SPO); + regval &= ~(SSI_CR0_FRF_MASK | SSI_CR0_SPH | SSI_CR0_SPO); regval |= modebits; ssi_putreg(priv, TIVA_SSI_CR0_OFFSET, regval); ssivdbg("CR0: %08x\n", regval); @@ -1359,7 +1359,7 @@ static void ssi_setbitsinternal(struct tiva_ssidev_s *priv, int nbits) ssidbg("nbits: %d\n", nbits); DEBUGASSERT(priv); - if (nbits != priv->nbits && nbits >=4 && nbits <= 16) + if (nbits != priv->nbits && nbits >= 4 && nbits <= 16) { regval = ssi_getreg(priv, TIVA_SSI_CR0_OFFSET); regval &= ~SSI_CR0_DSS_MASK; @@ -1401,7 +1401,7 @@ static void ssi_setbits(FAR struct spi_dev_s *dev, int nbits) static uint16_t ssi_send(FAR struct spi_dev_s *dev, uint16_t wd) { - struct tiva_ssidev_s *priv = (struct tiva_ssidev_s*)dev; + struct tiva_ssidev_s *priv = (struct tiva_ssidev_s *)dev; uint16_t response = 0; (void)ssi_transfer(priv, &wd, &response, 1); diff --git a/arch/arm/src/tiva/tiva_start.c b/arch/arm/src/tiva/tiva_start.c index 1e13266787..6ecc46223e 100644 --- a/arch/arm/src/tiva/tiva_start.c +++ b/arch/arm/src/tiva/tiva_start.c @@ -168,5 +168,5 @@ void __start(void) /* Shouldn't get here */ - for (;;); + for (; ; ); } diff --git a/arch/arm/src/tiva/tiva_syscontrol.c b/arch/arm/src/tiva/tiva_syscontrol.c index 60808614d8..4f056033c4 100644 --- a/arch/arm/src/tiva/tiva_syscontrol.c +++ b/arch/arm/src/tiva/tiva_syscontrol.c @@ -319,13 +319,11 @@ void tiva_clockconfig(uint32_t newrcc, uint32_t newrcc2) } } #elif defined(CONFIG_ARCH_CHIP_CC3200) - { #if 0 - /* NOTE: we do this in up_earlyconsoleinit() */ + /* NOTE: we do this in up_earlyconsoleinit() */ - cc3200_init(); + cc3200_init(); #endif - } #else if (((rcc & SYSCON_RCC_MOSCDIS) != 0 && (newrcc & SYSCON_RCC_MOSCDIS) == 0) || ((rcc & SYSCON_RCC_IOSCDIS) != 0 && (newrcc & SYSCON_RCC_IOSCDIS) == 0)) diff --git a/arch/arm/src/tiva/tiva_timerisr.c b/arch/arm/src/tiva/tiva_timerisr.c index 235b7abdf8..76fd7e96cb 100644 --- a/arch/arm/src/tiva/tiva_timerisr.c +++ b/arch/arm/src/tiva/tiva_timerisr.c @@ -98,10 +98,10 @@ int up_timerisr(int irq, uint32_t *regs) { - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); - return 0; + sched_process_timer(); + return 0; } /**************************************************************************** @@ -134,7 +134,8 @@ void up_timer_initialize(void) /* Enable SysTick interrupts */ - putreg32((NVIC_SYSTICK_CTRL_CLKSOURCE|NVIC_SYSTICK_CTRL_TICKINT|NVIC_SYSTICK_CTRL_ENABLE), NVIC_SYSTICK_CTRL); + putreg32((NVIC_SYSTICK_CTRL_CLKSOURCE | NVIC_SYSTICK_CTRL_TICKINT | + NVIC_SYSTICK_CTRL_ENABLE), NVIC_SYSTICK_CTRL); /* And enable the timer interrupt */ diff --git a/arch/arm/src/tiva/tiva_timerlib.c b/arch/arm/src/tiva/tiva_timerlib.c index a1e9f3f207..2939071a8b 100644 --- a/arch/arm/src/tiva/tiva_timerlib.c +++ b/arch/arm/src/tiva/tiva_timerlib.c @@ -883,10 +883,10 @@ static int tiva_oneshot_periodic_mode32(struct tiva_gptmstate_s *priv, */ #warning Missing Logic - /* Enable wait-on-trigger? - * - * TODO: Not implemented - */ + /* Enable wait-on-trigger? + * + * TODO: Not implemented + */ #warning Missing Logic /* Enable count down? */ @@ -2350,7 +2350,7 @@ void tiva_timer32_setinterval(TIMER_HANDLE handle, uint32_t interval) flags = irqsave(); - /* Set the new timeout interval */ + /* Set the new timeout interval */ putreg32(interval, loadr); @@ -2497,14 +2497,14 @@ void tiva_timer16_setinterval(TIMER_HANDLE handle, uint16_t interval, int tmndx) if (toints) { #ifdef CONFIG_ARCH_CHIP_TM4C129 - if (tmndx) - { - moder = base + TIVA_TIMER_TBMR_OFFSET; - } - else - { - moder = base + TIVA_TIMER_TAMR_OFFSET; - } + if (tmndx) + { + moder = base + TIVA_TIMER_TBMR_OFFSET; + } + else + { + moder = base + TIVA_TIMER_TAMR_OFFSET; + } /* Clearing the TACINTD bit allows the time-out interrupt to be * generated as normal diff --git a/arch/arm/src/tiva/tiva_userspace.c b/arch/arm/src/tiva/tiva_userspace.c index 9f2c6b59aa..b041a5d58c 100644 --- a/arch/arm/src/tiva/tiva_userspace.c +++ b/arch/arm/src/tiva/tiva_userspace.c @@ -87,8 +87,8 @@ void tiva_userspace(void) DEBUGASSERT(USERSPACE->us_bssstart != 0 && USERSPACE->us_bssend != 0 && USERSPACE->us_bssstart <= USERSPACE->us_bssend); - dest = (uint8_t*)USERSPACE->us_bssstart; - end = (uint8_t*)USERSPACE->us_bssend; + dest = (uint8_t *)USERSPACE->us_bssstart; + end = (uint8_t *)USERSPACE->us_bssend; while (dest != end) { @@ -101,9 +101,9 @@ void tiva_userspace(void) USERSPACE->us_datastart != 0 && USERSPACE->us_dataend != 0 && USERSPACE->us_datastart <= USERSPACE->us_dataend); - src = (uint8_t*)USERSPACE->us_datasource; - dest = (uint8_t*)USERSPACE->us_datastart; - end = (uint8_t*)USERSPACE->us_dataend; + src = (uint8_t *)USERSPACE->us_datasource; + dest = (uint8_t *)USERSPACE->us_datastart; + end = (uint8_t *)USERSPACE->us_dataend; while (dest != end) { diff --git a/arch/arm/src/tiva/tm4c_ethernet.c b/arch/arm/src/tiva/tm4c_ethernet.c index 0c259e1497..1a61f16672 100644 --- a/arch/arm/src/tiva/tm4c_ethernet.c +++ b/arch/arm/src/tiva/tm4c_ethernet.c @@ -513,7 +513,7 @@ (EMAC_DMABUSMOD_SWR | EMAC_DMABUSMOD_DA | EMAC_DMABUSMOD_DSL_MASK | \ EMAC_DMABUSMOD_ATDS | EMAC_DMABUSMOD_PBL_MASK | EMAC_DMABUSMOD_PR_MASK | \ EMAC_DMABUSMOD_FB | EMAC_DMABUSMOD_RPBL_MASK | EMAC_DMABUSMOD_USP | \ - EMAC_DMABUSMOD_8XPBL | EMAC_DMABUSMOD_AAL | EMAC_DMABUSMOD_MB |\ + EMAC_DMABUSMOD_8XPBL | EMAC_DMABUSMOD_AAL | EMAC_DMABUSMOD_MB | \ EMAC_DMABUSMOD_TXPR | EMAC_DMABUSMOD_RIB) /* The following bits are set or left zero unconditionally in all modes. @@ -583,7 +583,7 @@ */ #define EMAC_DMAINT_NORMAL \ - (EMAC_DMAINT_TI | EMAC_DMAINT_TBUI |EMAC_DMAINT_RI | EMAC_DMAINT_ERI) + (EMAC_DMAINT_TI | EMAC_DMAINT_TBUI | EMAC_DMAINT_RI | EMAC_DMAINT_ERI) #define EMAC_DMAINT_ABNORMAL \ (EMAC_DMAINT_TPSI | EMAC_DMAINT_TJTI | EMAC_DMAINT_OVFI | EMAC_EMAINT_UNFI | \ @@ -807,10 +807,10 @@ static uint32_t tiva_getreg(uint32_t addr) { if (count == 0xffffffff || ++count > 3) { - if (count == 4) - { - lldbg("...\n"); - } + if (count == 4) + { + lldbg("...\n"); + } return val; } @@ -820,20 +820,20 @@ static uint32_t tiva_getreg(uint32_t addr) else { - /* Did we print "..." for the previous value? */ + /* Did we print "..." for the previous value? */ - if (count > 3) - { - /* Yes.. then show how many times the value repeated */ + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ - lldbg("[repeats %d more times]\n", count-3); - } + lldbg("[repeats %d more times]\n", count-3); + } - /* Save the new address, value, and count */ + /* Save the new address, value, and count */ - prevaddr = addr; - preval = val; - count = 1; + prevaddr = addr; + preval = val; + count = 1; } /* Show the register value read */ @@ -1574,7 +1574,7 @@ static int tiva_recvframe(FAR struct tiva_ethmac_s *priv) /* Check if this is an intermediate segment in the frame */ - else if (((rxdesc->rdes0 & EMAC_RDES0_LS) == 0)&& + else if (((rxdesc->rdes0 & EMAC_RDES0_LS) == 0) && ((rxdesc->rdes0 & EMAC_RDES0_FS) == 0)) { priv->segments++; @@ -1626,14 +1626,14 @@ static int tiva_recvframe(FAR struct tiva_ethmac_s *priv) */ DEBUGASSERT(dev->d_buf == NULL); - dev->d_buf = (uint8_t*)rxcurr->rdes2; + dev->d_buf = (uint8_t *)rxcurr->rdes2; rxcurr->rdes2 = (uint32_t)buffer; /* Return success, remebering where we should re-start scanning * and resetting the segment scanning logic */ - priv->rxhead = (struct emac_rxdesc_s*)rxdesc->rdes3; + priv->rxhead = (struct emac_rxdesc_s *)rxdesc->rdes3; tiva_freesegment(priv, rxcurr, priv->segments); nvdbg("rxhead: %p d_buf: %p d_len: %d\n", @@ -1654,7 +1654,7 @@ static int tiva_recvframe(FAR struct tiva_ethmac_s *priv) /* Try the next descriptor */ - rxdesc = (struct emac_rxdesc_s*)rxdesc->rdes3; + rxdesc = (struct emac_rxdesc_s *)rxdesc->rdes3; } /* We get here after all of the descriptors have been scanned or when rxdesc points @@ -1767,7 +1767,7 @@ static void tiva_receive(FAR struct tiva_ethmac_s *priv) */ if (priv->dev.d_len > 0) - { + { /* Update the Ethernet header with the correct MAC address */ #ifdef CONFIG_NET_IPv4 @@ -1879,7 +1879,7 @@ static void tiva_freeframe(FAR struct tiva_ethmac_s *priv) { /* Yes.. Free the buffer */ - tiva_freebuffer(priv, (uint8_t*)txdesc->tdes2); + tiva_freebuffer(priv, (uint8_t *)txdesc->tdes2); } /* In any event, make sure that TDES2 is nullified. */ @@ -1912,7 +1912,7 @@ static void tiva_freeframe(FAR struct tiva_ethmac_s *priv) /* Try the next descriptor in the TX chain */ - txdesc = (struct emac_txdesc_s*)txdesc->tdes3; + txdesc = (struct emac_txdesc_s *)txdesc->tdes3; } /* We get here if (1) there are still frames "in-flight". Remember @@ -4207,7 +4207,7 @@ int tiva_ethinitialize(int intf) #ifdef CONFIG_NETDEV_PHY_IOCTL priv->dev.d_ioctl = tiva_ioctl; /* Support PHY ioctl() calls */ #endif - priv->dev.d_private = (void*)g_tiva_ethmac; /* Used to recover private state from dev */ + priv->dev.d_private = (void *)g_tiva_ethmac; /* Used to recover private state from dev */ /* Create a watchdog for timing polling for and timing of transmissions */ @@ -4427,7 +4427,7 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) if (enable) { - *enable = handler ? tiva_phy_intenable : NULL;; + *enable = handler ? tiva_phy_intenable : NULL; } /* Return the old handler (so that it can be restored) */ From a73d2664693083e7627ee3456d66c5df7af85796 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 7 Oct 2015 16:24:54 -0600 Subject: [PATCH 31/33] AVR: Fix some spacing issues --- arch/avr/src/at32uc3/at32uc3_clkinit.c | 2 +- arch/avr/src/at32uc3/at32uc3_gpioirq.c | 44 ++++++++--------- arch/avr/src/at32uc3/at32uc3_irq.c | 6 +-- arch/avr/src/at32uc3/at32uc3_lowconsole.c | 13 ++--- arch/avr/src/at32uc3/at32uc3_serial.c | 55 +++++++++++---------- arch/avr/src/at32uc3/at32uc3_timerisr.c | 10 ++-- arch/avr/src/at90usb/at90usb_serial.c | 12 ++--- arch/avr/src/at90usb/at90usb_timerisr.c | 9 ++-- arch/avr/src/at90usb/at90usb_usbdev.c | 60 +++++++++++------------ arch/avr/src/atmega/atmega_serial.c | 22 ++++----- arch/avr/src/atmega/atmega_timerisr.c | 9 ++-- arch/avr/src/avr/up_blocktask.c | 6 +-- arch/avr/src/avr/up_checkstack.c | 8 +-- arch/avr/src/avr/up_createstack.c | 2 +- arch/avr/src/avr/up_doirq.c | 6 +-- arch/avr/src/avr/up_dumpstate.c | 4 +- arch/avr/src/avr/up_releasepending.c | 6 +-- arch/avr/src/avr/up_reprioritizertr.c | 8 +-- arch/avr/src/avr/up_schedulesigaction.c | 2 +- arch/avr/src/avr/up_sigdeliver.c | 2 +- arch/avr/src/avr/up_spi.c | 20 ++++---- arch/avr/src/avr/up_unblocktask.c | 6 +-- arch/avr/src/avr32/up_blocktask.c | 18 +++---- arch/avr/src/avr32/up_createstack.c | 2 +- arch/avr/src/avr32/up_doirq.c | 2 +- arch/avr/src/avr32/up_dumpstate.c | 4 +- arch/avr/src/avr32/up_releasepending.c | 6 +-- arch/avr/src/avr32/up_reprioritizertr.c | 6 +-- arch/avr/src/avr32/up_schedulesigaction.c | 2 +- arch/avr/src/avr32/up_sigdeliver.c | 2 +- arch/avr/src/avr32/up_unblocktask.c | 18 +++---- arch/avr/src/common/up_allocateheap.c | 2 +- arch/avr/src/common/up_assert.c | 20 ++++---- arch/avr/src/common/up_exit.c | 4 +- arch/avr/src/common/up_interruptcontext.c | 2 +- arch/avr/src/common/up_mdelay.c | 6 +-- 36 files changed, 203 insertions(+), 203 deletions(-) diff --git a/arch/avr/src/at32uc3/at32uc3_clkinit.c b/arch/avr/src/at32uc3/at32uc3_clkinit.c index 53eb5ad04d..62848010e3 100644 --- a/arch/avr/src/at32uc3/at32uc3_clkinit.c +++ b/arch/avr/src/at32uc3/at32uc3_clkinit.c @@ -110,7 +110,7 @@ static inline void up_enableosc32(void) regval = getreg32(AVR32_PM_OSCCTRL32); regval &= ~PM_OSCCTRL32_STARTUP_MASK; - regval |= PM_OSCCTRL32_EN|(AVR32_OSC32STARTUP << PM_OSCCTRL32_STARTUP_SHIFT); + regval |= PM_OSCCTRL32_EN | (AVR32_OSC32STARTUP << PM_OSCCTRL32_STARTUP_SHIFT); putreg32(regval, AVR32_PM_OSCCTRL32); } #endif diff --git a/arch/avr/src/at32uc3/at32uc3_gpioirq.c b/arch/avr/src/at32uc3/at32uc3_gpioirq.c index 9a0b18075c..3d8285856e 100644 --- a/arch/avr/src/at32uc3/at32uc3_gpioirq.c +++ b/arch/avr/src/at32uc3/at32uc3_gpioirq.c @@ -157,25 +157,25 @@ static inline int gpio_pin(unsigned int irq) /* Is this pin at bit 0 configured for interrupt support? */ if ((pinset & 1) != 0) - { - /* Is it the on IRQ we are looking for? */ + { + /* Is it the on IRQ we are looking for? */ - if (pinirq == irq) - { - /* Yes, return the associated pin number */ + if (pinirq == irq) + { + /* Yes, return the associated pin number */ - return pin; - } + return pin; + } - /* No.. Increment the IRQ number for the next configured pin */ + /* No.. Increment the IRQ number for the next configured pin */ - pinirq++; - } + pinirq++; + } - /* Shift the next pin to position bit 0 */ + /* Shift the next pin to position bit 0 */ - pinset >>= 1; - } + pinset >>= 1; + } return -EINVAL; } @@ -209,10 +209,10 @@ static void gpio_porthandler(uint32_t regbase, int irqbase, uint32_t irqset, voi uint32_t bit = (1 << pin); if ((irqset & bit) != 0) - { - /* Is an interrupt pending on this pin? */ + { + /* Is an interrupt pending on this pin? */ - if ((ifr & bit) != 0) + if ((ifr & bit) != 0) { /* Yes.. Clear the pending interrupt */ @@ -231,16 +231,16 @@ static void gpio_porthandler(uint32_t regbase, int irqbase, uint32_t irqset, voi lldbg("No handler: pin=%d ifr=%08x irqset=%08x", pin, ifr, irqset); } - } + } - /* Increment the IRQ number on all configured pins */ + /* Increment the IRQ number on all configured pins */ - irq++; - } + irq++; + } - /* Not configured. An interrupt on this pin would be an error. */ + /* Not configured. An interrupt on this pin would be an error. */ - else if ((ifr & bit) != 0) + else if ((ifr & bit) != 0) { /* Clear the pending interrupt */ diff --git a/arch/avr/src/at32uc3/at32uc3_irq.c b/arch/avr/src/at32uc3/at32uc3_irq.c index c5d7b8bc41..127d1ae99e 100644 --- a/arch/avr/src/at32uc3/at32uc3_irq.c +++ b/arch/avr/src/at32uc3/at32uc3_irq.c @@ -211,9 +211,9 @@ void up_irqinitialize(void) */ for (group = 0; group < AVR32_IRQ_MAXGROUPS; group++) - { - putreg32(g_ipr[0], AVR32_INTC_IPR(group)); - } + { + putreg32(g_ipr[0], AVR32_INTC_IPR(group)); + } /* currents_regs is non-NULL only while processing an interrupt */ diff --git a/arch/avr/src/at32uc3/at32uc3_lowconsole.c b/arch/avr/src/at32uc3/at32uc3_lowconsole.c index 4e6f4240fa..58c7e067ed 100644 --- a/arch/avr/src/at32uc3/at32uc3_lowconsole.c +++ b/arch/avr/src/at32uc3/at32uc3_lowconsole.c @@ -152,7 +152,7 @@ static void usart_setbaudrate(uintptr_t usart_base, uint32_t baudrate) { /* Select 16x oversampling mode and clear the SYNC mode bit */ - mr &= ~(USART_MR_OVER|USART_MR_SYNC); + mr &= ~(USART_MR_OVER | USART_MR_SYNC); /* Calculate the clock divider assuming 16x oversampling */ @@ -218,8 +218,9 @@ void usart_reset(uintptr_t usart_base) /* Disable RX and TX, put USART in reset, disable handshaking signals */ usart_putreg(usart_base, AVR32_USART_CR_OFFSET, - USART_CR_RSTRX|USART_CR_RSTTX|USART_CR_RSTSTA|USART_CR_RSTIT| - USART_CR_RSTNACK|USART_CR_DTRDIS|USART_CR_RTSDIS); + USART_CR_RSTRX | USART_CR_RSTTX | USART_CR_RSTSTA | + USART_CR_RSTIT | USART_CR_RSTNACK | USART_CR_DTRDIS | + USART_CR_RTSDIS); } #endif @@ -243,7 +244,7 @@ void usart_configure(uintptr_t usart_base, uint32_t baud, unsigned int parity, /* Configure STOP bits */ - regval = USART_MR_MODE_NORMAL|USART_MR_CHMODE_NORMAL; /* Normal RS-232 mode */ + regval = USART_MR_MODE_NORMAL | USART_MR_CHMODE_NORMAL; /* Normal RS-232 mode */ regval |= stop2 ? USART_MR_NBSTOP_2 : USART_MR_NBSTOP_1; /* Configure parity */ @@ -285,7 +286,7 @@ void usart_configure(uintptr_t usart_base, uint32_t baud, unsigned int parity, /* Enable RX and TX */ regval = usart_getreg(usart_base, AVR32_USART_CR_OFFSET); - regval |= (USART_CR_RXEN|USART_CR_TXEN); + regval |= (USART_CR_RXEN | USART_CR_TXEN); usart_putreg(usart_base, AVR32_USART_CR_OFFSET, regval); } #endif @@ -354,7 +355,7 @@ void up_consoleinit(void) /* Enable selected clocks (and disabled unselected clocks) */ regval = getreg32(AVR32_PM_PBAMASK); - regval &= ~(PM_PBAMASK_USART0|PM_PBAMASK_USART1|PM_PBAMASK_USART2); + regval &= ~(PM_PBAMASK_USART0 | PM_PBAMASK_USART1 | PM_PBAMASK_USART2); regval |= pbamask; putreg32(regval, AVR32_PM_PBAMASK); diff --git a/arch/avr/src/at32uc3/at32uc3_serial.c b/arch/avr/src/at32uc3/at32uc3_serial.c index ad655a1ca8..5631446272 100644 --- a/arch/avr/src/at32uc3/at32uc3_serial.c +++ b/arch/avr/src/at32uc3/at32uc3_serial.c @@ -358,7 +358,7 @@ static inline void up_disableusartint(struct up_dev_s *priv, uint32_t *imr) static int up_setup(struct uart_dev_s *dev) { #ifndef CONFIG_SUPPRESS_UART_CONFIG - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Configure the USART as an RS-232 UART */ @@ -380,7 +380,7 @@ static int up_setup(struct uart_dev_s *dev) static void up_shutdown(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Reset, disable interrupts, and disable Rx and Tx */ @@ -404,7 +404,7 @@ static void up_shutdown(struct uart_dev_s *dev) static int up_attach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; /* Attach the IRQ */ @@ -423,7 +423,7 @@ static int up_attach(struct uart_dev_s *dev) static void up_detach(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_serialout(priv, AVR32_USART_IDR_OFFSET, 0xffffffff); irq_detach(priv->irq); } @@ -472,7 +472,7 @@ static int up_interrupt(int irq, void *context) { PANIC(); } - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; DEBUGASSERT(priv); /* Loop until there are no characters to be transferred or, @@ -491,25 +491,26 @@ static int up_interrupt(int irq, void *context) /* Handle incoming, receive bytes (with or without timeout) */ - if ((csr & (USART_CSR_RXRDY|USART_CSR_TIMEOUT)) != 0) + if ((csr & (USART_CSR_RXRDY | USART_CSR_TIMEOUT)) != 0) { - /* Received data ready... process incoming bytes */ + /* Received data ready... process incoming bytes */ - uart_recvchars(dev); - handled = true; + uart_recvchars(dev); + handled = true; } /* Handle outgoing, transmit bytes */ if ((csr & USART_CSR_TXRDY) != 0) { - /* Transmit data regiser empty ... process outgoing bytes */ + /* Transmit data regiser empty ... process outgoing bytes */ - uart_xmitchars(dev); - handled = true; + uart_xmitchars(dev); + handled = true; } } - return OK; + + return OK; } /**************************************************************************** @@ -533,7 +534,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) dev = inode->i_private; DEBUGASSERT(dev, dev->priv); - priv = (struct up_dev_s*)dev->priv; + priv = (struct up_dev_s *)dev->priv; switch (cmd) { @@ -563,7 +564,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) static int up_receive(struct uart_dev_s *dev, uint32_t *status) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t rhr; /* Get the Rx byte. The USART Rx interrupt flag is cleared by side effect @@ -595,7 +596,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; if (enable) { @@ -606,19 +607,19 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) #ifndef CONFIG_SUPPRESS_SERIAL_INTS # ifdef CONFIG_USART_ERRINTS up_serialout(priv, AVR32_USART_IER_OFFSET, - USART_INT_RXRDY|USART_INT_TIMEOUT| - USART_INT_OVRE|USART_INT_FRAME|USART_INT_PARE); + USART_INT_RXRDY | USART_INT_TIMEOUT | USART_INT_OVRE | + USART_INT_FRAME | USART_INT_PARE); # else up_serialout(priv, AVR32_USART_IER_OFFSET, - USART_INT_RXRDY|USART_INT_TIMEOUT); + USART_INT_RXRDY | USART_INT_TIMEOUT); # endif #endif } else { - up_serialout(priv, AVR32_USART_IDR_OFFSET, - USART_INT_RXRDY|USART_INT_TIMEOUT| - USART_INT_OVRE|USART_INT_FRAME|USART_INT_PARE); + up_serialout(priv, AVR32_USART_IDR_OFFSET, + USART_INT_RXRDY | USART_INT_TIMEOUT | USART_INT_OVRE | + USART_INT_FRAME | USART_INT_PARE); } } @@ -632,7 +633,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) static bool up_rxavailable(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t regval; /* Read the channel status register and check if character is available to @@ -653,7 +654,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; up_serialout(priv, AVR32_USART_THR_OFFSET, (uint32_t)ch); } @@ -667,7 +668,7 @@ static void up_send(struct uart_dev_s *dev, int ch) static void up_txint(struct uart_dev_s *dev, bool enable) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; irqstate_t flags; flags = irqsave(); @@ -704,7 +705,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) static bool up_txready(struct uart_dev_s *dev) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t regval; /* Read the channel status register and check if THR is ready to accept @@ -790,7 +791,7 @@ void up_serialinit(void) int up_putc(int ch) { #ifdef HAVE_SERIAL_CONSOLE - struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; + struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; uint32_t imr; up_disableusartint(priv, &imr); diff --git a/arch/avr/src/at32uc3/at32uc3_timerisr.c b/arch/avr/src/at32uc3/at32uc3_timerisr.c index acb508cab0..c8ec47edcb 100644 --- a/arch/avr/src/at32uc3/at32uc3_timerisr.c +++ b/arch/avr/src/at32uc3/at32uc3_timerisr.c @@ -167,14 +167,14 @@ static void rtc_waitnotbusy(void) int up_timerisr(int irq, uint32_t *regs) { - /* Clear the pending timer interrupt */ + /* Clear the pending timer interrupt */ - putreg32(RTC_INT_TOPI, AVR32_RTC_ICR); + putreg32(RTC_INT_TOPI, AVR32_RTC_ICR); - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); - return 0; + sched_process_timer(); + return 0; } /**************************************************************************** diff --git a/arch/avr/src/at90usb/at90usb_serial.c b/arch/avr/src/at90usb/at90usb_serial.c index 8af0aae45a..4b4c361768 100644 --- a/arch/avr/src/at90usb/at90usb_serial.c +++ b/arch/avr/src/at90usb/at90usb_serial.c @@ -247,7 +247,7 @@ static int usart1_attach(struct uart_dev_s *dev) (void)irq_attach(AT90USB_IRQ_U1RX, usart1_rxinterrupt); (void)irq_attach(AT90USB_IRQ_U1DRE, usart1_txinterrupt); -// (void)irq_attach(AT90USB_IRQ_U1TX, usart1_txinterrupt); +//(void)irq_attach(AT90USB_IRQ_U1TX, usart1_txinterrupt); return OK; } @@ -271,7 +271,7 @@ static void usart1_detach(struct uart_dev_s *dev) (void)irq_detach(AT90USB_IRQ_U1RX); (void)irq_detach(AT90USB_IRQ_U1DRE); -// (void)irq_detach(AT90USB_IRQ_U1TX); +//(void)irq_detach(AT90USB_IRQ_U1TX); } /**************************************************************************** @@ -292,9 +292,9 @@ static int usart1_rxinterrupt(int irq, void *context) if ((ucsr1a & (1 << RXC1)) != 0) { - /* Received data ready... process incoming bytes */ + /* Received data ready... process incoming bytes */ - uart_recvchars(&g_usart1port); + uart_recvchars(&g_usart1port); } return OK; @@ -320,9 +320,9 @@ static int usart1_txinterrupt(int irq, void *context) if ((ucsr1a & (1 << UDRE1)) != 0) { - /* Transmit data regiser empty ... process outgoing bytes */ + /* Transmit data regiser empty ... process outgoing bytes */ - uart_xmitchars(&g_usart1port); + uart_xmitchars(&g_usart1port); } return OK; diff --git a/arch/avr/src/at90usb/at90usb_timerisr.c b/arch/avr/src/at90usb/at90usb_timerisr.c index 7aa9e66493..824fc074a7 100644 --- a/arch/avr/src/at90usb/at90usb_timerisr.c +++ b/arch/avr/src/at90usb/at90usb_timerisr.c @@ -92,8 +92,7 @@ # error "Cannot represent this timer frequency" #endif -/* - * Eg. CPU_CLOCK = 8MHz, CLOCKS_PER_SEC = 100 +/* Eg. CPU_CLOCK = 8MHz, CLOCKS_PER_SEC = 100 * * MATCH1 ((8000000 + 50) / 100) = 80,000 FREQ=100.0Hz * MATCH8 ((1000000 + 50) / 100) = 10,000 FREQ=100.0Hz <-- this one @@ -125,10 +124,10 @@ int up_timerisr(int irq, uint32_t *regs) { - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); - return 0; + sched_process_timer(); + return 0; } /**************************************************************************** diff --git a/arch/avr/src/at90usb/at90usb_usbdev.c b/arch/avr/src/at90usb/at90usb_usbdev.c index 49dc0b0e3a..4abe43d900 100644 --- a/arch/avr/src/at90usb/at90usb_usbdev.c +++ b/arch/avr/src/at90usb/at90usb_usbdev.c @@ -450,7 +450,7 @@ static int avr_fifoready(int timeout) { UDINT &= ~(1 << SOFI); - for (;;) + for (; ; ) { /* Check if the FIFO is ready by testing RWAL (read/write allowed). The * meaning of this bigtdepends on the direction of the endpoint: For an @@ -518,9 +518,9 @@ static void avr_ep0send(FAR const uint8_t *buffer, uint16_t buflen) while (buflen) { - /* Verify that RXOUTI is clear. RXOUTI is set when a new OUT data is - * received. In this case, we have not option but to abort the transfer. - */ + /* Verify that RXOUTI is clear. RXOUTI is set when a new OUT data is + * received. In this case, we have not option but to abort the transfer. + */ regval = UEINTX; if ((regval & (1 << RXOUTI)) != 0) @@ -854,10 +854,10 @@ static int avr_epINqueue(FAR struct avr_ep_s *privep) } else { - /* No.. remove the next request from the queue of IN requests */ + /* No.. remove the next request from the queue of IN requests */ - privreq = avr_rqdequeue(privep); - privep->pending = privreq; + privreq = avr_rqdequeue(privep); + privep->pending = privreq; } /* Is there an IN request */ @@ -873,7 +873,7 @@ static int avr_epINqueue(FAR struct avr_ep_s *privep) * pending transfer in place. */ - if (ret == OK || ret != -ETIME) + if (ret == OK || ret != -ETIME) { /* The transfer has completed, perhaps with an error. Return the request * to the class driver. @@ -1386,7 +1386,7 @@ static inline void avr_ep0setup(void) /* Read EP0 setup data -- Read the setup data from the hardware. */ - ptr = (uint8_t*)&ctrl; + ptr = (uint8_t *)&ctrl; for (i = 0; i < USB_SIZEOF_CTRLREQ; i++) { *ptr++ = UEDATX; @@ -2611,33 +2611,33 @@ static FAR struct usbdev_ep_s *avr_allocep(FAR struct usbdev_s *dev, epmask = 1 << epndx; if ((epset & epmask) != 0) { - /* Initialize the endpoint structure */ + /* Initialize the endpoint structure */ - privep = &g_usbdev.eplist[epndx]; - memset(privep, 0, sizeof(struct avr_ep_s)); + privep = &g_usbdev.eplist[epndx]; + memset(privep, 0, sizeof(struct avr_ep_s)); - privep->ep.ops = &g_epops; - privep->ep.eplog = epndx; - privep->ep.maxpacket = (epndx == 1) ? 256 : 64; + privep->ep.ops = &g_epops; + privep->ep.eplog = epndx; + privep->ep.maxpacket = (epndx == 1) ? 256 : 64; - /* Mark the IN/OUT endpoint no longer available */ + /* Mark the IN/OUT endpoint no longer available */ - g_usbdev.epavail &= ~epmask; - if (in) - { - g_usbdev.epinset |= epmask; - privep->epin = 1; - } - else - { - g_usbdev.epoutset |= epmask; - privep->epin = 0; - } + g_usbdev.epavail &= ~epmask; + if (in) + { + g_usbdev.epinset |= epmask; + privep->epin = 1; + } + else + { + g_usbdev.epoutset |= epmask; + privep->epin = 0; + } - /* And return the pointer to the standard endpoint structure */ + /* And return the pointer to the standard endpoint structure */ - irqrestore(flags); - return &privep->ep; + irqrestore(flags); + return &privep->ep; } } diff --git a/arch/avr/src/atmega/atmega_serial.c b/arch/avr/src/atmega/atmega_serial.c index 9255eb6f98..c881debe25 100644 --- a/arch/avr/src/atmega/atmega_serial.c +++ b/arch/avr/src/atmega/atmega_serial.c @@ -387,7 +387,7 @@ static int usart0_attach(struct uart_dev_s *dev) (void)irq_attach(ATMEGA_IRQ_U0RX, usart0_rxinterrupt); (void)irq_attach(ATMEGA_IRQ_U0DRE, usart0_txinterrupt); -// (void)irq_attach(ATMEGA_IRQ_U0TX, usart0_txinterrupt); +//(void)irq_attach(ATMEGA_IRQ_U0TX, usart0_txinterrupt); return OK; } #endif @@ -409,7 +409,7 @@ static int usart1_attach(struct uart_dev_s *dev) (void)irq_attach(ATMEGA_IRQ_U1RX, usart1_rxinterrupt); (void)irq_attach(ATMEGA_IRQ_U1DRE, usart1_txinterrupt); -// (void)irq_attach(ATMEGA_IRQ_U1TX, usart1_txinterrupt); +//(void)irq_attach(ATMEGA_IRQ_U1TX, usart1_txinterrupt); return OK; } #endif @@ -450,7 +450,7 @@ static void usart1_detach(struct uart_dev_s *dev) (void)irq_detach(ATMEGA_IRQ_U1RX); (void)irq_detach(ATMEGA_IRQ_U1DRE); -// (void)irq_detach(ATMEGA_IRQ_U1TX); +//(void)irq_detach(ATMEGA_IRQ_U1TX); } #endif @@ -473,9 +473,9 @@ static int usart0_rxinterrupt(int irq, void *context) if ((ucsr0a & (1 << RXC0)) != 0) { - /* Received data ready... process incoming bytes */ + /* Received data ready... process incoming bytes */ - uart_recvchars(&g_usart0port); + uart_recvchars(&g_usart0port); } return OK; @@ -491,9 +491,9 @@ static int usart1_rxinterrupt(int irq, void *context) if ((ucsr1a & (1 << RXC1)) != 0) { - /* Received data ready... process incoming bytes */ + /* Received data ready... process incoming bytes */ - uart_recvchars(&g_usart1port); + uart_recvchars(&g_usart1port); } return OK; @@ -521,9 +521,9 @@ static int usart0_txinterrupt(int irq, void *context) if ((ucsr0a & (1 << UDRE0)) != 0) { - /* Transmit data regiser empty ... process outgoing bytes */ + /* Transmit data regiser empty ... process outgoing bytes */ - uart_xmitchars(&g_usart0port); + uart_xmitchars(&g_usart0port); } return OK; @@ -541,9 +541,9 @@ static int usart1_txinterrupt(int irq, void *context) if ((ucsr1a & (1 << UDRE1)) != 0) { - /* Transmit data regiser empty ... process outgoing bytes */ + /* Transmit data regiser empty ... process outgoing bytes */ - uart_xmitchars(&g_usart1port); + uart_xmitchars(&g_usart1port); } return OK; diff --git a/arch/avr/src/atmega/atmega_timerisr.c b/arch/avr/src/atmega/atmega_timerisr.c index 2b30a2b7d6..04726ea9aa 100644 --- a/arch/avr/src/atmega/atmega_timerisr.c +++ b/arch/avr/src/atmega/atmega_timerisr.c @@ -92,8 +92,7 @@ # error "Cannot represent this timer frequency" #endif -/* - * Eg. CPU_CLOCK = 8MHz, CLOCKS_PER_SEC = 100 +/* Eg. CPU_CLOCK = 8MHz, CLOCKS_PER_SEC = 100 * * MATCH1 ((8000000 + 50) / 100) = 80,000 FREQ=100.0Hz * MATCH8 ((1000000 + 50) / 100) = 10,000 FREQ=100.0Hz <-- this one @@ -125,10 +124,10 @@ int up_timerisr(int irq, uint32_t *regs) { - /* Process timer interrupt */ + /* Process timer interrupt */ - sched_process_timer(); - return 0; + sched_process_timer(); + return 0; } /**************************************************************************** diff --git a/arch/avr/src/avr/up_blocktask.c b/arch/avr/src/avr/up_blocktask.c index 4ebf64cbbd..4cae397091 100644 --- a/arch/avr/src/avr/up_blocktask.c +++ b/arch/avr/src/avr/up_blocktask.c @@ -75,7 +75,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; bool switch_needed; /* Verify that the context switch can be performed */ @@ -127,7 +127,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Reset scheduler parameters */ @@ -142,7 +142,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) else { - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head; /* Reset scheduler parameters */ diff --git a/arch/avr/src/avr/up_checkstack.c b/arch/avr/src/avr/up_checkstack.c index fcba783bc6..2273d43d18 100644 --- a/arch/avr/src/avr/up_checkstack.c +++ b/arch/avr/src/avr/up_checkstack.c @@ -131,11 +131,11 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size) } up_putc(ch); - } + } up_putc('\n'); } - } + } #endif /* Return our guess about how much stack space was used */ @@ -175,12 +175,12 @@ ssize_t up_check_tcbstack_remain(FAR struct tcb_s *tcb) size_t up_check_stack(void) { - return up_check_tcbstack((FAR struct tcb_s*)g_readytorun.head); + return up_check_tcbstack((FAR struct tcb_s *)g_readytorun.head); } ssize_t up_check_stack_remain(void) { - return up_check_tcbstack_remain((FAR struct tcb_s*)g_readytorun.head); + return up_check_tcbstack_remain((FAR struct tcb_s *)g_readytorun.head); } #if CONFIG_ARCH_INTERRUPTSTACK > 3 diff --git a/arch/avr/src/avr/up_createstack.c b/arch/avr/src/avr/up_createstack.c index 860f0471eb..3a30888ab6 100644 --- a/arch/avr/src/avr/up_createstack.c +++ b/arch/avr/src/avr/up_createstack.c @@ -164,5 +164,5 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) return OK; } - return ERROR; + return ERROR; } diff --git a/arch/avr/src/avr/up_doirq.c b/arch/avr/src/avr/up_doirq.c index dc9cf8a7a2..a6768cf199 100644 --- a/arch/avr/src/avr/up_doirq.c +++ b/arch/avr/src/avr/up_doirq.c @@ -90,12 +90,12 @@ uint8_t *up_doirq(uint8_t irq, uint8_t *regs) * current_regs is also used to manage interrupt level context switches. */ - savestate = (uint8_t*)current_regs; /* Cast removes volatile attribute */ + savestate = (uint8_t *)current_regs; /* Cast removes volatile attribute */ current_regs = regs; /* Deliver the IRQ */ - irq_dispatch((int)irq, (uint32_t*)regs); + irq_dispatch((int)irq, (uint32_t *)regs); /* If a context switch occurred while processing the interrupt then * current_regs may have change value. If we return any value different @@ -103,7 +103,7 @@ uint8_t *up_doirq(uint8_t irq, uint8_t *regs) * switch occurred during interrupt processing. */ - regs = (uint8_t*)current_regs; /* Cast removes volatile attribute */ + regs = (uint8_t *)current_regs; /* Cast removes volatile attribute */ /* Restore the previous value of current_regs. NULL would indicate that * we are no longer in an interrupt handler. It will be non-NULL if we diff --git a/arch/avr/src/avr/up_dumpstate.c b/arch/avr/src/avr/up_dumpstate.c index 1f77c899a6..97b9d1d409 100644 --- a/arch/avr/src/avr/up_dumpstate.c +++ b/arch/avr/src/avr/up_dumpstate.c @@ -104,7 +104,7 @@ static void up_stackdump(uint16_t sp, uint16_t stack_base) for (stack = sp & ~3; stack < stack_base; stack += 12) { - uint8_t *ptr = (uint8_t*)stack; + uint8_t *ptr = (uint8_t *)stack; lldbg("%04x: %02x %02x %02x %02x %02x %02x %02x %02x" " %02x %02x %02x %02x\n", stack, @@ -168,7 +168,7 @@ static inline void up_registerdump(void) void up_dumpstate(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; uint16_t sp = up_getsp(); uint16_t ustackbase; uint16_t ustacksize; diff --git a/arch/avr/src/avr/up_releasepending.c b/arch/avr/src/avr/up_releasepending.c index d75d9d8c11..cf5ff951bf 100644 --- a/arch/avr/src/avr/up_releasepending.c +++ b/arch/avr/src/avr/up_releasepending.c @@ -64,7 +64,7 @@ void up_release_pending(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; slldbg("From TCB=%p\n", rtcb); @@ -93,7 +93,7 @@ void up_release_pending(void) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -108,7 +108,7 @@ void up_release_pending(void) else { - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ diff --git a/arch/avr/src/avr/up_reprioritizertr.c b/arch/avr/src/avr/up_reprioritizertr.c index 98f491d605..ccda24b1d0 100644 --- a/arch/avr/src/avr/up_reprioritizertr.c +++ b/arch/avr/src/avr/up_reprioritizertr.c @@ -91,7 +91,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) } else { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; bool switch_needed; slldbg("TCB=%p PRI=%d\n", tcb, priority); @@ -135,7 +135,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sched_suspend_scheduler(rtcb); - /* Are we in an interrupt handler? */ + /* Are we in an interrupt handler? */ if (current_regs) { @@ -149,7 +149,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -164,7 +164,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) else { - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ diff --git a/arch/avr/src/avr/up_schedulesigaction.c b/arch/avr/src/avr/up_schedulesigaction.c index 54f5601df7..4bafc7f1b2 100644 --- a/arch/avr/src/avr/up_schedulesigaction.c +++ b/arch/avr/src/avr/up_schedulesigaction.c @@ -121,7 +121,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs); - if (tcb == (struct tcb_s*)g_readytorun.head) + if (tcb == (struct tcb_s *)g_readytorun.head) { /* CASE 1: We are not in an interrupt handler and * a task is signalling itself for some reason. diff --git a/arch/avr/src/avr/up_sigdeliver.c b/arch/avr/src/avr/up_sigdeliver.c index 368c47bc64..ae2d70f8e3 100644 --- a/arch/avr/src/avr/up_sigdeliver.c +++ b/arch/avr/src/avr/up_sigdeliver.c @@ -82,7 +82,7 @@ void up_sigdeliver(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; uint8_t regs[XCPTCONTEXT_REGS]; sig_deliver_t sigdeliver; diff --git a/arch/avr/src/avr/up_spi.c b/arch/avr/src/avr/up_spi.c index 75ebe41da9..dd22a44f21 100644 --- a/arch/avr/src/avr/up_spi.c +++ b/arch/avr/src/avr/up_spi.c @@ -263,7 +263,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) } else /* if (frequency >= BOARD_CPU_CLOCK / 128) */ { - spcr |= (1 << SPR0)|(1 << SPR1); + spcr |= (1 << SPR0) | (1 << SPR1); actual = BOARD_CPU_CLOCK / 128; } @@ -393,7 +393,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) /* Wait for transmission to complete */ - while (!(SPSR & (1< 0) - { - (void)spi_send(dev, (uint16_t)*ptr++); - } + { + (void)spi_send(dev, (uint16_t)*ptr++); + } } /**************************************************************************** @@ -453,13 +453,13 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nwords) { - FAR uint8_t *ptr = (FAR uint8_t*)buffer; + FAR uint8_t *ptr = (FAR uint8_t *)buffer; spidbg("nwords: %d\n", nwords); while (nwords-- > 0) - { - *ptr++ = spi_send(dev, (uint16_t)0xff); - } + { + *ptr++ = spi_send(dev, (uint16_t)0xff); + } } /**************************************************************************** diff --git a/arch/avr/src/avr/up_unblocktask.c b/arch/avr/src/avr/up_unblocktask.c index 841d82b08f..cccdc631dd 100644 --- a/arch/avr/src/avr/up_unblocktask.c +++ b/arch/avr/src/avr/up_unblocktask.c @@ -70,7 +70,7 @@ void up_unblock_task(struct tcb_s *tcb) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; /* Verify that the context switch can be performed */ @@ -109,7 +109,7 @@ void up_unblock_task(struct tcb_s *tcb) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -124,7 +124,7 @@ void up_unblock_task(struct tcb_s *tcb) else { - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ diff --git a/arch/avr/src/avr32/up_blocktask.c b/arch/avr/src/avr32/up_blocktask.c index e72894a289..9939bdaa4a 100644 --- a/arch/avr/src/avr32/up_blocktask.c +++ b/arch/avr/src/avr32/up_blocktask.c @@ -76,7 +76,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; bool switch_needed; /* Verify that the context switch can be performed */ @@ -128,7 +128,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Reset scheduler parameters */ @@ -150,16 +150,16 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * run list. */ - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head; #ifdef CONFIG_ARCH_ADDRENV - /* Make sure that the address environment for the previously - * running task is closed down gracefully (data caches dump, - * MMU flushed) and set up the address environment for the new - * thread at the head of the ready-to-run list. - */ + /* Make sure that the address environment for the previously + * running task is closed down gracefully (data caches dump, + * MMU flushed) and set up the address environment for the new + * thread at the head of the ready-to-run list. + */ - (void)group_addrenv(nexttcb); + (void)group_addrenv(nexttcb); #endif /* Reset scheduler parameters */ diff --git a/arch/avr/src/avr32/up_createstack.c b/arch/avr/src/avr32/up_createstack.c index d6d5b01789..f4ad76a679 100644 --- a/arch/avr/src/avr32/up_createstack.c +++ b/arch/avr/src/avr32/up_createstack.c @@ -190,5 +190,5 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) return OK; } - return ERROR; + return ERROR; } diff --git a/arch/avr/src/avr32/up_doirq.c b/arch/avr/src/avr32/up_doirq.c index c9a5192972..ba0dfe4cca 100644 --- a/arch/avr/src/avr32/up_doirq.c +++ b/arch/avr/src/avr32/up_doirq.c @@ -104,7 +104,7 @@ uint32_t *up_doirq(int irq, uint32_t *regs) #ifdef CONFIG_ARCH_FPU /* Restore floating point registers */ - up_restorefpu((uint32_t*)current_regs); + up_restorefpu((uint32_t *)current_regs); #endif #ifdef CONFIG_ARCH_ADDRENV diff --git a/arch/avr/src/avr32/up_dumpstate.c b/arch/avr/src/avr32/up_dumpstate.c index 4bba418b84..52a5b7a2c7 100644 --- a/arch/avr/src/avr32/up_dumpstate.c +++ b/arch/avr/src/avr32/up_dumpstate.c @@ -100,7 +100,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base) for (stack = sp & ~0x1f; stack < stack_base; stack += 32) { - uint32_t *ptr = (uint32_t*)stack; + uint32_t *ptr = (uint32_t *)stack; lldbg("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); @@ -145,7 +145,7 @@ static inline void up_registerdump(void) void up_dumpstate(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; uint32_t sp = up_getsp(); uint32_t ustackbase; uint32_t ustacksize; diff --git a/arch/avr/src/avr32/up_releasepending.c b/arch/avr/src/avr32/up_releasepending.c index 1abd058a29..d8997f6551 100644 --- a/arch/avr/src/avr32/up_releasepending.c +++ b/arch/avr/src/avr32/up_releasepending.c @@ -65,7 +65,7 @@ void up_release_pending(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; slldbg("From TCB=%p\n", rtcb); @@ -96,7 +96,7 @@ void up_release_pending(void) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -117,7 +117,7 @@ void up_release_pending(void) * ready to run list. */ - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head; #ifdef CONFIG_ARCH_ADDRENV /* Make sure that the address environment for the previously diff --git a/arch/avr/src/avr32/up_reprioritizertr.c b/arch/avr/src/avr32/up_reprioritizertr.c index 6535be5f20..6f35e94c24 100644 --- a/arch/avr/src/avr32/up_reprioritizertr.c +++ b/arch/avr/src/avr32/up_reprioritizertr.c @@ -92,7 +92,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) } else { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; bool switch_needed; slldbg("TCB=%p PRI=%d\n", tcb, priority); @@ -150,7 +150,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -171,7 +171,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) * ready to run list. */ - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head; #ifdef CONFIG_ARCH_ADDRENV /* Make sure that the address environment for the previously diff --git a/arch/avr/src/avr32/up_schedulesigaction.c b/arch/avr/src/avr32/up_schedulesigaction.c index d1166f79c8..cc5db69d1c 100644 --- a/arch/avr/src/avr32/up_schedulesigaction.c +++ b/arch/avr/src/avr32/up_schedulesigaction.c @@ -121,7 +121,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs); - if (tcb == (struct tcb_s*)g_readytorun.head) + if (tcb == (struct tcb_s *)g_readytorun.head) { /* CASE 1: We are not in an interrupt handler and * a task is signalling itself for some reason. diff --git a/arch/avr/src/avr32/up_sigdeliver.c b/arch/avr/src/avr32/up_sigdeliver.c index 43a0af96b1..691fe8cc8f 100644 --- a/arch/avr/src/avr32/up_sigdeliver.c +++ b/arch/avr/src/avr32/up_sigdeliver.c @@ -82,7 +82,7 @@ void up_sigdeliver(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; #if 0 uint32_t regs[XCPTCONTEXT_REGS+3]; /* Why +3? See below */ #else diff --git a/arch/avr/src/avr32/up_unblocktask.c b/arch/avr/src/avr32/up_unblocktask.c index f65942eaef..03c0feeb40 100644 --- a/arch/avr/src/avr32/up_unblocktask.c +++ b/arch/avr/src/avr32/up_unblocktask.c @@ -71,7 +71,7 @@ void up_unblock_task(struct tcb_s *tcb) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; /* Verify that the context switch can be performed */ @@ -110,7 +110,7 @@ void up_unblock_task(struct tcb_s *tcb) * of the g_readytorun task list. */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Update scheduler parameters */ @@ -133,16 +133,16 @@ void up_unblock_task(struct tcb_s *tcb) * g_readytorun task list. */ - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head; #ifdef CONFIG_ARCH_ADDRENV - /* Make sure that the address environment for the previously - * running task is closed down gracefully (data caches dump, - * MMU flushed) and set up the address environment for the new - * thread at the head of the ready-to-run list. - */ + /* Make sure that the address environment for the previously + * running task is closed down gracefully (data caches dump, + * MMU flushed) and set up the address environment for the new + * thread at the head of the ready-to-run list. + */ - (void)group_addrenv(nexttcb); + (void)group_addrenv(nexttcb); #endif /* Update scheduler parameters */ diff --git a/arch/avr/src/common/up_allocateheap.c b/arch/avr/src/common/up_allocateheap.c index b7a60ed670..7e2c03022a 100644 --- a/arch/avr/src/common/up_allocateheap.c +++ b/arch/avr/src/common/up_allocateheap.c @@ -83,6 +83,6 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) { board_led_on(LED_HEAPALLOCATE); - *heap_start = (FAR void*)g_idle_topstack; + *heap_start = (FAR void *)g_idle_topstack; *heap_size = CONFIG_RAM_END - g_idle_topstack; } diff --git a/arch/avr/src/common/up_assert.c b/arch/avr/src/common/up_assert.c index 402556eb31..a1a2295685 100644 --- a/arch/avr/src/common/up_assert.c +++ b/arch/avr/src/common/up_assert.c @@ -105,18 +105,18 @@ static void _up_assert(int errorcode) { /* Are we in an interrupt handler or the idle task? */ - if (current_regs || ((struct tcb_s*)g_readytorun.head)->pid == 0) + if (current_regs || ((struct tcb_s *)g_readytorun.head)->pid == 0) { - (void)irqsave(); - for (;;) - { + (void)irqsave(); + for (; ; ) + { #ifdef CONFIG_ARCH_LEDS - board_led_on(LED_PANIC); - up_mdelay(250); - board_led_off(LED_PANIC); - up_mdelay(250); + board_led_on(LED_PANIC); + up_mdelay(250); + board_led_off(LED_PANIC); + up_mdelay(250); #endif - } + } } else { @@ -160,7 +160,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) void up_assert(const uint8_t *filename, int lineno) { #ifdef CONFIG_PRINT_TASKNAME - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; #endif board_led_on(LED_ASSERTION); diff --git a/arch/avr/src/common/up_exit.c b/arch/avr/src/common/up_exit.c index 74c3d7367c..aac92f61d0 100644 --- a/arch/avr/src/common/up_exit.c +++ b/arch/avr/src/common/up_exit.c @@ -138,7 +138,7 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) void _exit(int status) { - struct tcb_s* tcb; + struct tcb_s *tcb; /* Disable interrupts. They will be restored when the next * task is started. @@ -161,7 +161,7 @@ void _exit(int status) * head of the list. */ - tcb = (struct tcb_s*)g_readytorun.head; + tcb = (struct tcb_s *)g_readytorun.head; #ifdef CONFIG_ARCH_ADDRENV /* Make sure that the address environment for the previously running diff --git a/arch/avr/src/common/up_interruptcontext.c b/arch/avr/src/common/up_interruptcontext.c index ac9525c5cf..1e07bc3999 100644 --- a/arch/avr/src/common/up_interruptcontext.c +++ b/arch/avr/src/common/up_interruptcontext.c @@ -66,5 +66,5 @@ bool up_interrupt_context(void) { - return current_regs != NULL; + return current_regs != NULL; } diff --git a/arch/avr/src/common/up_mdelay.c b/arch/avr/src/common/up_mdelay.c index 5319a4d6a2..1b1a63a4ff 100644 --- a/arch/avr/src/common/up_mdelay.c +++ b/arch/avr/src/common/up_mdelay.c @@ -83,9 +83,9 @@ void up_mdelay(unsigned int milliseconds) for (i = 0; i < milliseconds; i++) { - for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) - { - } + for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) + { + } } } From a92842906fc720f6a34e2781640e79d6ae8f760b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 7 Oct 2015 19:58:05 -0600 Subject: [PATCH 32/33] STM32: Fix a search-and-replace error in previous commit --- arch/arm/src/stm32/stm32f40xxx_rcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/src/stm32/stm32f40xxx_rcc.c b/arch/arm/src/stm32/stm32f40xxx_rcc.c index 6b62df5e33..cf9e987141 100644 --- a/arch/arm/src/stm32/stm32f40xxx_rcc.c +++ b/arch/arm/src/stm32/stm32f40xxx_rcc.c @@ -196,7 +196,7 @@ static inline void rcc_enableahb1(void) #ifdef CONFIG_STM32_ETHMAC /* Ethernet MAC clocking */ - regval | = (RCC_AHB1ENR_ETHMACEN | RCC_AHB1ENR_ETHMACTXEN | RCC_AHB1ENR_ETHMACRXEN); + regval |= (RCC_AHB1ENR_ETHMACEN | RCC_AHB1ENR_ETHMACTXEN | RCC_AHB1ENR_ETHMACRXEN); #ifdef CONFIG_STM32_ETH_PTP /* Precision Time Protocol (PTP) */ From beb060d422990e122b87930d2c7b52664d2b724e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 7 Oct 2015 20:24:19 -0600 Subject: [PATCH 33/33] Yet more spacing issues --- arch/arm/src/kinetis/kinetis_irq.c | 4 ++-- arch/arm/src/lpc2378/lpc23xx_io.c | 10 +++++----- arch/arm/src/lpc31xx/lpc31_spi.c | 2 +- arch/arm/src/lpc43xx/lpc43_ethernet.c | 3 ++- arch/arm/src/lpc43xx/lpc43_irq.c | 4 ++-- arch/arm/src/sam34/sam_irq.c | 4 ++-- arch/arm/src/samv7/sam_irq.c | 4 ++-- arch/arm/src/stm32/stm32_irq.c | 4 ++-- arch/arm/src/stm32f7/stm32_irq.c | 4 ++-- arch/arm/src/tiva/tiva_gpio.c | 2 +- arch/arm/src/tiva/tiva_irq.c | 4 ++-- 11 files changed, 23 insertions(+), 22 deletions(-) diff --git a/arch/arm/src/kinetis/kinetis_irq.c b/arch/arm/src/kinetis/kinetis_irq.c index b70a689f4a..50e66ea705 100644 --- a/arch/arm/src/kinetis/kinetis_irq.c +++ b/arch/arm/src/kinetis/kinetis_irq.c @@ -401,10 +401,10 @@ void up_irqinitialize(void) /* Set the priority of the SVCall interrupt */ #ifdef CONFIG_ARCH_IRQPRIO -/* up_prioritize_irq(KINETIS_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ + /* up_prioritize_irq(KINETIS_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ #endif #ifdef CONFIG_ARMV7M_USEBASEPRI - kinetis_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); + kinetis_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); #endif /* If the MPU is enabled, then attach and enable the Memory Management diff --git a/arch/arm/src/lpc2378/lpc23xx_io.c b/arch/arm/src/lpc2378/lpc23xx_io.c index 8dd17f8d36..94e7f99c54 100644 --- a/arch/arm/src/lpc2378/lpc23xx_io.c +++ b/arch/arm/src/lpc2378/lpc23xx_io.c @@ -53,11 +53,11 @@ ****************************************************************************/ /**************************************************************************** -* Name: IO_Init() -* -* Descriptions: Initialize the target board before running the main() -* -************************************************************************/ + * Name: IO_Init() + * + * Descriptions: Initialize the target board before running the main() + * + ****************************************************************************/ void IO_Init(void) { diff --git a/arch/arm/src/lpc31xx/lpc31_spi.c b/arch/arm/src/lpc31xx/lpc31_spi.c index 6b64863d05..3556b3597c 100644 --- a/arch/arm/src/lpc31xx/lpc31_spi.c +++ b/arch/arm/src/lpc31xx/lpc31_spi.c @@ -606,7 +606,7 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) uint16_t setbits; uint16_t clrbits; -/* Has the mode changed? */ + /* Has the mode changed? */ if (mode != priv->mode) { diff --git a/arch/arm/src/lpc43xx/lpc43_ethernet.c b/arch/arm/src/lpc43xx/lpc43_ethernet.c index aec78c7b5a..c36c87f9c0 100644 --- a/arch/arm/src/lpc43xx/lpc43_ethernet.c +++ b/arch/arm/src/lpc43xx/lpc43_ethernet.c @@ -2975,7 +2975,8 @@ static int lpc43_ioctl(struct net_driver_s *dev, int cmd, long arg) * Function: lpc43_phyintenable * * Description: -* Enable link up/down PHY interrupts. The interrupt protocol is like this: + * Enable link up/down PHY interrupts. The interrupt protocol is like + * this: * * - Interrupt status is cleared when the interrupt is enabled. * - Interrupt occurs. Interrupt is disabled (at the processor level) when diff --git a/arch/arm/src/lpc43xx/lpc43_irq.c b/arch/arm/src/lpc43xx/lpc43_irq.c index bb78263abd..c8178474a4 100644 --- a/arch/arm/src/lpc43xx/lpc43_irq.c +++ b/arch/arm/src/lpc43xx/lpc43_irq.c @@ -376,10 +376,10 @@ void up_irqinitialize(void) /* Set the priority of the SVCall interrupt */ #ifdef CONFIG_ARCH_IRQPRIO -/* up_prioritize_irq(LPC43_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ + /* up_prioritize_irq(LPC43_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ #endif #ifdef CONFIG_ARMV7M_USEBASEPRI - lpc43_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); + lpc43_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); #endif /* If the MPU is enabled, then attach and enable the Memory Management diff --git a/arch/arm/src/sam34/sam_irq.c b/arch/arm/src/sam34/sam_irq.c index efc2ad38f5..54ba87ff88 100644 --- a/arch/arm/src/sam34/sam_irq.c +++ b/arch/arm/src/sam34/sam_irq.c @@ -437,10 +437,10 @@ void up_irqinitialize(void) /* Set the priority of the SVCall interrupt */ #ifdef CONFIG_ARCH_IRQPRIO -/* up_prioritize_irq(SAM_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ + /* up_prioritize_irq(SAM_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ #endif #ifdef CONFIG_ARMV7M_USEBASEPRI - sam_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); + sam_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); #endif /* If the MPU is enabled, then attach and enable the Memory Management diff --git a/arch/arm/src/samv7/sam_irq.c b/arch/arm/src/samv7/sam_irq.c index 772a2b2550..928a7d3b73 100644 --- a/arch/arm/src/samv7/sam_irq.c +++ b/arch/arm/src/samv7/sam_irq.c @@ -437,10 +437,10 @@ void up_irqinitialize(void) /* Set the priority of the SVCall interrupt */ #ifdef CONFIG_ARCH_IRQPRIO -/* up_prioritize_irq(SAM_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ + /* up_prioritize_irq(SAM_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ #endif #ifdef CONFIG_ARMV7M_USEBASEPRI - sam_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); + sam_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); #endif /* If the MPU is enabled, then attach and enable the Memory Management diff --git a/arch/arm/src/stm32/stm32_irq.c b/arch/arm/src/stm32/stm32_irq.c index 0013a2e622..ba51754330 100644 --- a/arch/arm/src/stm32/stm32_irq.c +++ b/arch/arm/src/stm32/stm32_irq.c @@ -384,10 +384,10 @@ void up_irqinitialize(void) /* Set the priority of the SVCall interrupt */ #ifdef CONFIG_ARCH_IRQPRIO -/* up_prioritize_irq(STM32_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ + /* up_prioritize_irq(STM32_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ #endif #ifdef CONFIG_ARMV7M_USEBASEPRI - stm32_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); + stm32_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); #endif /* If the MPU is enabled, then attach and enable the Memory Management diff --git a/arch/arm/src/stm32f7/stm32_irq.c b/arch/arm/src/stm32f7/stm32_irq.c index 15a690068d..bbab860e0e 100644 --- a/arch/arm/src/stm32f7/stm32_irq.c +++ b/arch/arm/src/stm32f7/stm32_irq.c @@ -471,10 +471,10 @@ void up_irqinitialize(void) /* Set the priority of the SVCall interrupt */ #ifdef CONFIG_ARCH_IRQPRIO -/* up_prioritize_irq(STM32_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ + /* up_prioritize_irq(STM32_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ #endif #ifdef CONFIG_ARMV7M_USEBASEPRI - stm32_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); + stm32_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); #endif /* If the MPU is enabled, then attach and enable the Memory Management diff --git a/arch/arm/src/tiva/tiva_gpio.c b/arch/arm/src/tiva/tiva_gpio.c index 112e6b33d9..4291d0b67a 100644 --- a/arch/arm/src/tiva/tiva_gpio.c +++ b/arch/arm/src/tiva/tiva_gpio.c @@ -461,7 +461,7 @@ static inline void tiva_gpiopadstrength(uint32_t base, uint32_t pin, modifyreg32(base + TIVA_GPIO_SLR_OFFSET, slrclr, slrset); #ifdef CONFIG_ARCH_CHIP_TM4C129 -/* TODO: Add TM4C129 registers (TIVA_GPIO_DR12R) */ + /* TODO: Add TM4C129 registers (TIVA_GPIO_DR12R) */ # if 0 /* Set the 12-mA drive select register. This register only appears in * TM4E111 and later device classes, but is a harmless write on older diff --git a/arch/arm/src/tiva/tiva_irq.c b/arch/arm/src/tiva/tiva_irq.c index d399f8ac03..a1434e307b 100644 --- a/arch/arm/src/tiva/tiva_irq.c +++ b/arch/arm/src/tiva/tiva_irq.c @@ -455,10 +455,10 @@ void up_irqinitialize(void) /* Set the priority of the SVCall interrupt */ #ifdef CONFIG_ARCH_IRQPRIO -/* up_prioritize_irq(TIVA_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ + /* up_prioritize_irq(TIVA_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ #endif #ifdef CONFIG_ARMV7M_USEBASEPRI - tiva_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); + tiva_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); #endif /* If the MPU is enabled, then attach and enable the Memory Management