summaryrefslogtreecommitdiff
path: root/src/drivers/nvs.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-01-15 12:31:20 +1100
committerjacqueline <me@jacqueline.id.au>2024-01-15 12:31:20 +1100
commit7cdcd44e0ca10ebdc796638190ed1d9b45d99ef0 (patch)
tree637b43848d17c9dbdc1688cb4733eb235f223e37 /src/drivers/nvs.cpp
parent0e04eb918ec976017276306181282769d8896c83 (diff)
downloadtangara-fw-7cdcd44e0ca10ebdc796638190ed1d9b45d99ef0.tar.gz
Begin migration of remaining screens to Lua
Diffstat (limited to 'src/drivers/nvs.cpp')
-rw-r--r--src/drivers/nvs.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/drivers/nvs.cpp b/src/drivers/nvs.cpp
index c8a9a7c7..c8d4d636 100644
--- a/src/drivers/nvs.cpp
+++ b/src/drivers/nvs.cpp
@@ -30,6 +30,7 @@ static constexpr char kKeyOutput[] = "out";
static constexpr char kKeyBrightness[] = "bright";
static constexpr char kKeyAmpMaxVolume[] = "hp_vol_max";
static constexpr char kKeyAmpCurrentVolume[] = "hp_vol";
+static constexpr char kKeyAmpLeftBias[] = "hp_bias";
static constexpr char kKeyOnboarded[] = "intro";
static constexpr char kKeyPrimaryInput[] = "in_pri";
@@ -156,6 +157,17 @@ auto NvsStorage::AmpCurrentVolume(uint16_t val) -> bool {
return nvs_commit(handle_) == ESP_OK;
}
+auto NvsStorage::AmpLeftBias() -> int_fast8_t {
+ int8_t out = 0;
+ nvs_get_i8(handle_, kKeyAmpLeftBias, &out);
+ return out;
+}
+
+auto NvsStorage::AmpLeftBias(int_fast8_t val) -> bool {
+ nvs_set_i8(handle_, kKeyAmpLeftBias, val);
+ return nvs_commit(handle_) == ESP_OK;
+}
+
auto NvsStorage::HasShownOnboarding() -> bool {
uint8_t out = false;
nvs_get_u8(handle_, kKeyOnboarded, &out);