| 76 | } |
| 77 | |
| 78 | static bool setupUsbBootMode() { |
| 79 | if (!hal::usb::isUsbBootMode()) { |
| 80 | return false; |
| 81 | } |
| 82 | |
| 83 | LOGGER.info("Rebooting into mass storage device mode"); |
| 84 | auto mode = hal::usb::getUsbBootMode(); // Get mode before reset |
| 85 | hal::usb::resetUsbBootMode(); |
| 86 | if (mode == hal::usb::BootMode::Flash) { |
| 87 | if (!hal::usb::startMassStorageWithFlash(true)) { |
| 88 | LOGGER.error("Unable to start flash mass storage"); |
| 89 | return false; |
| 90 | } |
| 91 | } else if (mode == hal::usb::BootMode::Sdmmc) { |
| 92 | if (!hal::usb::startMassStorageWithSdmmc(true)) { |
| 93 | LOGGER.error("Unable to start SD mass storage"); |
| 94 | return false; |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | return true; |
| 99 | } |
| 100 | |
| 101 | static void waitForMinimalSplashDuration(TickType_t startTime) { |
| 102 | const auto end_time = kernel::getTicks(); |
nothing calls this directly
no test coverage detected