MCPcopy Create free account
hub / github.com/Michael-Manning/E-Paper-Climate-Logger / MainMenu

Method MainMenu

firmware/src/app.cpp:391–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389 else{
390 disp->printf(0, 199, "No data", (int(readingCount)));
391 }
392
393 disp->EndRefresh();
394 }
395
396 if(getBtn2Down()){
397 setState(State::MainMenu);
398 menuSelectedOption = 0;
399
400 resetInactivity();
401 }
402}
403
404void App::MainMenu()
405{
406 auto d = disp->d;
407
408 const char* options[] = {
409 "View data",
410 "Debug menu",
411 "Settings",
412 "Set time",
413 "E-reader"
414 };
415
416 const int optionsCount = Constants::easterEggs ? 5 : 4;
417
418 if(shouldRedraw()){
419 disp->StartRefresh();
420 d->setRotation(1);
421 d->fillScreen(white);
422
423 // top bar
424 {
425 d->setFont(&FreeMonoBold9pt7b);
426
427 d->drawCircle(14, 6, 2, black);
428 disp->print(24, 10, "Back");
429
430
431 d->drawCircle(120, 6, 2, black);
432 disp->print(128, 10, "Next");
433
434 d->drawCircle(110, 22, 2, black);
435 d->drawCircle(120, 22, 2, black);
436 disp->print(128, 26, "Enter");
437
438 d->drawFastHLine(0, 30, 199, black);
439 }
440
441 d->setFont(&FreeMonoBold12pt7b);
442
443 int optionsPos = 50;
444 for (int i = 0; i < optionsCount; i++)
445 {
446
447 int y = optionsPos + 20 * i;
448 int xo = disp->printAndOffset(0, y, options[i]);

Callers

nothing calls this directly

Calls 7

getBtn2DownFunction · 0.85
StartRefreshMethod · 0.80
printMethod · 0.80
printAndOffsetMethod · 0.80
EndRefreshMethod · 0.80

Tested by

no test coverage detected