First of all, I see that the most the time in the g_adc_framework_user_callback. Please consider refactoring this routine, it's recommended that the interrupt callback should be short, now it takes about 1 second, which is quite long. You can use a semaphore for that, put the semaphore in the callback, and get it in the main loop in adc_thread_entry.c followed by LED blinking. In this case tx_thread_sleep might be better than R_BSP_SoftwareDelay, since the second one is more CPU intensive, while in the first case the ThreadX can schedule another thread to be executed. Secondly, in the USB Thread there is _ux_device_class_cdc_acm_read call with g_cdc. As far as I see, it isn't initialized, however it's not an issue. If you're using Communications Framework, you don't have to take care about the initialization. You can remove all _ux_* calls and g_cdc declaration from your code and just use: ssp_err_t err = g_sf_comms0.p_api->write(g_sf_comms0.p_ctrl, "Test\n", 5, TX_WAIT_FOREVER), read() function is very similar. Regards, adboc
↧