[an error occurred while processing this directive]
|
volatile int recv_data;
SIGNAL(SIG_UART_RECV)
{
recv_data = UDR;
}
int uart_RecvByte(void)
{
int data;
uint8_t sreg = SREG;
cli();
data = recv_data;
recv_data = -1;
SREG = sreg;
return (data);
}
int main(void)
{
// ... init
sei();
while (1)
{
int data;
data = uart_RecvByte();
if (data != -1)
uart_SendByte(data);
}
return (0);
}
E-mail: info@telesys.ru