diff --git a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_usbhost.c b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_usbhost.c index af174edff0..71dc0b0808 100644 --- a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_usbhost.c +++ b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_usbhost.c @@ -276,7 +276,7 @@ void imxrt_usbhost_vbusdrive(int rhport, bool enable) } } -/**************************************************************************** +/***************************************************************************** * Name: imxrt_setup_overcurrent * * Description: @@ -291,7 +291,7 @@ void imxrt_usbhost_vbusdrive(int rhport, bool enable) * Zero (OK) returned on success; a negated errno value is returned on * failure. * - ****************************************************************************/ + *****************************************************************************/ #if 0 /* Not ready yet */ int imxrt_setup_overcurrent(xcpt_t handler, void *arg) diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_usbhost.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_usbhost.c index 8f59821763..0195c07ca5 100644 --- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_usbhost.c +++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_usbhost.c @@ -274,7 +274,7 @@ void imxrt_usbhost_vbusdrive(int rhport, bool enable) } } -/**************************************************************************** +/***************************************************************************** * Name: imxrt_setup_overcurrent * * Description: @@ -289,7 +289,7 @@ void imxrt_usbhost_vbusdrive(int rhport, bool enable) * Zero (OK) returned on success; a negated errno value is returned on * failure. * - ****************************************************************************/ + *****************************************************************************/ #if 0 /* Not ready yet */ int imxrt_setup_overcurrent(xcpt_t handler, void *arg) diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c index af9687df7b..8c0d993d17 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c @@ -302,7 +302,8 @@ static int nsh_usbhostinitialize(void) if (ret != OK) { syslog(LOG_ERR, - "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + "ERROR: Failed to register the CDC/ACM serial class: %d\n", + ret); } #endif diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_bringup.c index fcc2a8eedb..89723bc19f 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_bringup.c @@ -338,7 +338,8 @@ static int nsh_usbhostinitialize(void) if (ret != OK) { syslog(LOG_ERR, - "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + "ERROR: Failed to register the CDC/ACM serial class: %d\n", + ret); } #endif diff --git a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c index e6d96af8ff..2574198457 100644 --- a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c @@ -291,7 +291,8 @@ static int nsh_usbhostinitialize(void) if (ret != OK) { syslog(LOG_ERR, - "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + "ERROR: Failed to register the CDC/ACM serial class: %d\n", + ret); } #endif diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c index f72befecbc..810a18f362 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c @@ -288,7 +288,8 @@ static int nsh_usbhostinitialize(void) if (ret < 0) { syslog(LOG_ERR, - "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + "ERROR: Failed to register the CDC/ACM serial class: %d\n", + ret); } #endif diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c index 47acf09045..4b83b23251 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c @@ -337,7 +337,8 @@ static int nsh_usbhostinitialize(void) if (ret != OK) { syslog(LOG_ERR, - "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + "ERROR: Failed to register the CDC/ACM serial class: %d\n", + ret); } #endif diff --git a/boards/arm/sama5/sama5d3-xplained/src/sam_usb.c b/boards/arm/sama5/sama5d3-xplained/src/sam_usb.c index 89f195e79a..1e3f04bfa6 100644 --- a/boards/arm/sama5/sama5d3-xplained/src/sam_usb.c +++ b/boards/arm/sama5/sama5d3-xplained/src/sam_usb.c @@ -194,8 +194,8 @@ static int ehci_waiter(int argc, char *argv[]) * USB Ports * The SAMA5D3 series-MB features three USB communication ports: * - * 1. Port A Host High Speed (EHCI) and Full Speed (OHCI) multiplexed with - * USB Device High Speed Micro AB connector, J20 + * 1. Port A Host High Speed (EHCI) and Full Speed (OHCI) multiplexed + * with USB Device High Speed Micro AB connector, J20 * * 2. Port B Host High Speed (EHCI) and Full Speed (OHCI) standard type A * connector, J19 upper port diff --git a/boards/arm/stm32/axoloti/src/stm32_usbhost.c b/boards/arm/stm32/axoloti/src/stm32_usbhost.c index 8490c0e2b2..e8f6efc6b5 100644 --- a/boards/arm/stm32/axoloti/src/stm32_usbhost.c +++ b/boards/arm/stm32/axoloti/src/stm32_usbhost.c @@ -224,6 +224,7 @@ int stm32_usbhost_initialize(void) /* First, register all of the class drivers needed to support the drivers * that we care about: */ + uinfo("Register class drivers\n"); #ifdef CONFIG_USBHOST_MSC diff --git a/boards/arm/stm32/cloudctrl/src/stm32_usb.c b/boards/arm/stm32/cloudctrl/src/stm32_usb.c index 28b8c3e3da..45381b6894 100644 --- a/boards/arm/stm32/cloudctrl/src/stm32_usb.c +++ b/boards/arm/stm32/cloudctrl/src/stm32_usb.c @@ -109,7 +109,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uinfo("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -140,16 +140,20 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32_usbinitialize * * Description: - * Called from stm32_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the STM3240G-EVAL board. + * Called from stm32_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the STM3240G-EVAL board. * ****************************************************************************/ void stm32_usbinitialize(void) { - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ #ifdef CONFIG_STM32_OTGFS stm32_configgpio(GPIO_OTGFS_VBUS); @@ -162,7 +166,8 @@ void stm32_usbinitialize(void) * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * @@ -224,21 +229,24 @@ int stm32_usbhost_initialize(void) * Name: stm32_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG FS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_FS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and + * status register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an overcurrent condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an overcurrent condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: @@ -270,16 +278,16 @@ void stm32_usbhost_vbusdrive(int iface, bool enable) * Name: stm32_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument provided for the interrupt handler * * Returned Value: - * Zero (OK) is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero (OK) is returned on success. Otherwise, a negated errno value + * is returned to indicate the nature of the failure. * ****************************************************************************/ @@ -294,10 +302,10 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) * Name: stm32_usbsuspend * * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32/mikroe-stm32f4/src/stm32_usb.c b/boards/arm/stm32/mikroe-stm32f4/src/stm32_usb.c index f7ad77025f..cfcb8c7fe6 100644 --- a/boards/arm/stm32/mikroe-stm32f4/src/stm32_usb.c +++ b/boards/arm/stm32/mikroe-stm32f4/src/stm32_usb.c @@ -108,7 +108,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uinfo("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -139,16 +139,20 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32_usbinitialize * * Description: - * Called from stm32_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the STM32F4Discovery board. + * Called from stm32_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the STM32F4Discovery board. * ****************************************************************************/ void stm32_usbinitialize(void) { - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ #ifdef CONFIG_STM32_OTGFS stm32_configgpio(GPIO_OTGFS_VBUS); @@ -161,7 +165,8 @@ void stm32_usbinitialize(void) * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * @@ -223,21 +228,24 @@ int stm32_usbhost_initialize(void) * Name: stm32_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG FS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_FS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and + * status register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an overcurrent condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an overcurrent condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: @@ -269,16 +277,16 @@ void stm32_usbhost_vbusdrive(int iface, bool enable) * Name: stm32_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument provided for the interrupt handler * * Returned Value: - * Zero (OK) is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero (OK) is returned on success. Otherwise, a negated errno value + * is returned to indicate the nature of the failure. * ****************************************************************************/ @@ -290,13 +298,13 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) #endif /**************************************************************************** - * Name: stm32_usbsuspend + * Name: stm32_usbsuspend * * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32/nucleo-f207zg/src/stm32_usb.c b/boards/arm/stm32/nucleo-f207zg/src/stm32_usb.c index 02c4415ea0..f7af9fd2db 100644 --- a/boards/arm/stm32/nucleo-f207zg/src/stm32_usb.c +++ b/boards/arm/stm32/nucleo-f207zg/src/stm32_usb.c @@ -105,7 +105,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uinfo("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -136,16 +136,20 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32_usbinitialize * * Description: - * Called from stm32_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the nucleo-144 board. + * Called from stm32_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the nucleo-144 board. * ****************************************************************************/ void stm32_usbinitialize(void) { - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ #ifdef CONFIG_STM32_OTGFS stm32_configgpio(GPIO_OTGFS_VBUS); @@ -158,7 +162,8 @@ void stm32_usbinitialize(void) * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * @@ -253,21 +258,24 @@ int stm32_usbhost_initialize(void) * Name: stm32_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG FS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_FS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and + * status register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an overcurrent condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an overcurrent condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: @@ -290,16 +298,16 @@ void stm32_usbhost_vbusdrive(int iface, bool enable) * Name: stm32_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument provided for the interrupt handler * * Returned Value: - * Zero (OK) is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero (OK) is returned on success. Otherwise, a negated errno value + * is returned to indicate the nature of the failure. * ****************************************************************************/ @@ -311,13 +319,13 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) #endif /**************************************************************************** - * Name: stm32_usbsuspend + * Name: stm32_usbsuspend * * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32/olimex-stm32-e407/src/stm32_usb.c b/boards/arm/stm32/olimex-stm32-e407/src/stm32_usb.c index e74a49c5af..492052537d 100644 --- a/boards/arm/stm32/olimex-stm32-e407/src/stm32_usb.c +++ b/boards/arm/stm32/olimex-stm32-e407/src/stm32_usb.c @@ -104,7 +104,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uinfo("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -142,9 +142,13 @@ static int usbhost_waiter(int argc, char *argv[]) void stm32_usbinitialize(void) { - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ #ifdef CONFIG_STM32_OTGFS stm32_configgpio(GPIO_OTGFS_VBUS); @@ -153,7 +157,7 @@ void stm32_usbinitialize(void) #endif } -/*************************************************************************** +/**************************************************************************** * Name: stm32_usbhost_initialize * * Description: @@ -161,7 +165,7 @@ void stm32_usbinitialize(void) * functionality. This function will start a thread that will monitor * for device connection/disconnection events. * - ***************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST int stm32_usbhost_initialize(void) diff --git a/boards/arm/stm32/olimex-stm32-h407/src/stm32_usb.c b/boards/arm/stm32/olimex-stm32-h407/src/stm32_usb.c index 1c4c6ee595..f547d57fab 100644 --- a/boards/arm/stm32/olimex-stm32-h407/src/stm32_usb.c +++ b/boards/arm/stm32/olimex-stm32-h407/src/stm32_usb.c @@ -105,7 +105,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uinfo("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -136,16 +136,20 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32_usbinitialize * * Description: - * Called from stm32_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the STM32F4Discovery board. + * Called from stm32_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the STM32F4Discovery board. * ****************************************************************************/ void stm32_usbinitialize(void) { - /* The OTG HS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG HS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ #ifdef CONFIG_STM32_OTGHS stm32_configgpio(GPIO_OTGHS_VBUS); @@ -158,7 +162,8 @@ void stm32_usbinitialize(void) * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * @@ -230,21 +235,24 @@ int stm32_usbhost_initialize(void) * Name: stm32_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG HS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_HS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and + * status register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an overcurrent condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an overcurrent condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: @@ -276,16 +284,16 @@ void stm32_usbhost_vbusdrive(int iface, bool enable) * Name: stm32_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument provided for the interrupt handler * * Returned Value: - * Zero (OK) is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero (OK) is returned on success. Otherwise, a negated errno value + * is returned to indicate the nature of the failure. * ****************************************************************************/ @@ -300,10 +308,10 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) * Name: stm32_usbsuspend * * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c b/boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c index 3bf8041dfc..d755da0a0b 100644 --- a/boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c +++ b/boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c @@ -107,7 +107,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uinfo("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -138,16 +138,20 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32_usbinitialize * * Description: - * Called from stm32_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the STM32F4Discovery board. + * Called from stm32_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the STM32F4Discovery board. * ****************************************************************************/ void stm32_usbinitialize(void) { - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, and Power On GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ #ifdef CONFIG_STM32_OTGFS stm32_configgpio(GPIO_OTGFS_VBUS); @@ -160,7 +164,8 @@ void stm32_usbinitialize(void) * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * @@ -234,16 +239,16 @@ int stm32_usbhost_initialize(void) * Name: stm32_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument provided for the interrupt handler * * Returned Value: - * Zero (OK) is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero (OK) is returned on success. Otherwise, a negated errno value + * is returned to indicate the nature of the failure. * ****************************************************************************/ @@ -258,21 +263,24 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) * Name: stm32_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG FS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_FS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and + * status register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an overcurrent condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an overcurrent condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: @@ -304,10 +312,10 @@ void stm32_usbhost_vbusdrive(int iface, bool enable) * Name: stm32_usbsuspend * * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32/olimex-stm32-p407/src/stm32_usb.c b/boards/arm/stm32/olimex-stm32-p407/src/stm32_usb.c index 7494db02c9..96583cfc1f 100644 --- a/boards/arm/stm32/olimex-stm32-p407/src/stm32_usb.c +++ b/boards/arm/stm32/olimex-stm32-p407/src/stm32_usb.c @@ -104,7 +104,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uinfo("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -135,17 +135,21 @@ static int usbhost_waiter(int argc, char *argv[]) * 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_usb_configure very early in inialization to setup + * USB-related GPIO pins for the Olimex STM32 P407 board. * ****************************************************************************/ void stm32_usb_configure(void) { #ifdef CONFIG_STM32_OTGFS - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ stm32_configgpio(GPIO_OTGFS_VBUS); stm32_configgpio(GPIO_OTGFS_PWRON); @@ -157,7 +161,8 @@ void stm32_usb_configure(void) * Name: stm32_usbhost_setup * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * @@ -251,21 +256,24 @@ int stm32_usbhost_setup(void) * Name: stm32_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG FS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_FS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and + * status register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an overcurrent condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an overcurrent condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: @@ -297,16 +305,16 @@ void stm32_usbhost_vbusdrive(int iface, bool enable) * Name: stm32_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument provided for the interrupt handler * * Returned Value: - * Zero (OK) is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero (OK) is returned on success. Otherwise, a negated errno value + * is returned to indicate the nature of the failure. * ****************************************************************************/ @@ -321,10 +329,10 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) * Name: stm32_usbsuspend * * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32/omnibusf4/src/stm32_usb.c b/boards/arm/stm32/omnibusf4/src/stm32_usb.c index 32946a506f..9982bab515 100644 --- a/boards/arm/stm32/omnibusf4/src/stm32_usb.c +++ b/boards/arm/stm32/omnibusf4/src/stm32_usb.c @@ -137,16 +137,20 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32_usbinitialize * * Description: - * Called from stm32_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the Omnibusf4 board. + * Called from stm32_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the Omnibusf4 board. * ****************************************************************************/ void stm32_usbinitialize(void) { - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ #ifdef CONFIG_STM32_OTGFS stm32_configgpio(GPIO_OTGFS_VBUS); @@ -157,7 +161,8 @@ void stm32_usbinitialize(void) * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * @@ -263,21 +268,24 @@ int stm32_usbhost_initialize(void) * Name: stm32_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG FS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_FS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and + * status register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an overcurrent condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an overcurrent condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: @@ -309,16 +317,16 @@ void stm32_usbhost_vbusdrive(int iface, bool enable) * Name: stm32_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument provided for the interrupt handler * * Returned Value: - * Zero (OK) is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero (OK) is returned on success. Otherwise, a negated errno value + * is returned to indicate the nature of the failure. * ****************************************************************************/ @@ -333,10 +341,10 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) * Name: stm32_usbsuspend * * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32/photon/src/stm32_wdt.c b/boards/arm/stm32/photon/src/stm32_wdt.c index b10d796aeb..3c3c1462b3 100644 --- a/boards/arm/stm32/photon/src/stm32_wdt.c +++ b/boards/arm/stm32/photon/src/stm32_wdt.c @@ -82,8 +82,8 @@ static int wdog_daemon(int argc, char *argv[]) ret = file_ioctl(&filestruct, WDIOC_START, 0); if (ret < 0) { - wderr("ERROR: ioctl(WDIOC_START) failed: %d\n", errno); - goto exit_close_dev; + wderr("ERROR: ioctl(WDIOC_START) failed: %d\n", errno); + goto exit_close_dev; } while (1) @@ -101,6 +101,7 @@ static int wdog_daemon(int argc, char *argv[]) } exit_close_dev: + /* Close watchdog device and exit. */ file_close(&filestruct); diff --git a/boards/arm/stm32/shenzhou/src/stm32_usb.c b/boards/arm/stm32/shenzhou/src/stm32_usb.c index 168b28a172..4335249022 100644 --- a/boards/arm/stm32/shenzhou/src/stm32_usb.c +++ b/boards/arm/stm32/shenzhou/src/stm32_usb.c @@ -108,7 +108,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uinfo("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -139,16 +139,20 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32_usbinitialize * * Description: - * Called from stm32_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the STM3240G-EVAL board. + * Called from stm32_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the STM3240G-EVAL board. * ****************************************************************************/ void stm32_usbinitialize(void) { - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ #ifdef CONFIG_STM32_OTGFS stm32_configgpio(GPIO_OTGFS_VBUS); @@ -161,7 +165,8 @@ void stm32_usbinitialize(void) * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * @@ -223,21 +228,24 @@ int stm32_usbhost_initialize(void) * Name: stm32_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG FS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_FS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and + * status register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an overcurrent condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an overcurrent condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: @@ -269,16 +277,16 @@ void stm32_usbhost_vbusdrive(int iface, bool enable) * Name: stm32_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument provided for the interrupt handler * * Returned Value: - * Zero (OK) is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero (OK) is returned on success. Otherwise, a negated errno value + * is returned to indicate the nature of the failure. * ****************************************************************************/ @@ -293,10 +301,10 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) * Name: stm32_usbsuspend * * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32/stm3220g-eval/src/stm32_usb.c b/boards/arm/stm32/stm3220g-eval/src/stm32_usb.c index 6b216403dd..70fd61b2cf 100644 --- a/boards/arm/stm32/stm3220g-eval/src/stm32_usb.c +++ b/boards/arm/stm32/stm3220g-eval/src/stm32_usb.c @@ -108,7 +108,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uinfo("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -139,17 +139,21 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32_usbinitialize * * Description: - * Called from stm32_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the STM3220G-EVAL board. + * Called from stm32_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the STM3220G-EVAL board. * ****************************************************************************/ void stm32_usbinitialize(void) { #ifdef HAVE_USB - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ stm32_configgpio(GPIO_OTGFS_VBUS); stm32_configgpio(GPIO_OTGFS_PWRON); @@ -161,7 +165,8 @@ void stm32_usbinitialize(void) * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * @@ -223,21 +228,24 @@ int stm32_usbhost_initialize(void) * Name: stm32_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG FS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_FS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and + * status register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an overcurrent condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an overcurrent condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: @@ -269,16 +277,16 @@ void stm32_usbhost_vbusdrive(int iface, bool enable) * Name: stm32_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument provided for the interrupt handler * * Returned Value: - * Zero (OK) is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero (OK) is returned on success. Otherwise, a negated errno value + * is returned to indicate the nature of the failure. * ****************************************************************************/ @@ -293,10 +301,10 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) * Name: stm32_usbsuspend * * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32/stm3240g-eval/src/stm32_usb.c b/boards/arm/stm32/stm3240g-eval/src/stm32_usb.c index 98a1f8691d..bdc6994f11 100644 --- a/boards/arm/stm32/stm3240g-eval/src/stm32_usb.c +++ b/boards/arm/stm32/stm3240g-eval/src/stm32_usb.c @@ -108,7 +108,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uinfo("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -139,16 +139,20 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32_usbinitialize * * Description: - * Called from stm32_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the STM3240G-EVAL board. + * Called from stm32_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the STM3240G-EVAL board. * ****************************************************************************/ void stm32_usbinitialize(void) { - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ #ifdef CONFIG_STM32_OTGFS stm32_configgpio(GPIO_OTGFS_VBUS); @@ -161,7 +165,8 @@ void stm32_usbinitialize(void) * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * @@ -223,21 +228,24 @@ int stm32_usbhost_initialize(void) * Name: stm32_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG FS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_FS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and + * status register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an overcurrent condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an overcurrent condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: @@ -269,16 +277,16 @@ void stm32_usbhost_vbusdrive(int iface, bool enable) * Name: stm32_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument provided for the interrupt handler * * Returned Value: - * Zero (OK) is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero (OK) is returned on success. Otherwise, a negated errno value + * is returned to indicate the nature of the failure. * ****************************************************************************/ @@ -293,10 +301,10 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) * Name: stm32_usbsuspend * * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32/stm32f411e-disco/src/stm32_usb.c b/boards/arm/stm32/stm32f411e-disco/src/stm32_usb.c index 421761904e..5346d1fbfa 100644 --- a/boards/arm/stm32/stm32f411e-disco/src/stm32_usb.c +++ b/boards/arm/stm32/stm32f411e-disco/src/stm32_usb.c @@ -104,7 +104,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uinfo("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -135,16 +135,20 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32_usbinitialize * * Description: - * Called from stm32_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the STM32F411 Discovery board. + * Called from stm32_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the STM32F411 board. * ****************************************************************************/ void stm32_usbinitialize(void) { - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ #ifdef CONFIG_STM32_OTGFS stm32_configgpio(GPIO_OTGFS_VBUS); @@ -157,7 +161,8 @@ void stm32_usbinitialize(void) * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * @@ -263,21 +268,24 @@ int stm32_usbhost_initialize(void) * Name: stm32_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG FS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_FS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and + * status register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an overcurrent condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an overcurrent condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: @@ -309,16 +317,16 @@ void stm32_usbhost_vbusdrive(int iface, bool enable) * Name: stm32_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument provided for the interrupt handler * * Returned Value: - * Zero (OK) is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero (OK) is returned on success. Otherwise, a negated errno value + * is returned to indicate the nature of the failure. * ****************************************************************************/ @@ -333,10 +341,10 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) * Name: stm32_usbsuspend * * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32/stm32f429i-disco/src/stm32_usb.c b/boards/arm/stm32/stm32f429i-disco/src/stm32_usb.c index 95dc1ee7f5..7b905e662e 100644 --- a/boards/arm/stm32/stm32f429i-disco/src/stm32_usb.c +++ b/boards/arm/stm32/stm32f429i-disco/src/stm32_usb.c @@ -104,7 +104,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uinfo("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -135,16 +135,20 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32_usbinitialize * * Description: - * Called from stm32_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the STM32F4Discovery board. + * Called from stm32_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the STM32F4Discovery board. * ****************************************************************************/ void stm32_usbinitialize(void) { - /* The OTG HS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG HS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ #ifdef CONFIG_STM32_OTGHS stm32_configgpio(GPIO_OTGHS_VBUS); @@ -157,7 +161,8 @@ void stm32_usbinitialize(void) * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * @@ -229,21 +234,24 @@ int stm32_usbhost_initialize(void) * Name: stm32_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG HS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_HS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and + * status register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an overcurrent condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an overcurrent condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: @@ -275,16 +283,16 @@ void stm32_usbhost_vbusdrive(int iface, bool enable) * Name: stm32_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument provided for the interrupt handler * * Returned Value: - * Zero (OK) is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero (OK) is returned on success. Otherwise, a negated errno value + * is returned to indicate the nature of the failure. * ****************************************************************************/ @@ -299,10 +307,10 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) * Name: stm32_usbsuspend * * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_usb.c b/boards/arm/stm32/stm32f4discovery/src/stm32_usb.c index 0d92f895ee..f3f2682520 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_usb.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_usb.c @@ -104,7 +104,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uinfo("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -135,16 +135,20 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32_usbinitialize * * Description: - * Called from stm32_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the STM32F4Discovery board. + * Called from stm32_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the STM32F4Discovery board. * ****************************************************************************/ void stm32_usbinitialize(void) { - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ #ifdef CONFIG_STM32_OTGFS stm32_configgpio(GPIO_OTGFS_VBUS); @@ -157,7 +161,8 @@ void stm32_usbinitialize(void) * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * @@ -263,21 +268,24 @@ int stm32_usbhost_initialize(void) * Name: stm32_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG FS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_FS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and + * status register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an overcurrent condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an overcurrent condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: @@ -309,16 +317,16 @@ void stm32_usbhost_vbusdrive(int iface, bool enable) * Name: stm32_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument provided for the interrupt handler * * Returned Value: - * Zero (OK) is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero (OK) is returned on success. Otherwise, a negated errno value + * is returned to indicate the nature of the failure. * ****************************************************************************/ @@ -333,10 +341,10 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) * Name: stm32_usbsuspend * * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32/viewtool-stm32f107/src/stm32_max3421e.c b/boards/arm/stm32/viewtool-stm32f107/src/stm32_max3421e.c index 1ec59ac6ae..9414c5f490 100644 --- a/boards/arm/stm32/viewtool-stm32f107/src/stm32_max3421e.c +++ b/boards/arm/stm32/viewtool-stm32f107/src/stm32_max3421e.c @@ -92,7 +92,8 @@ struct viewtool_max3421elower_s * * Interrupts should be configured on the falling edge of nINT. * - * attach - Attach the ADS7843E interrupt handler to the GPIO interrupt + * attach - Attach the ADS7843E interrupt handler to the GPIO + * interrupt * enable - Enable or disable the GPIO interrupt * acknowledge - Acknowledge/clear any pending GPIO interrupt as necessary. */ @@ -101,7 +102,8 @@ static int max3421e_attach(FAR const struct max3421e_lowerhalf_s *lower, xcpt_t isr, FAR void *arg); static void max3421e_enable(FAR const struct max3421e_lowerhalf_s *lower, bool enable); -static void max3421e_acknowledge(FAR const struct max3421e_lowerhalf_s *lower); +static void max3421e_acknowledge + (FAR const struct max3421e_lowerhalf_s *lower); static void max3421e_power(FAR const struct max3421e_lowerhalf_s *lower, bool enable); @@ -149,7 +151,8 @@ static FAR struct usbhost_connection_s *g_usbconn; * interrupts should be configured on both rising and falling edges * so that contact and loss-of-contact events can be detected. * - * attach - Attach the ADS7843E interrupt handler to the GPIO interrupt + * attach - Attach the ADS7843E interrupt handler to the GPIO + * interrupt * enable - Enable or disable the GPIO interrupt * acknowledge - Acknowledge/clear any pending GPIO interrupt as necessary. * power - Enable or disable 5V VBUS power @@ -223,7 +226,8 @@ static void max3421e_enable(FAR const struct max3421e_lowerhalf_s *lower, leave_critical_section(flags); } -static void max3421e_acknowledge(FAR const struct max3421e_lowerhalf_s *lower) +static void max3421e_acknowledge + (FAR const struct max3421e_lowerhalf_s *lower) { /* Does nothing */ } @@ -238,7 +242,7 @@ static void max3421e_power(FAR const struct max3421e_lowerhalf_s *lower, #endif } -/***************************************************************************** +/**************************************************************************** * Name: usbhost_detect * * Description: @@ -251,7 +255,7 @@ static int usbhost_detect(int argc, FAR char *argv[]) uinfo("Starting USB detect thread\n"); - for (;;) + for (; ; ) { CONN_WAIT(g_usbconn, &hport); @@ -365,22 +369,20 @@ int stm32_max3421e_setup(void) #endif #if defined(CONFIG_RNDIS) - { - uint8_t mac[6]; + uint8_t mac[6]; - mac[0] = 0xa0; /* TODO */ - mac[1] = (CONFIG_NETINIT_MACADDR_2 >> (8 * 0)) & 0xff; - mac[2] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 3)) & 0xff; - mac[3] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 2)) & 0xff; - mac[4] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 1)) & 0xff; - mac[5] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 0)) & 0xff; + mac[0] = 0xa0; /* TODO */ + mac[1] = (CONFIG_NETINIT_MACADDR_2 >> (8 * 0)) & 0xff; + mac[2] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 3)) & 0xff; + mac[3] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 2)) & 0xff; + mac[4] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 1)) & 0xff; + mac[5] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 0)) & 0xff; - ret = usbdev_rndis_initialize(mac); - if (ret < 0) - { - uerr("ERROR: Failed to register RNDIS class: %d\n", ret); - } - } + ret = usbdev_rndis_initialize(mac); + if (ret < 0) + { + uerr("ERROR: Failed to register RNDIS class: %d\n", ret); + } #endif #ifdef CONFIG_VIEWTOOL_MAX3421E_RST diff --git a/boards/arm/stm32f7/nucleo-144/src/stm32_usb.c b/boards/arm/stm32f7/nucleo-144/src/stm32_usb.c index 37e4ad3a72..fc085c668e 100644 --- a/boards/arm/stm32f7/nucleo-144/src/stm32_usb.c +++ b/boards/arm/stm32f7/nucleo-144/src/stm32_usb.c @@ -106,7 +106,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uinfo("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -137,16 +137,20 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32_usbinitialize * * Description: - * Called from stm32_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the nucleo-144 board. + * Called from stm32_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the nucleo-144 board. * ****************************************************************************/ void stm32_usbinitialize(void) { - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ #ifdef CONFIG_STM32F7_OTGFS stm32_configgpio(GPIO_OTGFS_VBUS); @@ -155,15 +159,16 @@ void stm32_usbinitialize(void) #endif } -/*********************************************************************************** +/**************************************************************************** * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * - ***********************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST int stm32_usbhost_initialize(void) @@ -250,31 +255,34 @@ int stm32_usbhost_initialize(void) } #endif -/*********************************************************************************** +/**************************************************************************** * Name: stm32_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG FS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_FS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and + * status register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an overcurrent condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an overcurrent condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: * None * - ***********************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST void stm32_usbhost_vbusdrive(int iface, bool enable) @@ -291,16 +299,16 @@ void stm32_usbhost_vbusdrive(int iface, bool enable) * Name: stm32_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument provided for the interrupt handler * * Returned Value: - * Zero (OK) is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero (OK) is returned on success. Otherwise, a negated errno value + * is returned to indicate the nature of the failure. * ****************************************************************************/ @@ -315,10 +323,10 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) * Name: stm32_usbsuspend * * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c b/boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c index 07bb833490..1c2566feda 100644 --- a/boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c +++ b/boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c @@ -104,7 +104,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uinfo("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -135,16 +135,20 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32_usbinitialize * * Description: - * Called from stm32_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the STM32F4Discovery board. + * Called from stm32_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the STM32F4Discovery board. * ****************************************************************************/ void stm32_usbinitialize(void) { - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ #ifdef CONFIG_STM32F7_OTGFS stm32_configgpio(GPIO_OTGFS_VBUS); @@ -156,15 +160,16 @@ void stm32_usbinitialize(void) #endif } -/*********************************************************************************** +/**************************************************************************** * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * - ***********************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST int stm32_usbhost_initialize(void) @@ -251,31 +256,34 @@ int stm32_usbhost_initialize(void) } #endif -/*********************************************************************************** +/**************************************************************************** * Name: stm32_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG FS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_FS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and + * status register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an overcurrent condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an overcurrent condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: * None * - ***********************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST void stm32_usbhost_vbusdrive(int iface, bool enable) @@ -301,16 +309,16 @@ void stm32_usbhost_vbusdrive(int iface, bool enable) * Name: stm32_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument provided for the interrupt handler * * Returned Value: - * Zero (OK) is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero (OK) is returned on success. Otherwise, a negated errno value + * is returned to indicate the nature of the failure. * ****************************************************************************/ @@ -325,10 +333,10 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) * Name: stm32_usbsuspend * * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_usb.c b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_usb.c index d2310a3b18..be7a0a9fc3 100644 --- a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_usb.c +++ b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_usb.c @@ -136,16 +136,20 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32_usbinitialize * * Description: - * Called from stm32_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the nucleo-144 board. + * Called from stm32_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the nucleo-144 board. * ****************************************************************************/ void stm32_usbinitialize(void) { - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ #ifdef CONFIG_STM32H7_OTGFS stm32_configgpio(GPIO_OTGFS_VBUS); @@ -154,15 +158,16 @@ void stm32_usbinitialize(void) #endif } -/*********************************************************************************** +/**************************************************************************** * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * - ***********************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST int stm32_usbhost_initialize(void) @@ -249,31 +254,34 @@ int stm32_usbhost_initialize(void) } #endif -/*********************************************************************************** +/**************************************************************************** * Name: stm32_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG FS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_FS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and status + * register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an overcurrent condition." + * "The application uses this field to control power to this port, and + * the core clears this bit on an overcurrent condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: * None * - ***********************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST void stm32_usbhost_vbusdrive(int iface, bool enable) @@ -290,16 +298,16 @@ void stm32_usbhost_vbusdrive(int iface, bool enable) * Name: stm32_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument provided for the interrupt handler * * Returned Value: - * Zero (OK) is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero (OK) is returned on success. Otherwise, a negated errno value + * is returned to indicate the nature of the failure. * ****************************************************************************/ @@ -314,10 +322,10 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) * Name: stm32_usbsuspend * * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32l4/nucleo-l496zg/src/stm32_usb.c b/boards/arm/stm32l4/nucleo-l496zg/src/stm32_usb.c index a41b884d65..2f14c54835 100644 --- a/boards/arm/stm32l4/nucleo-l496zg/src/stm32_usb.c +++ b/boards/arm/stm32l4/nucleo-l496zg/src/stm32_usb.c @@ -106,7 +106,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uinfo("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -137,16 +137,20 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32_usbinitialize * * Description: - * Called from stm32_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the nucleo-144 board. + * Called from stm32_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the nucleo-144 board. * ****************************************************************************/ void stm32_usbinitialize(void) { - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Overcurrent GPIOs + */ #ifdef CONFIG_STM32L4_OTGFS stm32l4_configgpio(GPIO_OTGFS_VBUS); @@ -155,15 +159,16 @@ void stm32_usbinitialize(void) #endif } -/*********************************************************************************** +/**************************************************************************** * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * - ***********************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST int stm32_usbhost_initialize(void) @@ -250,31 +255,34 @@ int stm32_usbhost_initialize(void) } #endif -/*********************************************************************************** +/**************************************************************************** * Name: stm32_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG FS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_FS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and status + * register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an overcurrent condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an overcurrent condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: * None * - ***********************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST void stm32_usbhost_vbusdrive(int iface, bool enable) @@ -291,23 +299,24 @@ void stm32_usbhost_vbusdrive(int iface, bool enable) * Name: stm32_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument provided for the interrupt handler * * Returned Value: - * Zero (OK) is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero (OK) is returned on success. Otherwise, a negated errno value + * is returned to indicate the nature of the failure. * ****************************************************************************/ #ifdef CONFIG_USBHOST int stm32_setup_overcurrent(xcpt_t handler, void *arg) { - return stm32l4_gpiosetevent(GPIO_OTGFS_OVER, true, true, true, handler, arg); + return stm32l4_gpiosetevent(GPIO_OTGFS_OVER, + true, true, true, handler, arg); } #endif @@ -315,10 +324,10 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) * Name: stm32_usbsuspend * * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_usb.c b/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_usb.c index b96393a95a..85e60fc83a 100644 --- a/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_usb.c +++ b/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_usb.c @@ -104,7 +104,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uvdbg("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -135,16 +135,20 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32l4_usbinitialize * * Description: - * Called from stm32l4_usbinitialize very early in initialization to setup USB-related - * GPIO pins for the STM32L4Discovery board. + * Called from stm32l4_usbinitialize very early in initialization to + * setup USB-related GPIO pins for the STM32L4Discovery board. * ****************************************************************************/ void stm32l4_usbinitialize(void) { - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Over current GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Over current GPIOs + */ #ifdef CONFIG_STM32L4_OTGFS stm32l4_configgpio(GPIO_OTGFS_VBUS); @@ -158,7 +162,7 @@ void stm32l4_usbinitialize(void) * * Description: * Called at application startup time to initialize the USB host -* functionality. + * functionality. * This function will start a thread that will monitor for device * connection/disconnection events. * @@ -249,31 +253,33 @@ int stm32l4_usbhost_initialize(void) } #endif -/***************************************************************************** +/**************************************************************************** * Name: stm32l4_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG FS host interface + * Enable/disable driving of VBUS 5V output. This function must be provided + * be each platform that implements the STM32 OTG FS host interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_FS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a charge + * pump or, if 5 V are available on the application board, a basic power + * switch, must be added externally to drive the 5 V VBUS line. The + * external charge pump can be driven by any GPIO output. When the + * application decides to power on VBUS using the chosen GPIO, it must + * also set the port power bit in the host port control and status + * register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an over current condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an over current condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: * None * - *****************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST void stm32l4_usbhost_vbusdrive(int iface, bool enable) @@ -299,8 +305,8 @@ void stm32l4_usbhost_vbusdrive(int iface, bool enable) * Name: stm32l4_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an over current condition is - * detected. + * Setup to receive an interrupt-level callback if an over current + * condition is detected. * * Input Parameters: * handler - New over current interrupt handler @@ -322,10 +328,10 @@ xcpt_t stm32l4_setup_overcurrent(xcpt_t handler) * Name: stm32l4_usbsuspend * * Description: - * Board logic must provide the stm32l4_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32l4_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_usb.c b/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_usb.c index 1c7a56a1f2..76cb99eb39 100644 --- a/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_usb.c +++ b/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_usb.c @@ -104,7 +104,7 @@ static int usbhost_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; uvdbg("Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -135,16 +135,20 @@ static int usbhost_waiter(int argc, char *argv[]) * Name: stm32l4_usbinitialize * * Description: - * Called from stm32l4_usbinitialize very early in initialization to setup USB-related - * GPIO pins for the STM32L4Discovery board. + * Called from stm32l4_usbinitialize very early in initialization to setup + * USB-related GPIO pins for the STM32L4Discovery board. * ****************************************************************************/ void stm32l4_usbinitialize(void) { - /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + /* The OTG FS has an internal soft pull-up. + * No GPIO configuration is required + */ - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Over current GPIOs */ + /* Configure the OTG FS VBUS sensing GPIO, + * Power On, and Over current GPIOs + */ #ifdef CONFIG_STM32L4_OTGFS stm32l4_configgpio(GPIO_OTGFS_VBUS); @@ -153,15 +157,16 @@ void stm32l4_usbinitialize(void) #endif } -/*********************************************************************************** +/**************************************************************************** * Name: stm32l4_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * 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. * - ***********************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST int stm32l4_usbhost_initialize(void) @@ -248,31 +253,34 @@ int stm32l4_usbhost_initialize(void) } #endif -/*********************************************************************************** +/**************************************************************************** * Name: stm32l4_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided be - * each platform that implements the STM32 OTG FS host interface + * Enable/disable driving of VBUS 5V output. This function must be + * provided be each platform that implements the STM32 OTG FS host + * interface * - * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump - * or, if 5 V are available on the application board, a basic power switch, must - * be added externally to drive the 5 V VBUS line. The external charge pump can - * be driven by any GPIO output. When the application decides to power on VBUS - * using the chosen GPIO, it must also set the port power bit in the host port - * control and status register (PPWR bit in OTG_FS_HPRT). + * "On-chip 5 V VBUS generation is not supported. For this reason, a + * charge pump or, if 5 V are available on the application board, a + * basic power switch, must be added externally to drive the 5 V VBUS + * line. The external charge pump can be driven by any GPIO output. + * When the application decides to power on VBUS using the chosen GPIO, + * it must also set the port power bit in the host port control and + * status register (PPWR bit in OTG_FS_HPRT). * - * "The application uses this field to control power to this port, and the core - * clears this bit on an over current condition." + * "The application uses this field to control power to this port, + * and the core clears this bit on an over current condition." * * Input Parameters: - * iface - For future growth to handle multiple USB host interface. Should be zero. + * iface - For future growth to handle multiple USB host interface. + * Should be zero. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: * None * - ***********************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_USBHOST void stm32l4_usbhost_vbusdrive(int iface, bool enable) @@ -298,8 +306,8 @@ void stm32l4_usbhost_vbusdrive(int iface, bool enable) * Name: stm32l4_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an over current condition is - * detected. + * Setup to receive an interrupt-level callback if an over current + * condition is detected. * * Input Parameters: * handler - New over current interrupt handler @@ -321,10 +329,10 @@ xcpt_t stm32l4_setup_overcurrent(xcpt_t handler) * Name: stm32l4_usbsuspend * * Description: - * Board logic must provide the stm32l4_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the stm32l4_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. This is an opportunity for the board logic to + * shutdown clocks, power, etc. while the USB is suspended. * ****************************************************************************/ diff --git a/boards/mips/pic32mx/pic32mx-starterkit/src/pic32mx_appinit.c b/boards/mips/pic32mx/pic32mx-starterkit/src/pic32mx_appinit.c index 6ea42b7564..bc7b7708aa 100644 --- a/boards/mips/pic32mx/pic32mx-starterkit/src/pic32mx_appinit.c +++ b/boards/mips/pic32mx/pic32mx-starterkit/src/pic32mx_appinit.c @@ -301,7 +301,8 @@ static int nsh_usbhostinitialize(void) if (ret != OK) { syslog(LOG_ERR, - "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + "ERROR: Failed to register the CDC/ACM serial class: %d\n", + ret); } #endif diff --git a/boards/mips/pic32mx/pic32mx7mmb/src/pic32_bringup.c b/boards/mips/pic32mx/pic32mx7mmb/src/pic32_bringup.c index 404d25562b..d7f505f6f8 100644 --- a/boards/mips/pic32mx/pic32mx7mmb/src/pic32_bringup.c +++ b/boards/mips/pic32mx/pic32mx7mmb/src/pic32_bringup.c @@ -66,7 +66,9 @@ #define NSH_HAVEMMCSD 1 #define NSH_HAVEUSBHOST 1 -/* The Mikroelektronika PIC32MX7 MMB has one SD slot on board, connected to SPI 1. */ +/* The Mikroelektronika PIC32MX7 MMB has one SD slot on board, + * connected to SPI 1. + */ #ifndef CONFIG_PIC32MX_MMCSDSPIPORTNO # define CONFIG_PIC32MX_MMCSDSPIPORTNO 1 @@ -312,7 +314,8 @@ static int nsh_usbhostinitialize(void) if (ret != OK) { syslog(LOG_ERR, - "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + "ERROR: Failed to register the CDC/ACM serial class: %d\n", + ret); } #endif @@ -331,6 +334,7 @@ static int nsh_usbhostinitialize(void) (main_t)nsh_waiter, (FAR char * const *)NULL); return pid < 0 ? -ENOEXEC : OK; } + return -ENODEV; } #else diff --git a/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_appinit.c b/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_appinit.c index 874f0ffa83..0cef0323f7 100644 --- a/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_appinit.c +++ b/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_appinit.c @@ -307,7 +307,8 @@ static int nsh_usbhostinitialize(void) if (ret != OK) { syslog(LOG_ERR, - "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + "ERROR: Failed to register the CDC/ACM serial class: %d\n", + ret); } #endif @@ -327,6 +328,7 @@ static int nsh_usbhostinitialize(void) (main_t)nsh_waiter, (FAR char * const *)NULL); return pid < 0 ? -ENOEXEC : OK; } + return -ENODEV; } #else diff --git a/graphics/nxmu/nxmu_start.c b/graphics/nxmu/nxmu_start.c index b723a401cb..bcc2ef526a 100644 --- a/graphics/nxmu/nxmu_start.c +++ b/graphics/nxmu/nxmu_start.c @@ -196,13 +196,13 @@ int nxmu_start(int display, int plane) { FAR char display_str[8]; FAR char plane_str[8]; + pid_t server; FAR char * const argv[3] = { (FAR char * const)display_str, (FAR char * const)plane_str, NULL }; - pid_t server; /* Start the server kernel thread */ @@ -225,7 +225,7 @@ int nxmu_start(int display, int plane) * this operation cannot be done from the IDLE thread! */ - nxsig_usleep(50*1000); + nxsig_usleep(50 * 1000); } return OK; diff --git a/include/nuttx/kthread.h b/include/nuttx/kthread.h index 9f745483c4..b68e043c09 100644 --- a/include/nuttx/kthread.h +++ b/include/nuttx/kthread.h @@ -105,13 +105,13 @@ extern "C" int nxtask_create(FAR const char *name, int priority, int stack_size, main_t entry, FAR char * const argv[]); -/******************************************************************************** +/**************************************************************************** * Name: kthread_create * * Description: - * This function creates and activates a kernel thread task with kernel-mode - * privileges. It is identical to task_create() except that it configures the - * newly started thread to run in kernel model. + * This function creates and activates a kernel thread task with + * kernel-mode privileges. It is identical to task_create() except + * that it configures the newly started thread to run in kernel model. * * Input Parameters: * name - Name of the new task @@ -127,7 +127,7 @@ int nxtask_create(FAR const char *name, int priority, * errno value to indicate the nature of any failure. If memory is * insufficient or the task cannot be created -ENOMEM will be returned. * - ********************************************************************************/ + ****************************************************************************/ int kthread_create(FAR const char *name, int priority, int stack_size, main_t entry, FAR char * const argv[]);