chore: rewrite to modbus rtu
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#ifndef __SIMPLE_EEPROM_H
|
||||
#define __SIMPLE_EEPROM_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "ch32v003fun.h"
|
||||
@@ -130,10 +129,10 @@ eeprom_status_t eeprom_init(void) {
|
||||
uint16_t *page = (uint16_t *)EEPROM_BASE;
|
||||
|
||||
// check empty/partial page
|
||||
bool needs_erase = true;
|
||||
int needs_erase = 1;
|
||||
for (int i = 0; i < EEPROM_MAX_ENTRIES; i++) {
|
||||
if (page[i] != 0xFFFF) {
|
||||
needs_erase = false;
|
||||
needs_erase = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user