This commit is contained in:
Edward Emelianov
2023-04-29 21:49:45 +03:00
parent 72ef5c9cc6
commit 9b0504944b
14 changed files with 993 additions and 15 deletions

View File

@@ -19,6 +19,7 @@
#include "cmdproto.h"
#include "debug.h"
#include "strfunc.h"
#include "usart.h"
#include "usb.h"
#include "usb_lib.h" // USBON
#include "version.inc"
@@ -28,12 +29,13 @@
extern volatile uint32_t Tms;
const char* helpmsg =
"https://github.com/eddyem/stm32samples/tree/master/F3:F303/PL2303 build#" BUILD_NUMBER " @ " BUILD_DATE "\n"
static const char* helpmsg =
"https://github.com/eddyem/stm32samples/tree/master/F3:F303/Seven_CDCs build#" BUILD_NUMBER " @ " BUILD_DATE "\n"
"2..7 - send next string to given EP\n"
"'i' - print USB->ISTR state\n"
"'N' - read number (dec, 0xhex, 0oct, bbin) and show it in decimal\n"
"'R' - software reset\n"
"'ux data' - send data to USARTx\n"
"'U' - get USB status\n"
"'W' - test watchdog\n"
;
@@ -94,6 +96,15 @@ void parse_cmd(const char *buf){
SEND(nxt);
}else SEND("\n");
break;
case 'u':
nxt = getnum(buf, &Num);
if(buf == nxt || Num < 1 || Num > USARTSNO){
if(Num == 0) SENDN("Wrong USART number");
}
nxt = omit_spaces(nxt);
usart_sendn(Num, (uint8_t*)nxt, mystrlen(nxt));
SENDN("OK");
break;
default:
SEND(buf-1); // echo
return;