From 4cd3c187f92d8f5b73c2c985da308280c18465cf Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 20 Mar 2024 11:08:35 +1100 Subject: Add exact display size to nvs, since it can vary --- src/drivers/include/display_init.hpp | 3 +++ src/drivers/include/nvs.hpp | 8 ++++++++ 2 files changed, 11 insertions(+) (limited to 'src/drivers/include') diff --git a/src/drivers/include/display_init.hpp b/src/drivers/include/display_init.hpp index f6c28b54..9bf5b3f5 100644 --- a/src/drivers/include/display_init.hpp +++ b/src/drivers/include/display_init.hpp @@ -6,6 +6,7 @@ #pragma once +#include #include namespace drivers { @@ -14,6 +15,8 @@ namespace displays { extern const uint8_t kDelayBit; struct InitialisationData { + uint16_t width; + uint16_t height; uint8_t num_sequences; const uint8_t* sequences[4]; }; diff --git a/src/drivers/include/nvs.hpp b/src/drivers/include/nvs.hpp index 5bd825e5..f288f8e2 100644 --- a/src/drivers/include/nvs.hpp +++ b/src/drivers/include/nvs.hpp @@ -71,6 +71,11 @@ class NvsStorage { auto LockPolarity() -> bool; auto LockPolarity(bool) -> void; + auto DisplaySize() + -> std::pair, std::optional>; + auto DisplaySize(std::pair, std::optional>) + -> void; + auto PreferredBluetoothDevice() -> std::optional; auto PreferredBluetoothDevice(std::optional) -> void; @@ -120,6 +125,9 @@ class NvsStorage { nvs_handle_t handle_; Setting lock_polarity_; + Setting display_cols_; + Setting display_rows_; + Setting brightness_; Setting sensitivity_; Setting amp_max_vol_; -- cgit v1.2.3 From a05d93a1e26181237a76da5ce398c6b08497d591 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 20 Mar 2024 11:43:33 +1100 Subject: Start using the lock switch polarity bit in nvs --- src/drivers/include/gpios.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/drivers/include') diff --git a/src/drivers/include/gpios.hpp b/src/drivers/include/gpios.hpp index 55486be7..e27a3ade 100644 --- a/src/drivers/include/gpios.hpp +++ b/src/drivers/include/gpios.hpp @@ -79,12 +79,12 @@ class IGpios { */ virtual auto Get(Pin) const -> bool = 0; - virtual auto IsLocked() const -> bool { return Get(Pin::kKeyLock); } + virtual auto IsLocked() const -> bool = 0; }; class Gpios : public IGpios { public: - static auto Create() -> Gpios*; + static auto Create(bool invert_lock_switch) -> Gpios*; ~Gpios(); /* @@ -106,6 +106,8 @@ class Gpios : public IGpios { auto Get(Pin) const -> bool override; + auto IsLocked() const -> bool override; + /** * Reads from the GPIO expander, populating `inputs` with the most recent * values. @@ -118,10 +120,11 @@ class Gpios : public IGpios { Gpios& operator=(const Gpios&) = delete; private: - Gpios(); + Gpios(bool invert_lock); std::atomic ports_; std::atomic inputs_; + const bool invert_lock_switch_; }; } // namespace drivers -- cgit v1.2.3 From 239e6d89507a24c849385f4bfa93ac4ad58e5de5 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 28 Mar 2024 13:30:24 +1100 Subject: bump esp-idf to 5.2.1 --- src/drivers/include/haptics.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/drivers/include') diff --git a/src/drivers/include/haptics.hpp b/src/drivers/include/haptics.hpp index dfafa2eb..6cfcbb0d 100644 --- a/src/drivers/include/haptics.hpp +++ b/src/drivers/include/haptics.hpp @@ -6,10 +6,11 @@ #pragma once -#include +#include #include #include #include +#include namespace drivers { -- cgit v1.2.3