Esempio n. 1
0
int noinline
debug_uart_put(char d, FILE * stream)
{
  if (d == '\n')
    debug_uart_put('\r', stream);

  /* replace escape sequences */
  if (d == 0x1b)
    d = '^';

  #ifdef S1D15G10_SUPPORT
    lcd_putch(d);
  #endif /* S1D15G10_SUPPORT */

  #ifdef SOFT_UART_SUPPORT
    soft_uart_putchar(d);
  #else /* SOFT_UART_SUPPORT */
    while (!(usart(UCSR, A) & _BV(usart(UDRE))));

    #if RS485_HAVE_TE
      /* enable interrupt usart transmit complete */
      usart(UCSR,B) |= _BV(usart(TXCIE));
      RS485_ENABLE_TX;
    #endif  /* RS485_HAVE_TE */

    usart(UDR) = d;
  #endif /* SOFT_UART_SUPPORT */

  return 0;
}
Esempio n. 2
0
int noinline
debug_uart_put(char d, FILE * stream)
{
  if (d == '\n')
    debug_uart_put('\r', stream);

  /* replace escape sequences */
  if (d == 0x1b)
    d = '^';

#ifdef S1D15G10_SUPPORT
  lcd_putch(d);
#endif /* S1D15G10_SUPPORT */
#ifdef SOFT_UART_SUPPORT
  soft_uart_putchar(d);
#else /* SOFT_UART_SUPPORT */
  while (!(usart(UCSR, A) & _BV(usart(UDRE))));

  #if (HAVE_RS485TE_USART0 == 1 || HAVE_RS485TE_USART1 == 1)
  /* enable usart transmit complete interrupt */
  usart(UCSR,B) |= _BV(usart(TXCIE));
    #if (USE_USART == 0)
  PIN_SET(RS485TE_USART0);  // enable RS485 transmitter for usart 0
    #elif (USE_USART == 1)
  PIN_SET(RS485TE_USART1);  // enable RS485 transmitter for usart 1
    #endif
  #endif  /* HAVE_RS485TE_USART0 == 1 || HAVE_RS485TE_USART1 == 1 */

  usart(UDR) = d;
#endif /* SOFT_UART_SUPPORT */
  return 0;
}
Esempio n. 3
0
int noinline
debug_uart_put (char d, FILE *stream)
{
    if (d == '\n')
	debug_uart_put('\r', stream);

    if (d == 0x1b)
	d = '^';		/* replace escape sequences. */

#ifdef S1D15G10_SUPPORT
    lcd_putch(d);
#endif
#ifdef SOFT_UART_SUPPORT
    soft_uart_putchar(d);
    return 0;
#else
    while (!(usart(UCSR,A) & _BV(usart(UDRE))));
    usart(UDR) = d;

    return 0;
#endif
}