Skip to content

Commit

Permalink
arch/arm/src/stm32h7: Correct naming of global variables that violati…
Browse files Browse the repository at this point in the history
…ons the naming requirements of the coding standard.
  • Loading branch information
gregory-nutt committed Jul 12, 2018
1 parent e569872 commit c09efb2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
26 changes: 13 additions & 13 deletions arch/arm/src/stm32h7/stm32_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ static struct up_dev_s g_uart8priv =

/* 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
[0] = &g_usart1priv,
Expand Down Expand Up @@ -2145,17 +2145,17 @@ FAR uart_dev_t *stm32_serial_get_uart(int uart_num)
{
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;
}

if (!uart_devs[uart_idx]->initialized)
if (!g_uart_devs[uart_idx]->initialized)
{
return NULL;
}

return &uart_devs[uart_idx]->dev;
return &g_uart_devs[uart_idx]->dev;
}

/****************************************************************************
Expand All @@ -2178,16 +2178,16 @@ void up_earlyserialinit(void)

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 */

#if CONSOLE_UART > 0
up_setup(&uart_devs[CONSOLE_UART - 1]->dev);
up_setup(&g_uart_devs[CONSOLE_UART - 1]->dev);
#endif
#endif /* HAVE UART */
}
Expand Down Expand Up @@ -2223,14 +2223,14 @@ void up_serialinit(void)
/* Register the console */

#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
/* If not disabled, register the console UART to ttyS0 and exclude
* 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;
#endif

Expand All @@ -2244,15 +2244,15 @@ void up_serialinit(void)
{
/* Don't create a device for non-configured ports. */

if (uart_devs[i] == 0)
if (g_uart_devs[i] == 0)
{
continue;
}

#ifndef CONFIG_STM32H7_SERIAL_DISABLE_REORDERING
/* 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;
}
Expand All @@ -2261,7 +2261,7 @@ void up_serialinit(void)
/* Register USARTs as devices in increasing order */

devname[9] = '0' + minor++;
(void)uart_register(devname, &uart_devs[i]->dev);
(void)uart_register(devname, &g_uart_devs[i]->dev);
}
#endif /* HAVE UART */
}
Expand All @@ -2277,7 +2277,7 @@ void up_serialinit(void)
int up_putc(int ch)
{
#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;

up_disableusartint(priv, &ie);
Expand Down
14 changes: 9 additions & 5 deletions configs/nucleo-h743zi/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ STATUS
- There is a fragmentary NSH here. However, it does not have any serial
console selected and is not expected to be usable.

This logic has set on a branch for some time with little progress. I
have decided to bring it into the master but only with the option to
select the STM32 H7 architecture dependent on CONFIG_EXPERMIMENTAL.
That should eliminate the possibility of anyone accidentally enabling
this know incomplete port.
This logic has set on a branch for some time with little progress. I
have decided to bring it into the master but only with the option to
select the STM32 H7 architecture dependent on CONFIG_EXPERMIMENTAL.
That should eliminate the possibility of anyone accidentally enabling
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
==============
Expand Down

0 comments on commit c09efb2

Please sign in to comment.