// // Created by MightyPork on 2017/11/21. // // TinyFrame integration // #include "platform.h" #include "task_main.h" #include "utils/hexdump.h" #include "USB/usbd_cdc_if.h" #include "TinyFrame.h" extern osSemaphoreId semVcomTxReadyHandle; extern osMutexId mutTinyFrameTxHandle; void TF_WriteImpl(TinyFrame *tf, const uint8_t *buff, size_t len) { (void) tf; #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, 5000)); uint16_t chunksize = (uint16_t) MIN(total, CHUNK); assert_param(USBD_OK == CDC_Transmit_FS((uint8_t *) buff, chunksize)); PUTS("Tx: "); for(int i=0;i