Skip to content

Commit cd63b00

Browse files
committed
at_commands: fix AT+RESET peculiar behaviour
1 parent 189ec9d commit cd63b00

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

UNOR4USBBridge/cmds_esp_generic.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,22 @@ void CAtHandler::add_cmds_esp_generic() {
1414
switch (parser.cmd_mode) {
1515
case chAT::CommandMode::Run: {
1616
ESP.restart();
17-
break;
17+
return chAT::CommandStatus::OK;
1818
}
19-
case chAT::CommandMode::Write: {
19+
}
20+
return chAT::CommandStatus::ERROR;
21+
};
22+
23+
/* ....................................................................... */
24+
command_table[_RESTART_BOOTLOADER] = [this](auto & srv, auto & parser) {
25+
/* ....................................................................... */
26+
switch (parser.cmd_mode) {
27+
case chAT::CommandMode::Run: {
2028
usb_persist_restart(RESTART_BOOTLOADER);
21-
break;
29+
return chAT::CommandStatus::OK;
2230
}
2331
}
24-
return chAT::CommandStatus::OK;
32+
return chAT::CommandStatus::ERROR;
2533
};
2634

2735
/* ....................................................................... */

0 commit comments

Comments
 (0)