|
|
@ -40,6 +40,7 @@ static constexpr char kKeyScrollSensitivity[] = "scroll"; |
|
|
|
static constexpr char kKeyLockPolarity[] = "lockpol"; |
|
|
|
static constexpr char kKeyLockPolarity[] = "lockpol"; |
|
|
|
static constexpr char kKeyDisplayCols[] = "dispcols"; |
|
|
|
static constexpr char kKeyDisplayCols[] = "dispcols"; |
|
|
|
static constexpr char kKeyDisplayRows[] = "disprows"; |
|
|
|
static constexpr char kKeyDisplayRows[] = "disprows"; |
|
|
|
|
|
|
|
static constexpr char kKeyDisplayLeftPadding[] = "displeftpad"; |
|
|
|
static constexpr char kKeyHapticMotorType[] = "hapticmtype"; |
|
|
|
static constexpr char kKeyHapticMotorType[] = "hapticmtype"; |
|
|
|
static constexpr char kKeyLraCalibration[] = "lra_cali"; |
|
|
|
static constexpr char kKeyLraCalibration[] = "lra_cali"; |
|
|
|
static constexpr char kKeyDbAutoIndex[] = "dbautoindex"; |
|
|
|
static constexpr char kKeyDbAutoIndex[] = "dbautoindex"; |
|
|
@ -265,6 +266,7 @@ NvsStorage::NvsStorage(nvs_handle_t handle) |
|
|
|
lock_polarity_(kKeyLockPolarity), |
|
|
|
lock_polarity_(kKeyLockPolarity), |
|
|
|
display_cols_(kKeyDisplayCols), |
|
|
|
display_cols_(kKeyDisplayCols), |
|
|
|
display_rows_(kKeyDisplayRows), |
|
|
|
display_rows_(kKeyDisplayRows), |
|
|
|
|
|
|
|
display_left_padding_(kKeyDisplayLeftPadding), |
|
|
|
haptic_motor_type_(kKeyHapticMotorType), |
|
|
|
haptic_motor_type_(kKeyHapticMotorType), |
|
|
|
lra_calibration_(kKeyLraCalibration), |
|
|
|
lra_calibration_(kKeyLraCalibration), |
|
|
|
fast_charge_(kKeyFastCharge), |
|
|
|
fast_charge_(kKeyFastCharge), |
|
|
@ -295,6 +297,7 @@ auto NvsStorage::Read() -> void { |
|
|
|
lock_polarity_.read(handle_); |
|
|
|
lock_polarity_.read(handle_); |
|
|
|
display_cols_.read(handle_); |
|
|
|
display_cols_.read(handle_); |
|
|
|
display_rows_.read(handle_); |
|
|
|
display_rows_.read(handle_); |
|
|
|
|
|
|
|
display_left_padding_.read(handle_); |
|
|
|
haptic_motor_type_.read(handle_); |
|
|
|
haptic_motor_type_.read(handle_); |
|
|
|
lra_calibration_.read(handle_); |
|
|
|
lra_calibration_.read(handle_); |
|
|
|
fast_charge_.read(handle_); |
|
|
|
fast_charge_.read(handle_); |
|
|
@ -320,6 +323,7 @@ auto NvsStorage::Write() -> bool { |
|
|
|
lock_polarity_.write(handle_); |
|
|
|
lock_polarity_.write(handle_); |
|
|
|
display_cols_.write(handle_); |
|
|
|
display_cols_.write(handle_); |
|
|
|
display_rows_.write(handle_); |
|
|
|
display_rows_.write(handle_); |
|
|
|
|
|
|
|
display_left_padding_.write(handle_); |
|
|
|
haptic_motor_type_.write(handle_); |
|
|
|
haptic_motor_type_.write(handle_); |
|
|
|
lra_calibration_.write(handle_); |
|
|
|
lra_calibration_.write(handle_); |
|
|
|
fast_charge_.write(handle_); |
|
|
|
fast_charge_.write(handle_); |
|
|
@ -399,6 +403,16 @@ auto NvsStorage::DisplaySize( |
|
|
|
display_rows_.set(std::move(size.second)); |
|
|
|
display_rows_.set(std::move(size.second)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto NvsStorage::DisplayLeftPadding() -> uint8_t { |
|
|
|
|
|
|
|
std::lock_guard<std::mutex> lock{mutex_}; |
|
|
|
|
|
|
|
return display_left_padding_.get().value_or(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto NvsStorage::DisplayLeftPadding(uint8_t val) -> void { |
|
|
|
|
|
|
|
std::lock_guard<std::mutex> lock{mutex_}; |
|
|
|
|
|
|
|
display_left_padding_.set(val); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
auto NvsStorage::PreferredBluetoothDevice() |
|
|
|
auto NvsStorage::PreferredBluetoothDevice() |
|
|
|
-> std::optional<bluetooth::MacAndName> { |
|
|
|
-> std::optional<bluetooth::MacAndName> { |
|
|
|
std::lock_guard<std::mutex> lock{mutex_}; |
|
|
|
std::lock_guard<std::mutex> lock{mutex_}; |
|
|
|