|
|
@@ -37,7 +37,7 @@ static uint8_t crc8x_fast(void const *mem, uint16_t len)
|
|
|
|
|
|
inline static void receivePacket(void)
|
|
|
{
|
|
|
- nBus.hw_platform->uart_receive(nBus.rx_buffer, 64);
|
|
|
+ nBus.hw_platform->uart_receive(nBus.rx_buffer, BUFF_SIZE);
|
|
|
}
|
|
|
|
|
|
inline static void send_response()
|
|
|
@@ -93,7 +93,6 @@ static void process_request()
|
|
|
if (crcC != nBus.rx_buffer[nBus.rx_length - 1])
|
|
|
{
|
|
|
nBus.send_response = NO_RESPONSE;
|
|
|
- receivePacket();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -108,7 +107,6 @@ static void process_request()
|
|
|
if (nBus.addressModule != MODULE_ADDRESS)
|
|
|
{
|
|
|
nBus.send_response = NO_RESPONSE;
|
|
|
- receivePacket();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -251,6 +249,7 @@ void nbus_init_memory_driver(nBus_MemoryDriver *memDriver)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* @brief Run protocol stack.
|
|
|
* This is infinity protocol loop.
|
|
|
@@ -290,15 +289,13 @@ void nbus_stack(void)
|
|
|
|
|
|
if (nBus.hw_platform->loop_callback != NULL)
|
|
|
{
|
|
|
+
|
|
|
if (nBus.hw_platform->loop_callback(CallbackType_SENSOR) == 1)
|
|
|
{
|
|
|
nBus.interface->read();
|
|
|
}
|
|
|
|
|
|
- if (nBus.hw_platform->loop_callback(CallbackType_UART) == 1)
|
|
|
- {
|
|
|
- nBus.uart_state = UART_RX_WAIT;
|
|
|
- }
|
|
|
+ nBus.hw_platform->loop_callback(CallbackType_UART);
|
|
|
}
|
|
|
}
|
|
|
}
|