Implement EEPROM and use it for saving the calibration
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#include <reflow-controller/safety/safety-memory.h>
|
||||
#include <reflow-controller/safety/fault.h>
|
||||
#include <reflow-controller/updater/updater.h>
|
||||
|
||||
#include <reflow-controller/settings/spi-eeprom.h>
|
||||
|
||||
static void setup_nvic_priorities(void)
|
||||
@@ -179,7 +180,7 @@ static inline void setup_system(void)
|
||||
loudspeaker_setup();
|
||||
gui_init();
|
||||
uart_gpio_config();
|
||||
spi_eeprom_init();
|
||||
settings_setup();
|
||||
|
||||
handle_boot_status();
|
||||
|
||||
@@ -210,8 +211,15 @@ int main(void)
|
||||
shellmatta_handle_t shell_handle;
|
||||
int menu_wait_request;
|
||||
uint64_t quarter_sec_timestamp = 0ULL;
|
||||
|
||||
setup_system();
|
||||
|
||||
/* Try load the calibration. This will only succeed if there's an EEPROM */
|
||||
status = settings_load_calibration(&sens, &offset);
|
||||
if (!status) {
|
||||
adc_pt1000_set_resistance_calibration(offset, sens, true);
|
||||
}
|
||||
|
||||
shell_handle = shell_init(write_shell_callback);
|
||||
shell_print_motd(shell_handle);
|
||||
|
||||
|
Reference in New Issue
Block a user