fixes
This commit is contained in:
+6
-2
@@ -144,8 +144,12 @@ void write_struct_to_last_page(tx_rx_data_struct tx_data_in)
|
||||
{
|
||||
uint8_t page_val = get_last_page();
|
||||
uint8_t next_page_val;
|
||||
if (page_val == 255) {
|
||||
next_page_val = 1;
|
||||
if (page_val >= EEPROM_MAX_PAGE) {
|
||||
// Spool full (~2.6 days of failed sends). Overwrite the newest spooled
|
||||
// packet: one packet is lost either way, and this keeps the depth
|
||||
// truthful -- the old wrap to page 1 stranded 254 packets the counter
|
||||
// no longer admitted to.
|
||||
next_page_val = EEPROM_MAX_PAGE;
|
||||
} else {
|
||||
next_page_val = page_val + 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user