add command reset, fix some troubles

This commit is contained in:
Edward Emelianov
2023-09-12 23:13:50 +03:00
parent e959c7dfe2
commit 94f87db5c5
9 changed files with 64 additions and 34 deletions

View File

@@ -113,6 +113,8 @@ void can_messages_proc(){
SEND("DUMMY");
bufputchar('0' + (data[1]==CMD_DUMMY0 ? 0 : 1));
newline();
b[0] = CMD_PING;
can_send_data(b, 1); // return to slave: pong
break;
case CMD_PING: // pong
can_send_data(b, 1);
@@ -174,6 +176,9 @@ void can_messages_proc(){
*((uint32_t*)&b[2]) = Tms;
can_send_data(b, 6);
break;
case CMD_RESET_MCU:
NVIC_SystemReset();
break;
}
}else if(data[0] == DATA_MARK){ // process received data
char Ns = '0' + data[1];