add USB temlpate for F303

This commit is contained in:
eddyem
2023-01-23 12:19:19 +03:00
parent 09000fef73
commit a74e6f071b
26 changed files with 1633 additions and 2 deletions

View File

@@ -115,8 +115,8 @@ int USB_receive(uint8_t *buf, int len){
int USB_receivestr(char *buf, int len){
int l = RB_readto((ringbuffer*)&in, '\n', (uint8_t*)buf, len);
if(l == 0) return 0;
if(l < 1 || bufovrfl) RB_clearbuf((ringbuffer*)&in);
else buf[l-1] = 0; // replace '\n' with strend
if(--l < 1 || bufovrfl) RB_clearbuf((ringbuffer*)&in);
else buf[l] = 0; // replace '\n' with strend
if(bufovrfl){
if(l > 0) l = -l;
else l = -1;