Code: Select all
[Codebox=c file=Untitled.c]void update_NVS_data()
{// Write new data to NVS
ESP_LOGI(TAG,"Updating feedrate value in NVS ... ");
nvs_handle_t NVS_handle;
esp_err_t err = nvs_set_i32(NVS_handle, "feed_rate", feed_rate);
if (err != ESP_OK){
ESP_LOGI(TAG,"Updating NVS failed!\n");
ESP_LOGI(TAG,"Error code is %x\n", err);
}
ESP_LOGI(TAG,"Committing updates in NVS ... ");
err = nvs_commit(NVS_handle); // Commit written value.
nvs_close(NVS_handle);// Close storage
}[/Codebox]