usb serial debug interface & usb serial async msg (#2111)

* add serial_debug

* not use OSS

* add path print

* add string print and vec

* clean up

* clean up

* format

* add an async blocking bool

* add an async blocking bool - comment

* protect the unexpected tx

* naming

* remove demo code
This commit is contained in:
sommermorgentraum 2024-04-18 18:10:34 +08:00 committed by GitHub
parent bb1b703dc1
commit b2da21b88a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 177 additions and 1 deletions

View file

@ -1131,6 +1131,23 @@ static void cmd_sendpocsag(BaseSequentialStream* chp, int argc, char* argv[]) {
chprintf(chp, "ok\r\n");
}
static void cmd_asyncmsg(BaseSequentialStream* chp, int argc, char* argv[]) {
const char* usage = "usage: asyncmsg x, x can be enable or disable\r\n";
if (argc != 1) {
chprintf(chp, usage);
return;
}
if (strcmp(argv[0], "disable") == 0) {
portapack::async_tx_enabled = false;
chprintf(chp, "ok\r\n");
} else if (strcmp(argv[0], "enable") == 0) {
portapack::async_tx_enabled = true;
chprintf(chp, "ok\r\n");
} else {
chprintf(chp, usage);
}
}
static const ShellCommand commands[] = {
{"reboot", cmd_reboot},
{"dfu", cmd_dfu},
@ -1162,6 +1179,7 @@ static const ShellCommand commands[] = {
{"pmemreset", cmd_pmemreset},
{"settingsreset", cmd_settingsreset},
{"sendpocsag", cmd_sendpocsag},
{"asyncmsg", cmd_asyncmsg},
{NULL, NULL}};
static const ShellConfig shell_cfg1 = {