arch/arm/src/stm32h7: Correct naming of global variables that violations the naming requirements of the coding standard.

This commit is contained in:
Gregory Nutt 2018-07-12 13:19:57 -06:00
parent e569872358
commit c09efb2603
2 changed files with 22 additions and 18 deletions

View File

@ -705,7 +705,7 @@ static struct up_dev_s g_uart8priv =
/* This table lets us iterate over the configured USARTs */ /* This table lets us iterate over the configured USARTs */
static struct up_dev_s * const uart_devs[STM32_NSERIAL] = static struct up_dev_s * const g_uart_devs[STM32_NSERIAL] =
{ {
#ifdef CONFIG_STM32H7_USART1 #ifdef CONFIG_STM32H7_USART1
[0] = &g_usart1priv, [0] = &g_usart1priv,
@ -2145,17 +2145,17 @@ FAR uart_dev_t *stm32_serial_get_uart(int uart_num)
{ {
int uart_idx = uart_num - 1; int uart_idx = uart_num - 1;
if (uart_idx < 0 || uart_idx >= STM32_NSERIAL || !uart_devs[uart_idx]) if (uart_idx < 0 || uart_idx >= STM32_NSERIAL || !g_uart_devs[uart_idx])
{ {
return NULL; return NULL;
} }
if (!uart_devs[uart_idx]->initialized) if (!g_uart_devs[uart_idx]->initialized)
{ {
return NULL; return NULL;
} }
return &uart_devs[uart_idx]->dev; return &g_uart_devs[uart_idx]->dev;
} }
/**************************************************************************** /****************************************************************************
@ -2178,16 +2178,16 @@ void up_earlyserialinit(void)
for (i = 0; i < STM32_NSERIAL; i++) for (i = 0; i < STM32_NSERIAL; i++)
{ {
if (uart_devs[i]) if (g_uart_devs[i])
{ {
up_disableusartint(uart_devs[i], NULL); up_disableusartint(g_uart_devs[i], NULL);
} }
} }
/* Configure whichever one is the console */ /* Configure whichever one is the console */
#if CONSOLE_UART > 0 #if CONSOLE_UART > 0
up_setup(&uart_devs[CONSOLE_UART - 1]->dev); up_setup(&g_uart_devs[CONSOLE_UART - 1]->dev);
#endif #endif
#endif /* HAVE UART */ #endif /* HAVE UART */
} }
@ -2223,14 +2223,14 @@ void up_serialinit(void)
/* Register the console */ /* Register the console */
#if CONSOLE_UART > 0 #if CONSOLE_UART > 0
(void)uart_register("/dev/console", &uart_devs[CONSOLE_UART - 1]->dev); (void)uart_register("/dev/console", &g_uart_devs[CONSOLE_UART - 1]->dev);
#ifndef CONFIG_STM32H7_SERIAL_DISABLE_REORDERING #ifndef CONFIG_STM32H7_SERIAL_DISABLE_REORDERING
/* If not disabled, register the console UART to ttyS0 and exclude /* If not disabled, register the console UART to ttyS0 and exclude
* it from initializing it further down * it from initializing it further down
*/ */
(void)uart_register("/dev/ttyS0", &uart_devs[CONSOLE_UART - 1]->dev); (void)uart_register("/dev/ttyS0", &g_uart_devs[CONSOLE_UART - 1]->dev);
minor = 1; minor = 1;
#endif #endif
@ -2244,7 +2244,7 @@ void up_serialinit(void)
{ {
/* Don't create a device for non-configured ports. */ /* Don't create a device for non-configured ports. */
if (uart_devs[i] == 0) if (g_uart_devs[i] == 0)
{ {
continue; continue;
} }
@ -2252,7 +2252,7 @@ void up_serialinit(void)
#ifndef CONFIG_STM32H7_SERIAL_DISABLE_REORDERING #ifndef CONFIG_STM32H7_SERIAL_DISABLE_REORDERING
/* Don't create a device for the console - we did that above */ /* Don't create a device for the console - we did that above */
if (uart_devs[i]->dev.isconsole) if (g_uart_devs[i]->dev.isconsole)
{ {
continue; continue;
} }
@ -2261,7 +2261,7 @@ void up_serialinit(void)
/* Register USARTs as devices in increasing order */ /* Register USARTs as devices in increasing order */
devname[9] = '0' + minor++; devname[9] = '0' + minor++;
(void)uart_register(devname, &uart_devs[i]->dev); (void)uart_register(devname, &g_uart_devs[i]->dev);
} }
#endif /* HAVE UART */ #endif /* HAVE UART */
} }
@ -2277,7 +2277,7 @@ void up_serialinit(void)
int up_putc(int ch) int up_putc(int ch)
{ {
#if CONSOLE_UART > 0 #if CONSOLE_UART > 0
struct up_dev_s *priv = uart_devs[CONSOLE_UART - 1]; struct up_dev_s *priv = g_uart_devs[CONSOLE_UART - 1];
uint16_t ie; uint16_t ie;
up_disableusartint(priv, &ie); up_disableusartint(priv, &ie);

View File

@ -53,6 +53,10 @@ STATUS
That should eliminate the possibility of anyone accidentally enabling That should eliminate the possibility of anyone accidentally enabling
this know incomplete port. this know incomplete port.
2018-07-12: After several commits focused primarily on the H7 RCC and
serial driver, Mateusz Szafoni states the basic NSH configuration is
now functional.
Serial Console Serial Console
============== ==============