diff options
Diffstat (limited to 'src/app_console/app_console.cpp')
| -rw-r--r-- | src/app_console/app_console.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/app_console/app_console.cpp b/src/app_console/app_console.cpp index f99f7536..2d16b60b 100644 --- a/src/app_console/app_console.cpp +++ b/src/app_console/app_console.cpp @@ -39,6 +39,7 @@ #include "index.hpp" #include "lua_thread.hpp" #include "memory_resource.hpp" +#include "samd.hpp" #include "service_locator.hpp" #include "system_events.hpp" #include "track.hpp" @@ -414,14 +415,15 @@ int CmdSamd(int argc, char** argv) { std::cout << usage << std::endl; return 1; } + drivers::Samd& samd = AppConsole::sServices->samd(); std::pmr::string cmd{argv[1]}; if (cmd == "flash") { std::cout << "resetting samd..." << std::endl; vTaskDelay(pdMS_TO_TICKS(5)); - AppConsole::sServices->samd().ResetToFlashSamd(); + samd.ResetToFlashSamd(); } else if (cmd == "charge") { - auto res = AppConsole::sServices->samd().GetChargeStatus(); + auto res = samd.GetChargeStatus(); if (res) { switch (res.value()) { case drivers::Samd::ChargeStatus::kNoBattery: @@ -446,6 +448,10 @@ int CmdSamd(int argc, char** argv) { } else { std::cout << "unknown" << std::endl; } + } else if (cmd == "msc") { + bool current = samd.UsbMassStorage(); + std::cout << "toggling to: " << !current << std::endl; + samd.UsbMassStorage(!current); } else if (cmd == "off") { std::cout << "bye !!!" << std::endl; vTaskDelay(pdMS_TO_TICKS(5)); |
