@@ -80,16 +80,16 @@ class MainMenuScreen : public GPScreen {
8080 virtual void drawScreen ();
8181 private:
8282 bool isPressed = false ;
83- uint32_t checkDebounce;
84- std::vector<MenuEntry>* currentMenu;
85- std::vector<MenuEntry>* previousMenu;
83+ uint32_t checkDebounce = 0 ;
84+ std::vector<MenuEntry>* currentMenu = nullptr ;
85+ std::vector<MenuEntry>* previousMenu = nullptr ;
8686 uint16_t prevButtonState = 0 ;
8787 uint8_t prevDpadState = 0 ;
88- Mask_t prevValues;
88+ Mask_t prevValues = 0 ;
8989 GPMenu* gpMenu = nullptr ;
9090 const uint8_t menuLineSize = 4 ;
9191
92- GpioAction eventAction;
92+ GpioAction eventAction = GpioAction::NONE ;
9393
9494 bool screenIsPrompting = false ;
9595 bool promptChoice = false ;
@@ -98,13 +98,13 @@ class MainMenuScreen : public GPScreen {
9898 int8_t exitToScreenBeforePrompt = -1 ;
9999 int8_t exitToScreen = -1 ;
100100
101- GamepadButtonMapping *mapMenuUp;
102- GamepadButtonMapping *mapMenuDown;
103- GamepadButtonMapping *mapMenuLeft;
104- GamepadButtonMapping *mapMenuRight;
105- GamepadButtonMapping *mapMenuSelect;
106- GamepadButtonMapping *mapMenuBack;
107- GamepadButtonMapping *mapMenuToggle;
101+ GamepadButtonMapping *mapMenuUp = nullptr ;
102+ GamepadButtonMapping *mapMenuDown = nullptr ;
103+ GamepadButtonMapping *mapMenuLeft = nullptr ;
104+ GamepadButtonMapping *mapMenuRight = nullptr ;
105+ GamepadButtonMapping *mapMenuSelect = nullptr ;
106+ GamepadButtonMapping *mapMenuBack = nullptr ;
107+ GamepadButtonMapping *mapMenuToggle = nullptr ;
108108
109109 void saveOptions ();
110110 void resetOptions ();
@@ -118,39 +118,44 @@ class MainMenuScreen : public GPScreen {
118118 std::vector<MenuEntry> inputModeMenu = {
119119 InputMode_VALUELIST (INPUT_MODE_ENTRIES)
120120 };
121- InputMode prevInputMode;
122- InputMode updateInputMode;
121+ InputMode prevInputMode{} ;
122+ InputMode updateInputMode{} ;
123123
124124 std::vector<MenuEntry> dpadModeMenu = {
125125 DpadMode_VALUELIST (DPAD_MODE_ENTRIES)
126126 };
127- DpadMode prevDpadMode;
128- DpadMode updateDpadMode;
127+ DpadMode prevDpadMode{} ;
128+ DpadMode updateDpadMode{} ;
129129
130130 std::vector<MenuEntry> socdModeMenu = {
131131 SOCDMode_VALUELIST (SOCD_MODE_ENTRIES)
132132 };
133- SOCDMode prevSocdMode;
134- SOCDMode updateSocdMode;
133+ SOCDMode prevSocdMode{} ;
134+ SOCDMode updateSocdMode{} ;
135135
136136 std::vector<MenuEntry> profilesMenu = {};
137- uint8_t prevProfile;
138- uint8_t updateProfile;
137+ uint8_t prevProfile{} ;
138+ uint8_t updateProfile{} ;
139139
140140 std::vector<MenuEntry> focusModeMenu = {
141141 {" Off" , NULL , nullptr , std::bind (&MainMenuScreen::currentFocusMode, this ), std::bind (&MainMenuScreen::selectFocusMode, this ), 0 },
142142 {" On" , NULL , nullptr , std::bind (&MainMenuScreen::currentFocusMode, this ), std::bind (&MainMenuScreen::selectFocusMode, this ), 1 },
143143 };
144- bool prevFocus;
145- bool updateFocus;
144+ bool prevFocus = false ;
145+ bool updateFocus = false ;
146146
147147 std::vector<MenuEntry> turboModeMenu = {
148148 {" Off" , NULL , nullptr , std::bind (&MainMenuScreen::currentTurboMode, this ), std::bind (&MainMenuScreen::selectTurboMode, this ), 0 },
149149 {" On" , NULL , nullptr , std::bind (&MainMenuScreen::currentTurboMode, this ), std::bind (&MainMenuScreen::selectTurboMode, this ), 1 },
150150 };
151- bool prevTurbo;
152- bool updateTurbo;
151+ bool prevTurbo = false ;
152+ bool updateTurbo = false ;
153153
154+ std::vector<MenuEntry> saveMenu = {
155+ {" Save & Exit" ,NULL , nullptr , std::bind (&MainMenuScreen::modeValue, this ), std::bind (&MainMenuScreen::saveAndExit, this ), 1 },
156+ {" Exit" , NULL , nullptr , std::bind (&MainMenuScreen::modeValue, this ), std::bind (&MainMenuScreen::exitOnly, this ), 0 },
157+ };
158+
154159 std::vector<MenuEntry> mainMenu = {
155160 {" Input Mode" , NULL , &inputModeMenu, std::bind (&MainMenuScreen::modeValue, this ), std::bind (&MainMenuScreen::testMenu, this )},
156161 {" D-Pad Mode" , NULL , &dpadModeMenu, std::bind (&MainMenuScreen::modeValue, this ), std::bind (&MainMenuScreen::testMenu, this )},
@@ -161,10 +166,7 @@ class MainMenuScreen : public GPScreen {
161166 {" Exit" , NULL , &saveMenu, std::bind (&MainMenuScreen::modeValue, this ), std::bind (&MainMenuScreen::testMenu, this )},
162167 };
163168
164- std::vector<MenuEntry> saveMenu = {
165- {" Save & Exit" ,NULL , nullptr , std::bind (&MainMenuScreen::modeValue, this ), std::bind (&MainMenuScreen::saveAndExit, this ), 1 },
166- {" Exit" , NULL , nullptr , std::bind (&MainMenuScreen::modeValue, this ), std::bind (&MainMenuScreen::exitOnly, this ), 0 },
167- };
169+
168170};
169171
170172#endif
0 commit comments