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; }
static void usart1_detach(struct uart_dev_s *dev) { /* Disable USART1 interrupts */ usart1_disableusartint(NULL); /* Detach USART1 interrupts */ (void)irq_detach(AT90USB_IRQ_U1RX); (void)irq_detach(AT90USB_IRQ_U1DRE); // (void)irq_detach(AT90USB_IRQ_U1TX); }
void up_earlyserialinit(void) { /* Disable all USARTS */ usart1_disableusartint(NULL); /* Configuration whichever one is the console */ #ifdef HAVE_SERIAL_CONSOLE g_usart1port.isconsole = true; usart1_setup(&g_usart1port); #endif }
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; }
void up_earlyserialinit(void) { /* Disable all USARTS */ #ifdef CONFIG_AVR_USART0 usart0_disableusartint(NULL); #endif #ifdef CONFIG_AVR_USART1 usart1_disableusartint(NULL); #endif /* Configuration whichever one is the console */ #ifdef HAVE_SERIAL_CONSOLE CONSOLE_DEV.isconsole = true; # if defined(CONFIG_USART0_SERIAL_CONSOLE) usart0_setup(&g_usart0port); # elif defined(CONFIG_USART1_SERIAL_CONSOLE) usart1_setup(&g_usart1port); # endif #endif }