@@ -140,8 +140,14 @@ int main(void) {
140140
141141 if (THREADED ) {
142142 xTaskCreate (usb_thread , "TUD" , configMINIMAL_STACK_SIZE , NULL , TUD_TASK_PRIO , & tud_taskhandle );
143+ #if (configNUMBER_OF_CORES > 1 )
144+ vTaskCoreAffinitySet (tud_taskhandle , (1 << 0 ));
145+ #endif
143146#if PICO_RP2040
144147 xTaskCreate (dev_mon , "WDOG" , configMINIMAL_STACK_SIZE , NULL , TUD_TASK_PRIO , & mon_taskhandle );
148+ #if (configNUMBER_OF_CORES > 1 )
149+ vTaskCoreAffinitySet (mon_taskhandle , (1 << 0 ));
150+ #endif
145151#endif
146152 vTaskStartScheduler ();
147153 }
@@ -274,7 +280,11 @@ void tud_mount_cb(void)
274280 xTaskCreate (dap_thread , "DAP" , configMINIMAL_STACK_SIZE , NULL , DAP_TASK_PRIO , & dap_taskhandle );
275281 /* Autobaud detection using PIO as a frequency counter */
276282 xTaskCreate (autobaud_thread , "ABR" , configMINIMAL_STACK_SIZE , NULL , AUTOBAUD_TASK_PRIO , & autobaud_taskhandle );
283+ #if (configNUMBER_OF_CORES > 1 )
277284 vTaskCoreAffinitySet (autobaud_taskhandle , (1 << 1 ));
285+ vTaskCoreAffinitySet (dap_taskhandle , (1 << 0 ));
286+ vTaskCoreAffinitySet (uart_taskhandle , (1 << 0 ));
287+ #endif
278288 was_configured = 1 ;
279289 }
280290}
0 commit comments