MCPcopy Create free account
hub / github.com/OpenStickCommunity/GP2040-CE / reboot

Method reboot

src/system.cpp:61–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void System::reboot(BootMode bootMode) {
62 // Halt all running USB instances
63 USBHostManager::getInstance().shutdown();
64
65 // Make sure that the other core is halted
66 // We do not want it to be talking to devices (e.g. OLED display) while we reboot
67 multicore_lockout_start_timeout_us(0xfffffffffffffff);
68
69 watchdog_hw->scratch[5] = static_cast<uint32_t>(bootMode);
70
71 // This is based on MicroPythons machine.reset()
72 watchdog_reboot(0, 0, 0);
73 for (;;) {
74 __wfi();
75 }
76}
77
78System::BootMode System::takeBootMode() {
79 // If the boot was not caused by software we don't enter any of the special modes

Callers 1

handleRebootFunction · 0.80

Calls 1

shutdownMethod · 0.45

Tested by

no test coverage detected