This repository was archived by the owner on Jun 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ Screen infoScreen = {
117117 // .onPress = mainscreen_onpress,
118118 .onEnter = mainScreenOnEnter ,
119119 .onCustomized = eeprom_write_variables ,
120+ .onPress = anyscreen_onpress ,
120121
121122 .fields = {
122123 BATTERY_BAR ,
Original file line number Diff line number Diff line change 44
55
66# The integer build number for this release, MUST BE INCREMENTED FOR EACH RELEASE SO BOOTLOADER WILL INSTALL
7- VERSION_NUM := 13
7+ VERSION_NUM := 14
88
99VERSION_STRING := 0.19.$(VERSION_NUM)
1010
Original file line number Diff line number Diff line change @@ -33,3 +33,4 @@ extern Field socField,
3333extern Field batteryField ; // These fields are custom for board type
3434void battery_display (); // 850C and sw102 provide alternative versions due to different implementations
3535void set_conversions ();
36+ bool anyscreen_onpress (buttons_events_t events );
Original file line number Diff line number Diff line change @@ -156,19 +156,27 @@ Screen bootScreen = {
156156 }
157157};
158158
159- bool mainscreen_onpress (buttons_events_t events ) {
160- if ((events & DOWN_LONG_CLICK ) && l3_vars .ui8_walk_assist_feature_enabled ) {
161- ui8_walk_assist_state = 1 ;
162- return true;
163- }
159+ // Allow common operations (like walk assist and headlights) button presses to work on any page
160+ bool anyscreen_onpress (buttons_events_t events ) {
161+ if ((events & DOWN_LONG_CLICK ) && l3_vars .ui8_walk_assist_feature_enabled ) {
162+ ui8_walk_assist_state = 1 ;
163+ return true;
164+ }
164165
165- // long up to turn on headlights
166- if (events & UP_LONG_CLICK ) {
167- l3_vars .ui8_lights = !l3_vars .ui8_lights ;
168- set_lcd_backlight ();
166+ // long up to turn on headlights
167+ if (events & UP_LONG_CLICK ) {
168+ l3_vars .ui8_lights = !l3_vars .ui8_lights ;
169+ set_lcd_backlight ();
169170
170- return true;
171- }
171+ return true;
172+ }
173+
174+ return false;
175+ }
176+
177+ bool mainscreen_onpress (buttons_events_t events ) {
178+ if (anyscreen_onpress (events ))
179+ return true;
172180
173181 if (events & UP_CLICK /* &&
174182 m_lcd_vars.ui8_lcd_menu_max_power == 0 */ ) {
You can’t perform that action at this time.
0 commit comments