Skip to content

Commit

Permalink
Update ble_handlers.cpp
Browse files Browse the repository at this point in the history
Tried to implement #1594
  • Loading branch information
discip authored Mar 11, 2023
1 parent 5022eca commit d88eed4
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions source/Core/BSP/Pinecilv2/ble_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,19 @@ int ble_char_write_setting_value_callback(struct bt_conn *conn, const struct bt_
}
} else if (uuid_value < SettingsOptions::SettingsOptionsLength) {
setSettingValue((SettingsOptions)(uuid_value), new_value);
// @TODO refactor to make this more usable
if (uuid_value == SettingsOptions::OLEDInversion) {
switch (uuid_value) {
case SettingsOptions::OLEDInversion:
OLED::setInverseDisplay(getSettingValue(SettingsOptions::OLEDInversion));
}
if (uuid_value == SettingsOptions::OLEDBrightness){
break;
case SettingsOptions::OLEDBrightness:
OLED::setBrightness(getSettingValue(SettingsOptions::OLEDBrightness));
}
if (uuid_value == SettingsOptions::OrientationMode){
break;
case SettingsOptions::OrientationMode:
OLED::setRotation(getSettingValue(SettingsOptions::OrientationMode) & 1);
break;
default:
BT_WARN("Unhandled uuid_value in %s. Got 0x%x", PRETTY_FUNCTION, uuid_value);
break;
}
return len;
}
Expand Down

0 comments on commit d88eed4

Please sign in to comment.