fixed some problems with USB

This commit is contained in:
2025-04-02 16:09:27 +03:00
parent e5b3edeffa
commit c449cb7108
4 changed files with 17 additions and 7 deletions

View File

@@ -40,6 +40,7 @@ int USB_send(uint8_t *buf, uint16_t size){
if(!usbON || !size) return 0;
uint16_t ctr = 0;
while(size){
IWDG->KR = IWDG_REFRESH;
uint16_t s = (size > USB_EP1BUFSZ) ? USB_EP1BUFSZ : size;
tx_succesfull = 0;
EP_Write(1, (uint8_t*)&buf[ctr], s);