arch/arm/src/nrf52: fix coding standard issues

This commit is contained in:
raiden00pl 2020-03-27 17:56:57 +01:00 committed by patacongo
parent fef7abb598
commit d217b3a889
19 changed files with 57 additions and 78 deletions

View File

@ -58,20 +58,4 @@
#define ARMV7M_PERIPHERAL_INTERRUPTS NRF52_IRQ_NEXTINT
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/************************************************************************************
* Public Types
************************************************************************************/
/************************************************************************************
* Public Data
************************************************************************************/
/************************************************************************************
* Public Functions
************************************************************************************/
#endif /* __ARCH_ARM_SRC_NRF52_CHIP_H */

View File

@ -63,7 +63,7 @@
* clocking using the settings in board.h. This function also performs
* other low-level chip as necessary.
*
*****************************************************************************/
****************************************************************************/
void nrf52_clockconfig()
{

View File

@ -49,15 +49,9 @@
/* Frequencies of internal clocks */
#define NRF52_SYSTEM_CLOCK 64000000 /* Default System clock value */
#define NRF52_RTC_CLOCK 32768 /* RTC oscillator 32 kHz output (32k_clk )*/
/****************************************************************************
* Public Types
****************************************************************************/
/****************************************************************************
* Inline Functions
****************************************************************************/
#define NRF52_RTC_CLOCK 32768 /* RTC oscillator 32 kHz output
* (32k_clk)
*/
#ifndef __ASSEMBLY__
@ -87,7 +81,7 @@ extern "C"
* clocking using the settings in board.h. This function also performs
* other low-level chip as necessary.
*
*****************************************************************************/
****************************************************************************/
void nrf52_clockconfig(void);

View File

@ -49,7 +49,7 @@
* Pre-processor Definitions
************************************************************************************/
/* Configuration *********************************************************************/
/* Configuration ********************************************************************/
/* Make sure that no unsupported UART, I2C master, or SPI master peripherals are
* enabled.
@ -95,8 +95,4 @@
# define HAVE_UART_CONSOLE 1
#endif
/************************************************************************************
* Public Functions
************************************************************************************/
#endif /* __ARCH_ARM_SRC_NRF52_NRF52_CONFIG_H */

View File

@ -202,7 +202,7 @@ extern "C"
#endif
/************************************************************************************
* Public Functions
* Public Function Prototypes
************************************************************************************/
/************************************************************************************

View File

@ -46,10 +46,6 @@
#include "chip.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Function Prototypes
****************************************************************************/

View File

@ -85,7 +85,7 @@ struct nrf52_i2c_priv_s
uint32_t freq; /* Current I2C frequency */
int dcnt; /* Current message length */
uint16_t flags; /* Current message flags */
uint16_t addr; /* Current I2C address*/
uint16_t addr; /* Current I2C address */
sem_t sem_excl; /* Mutual exclusion semaphore */
#ifndef CONFIG_I2C_POLLED
sem_t sem_isr; /* Interrupt wait semaphore */

View File

@ -45,10 +45,6 @@
#include "chip.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Function Prototypes
****************************************************************************/

View File

@ -124,21 +124,30 @@ static void nrf52_dumpnvic(const char *msg, int irq)
getreg32(NVIC_SYSTICK_CTRL_ENABLE));
#endif
irqinfo(" IRQ ENABLE: %08x %08x\n",
getreg32(NVIC_IRQ0_31_ENABLE), getreg32(NVIC_IRQ32_63_ENABLE));
getreg32(NVIC_IRQ0_31_ENABLE),
getreg32(NVIC_IRQ32_63_ENABLE));
irqinfo(" SYSH_PRIO: %08x %08x %08x\n",
getreg32(NVIC_SYSH4_7_PRIORITY), getreg32(NVIC_SYSH8_11_PRIORITY),
getreg32(NVIC_SYSH4_7_PRIORITY),
getreg32(NVIC_SYSH8_11_PRIORITY),
getreg32(NVIC_SYSH12_15_PRIORITY));
irqinfo(" IRQ PRIO: %08x %08x %08x %08x\n",
getreg32(NVIC_IRQ0_3_PRIORITY), getreg32(NVIC_IRQ4_7_PRIORITY),
getreg32(NVIC_IRQ8_11_PRIORITY), getreg32(NVIC_IRQ12_15_PRIORITY));
getreg32(NVIC_IRQ0_3_PRIORITY),
getreg32(NVIC_IRQ4_7_PRIORITY),
getreg32(NVIC_IRQ8_11_PRIORITY),
getreg32(NVIC_IRQ12_15_PRIORITY));
irqinfo(" %08x %08x %08x %08x\n",
getreg32(NVIC_IRQ16_19_PRIORITY), getreg32(NVIC_IRQ20_23_PRIORITY),
getreg32(NVIC_IRQ24_27_PRIORITY), getreg32(NVIC_IRQ28_31_PRIORITY));
getreg32(NVIC_IRQ16_19_PRIORITY),
getreg32(NVIC_IRQ20_23_PRIORITY),
getreg32(NVIC_IRQ24_27_PRIORITY),
getreg32(NVIC_IRQ28_31_PRIORITY));
irqinfo(" %08x %08x %08x %08x\n",
getreg32(NVIC_IRQ32_35_PRIORITY), getreg32(NVIC_IRQ36_39_PRIORITY),
getreg32(NVIC_IRQ40_43_PRIORITY), getreg32(NVIC_IRQ44_47_PRIORITY));
getreg32(NVIC_IRQ32_35_PRIORITY),
getreg32(NVIC_IRQ36_39_PRIORITY),
getreg32(NVIC_IRQ40_43_PRIORITY),
getreg32(NVIC_IRQ44_47_PRIORITY));
irqinfo(" %08x %08x %08x\n",
getreg32(NVIC_IRQ48_51_PRIORITY), getreg32(NVIC_IRQ52_55_PRIORITY),
getreg32(NVIC_IRQ48_51_PRIORITY),
getreg32(NVIC_IRQ52_55_PRIORITY),
getreg32(NVIC_IRQ56_59_PRIORITY));
leave_critical_section(flags);

