mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
Flush the LUT every 30 seconds to prevent broken entires from causing incontrollable robot
This commit is contained in:
@@ -46,7 +46,8 @@ static const uint16_t crc16_table[256] = {
|
||||
#define ASYNC_QUEUE_WAIT_TICKS 100
|
||||
#define SEQUENCE_NUM_MAP_MUTEX_MAX_WAIT_MS 50
|
||||
#define MAX_RX_QUEUE_SIZE 100
|
||||
#define CONTROL_FRAME_LUT_SIZE 15 // Maximum number of control frames cached in the receiver-side LFU LUT
|
||||
#define CONTROL_FRAME_LUT_SIZE 15 // Maximum number of control frames cached in the receiver-side LFU LUT
|
||||
#define LUT_FLUSH_INTERVAL_MS 30000 // Flush (invalidate) the entire control-frame LUT every 30 seconds
|
||||
|
||||
/**
|
||||
* @brief Class to represent the Data Link Layer
|
||||
@@ -223,8 +224,19 @@ class DataLinkManager{
|
||||
*/
|
||||
void lut_insert(uint32_t hash, const uint8_t* message, size_t message_len, const FrameHeader& header);
|
||||
|
||||
/**
|
||||
* @brief Flush (invalidate) all entries in the control-frame LUT.
|
||||
*/
|
||||
void lut_flush();
|
||||
|
||||
/**
|
||||
* @brief Periodic task that flushes the control-frame LUT every LUT_FLUSH_INTERVAL_MS milliseconds.
|
||||
*/
|
||||
[[noreturn]] static void lut_flush_task(void* args);
|
||||
|
||||
ControlFrameLutEntry control_frame_lut[CONTROL_FRAME_LUT_SIZE];
|
||||
SemaphoreHandle_t control_frame_lut_mutex;
|
||||
TaskHandle_t lut_flush_task_handle = NULL;
|
||||
};
|
||||
|
||||
struct frame_scheduler_args {
|
||||
|
||||
Reference in New Issue
Block a user