|
|
|
@ -156,6 +156,42 @@ static void __near r_uart0_interrupt_send(void) |
|
|
|
static void r_uart0_callback_receiveend(void) |
|
|
|
{ |
|
|
|
/* Start user code. Do not edit comment generated here */ |
|
|
|
uint8_t c = rs485_rx_buffer[rs485_rx_index]; |
|
|
|
|
|
|
|
if (g_rs485_bridge_active) |
|
|
|
{ |
|
|
|
RS485_Bridge_Push(c); |
|
|
|
g_rs485_bridge_seq++; |
|
|
|
rs485_rx_index = 0; |
|
|
|
rs485_rx_length = 0; |
|
|
|
R_UART0_Receive((uint8_t *)&rs485_rx_buffer[0], 1); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (rs485_rx_index < (UART_RX_BUF_SIZE - 1)) |
|
|
|
{ |
|
|
|
rs485_rx_index++; |
|
|
|
rs485_rx_length = rs485_rx_index; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
rs485_rx_done = 1; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (c == '\r') |
|
|
|
{ |
|
|
|
R_UART0_Receive((uint8_t *)&rs485_rx_buffer[rs485_rx_index], 1); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (c == '\n') |
|
|
|
{ |
|
|
|
rs485_rx_done = 1; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
R_UART0_Receive((uint8_t *)&rs485_rx_buffer[rs485_rx_index], 1); |
|
|
|
/* End user code. Do not edit comment generated here */ |
|
|
|
} |
|
|
|
|
|
|
|
|