arch/stm32f7: Fix nxstyle errors

arch/arm/src/stm32f7/stm32_lowputc.c:

    * Fix nxstyle errors.
This commit is contained in:
Nathan Hartman
2021-03-01 09:53:36 -05:00
committed by Abdelatif Guettouche
parent 3d24288a66
commit 75eb3e8ec2
+16 -8
View File
@@ -271,8 +271,9 @@
# undef USE_OVER8 # undef USE_OVER8
/* Calculate USART BAUD rate divider */ /* Calculate USART BAUD rate divider
/* Baud rate for standard USART (SPI mode included): *
* Baud rate for standard USART (SPI mode included):
* *
* In case of oversampling by 16, the equation is: * In case of oversampling by 16, the equation is:
* baud = fCK / UARTDIV * baud = fCK / UARTDIV
@@ -289,7 +290,9 @@
# define STM32_USARTDIV16 \ # define STM32_USARTDIV16 \
((STM32_APBCLOCK + (STM32_CONSOLE_BAUD >> 1)) / STM32_CONSOLE_BAUD) ((STM32_APBCLOCK + (STM32_CONSOLE_BAUD >> 1)) / STM32_CONSOLE_BAUD)
/* Use oversampling by 8 only if the divisor is small. But what is small? */ /* Use oversampling by 8 only if the divisor is small. But what is
* small?
*/
# if STM32_USARTDIV8 > 100 # if STM32_USARTDIV8 > 100
# define STM32_BRR_VALUE STM32_USARTDIV16 # define STM32_BRR_VALUE STM32_USARTDIV16
@@ -337,9 +340,11 @@ void arm_lowputc(char ch)
#ifdef HAVE_CONSOLE #ifdef HAVE_CONSOLE
/* Wait until the TX data register is empty */ /* Wait until the TX data register is empty */
while ((getreg32(STM32_CONSOLE_BASE + STM32_USART_ISR_OFFSET) & USART_ISR_TXE) == 0); while ((getreg32(STM32_CONSOLE_BASE +
STM32_USART_ISR_OFFSET) & USART_ISR_TXE) == 0);
#ifdef STM32_CONSOLE_RS485_DIR #ifdef STM32_CONSOLE_RS485_DIR
stm32_gpiowrite(STM32_CONSOLE_RS485_DIR, STM32_CONSOLE_RS485_DIR_POLARITY); stm32_gpiowrite(STM32_CONSOLE_RS485_DIR,
STM32_CONSOLE_RS485_DIR_POLARITY);
#endif #endif
/* Then send the character */ /* Then send the character */
@@ -347,8 +352,10 @@ void arm_lowputc(char ch)
putreg32((uint32_t)ch, STM32_CONSOLE_BASE + STM32_USART_TDR_OFFSET); putreg32((uint32_t)ch, STM32_CONSOLE_BASE + STM32_USART_TDR_OFFSET);
#ifdef STM32_CONSOLE_RS485_DIR #ifdef STM32_CONSOLE_RS485_DIR
while ((getreg32(STM32_CONSOLE_BASE + STM32_USART_ISR_OFFSET) & USART_ISR_TC) == 0); while ((getreg32(STM32_CONSOLE_BASE +
stm32_gpiowrite(STM32_CONSOLE_RS485_DIR, !STM32_CONSOLE_RS485_DIR_POLARITY); STM32_USART_ISR_OFFSET) & USART_ISR_TC) == 0);
stm32_gpiowrite(STM32_CONSOLE_RS485_DIR,
!STM32_CONSOLE_RS485_DIR_POLARITY);
#endif #endif
#endif /* HAVE_CONSOLE */ #endif /* HAVE_CONSOLE */
@@ -391,7 +398,8 @@ void stm32_lowsetup(void)
#ifdef STM32_CONSOLE_RS485_DIR #ifdef STM32_CONSOLE_RS485_DIR
stm32_configgpio(STM32_CONSOLE_RS485_DIR); stm32_configgpio(STM32_CONSOLE_RS485_DIR);
stm32_gpiowrite(STM32_CONSOLE_RS485_DIR, !STM32_CONSOLE_RS485_DIR_POLARITY); stm32_gpiowrite(STM32_CONSOLE_RS485_DIR,
!STM32_CONSOLE_RS485_DIR_POLARITY);
#endif #endif
/* Enable and configure the selected console device */ /* Enable and configure the selected console device */