mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-27 08:46:01 -04:00
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:
parent
bb1b703dc1
commit
b2da21b88a
6 changed files with 177 additions and 1 deletions
|
@ -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 = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue