Correct some coding standard problems in last PR.

This commit is contained in:
Gregory Nutt 2019-06-21 10:42:21 -06:00
parent a54f9d5b2a
commit 0e9b71d925
3 changed files with 22 additions and 13 deletions

View File

@ -63,6 +63,7 @@
#endif #endif
/* Nucleo-144 GPIO Pin Definitions **************************************************/ /* Nucleo-144 GPIO Pin Definitions **************************************************/
/* LED /* LED
* *
* The Nucleo-144 board has numerous LEDs but only three, LD1 a Green LED, LD2 a * The Nucleo-144 board has numerous LEDs but only three, LD1 a Green LED, LD2 a

View File

@ -68,7 +68,7 @@
* arg - The boardctl() argument is passed to the board_app_initialize() * arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no * implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract * meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initalization logic and the * between the board-specific initialization logic and the
* matching application logic. The value cold be such things as a * matching application logic. The value cold be such things as a
* mode enumeration value, a set of DIP switch switch settings, a * mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH, * pointer to configuration data read from a file or serial FLASH,
@ -157,13 +157,13 @@ int board_app_initialize(uintptr_t arg)
ret = stm32_spidev_bus_test(); ret = stm32_spidev_bus_test();
if (ret != OK) if (ret != OK)
{ {
syslog(LOG_ERR, "ERROR: Failed to initialize SPI interfaces: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to initialize SPI interfaces: %d\n",
ret);
return ret; return ret;
} }
#endif #endif
#if defined(CONFIG_MMCSD) #if defined(CONFIG_MMCSD)
/* Configure SDIO */
/* Initialize the SDIO block driver */ /* Initialize the SDIO block driver */
ret = stm32_sdio_initialize(); ret = stm32_sdio_initialize();

View File

@ -4,7 +4,7 @@
* Copyright (C) 2017-2018 Gregory Nutt. All rights reserved. * Copyright (C) 2017-2018 Gregory Nutt. All rights reserved.
* Copyright (C) 2017 Alan Carvalho de Assis. All rights reserved. * Copyright (C) 2017 Alan Carvalho de Assis. All rights reserved.
* Author: Alan Carvalho de Assis <acassis@gmail.com> * Author: Alan Carvalho de Assis <acassis@gmail.com>
* Author: Philippe Coval <p.coval@samsung.com> * Author: Philippe Coval <p.coval@samsung.com>
* *
* Based on: configs/stm32f103-minimum/src/stm32_gpio.c * Based on: configs/stm32f103-minimum/src/stm32_gpio.c
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@ -155,18 +155,21 @@ static struct stm32gpint_dev_s g_gpint[BOARD_NGPIOINT];
static int stm32gpio_interrupt(int irq, void *context, void *arg) static int stm32gpio_interrupt(int irq, void *context, void *arg)
{ {
FAR struct stm32gpint_dev_s *stm32gpint = (FAR struct stm32gpint_dev_s *)arg; FAR struct stm32gpint_dev_s *stm32gpint =
(FAR struct stm32gpint_dev_s *)arg;
DEBUGASSERT(stm32gpint != NULL && stm32gpint->callback != NULL); DEBUGASSERT(stm32gpint != NULL && stm32gpint->callback != NULL);
gpioinfo("Interrupt! callback=%p\n", stm32gpint->callback); gpioinfo("Interrupt! callback=%p\n", stm32gpint->callback);
stm32gpint->callback(&stm32gpint->stm32gpio.gpio, stm32gpint->stm32gpio.id); stm32gpint->callback(&stm32gpint->stm32gpio.gpio,
stm32gpint->stm32gpio.id);
return OK; return OK;
} }
static int gpin_read(FAR struct gpio_dev_s *dev, FAR bool *value) static int gpin_read(FAR struct gpio_dev_s *dev, FAR bool *value)
{ {
FAR struct stm32gpio_dev_s *stm32gpio = (FAR struct stm32gpio_dev_s *)dev; FAR struct stm32gpio_dev_s *stm32gpio =
(FAR struct stm32gpio_dev_s *)dev;
DEBUGASSERT(stm32gpio != NULL && value != NULL); DEBUGASSERT(stm32gpio != NULL && value != NULL);
DEBUGASSERT(stm32gpio->id < BOARD_NGPIOIN); DEBUGASSERT(stm32gpio->id < BOARD_NGPIOIN);
@ -178,7 +181,8 @@ static int gpin_read(FAR struct gpio_dev_s *dev, FAR bool *value)
static int gpout_read(FAR struct gpio_dev_s *dev, FAR bool *value) static int gpout_read(FAR struct gpio_dev_s *dev, FAR bool *value)
{ {
FAR struct stm32gpio_dev_s *stm32gpio = (FAR struct stm32gpio_dev_s *)dev; FAR struct stm32gpio_dev_s *stm32gpio =
(FAR struct stm32gpio_dev_s *)dev;
DEBUGASSERT(stm32gpio != NULL && value != NULL); DEBUGASSERT(stm32gpio != NULL && value != NULL);
DEBUGASSERT(stm32gpio->id < BOARD_NGPIOOUT); DEBUGASSERT(stm32gpio->id < BOARD_NGPIOOUT);
@ -190,7 +194,8 @@ static int gpout_read(FAR struct gpio_dev_s *dev, FAR bool *value)
static int gpout_write(FAR struct gpio_dev_s *dev, bool value) static int gpout_write(FAR struct gpio_dev_s *dev, bool value)
{ {
FAR struct stm32gpio_dev_s *stm32gpio = (FAR struct stm32gpio_dev_s *)dev; FAR struct stm32gpio_dev_s *stm32gpio =
(FAR struct stm32gpio_dev_s *)dev;
DEBUGASSERT(stm32gpio != NULL); DEBUGASSERT(stm32gpio != NULL);
DEBUGASSERT(stm32gpio->id < BOARD_NGPIOOUT); DEBUGASSERT(stm32gpio->id < BOARD_NGPIOOUT);
@ -202,7 +207,8 @@ static int gpout_write(FAR struct gpio_dev_s *dev, bool value)
static int gpint_read(FAR struct gpio_dev_s *dev, FAR bool *value) static int gpint_read(FAR struct gpio_dev_s *dev, FAR bool *value)
{ {
FAR struct stm32gpint_dev_s *stm32gpint = (FAR struct stm32gpint_dev_s *)dev; FAR struct stm32gpint_dev_s *stm32gpint =
(FAR struct stm32gpint_dev_s *)dev;
DEBUGASSERT(stm32gpint != NULL && value != NULL); DEBUGASSERT(stm32gpint != NULL && value != NULL);
DEBUGASSERT(stm32gpint->stm32gpio.id < BOARD_NGPIOINT); DEBUGASSERT(stm32gpint->stm32gpio.id < BOARD_NGPIOINT);
@ -215,7 +221,8 @@ static int gpint_read(FAR struct gpio_dev_s *dev, FAR bool *value)
static int gpint_attach(FAR struct gpio_dev_s *dev, static int gpint_attach(FAR struct gpio_dev_s *dev,
pin_interrupt_t callback) pin_interrupt_t callback)
{ {
FAR struct stm32gpint_dev_s *stm32gpint = (FAR struct stm32gpint_dev_s *)dev; FAR struct stm32gpint_dev_s *stm32gpint =
(FAR struct stm32gpint_dev_s *)dev;
gpioinfo("Attaching the callback\n"); gpioinfo("Attaching the callback\n");
@ -231,7 +238,8 @@ static int gpint_attach(FAR struct gpio_dev_s *dev,
static int gpint_enable(FAR struct gpio_dev_s *dev, bool enable) static int gpint_enable(FAR struct gpio_dev_s *dev, bool enable)
{ {
FAR struct stm32gpint_dev_s *stm32gpint = (FAR struct stm32gpint_dev_s *)dev; FAR struct stm32gpint_dev_s *stm32gpint =
(FAR struct stm32gpint_dev_s *)dev;
if (enable) if (enable)
{ {
@ -244,7 +252,6 @@ static int gpint_enable(FAR struct gpio_dev_s *dev, bool enable)
(void)stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id], (void)stm32_gpiosetevent(g_gpiointinputs[stm32gpint->stm32gpio.id],
true, false, false, stm32gpio_interrupt, true, false, false, stm32gpio_interrupt,
&g_gpint[stm32gpint->stm32gpio.id]); &g_gpint[stm32gpint->stm32gpio.id]);
} }
} }
else else
@ -303,6 +310,7 @@ int stm32_gpio_initialize(void)
(void)gpio_pin_register(&g_gpout[i].gpio, pincount); (void)gpio_pin_register(&g_gpout[i].gpio, pincount);
/* Configure the pin that will be used as output */ /* Configure the pin that will be used as output */
stm32_gpiowrite(g_gpiooutputs[i], 0); stm32_gpiowrite(g_gpiooutputs[i], 0);
stm32_configgpio(g_gpiooutputs[i]); stm32_configgpio(g_gpiooutputs[i]);