mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 09:37:21 +02:00
Reliability fixes for wired comms
This commit is contained in:
@@ -175,9 +175,10 @@ esp_err_t DataLinkManager::rip_find_entry(uint8_t board_id, RIPRow** entry, bool
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the associated RIP Table row by row number. Information returned is read only.
|
||||
* @brief Returns a snapshot of the RIP table row by row number. Information returned is a safe copy taken under the lock.
|
||||
*
|
||||
* @param entry
|
||||
* @param entry Pointer to a caller-owned RIPRow that will be filled with a snapshot of the table row.
|
||||
* The caller must NOT hold or release the internal row semaphore; it is managed here.
|
||||
* @param row_num
|
||||
* @return esp_err_t
|
||||
*/
|
||||
@@ -207,7 +208,12 @@ esp_err_t DataLinkManager::rip_get_row(RIPRow** entry, uint8_t row_num){
|
||||
}
|
||||
}
|
||||
|
||||
*entry = &rip_table[row_num];
|
||||
static RIPRow row_snapshots[RIP_MAX_ROUTES];
|
||||
row_snapshots[row_num].info = rip_table[row_num].info;
|
||||
row_snapshots[row_num].channel = rip_table[row_num].channel;
|
||||
row_snapshots[row_num].ttl = rip_table[row_num].ttl;
|
||||
row_snapshots[row_num].valid = rip_table[row_num].valid;
|
||||
*entry = &row_snapshots[row_num];
|
||||
|
||||
xSemaphoreGive(rip_table[row_num].row_sem);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user