#define LOG_TAG "TH-CDC" #include #include "main.h" #include "usbd_cdc_if.h" #include "navikit.h" //global variable extern uint8_t port_restart[]; extern uint32_t number_restart; //task attributes const osThreadAttr_t cdcMonitorTask_attributes = { .name = "cdcMonitorTask", .priority = (osPriority_t) osPriorityNormal, .stack_size = 128 * 4 }; //task instance void StartCdcMonitorTask(void *argument){ uint8_t port_restart_temp[64]={0}; uint32_t number_restart_temp =0; bool beep_flag = false; log_v("Start CDC Monitor Task"); for(;;){ if(number_restart){ number_restart_temp = number_restart; memcpy(port_restart_temp,&port_restart,number_restart_temp<=12 ? number_restart_temp : 12); number_restart = 0; // turn off usb port device for(uint8_t i=0;i