Initial code import

This commit is contained in:
2021-10-03 17:51:12 +02:00
parent c2deb42b10
commit 08e62500ea
25 changed files with 1248 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#pragma once
// esp-idf includes
#include <nvs.h>
// local includes
#include "configutils_base.h"
#include "color_utils.h"
namespace espconfig {
inline esp_err_t nvs_get(nvs_handle handle, const char* key, cpputils::ColorHelper* out_value)
{
uint32_t temp;
const auto result = nvs_get(handle, key, &temp);
if (result == ESP_OK)
*out_value = cpputils::numberToColor(temp);
return result;
}
inline esp_err_t nvs_set(nvs_handle handle, const char* key, cpputils::ColorHelper value)
{
return nvs_set(handle, key, cpputils::colorToNumber(value));
}
} // namespace espconfig