[an error occurred while processing this directive]
|
typedef enum {UART_0, UART_1} t_uarts;
static t_uarts g_currentUsart = UART_0;
void SetActiveUart (t_uarts u)
{
g_currentUsart = u;
}int putchar (int ch)
{
if (UART_0 == g_currentUsart)
UDR0 = ch;
else if (UART_1 == g_currentUsart)
UDR1 = ch;
}void main ()
{
SetActiveUart (UART_0);
printf("hello world0");
SetActiveUart (UART_1);
printf("hello world1");}
Составить ответ ||| Конференция ||| Архив
Ответы
E-mail: info@telesys.ru