Skip to content
Snippets Groups Projects
Commit 7b28f31e authored by q3k's avatar q3k
Browse files

main: enable NVS

Fixes #12.
parent 064de7be
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "nvs_flash.h"
// Called by micropython via MICROPY_BOARD_STARTUP.
void flow3r_startup(void) {
......@@ -70,7 +71,14 @@ void flow3r_startup(void) {
st3m_leds_init();
st3m_io_init();
st3m_captouch_init();
st3m_mode_set(st3m_mode_kind_starting, "nvs");
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES ||
ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
nvs_flash_erase();
nvs_flash_init();
}
st3m_mode_set(st3m_mode_kind_starting, "micropython");
st3m_mode_update_display(NULL);
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment