We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have no issues running multiple thread instances but I can not run more then one thread at the same time, is that not possible? When the second thread starts, the code freezes.
//thd 1 extern osThreadId KA; osThreadId KA; void KA_CODE (void const *arg); KA = osThreadCreate (osThread(KA_CODE_HS), NULL); osThreadDef(KA_CODE_HS, osPriorityNormal, 1, NULL); void KA_CODE_HS(void const *arg) { while(1) { CANWrite_HS(ECU_ID_GM_1, ka, 1); osDelay(1000U); } } //and thd 2 extern osThreadId act; osThreadId act; static void Activity (void const *arg); act = osThreadCreate (osThread(activity_Thread), NULL); osThreadDef(activity_Thread, osPriorityNormal, 1, NULL); void activity_Thread(void const *arg) { while(1) { _LEDOFF(GREEN); osDelay(500u); _LEDON(GREEN); osDelay(500u); } }
Just FYI, currently we are working on the migration of this forum to a new one, which will still take some time (approx. a few weeks). Thus, I doubt this formatting issue would ever be fixed for this forum. Sorry! Thank you for your understanding!