arch: imx6: Refactor imx_lowputc()
Summary: - Remove '\n' -> '\r\n' conversion - Remove waiting for FIFO empty after sending a character - Remove CONFIG_DEBUG_FEATURES Impact: - None Testing: - Tested with sabre-6quad:netknsh (not merged yet) Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
parent
872c570343
commit
a75d905760
@ -571,7 +571,7 @@ int imx_uart_configure(uint32_t base, FAR const struct uart_config_s *config)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(IMX_HAVE_UART) && defined(CONFIG_DEBUG_FEATURES)
|
||||
#ifdef IMX_HAVE_UART
|
||||
void imx_lowputc(int ch)
|
||||
{
|
||||
/* Poll the TX fifo trigger level bit of the UART status register. When the
|
||||
@ -585,29 +585,8 @@ void imx_lowputc(int ch)
|
||||
* return
|
||||
*/
|
||||
|
||||
if (ch == '\n')
|
||||
{
|
||||
/* Send the carrage return by writing it into the UART_TXD register. */
|
||||
|
||||
putreg32((uint32_t)'\r', IMX_CONSOLE_VBASE + UART_TXD_OFFSET);
|
||||
|
||||
/* Wait for the tranmsit register to be emptied. When the TXFE bit is
|
||||
* non-zero, the TX Buffer FIFO is empty.
|
||||
*/
|
||||
|
||||
while ((getreg32(IMX_CONSOLE_VBASE + UART_USR2_OFFSET) &
|
||||
UART_USR2_TXFE) == 0);
|
||||
}
|
||||
|
||||
/* Send the character by writing it into the UART_TXD register. */
|
||||
|
||||
putreg32((uint32_t)ch, IMX_CONSOLE_VBASE + UART_TXD_OFFSET);
|
||||
|
||||
/* Wait for the tranmsit register to be emptied. When the TXFE bit is
|
||||
* non-zero, the TX Buffer FIFO is empty.
|
||||
*/
|
||||
|
||||
while ((getreg32(IMX_CONSOLE_VBASE + UART_USR2_OFFSET) &
|
||||
UART_USR2_TXFE) == 0);
|
||||
}
|
||||
#endif
|
||||
|
@ -91,10 +91,8 @@ int imx_uart_configure(uint32_t base,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(IMX_HAVE_UART) && defined(CONFIG_DEBUG_FEATURES)
|
||||
#ifdef IMX_HAVE_UART
|
||||
void imx_lowputc(int ch);
|
||||
#else
|
||||
# define imx_lowputc(ch)
|
||||
#endif
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_IMX6_IMX_LOWPUTC_H */
|
||||
|
Loading…
Reference in New Issue
Block a user