View File

@ -43,7 +43,7 @@
#include <nuttx/config.h>
/****************************************************************************
* Public Functions
* Public Function Prototypes
****************************************************************************/
/****************************************************************************

View File

@ -135,10 +135,10 @@ static void nrf52_setbaud(uintptr_t base, const struct uart_config_s *config)
* Name: nrf52_lowsetup
*
* Description:
* Called at the very beginning of _start. Performs low level initialization
* including setup of the console UART. This UART initialization is done
* early so that the serial console is available for debugging very early in
* the boot sequence.
* Called at the very beginning of _start. Performs low level
* initialization including setup of the console UART.
* This UART initialization is done early so that the serial console is
* available for debugging very early in the boot sequence.
*
****************************************************************************/
@ -163,7 +163,8 @@ void nrf52_lowsetup(void)
****************************************************************************/
#ifdef HAVE_UART_DEVICE
void nrf52_usart_configure(uintptr_t base, const struct uart_config_s *config)
void nrf52_usart_configure(uintptr_t base,
const struct uart_config_s *config)
{
uint32_t pin = 0;
uint32_t port = 0;

View File

@ -71,7 +71,7 @@ struct uart_config_s
#endif
/****************************************************************************
* Public Functions
* Public Function Prototypes
****************************************************************************/
/****************************************************************************

View File

@ -329,10 +329,10 @@ static void nrf52_shutdown(struct uart_dev_s *dev)
* Name: nrf52_attach
*
* Description:
* Configure the UART to operation in interrupt driven mode. This method is
* called when the serial port is opened. Normally, this is just after the
* the setup() method is called, however, the serial console may operate in
* a non-interrupt driven mode during the boot phase.
* Configure the UART to operation in interrupt driven mode. This method
* is called when the serial port is opened. Normally, this is just after
* the the setup() method is called, however, the serial console may
* operate in a non-interrupt driven mode during the boot phase.
*
* RX and TX interrupts are not enabled when by the attach method (unless
* the hardware supports multiple levels of interrupt enabling).
@ -364,8 +364,8 @@ static int nrf52_attach(struct uart_dev_s *dev)
*
* Description:
* Detach UART interrupts. This method is called when the serial port is
* closed normally just before the shutdown method is called. The exception
* is the serial console which is never shutdown.
* closed normally just before the shutdown method is called.
* The exception is the serial console which is never shutdown.
*
****************************************************************************/

View File

@ -44,7 +44,7 @@
#include "nrf52_config.h"
/****************************************************************************
* Public Functions
* Public Function Prototypes
****************************************************************************/
/****************************************************************************

View File

@ -84,7 +84,9 @@ struct nrf52_spidev_s
uint32_t frequency; /* Requested clock frequency */
uint8_t mode; /* Mode 0,1,2,3 */
sem_t exclsem; /* Held while chip is selected for mutual exclusion */
sem_t exclsem; /* Held while chip is selected for mutual
* exclusion
*/
#ifdef CONFIG_NRF52_SPI_MASTER_INTERRUPTS
sem_t sem_isr; /* Interrupt wait semaphore */
#endif

View File

@ -45,10 +45,6 @@
#include "chip.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
@ -84,14 +80,14 @@ FAR struct spi_dev_s *nrf52_spibus_initialize(int port);
* pins.
* 2. Provide nrf52_spi0/1/...select() and nrf52_spi0/1/...status()
* functions in your board-specific logic. These functions will perform
* chip selection and status operations using GPIOs in the way your board
* is configured.
* chip selection and status operations using GPIOs in the way your
* board is configured.
* 3. If CONFIG_SPI_CMDDATA is defined in your NuttX configuration file,
* then provide nrf52_spi0/1/...cmddata() functions in your
* board-specific logic. These functions will perform cmd/data selection
* operations using GPIOs in the way your board is configured.
* 4. Add a calls to nrf52_spibus_initialize() in your low level application
* initialization logic
* 4. Add a calls to nrf52_spibus_initialize() in your low level
* application initialization logic.
* 5. The handle returned by nrf52_spibus_initialize() may then be used to
* bind the SPI driver to higher level logic (e.g., calling
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to

View File

@ -33,6 +33,10 @@
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>

View File

@ -55,8 +55,8 @@
* Name: nrf52_clrpend
*
* Description:
* Clear a pending interrupt at the NVIC. This does not seem to be required
* for most interrupts.
* Clear a pending interrupt at the NVIC. This does not seem to be
* required for most interrupts.
*
* This function is logically a part of nrf52_irq.c, but I will keep it in
* a separate file so that it will not increase the footprint on NRF52
@ -76,7 +76,8 @@ void nrf52_clrpend(int irq)
}
else if (irq < NRF52_IRQ_NIRQS)
{
putreg32(1 << (irq - NRF52_IRQ_EXTINT - 32), NVIC_IRQ32_63_CLRPEND);
putreg32(1 << (irq - NRF52_IRQ_EXTINT - 32),
NVIC_IRQ32_63_CLRPEND);
}
}
}

View File

@ -55,7 +55,7 @@ enum wdt_behaviour_e
};
/****************************************************************************
* Public Functions
* Public Function Prototypes
****************************************************************************/
#undef EXTERN