MCPcopy Create free account
hub / github.com/Blueforcer/awtrix3 / rightButton

Method rightButton

src/MenuManager.cpp:215–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215void MenuManager_::rightButton()
216{
217 if (!inMenu)
218 return;
219 switch (currentState)
220 {
221 case MainMenu:
222 menuIndex = (menuIndex + 1) % menuItemCount;
223 break;
224 case BrightnessMenu:
225 if (!AUTO_BRIGHTNESS)
226 {
227 BRIGHTNESS_PERCENT = (BRIGHTNESS_PERCENT % 100) + 1;
228 BRIGHTNESS = convertBRIPercentTo8Bit(BRIGHTNESS_PERCENT);
229 DisplayManager.setBrightness(BRIGHTNESS);
230 }
231 break;
232 case ColorMenu:
233 currentColor = (currentColor + 1) % (sizeof(textColors) / sizeof(textColors[0]));
234 break;
235 case SwitchMenu:
236 AUTO_TRANSITION = !AUTO_TRANSITION;
237 break;
238 case TspeedMenu:
239 TIME_PER_TRANSITION = min(2000, TIME_PER_TRANSITION + 100);
240 break;
241 case AppTimeMenu:
242 TIME_PER_APP = min(static_cast<long>(30000), TIME_PER_APP + 1000);
243 break;
244 case TimeFormatMenu:
245 timeFormatIndex = (timeFormatIndex + 1) % timeFormatCount;
246 break;
247 case DateFormatMenu:
248 dateFormatIndex = (dateFormatIndex + 1) % dateFormatCount;
249 break;
250 case Appmenu:
251 appsIndex = (appsIndex + 1) % appsCount;
252 break;
253 case WeekdayMenu:
254 START_ON_MONDAY = !START_ON_MONDAY;
255 break;
256 case SoundMenu:
257 SOUND_ACTIVE = !SOUND_ACTIVE;
258 break;
259 case TempMenu:
260 IS_CELSIUS = !IS_CELSIUS;
261 break;
262 case VolumeMenu:
263 if (!(DFPLAYER_ACTIVE || BUZ_VOL))
264 break;
265 if ((SOUND_VOLUME + 1) > 30)
266 SOUND_VOLUME = 0;
267 else
268 SOUND_VOLUME++;
269 break;
270 default:
271 break;
272 }

Callers 1

right_button_pressedFunction · 0.45

Calls 2

convertBRIPercentTo8BitFunction · 0.85
setBrightnessMethod · 0.45

Tested by

no test coverage detected