24 lines
478 B
C
24 lines
478 B
C
#ifndef __STATE_MANAGER_H
|
|
#define __STATE_MANAGER_H
|
|
|
|
#include "simple_eeprom.h"
|
|
|
|
#define DEFAULT_STATE 0x0000
|
|
|
|
void save_state(uint16_t state) { eeprom_write(state); }
|
|
|
|
uint16_t load_state(void) { return eeprom_read(); }
|
|
|
|
void dump_eeprom(void) {
|
|
uint16_t *word = (uint16_t *)(EEPROM_BASE);
|
|
printf("EEPROM contents:");
|
|
for (int i = 0; i < 32; i++) {
|
|
uint16_t val = word[i];
|
|
// if (!(val & 0x8000)) {
|
|
printf(" %04X", val);
|
|
// }
|
|
}
|
|
printf("\n");
|
|
}
|
|
|
|
#endif |