| 372 | **********************************************************************/ |
| 373 | #ifndef HEADLESS |
| 374 | void loop() { |
| 375 | bool redraw = true; |
| 376 | bool update_sd; |
| 377 | int index = 0; |
| 378 | int opt = 5; // there are 3 options> 1 list SD files, 2 OTA, 3 USB and 4 Config |
| 379 | int pass_by = 0; |
| 380 | bool first_loop = true; |
| 381 | getBrightness(); |
| 382 | if (!sdcardMounted) index = 1; // if SD card is not present, paint SD square grey and auto select OTA |
| 383 | std::vector<MenuOptions> menuItems = { |
| 384 | { |
| 385 | #if (TFT_HEIGHT < 135) || (TFT_WIDTH < 135) |
| 386 | "SD", "Launch from SDCard", |
| 387 | #else |
| 388 | "SD", |
| 389 | "Launch from or mng SDCard", |
| 390 | #endif |
| 391 | [=]() { loopSD(false); }, |
| 392 | sdcardMounted |
| 393 | }, |
| 394 | #ifndef DISABLE_OTA |
| 395 | {"OTA", "Online Installer", [=]() { ota_function(); }}, |
| 396 | #endif |
| 397 | { |
| 398 | #if (TFT_HEIGHT < 135) || (TFT_WIDTH < 135) |
| 399 | "WUI", "Start WebUI", |
| 400 | #else |
| 401 | "WUI", |
| 402 | "Start Web User Interface", |
| 403 | #endif |
| 404 | [=]() { loopOptionsWebUi(); } |
| 405 | }, |
| 406 | #if defined(SOC_USB_OTG_SUPPORTED) |
| 407 | { |
| 408 | #if (TFT_HEIGHT < 135) || (TFT_WIDTH < 135) |
| 409 | "USB", "SD->USB", |
| 410 | #else |
| 411 | "USB", |
| 412 | "SD->USB Interface", |
| 413 | #endif |
| 414 | [=]() { |
| 415 | if (setupSdCard()) { |
| 416 | MassStorage(); |
| 417 | tft->drawPixel(0, 0, 0); |
| 418 | tft->fillScreen(BGCOLOR); |
| 419 | } else { |
| 420 | displayRedStripe("Insert SD Card"); |
| 421 | launcherDelayMs(2000); |
| 422 | } |
| 423 | }, sdcardMounted |
| 424 | }, |
| 425 | #endif |
| 426 | { |
| 427 | #if (TFT_HEIGHT < 135) || (TFT_WIDTH < 135) |
| 428 | "PM" |
| 429 | #else |
| 430 | "PMan" |
| 431 | #endif |
no test coverage detected