diff --git a/src/rx5808-pro-diversity/settings_eeprom.h b/src/rx5808-pro-diversity/settings_eeprom.h index e81ed2b2..816cdbdb 100644 --- a/src/rx5808-pro-diversity/settings_eeprom.h +++ b/src/rx5808-pro-diversity/settings_eeprom.h @@ -48,6 +48,7 @@ struct EepromSettings { uint8_t selectedHomePage; uint8_t buttonBeep; uint8_t invertDisplay; + uint8_t rotateOled; // Internal settings uint8_t spectatorFreqScanStep; @@ -108,6 +109,7 @@ PROGMEM const struct { uint8_t selectedHomePage = 0; uint8_t buttonBeep = true; uint8_t invertDisplay = false; + uint8_t rotateOled = false; // Internal settings uint8_t spectatorFreqScanStep = 5; diff --git a/src/rx5808-pro-diversity/settings_internal.h b/src/rx5808-pro-diversity/settings_internal.h index 0651b5fd..5cf122da 100644 --- a/src/rx5808-pro-diversity/settings_internal.h +++ b/src/rx5808-pro-diversity/settings_internal.h @@ -34,7 +34,7 @@ SOFTWARE. // This should be incremented after every EEPROM change. // Version Number format v00.01 -#define VERSION_NUMBER 0002 +#define VERSION_NUMBER 0001 // === Receiver Modules ========================================================= diff --git a/src/rx5808-pro-diversity/state_settings.cpp b/src/rx5808-pro-diversity/state_settings.cpp index 7a621935..bb4b217a 100644 --- a/src/rx5808-pro-diversity/state_settings.cpp +++ b/src/rx5808-pro-diversity/state_settings.cpp @@ -13,7 +13,7 @@ int8_t selectedMenuItem = 0; bool showChangeMenuOptions = false; -uint8_t menuItems = 12; // Number of items in settingsMenu[] +uint8_t menuItems = 13; // Number of items in settingsMenu[] char* settingsMenu[]={ "Quadversity", "Home Page", //defaut, simple, stats @@ -27,6 +27,7 @@ char* settingsMenu[]={ "Button Beep", "Draw Logo", "Invert Display", + "Rotate OLED", }; void StateMachine::SettingsStateHandler::onEnter() { @@ -213,6 +214,14 @@ void StateMachine::SettingsStateHandler::onUpdateDraw() { } break; + case 12: // Rotate OLED + if (EepromSettings.rotateOled) { + Ui::display.print(PSTR2(" Rotated ")); + } else { + Ui::display.print(PSTR2(" Normal ")); + } + break; + } } @@ -313,6 +322,10 @@ void StateMachine::SettingsStateHandler::onButtonChange( EepromSettings.invertDisplay = !EepromSettings.invertDisplay; break; + case (12): // Rotate OLED + EepromSettings.rotateOled = !EepromSettings.rotateOled; + break; + } } } @@ -388,6 +401,10 @@ void StateMachine::SettingsStateHandler::onButtonChange( EepromSettings.invertDisplay = !EepromSettings.invertDisplay; break; + case (12): // Rotate OLED + EepromSettings.rotateOled = !EepromSettings.rotateOled; + break; + } } } diff --git a/src/rx5808-pro-diversity/ui.cpp b/src/rx5808-pro-diversity/ui.cpp index 8efb1806..c4c4d11f 100644 --- a/src/rx5808-pro-diversity/ui.cpp +++ b/src/rx5808-pro-diversity/ui.cpp @@ -130,6 +130,11 @@ namespace Ui { } else { if (EepromSettings.useOledScreen) { #ifndef DISABLE_OLED + if (EepromSettings.rotateOled){ + display.setRotation(2); + } else { + display.setRotation(0); + } display.display(); #endif } else {