int up_putc(int ch) { #ifdef HAVE_SERIAL_CONSOLE uint8_t imr; #if defined(CONFIG_USART0_SERIAL_CONSOLE) usart0_disableusartint(&imr); #else usart1_disableusartint(&imr); #endif /* Check for LF */ if (ch == '\n') { /* Add CR */ up_lowputc('\r'); } up_lowputc(ch); #if defined(CONFIG_USART0_SERIAL_CONSOLE) usart0_restoreusartint(imr); #else usart1_restoreusartint(imr); #endif #endif return ch; }
int up_putc(int ch) { #ifdef HAVE_SERIAL_CONSOLE uint8_t imr; usart1_disableusartint(&imr); /* Check for LF */ if (ch == '\n') { /* Add CR */ up_lowputc('\r'); } up_lowputc(ch); usart1_restoreusartint(imr); #endif return ch; }