feat(radio): add the ability to trigger EM from CLI (#6640)
This commit is contained in:
@@ -153,7 +153,7 @@ void boardInit()
|
|||||||
|
|
||||||
#if !defined(DEBUG_SEGGER_RTT)
|
#if !defined(DEBUG_SEGGER_RTT)
|
||||||
// This is needed to prevent radio from starting when usb is plugged to charge
|
// This is needed to prevent radio from starting when usb is plugged to charge
|
||||||
if (usbPlugged()) {
|
if (!UNEXPECTED_SHUTDOWN() && usbPlugged()) {
|
||||||
while (usbPlugged() && !pwrPressed()) {
|
while (usbPlugged() && !pwrPressed()) {
|
||||||
delay_ms(1000);
|
delay_ms(1000);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1736,6 +1736,14 @@ int cliCrypt(const char ** argv)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int cliTriggerEM(const char** argv)
|
||||||
|
{
|
||||||
|
// Prevent task switching
|
||||||
|
vTaskSuspendAll();
|
||||||
|
// Trigger watchdog
|
||||||
|
while(1);
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(TP_GT911)
|
#if defined(TP_GT911)
|
||||||
// from tp_gt911.cpp
|
// from tp_gt911.cpp
|
||||||
extern uint8_t tp_gt911_cfgVer;
|
extern uint8_t tp_gt911_cfgVer;
|
||||||
@@ -1811,6 +1819,7 @@ const CliCommand cliCommands[] = {
|
|||||||
#if defined(TP_GT911)
|
#if defined(TP_GT911)
|
||||||
{ "reset_gt911", cliResetGT911, ""},
|
{ "reset_gt911", cliResetGT911, ""},
|
||||||
#endif
|
#endif
|
||||||
|
{ "trigger_watchdog_reset", cliTriggerEM, ""},
|
||||||
{ nullptr, nullptr, nullptr } /* sentinel */
|
{ nullptr, nullptr, nullptr } /* sentinel */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user