fixed the crash and implemented trigger arming

This commit is contained in:
2018-01-27 11:02:19 +01:00
parent 45b4fb45e9
commit 88bd46f516
4 changed files with 170 additions and 36 deletions
+6 -1
View File
@@ -20,7 +20,12 @@ void TF_WriteImpl(TinyFrame *tf, const uint8_t *buff, uint32_t len)
#define CHUNK 64 // same as TF_SENDBUF_LEN, so we should always have only one run of the loop
int32_t total = (int32_t) len;
while (total > 0) {
assert_param(osOK == osSemaphoreWait(semVcomTxReadyHandle, 1000));
int32_t mxStatus = osSemaphoreWait(semVcomTxReadyHandle, 250);
if (mxStatus != osOK) {
TF_Error("Tx stalled");
return;
}
uint16_t chunksize = (uint16_t) MIN(total, CHUNK);
assert_param(USBD_OK == CDC_Transmit_FS((uint8_t *) buff, chunksize));