MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / setupUsbBootMode

Method setupUsbBootMode

Tactility/Source/app/boot/Boot.cpp:78–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 7

infoMethod · 0.80
errorMethod · 0.80
isUsbBootModeFunction · 0.50
getUsbBootModeFunction · 0.50
resetUsbBootModeFunction · 0.50

Tested by

no test coverage detected