This is an automated email from the ASF dual-hosted git repository. jerpelea pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 2d8a534ef54eac1ec2b46d7a6102af93ee85ab6e Author: Matias Nitsche <[email protected]> AuthorDate: Tue May 12 17:36:48 2020 -0300 nxstyle --- boards/arm/stm32/common/include/stm32_bh1750.h | 2 +- boards/arm/stm32/common/include/stm32_dhtxx.h | 2 +- boards/arm/stm32/common/include/stm32_l3gd20.h | 2 +- boards/arm/stm32/common/src/stm32_dhtxx.c | 6 ++-- boards/arm/stm32/common/src/stm32_lis3dsh.c | 10 +++--- boards/arm/stm32/common/src/stm32_xen1210.c | 8 +++-- boards/arm/stm32/olimex-stm32-p407/include/board.h | 26 ++++++++------- .../olimex-stm32-p407/src/olimex-stm32-p407.h | 37 +++++++++++----------- .../stm32/olimex-stm32-p407/src/stm32_bringup.c | 3 +- .../arm/stm32/stm32f429i-disco/src/stm32_bringup.c | 9 ++++-- 10 files changed, 59 insertions(+), 46 deletions(-) diff --git a/boards/arm/stm32/common/include/stm32_bh1750.h b/boards/arm/stm32/common/include/stm32_bh1750.h index 2f7e723..6af1a54 100644 --- a/boards/arm/stm32/common/include/stm32_bh1750.h +++ b/boards/arm/stm32/common/include/stm32_bh1750.h @@ -1,5 +1,5 @@ /**************************************************************************** - * /home/v01d/coding/nuttx_latest/nuttx/boards/arm/stm32/common/include/stm32_bh1750.h + * boards/arm/stm32/common/include/stm32_bh1750.h * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/boards/arm/stm32/common/include/stm32_dhtxx.h b/boards/arm/stm32/common/include/stm32_dhtxx.h index 123d6e8..6915226 100644 --- a/boards/arm/stm32/common/include/stm32_dhtxx.h +++ b/boards/arm/stm32/common/include/stm32_dhtxx.h @@ -1,5 +1,5 @@ /**************************************************************************** - * /home/v01d/coding/nuttx_latest/nuttx/boards/arm/stm32/common/include/stm32_dhtxx.h + * boards/arm/stm32/common/include/stm32_dhtxx.h * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/boards/arm/stm32/common/include/stm32_l3gd20.h b/boards/arm/stm32/common/include/stm32_l3gd20.h index 9abecb4..0aca79a 100644 --- a/boards/arm/stm32/common/include/stm32_l3gd20.h +++ b/boards/arm/stm32/common/include/stm32_l3gd20.h @@ -1,5 +1,5 @@ /**************************************************************************** - * /home/v01d/coding/nuttx_latest/nuttx/boards/arm/stm32/common/include/stm32_l3gd20.h + * boards/arm/stm32/common/include/stm32_l3gd20.h * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/boards/arm/stm32/common/src/stm32_dhtxx.c b/boards/arm/stm32/common/src/stm32_dhtxx.c index 680198c..08e3342 100644 --- a/boards/arm/stm32/common/src/stm32_dhtxx.c +++ b/boards/arm/stm32/common/src/stm32_dhtxx.c @@ -60,7 +60,8 @@ * Private Function Prototypes ****************************************************************************/ -static void dhtxx_config_data_pin(FAR struct dhtxx_config_s *state, bool mode); +static void dhtxx_config_data_pin(FAR struct dhtxx_config_s *state, + bool mode); static void dhtxx_set_data_pin(FAR struct dhtxx_config_s *state, bool value); static bool dhtxx_read_data_pin(FAR struct dhtxx_config_s *state); static int64_t dhtxx_get_clock(FAR struct dhtxx_config_s *state); @@ -85,7 +86,8 @@ struct timespec ts; * Private Functions ****************************************************************************/ -static void dhtxx_config_data_pin(FAR struct dhtxx_config_s *state, bool mode) +static void dhtxx_config_data_pin(FAR struct dhtxx_config_s *state, + bool mode) { if (mode) { diff --git a/boards/arm/stm32/common/src/stm32_lis3dsh.c b/boards/arm/stm32/common/src/stm32_lis3dsh.c index 0c640a4..a091d3b 100644 --- a/boards/arm/stm32/common/src/stm32_lis3dsh.c +++ b/boards/arm/stm32/common/src/stm32_lis3dsh.c @@ -65,8 +65,8 @@ * on STM32F4Discovery * * Input Parameters: - * *config - The lis3dsh instance configuration data containing the IRQ number, - * device ID and interrupt handler + * config - The lis3dsh instance configuration data containing + * the IRQ number, device ID and interrupt handler * interrupt_handler - The interrupt handler to attach * arg - * @@ -74,11 +74,12 @@ * Zero (OK) on success; a negated errno value on failure. * ****************************************************************************/ + int attach_disc_lis3dsh(FAR struct lis3dsh_config_s *config, xcpt_t interrupt_handler) { - return stm32_gpiosetevent(BOARD_LIS3DSH_GPIO_EXT0, true, false, false, - interrupt_handler, NULL); + return stm32_gpiosetevent(BOARD_LIS3DSH_GPIO_EXT0, true, false, false, + interrupt_handler, NULL); } /**************************************************************************** @@ -127,4 +128,3 @@ int board_lis3dsh_initialize(int devno, int busno) return ret; } - diff --git a/boards/arm/stm32/common/src/stm32_xen1210.c b/boards/arm/stm32/common/src/stm32_xen1210.c index f44e0c8..ffbaa7e 100644 --- a/boards/arm/stm32/common/src/stm32_xen1210.c +++ b/boards/arm/stm32/common/src/stm32_xen1210.c @@ -211,8 +211,8 @@ static void xen1210_clear(FAR struct xen1210_config_s *state) * Name: xen1210_pwm_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/pwm. + * All STM32 architectures must provide the following interface to + * work with examples/pwm. * ****************************************************************************/ @@ -302,7 +302,9 @@ int board_xen1210_initialize(int devno, int busno) /* Instantiate the XEN1210 driver */ g_xen1210config.handle = - xen1210_instantiate(dev, (FAR struct xen1210_config_s *)&g_xen1210config); + xen1210_instantiate(dev, + (FAR struct xen1210_config_s *) + &g_xen1210config); if (!g_xen1210config.handle) { snerr("ERROR: Failed to instantiate the XEN1210 driver\n"); diff --git a/boards/arm/stm32/olimex-stm32-p407/include/board.h b/boards/arm/stm32/olimex-stm32-p407/include/board.h index de08f0a..e906dd5 100644 --- a/boards/arm/stm32/olimex-stm32-p407/include/board.h +++ b/boards/arm/stm32/olimex-stm32-p407/include/board.h @@ -50,7 +50,7 @@ * Pre-processor Definitions ****************************************************************************/ -/* Clocking *************************************************************************/ +/* Clocking *****************************************************************/ /* HSI - 16 MHz RC factory-trimmed * LSI - 32 KHz RC (30-60KHz, uncalibrated) @@ -165,9 +165,10 @@ # define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) #endif -/* LED definitions ******************************************************************/ -/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any - * way. The following definitions are used to access individual LEDs. +/* LED definitions **********************************************************/ + +/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs + * in any way. The following definitions are used to access individual LEDs. */ /* LED index values for use with board_userled() */ @@ -190,8 +191,9 @@ #define BOARD_LED3_BIT (1 << BOARD_LED3) #define BOARD_LED4_BIT (1 << BOARD_LED4) -/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the 4 LEDs on board the - * Olimex STM32-P407. The following definitions describe how NuttX controls the LEDs: +/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the 4 LEDs on + * board the Olimex STM32-P407. The following definitions describe how + * NuttX controls the LEDs: */ #define LED_STARTED 0 /* LED1 */ @@ -203,7 +205,8 @@ #define LED_ASSERTION 6 /* LED1 + LED2 + LED3 */ #define LED_PANIC 7 /* N/C + N/C + N/C + LED4 */ -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ + /* The Olimex STM32-P407 supports seven buttons: */ #define BUTTON_TAMPER 0 @@ -224,7 +227,7 @@ #define BUTTON_DOWN_BIT (1 << BUTTON_DOWN) #define BUTTON_CENTER_BIT (1 << BUTTON_CENTER) -/* Alternate function pin selections ************************************************/ +/* Alternate function pin selections ****************************************/ /* USART3: */ @@ -305,9 +308,10 @@ #define GPIO_ETH_RMII_TXD0 GPIO_ETH_RMII_TXD0_2 #define GPIO_ETH_RMII_TXD1 GPIO_ETH_RMII_TXD1_2 -/* DMA Channel/Stream Selections ****************************************************/ -/* Stream selections are arbitrary for now but might become important in the future - * if we set aside more DMA channels/streams. +/* DMA Channel/Stream Selections ********************************************/ + +/* Stream selections are arbitrary for now but might become important in + * the future if we set aside more DMA channels/streams. * * SDIO DMA * DMAMAP_SDIO_1 = Channel 4, Stream 3 diff --git a/boards/arm/stm32/olimex-stm32-p407/src/olimex-stm32-p407.h b/boards/arm/stm32/olimex-stm32-p407/src/olimex-stm32-p407.h index f8bee0c..3272513 100644 --- a/boards/arm/stm32/olimex-stm32-p407/src/olimex-stm32-p407.h +++ b/boards/arm/stm32/olimex-stm32-p407/src/olimex-stm32-p407.h @@ -64,8 +64,8 @@ #define HAVE_ELF 1 #define HAVE_MODSYMS 1 -/* Can't support MMC/SD features if mountpoints are disabled or if SDIO support - * is not enabled. +/* Can't support MMC/SD features if mountpoints are disabled or if SDIO + * support is not enabled. */ #if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_STM32_SDIO) || \ @@ -144,6 +144,7 @@ #endif /* Olimex-STM32-P407 GPIOs **************************************************/ + /* LEDs */ #define GPIO_LED1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\ @@ -189,7 +190,7 @@ #ifndef __ASSEMBLY__ /**************************************************************************** - * Public Functions + * Public Function Prototypes ****************************************************************************/ /**************************************************************************** @@ -212,25 +213,25 @@ int stm32_bringup(void); * Name: stm32_stram_configure * * Description: - * Initialize to access external SRAM. SRAM will be visible at the FSMC Bank - * NOR/SRAM2 base address (0x64000000) + * Initialize to access external SRAM. SRAM will be visible at the FSMC + * Bank NOR/SRAM2 base address (0x64000000) * - * General transaction rules. The requested AHB transaction data size can be 8-, - * 16- or 32-bit wide whereas the SRAM has a fixed 16-bit data width. Some simple - * transaction rules must be followed: + * General transaction rules. The requested AHB transaction data size can + * be 8-, 16- or 32-bit wide whereas the SRAM has a fixed 16-bit data + * width. Some simple transaction rules must be followed: * * Case 1: AHB transaction width and SRAM data width are equal * There is no issue in this case. * Case 2: AHB transaction size is greater than the memory size - * In this case, the FSMC splits the AHB transaction into smaller consecutive - * memory accesses in order to meet the external data width. + * In this case, the FSMC splits the AHB transaction into smaller + * consecutive memory accesses in order to meet the external data width. * Case 3: AHB transaction size is smaller than the memory size. * SRAM supports the byte select feature. * a) FSMC allows write transactions accessing the right data through its * byte lanes (NBL[1:0]) - * b) Read transactions are allowed (the controller reads the entire memory - * word and uses the needed byte only). The NBL[1:0] are always kept low - * during read transactions. + * b) Read transactions are allowed (the controller reads the entire + * memory word and uses the needed byte only). The NBL[1:0] are always + * kept low during read transactions. * ****************************************************************************/ @@ -242,8 +243,8 @@ void stm32_stram_configure(void); * Name: stm32_usb_configure * * Description: - * Called from stm32_boardinitialize very early in inialization to setup USB-related - * GPIO pins for the Olimex STM32 P407 board. + * Called from stm32_boardinitialize very early in inialization to setup + * USB-related GPIO pins for the Olimex STM32 P407 board. * ****************************************************************************/ @@ -255,9 +256,9 @@ void weak_function stm32_usb_configure(void); * Name: stm32_usbhost_setup * * Description: - * Called at application startup time to initialize the USB host functionality. - * This function will start a thread that will monitor for device connection/ - * disconnection events. + * Called at application startup time to initialize the USB host + * functionality. This function will start a thread that will monitor for + * device connection/disconnection events. * ****************************************************************************/ diff --git a/boards/arm/stm32/olimex-stm32-p407/src/stm32_bringup.c b/boards/arm/stm32/olimex-stm32-p407/src/stm32_bringup.c index 3a54120..8ba3ae8 100644 --- a/boards/arm/stm32/olimex-stm32-p407/src/stm32_bringup.c +++ b/boards/arm/stm32/olimex-stm32-p407/src/stm32_bringup.c @@ -121,6 +121,7 @@ int stm32_bringup(void) #ifdef HAVE_MMCSD /* Mount the SDIO-based MMC/SD block driver */ + /* First, get an instance of the SDIO interface */ sdio = sdio_initialize(MMCSD_SLOTNO); @@ -148,7 +149,7 @@ int stm32_bringup(void) * the slot so we are reduced to guessing. */ - sdio_mediachange(sdio, true); + sdio_mediachange(sdio, true); #endif #ifdef CONFIG_CAN diff --git a/boards/arm/stm32/stm32f429i-disco/src/stm32_bringup.c b/boards/arm/stm32/stm32f429i-disco/src/stm32_bringup.c index 4947d59..a51bf98 100644 --- a/boards/arm/stm32/stm32f429i-disco/src/stm32_bringup.c +++ b/boards/arm/stm32/stm32f429i-disco/src/stm32_bringup.c @@ -157,15 +157,18 @@ int stm32_bringup(void) mtd = sst25xx_initialize(spi); if (!mtd) { - syslog(LOG_ERR, "ERROR: Failed to bind SPI port 4 to the SPI FLASH driver\n"); + syslog(LOG_ERR, "ERROR: Failed to bind SPI port 4 to the SPI FLASH" + " driver\n"); } else { - syslog(LOG_INFO, "Successfully bound SPI port 4 to the SPI FLASH driver\n"); + syslog(LOG_INFO, "Successfully bound SPI port 4 to the SPI FLASH" + " driver\n"); /* Get the geometry of the FLASH device */ - ret = mtd->ioctl(mtd, MTDIOC_GEOMETRY, (unsigned long)((uintptr_t)&geo)); + ret = mtd->ioctl(mtd, MTDIOC_GEOMETRY, + (unsigned long)((uintptr_t)&geo)); if (ret < 0) { ferr("ERROR: mtd->ioctl failed: %d\n", ret);
