Add eeprom_commit command
This commit is contained in:
parent
0b14f5bf53
commit
2e71fc4fe5
2 changed files with 13 additions and 0 deletions
12
src/main.cpp
12
src/main.cpp
|
|
@ -62,6 +62,7 @@ const Command core_commands[] = {
|
||||||
{"list_modules", get_modules},
|
{"list_modules", get_modules},
|
||||||
{"eeprom_last_commit", get_eeprom_last_commit},
|
{"eeprom_last_commit", get_eeprom_last_commit},
|
||||||
{"system_status", get_system_status},
|
{"system_status", get_system_status},
|
||||||
|
{"eeprom_commit", eeprom_commit},
|
||||||
END_COMMAND};
|
END_COMMAND};
|
||||||
|
|
||||||
void register_module(const Command commands[], void (*loop_fn)(void))
|
void register_module(const Command commands[], void (*loop_fn)(void))
|
||||||
|
|
@ -191,6 +192,17 @@ void eeprom_commit_at_interval(unsigned long interval)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void eeprom_commit(String)
|
||||||
|
{
|
||||||
|
#if defined(SUPPORT_EEPROM) && defined(MCU_PICO)
|
||||||
|
EEPROM.commit();
|
||||||
|
eeprom_last_commit = millis();
|
||||||
|
comPort->println("EEPROM updated");
|
||||||
|
#else
|
||||||
|
comPort->println("Not using pico");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void get_eeprom_last_commit(String)
|
void get_eeprom_last_commit(String)
|
||||||
{
|
{
|
||||||
#if defined(SUPPORT_EEPROM) && defined(MCU_PICO)
|
#if defined(SUPPORT_EEPROM) && defined(MCU_PICO)
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ void get_version(String);
|
||||||
void get_board(String);
|
void get_board(String);
|
||||||
void get_modules(String);
|
void get_modules(String);
|
||||||
void get_eeprom_last_commit(String);
|
void get_eeprom_last_commit(String);
|
||||||
|
void eeprom_commit(String);
|
||||||
void get_system_status(String);
|
void get_system_status(String);
|
||||||
|
|
||||||
#define MAIN_H
|
#define MAIN_H
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue