Switching Tasks in ThreadX RTOS
Using the QEMU simulator to outline the ThreadX task scheduling process.0. Build ExampleCreate Task 0 and Task 1 #include "tx_api.h" #include "tx_thread.h" // Task 0 entry void thread_0_entry(ULONG thread_input){ TX_THREAD *current_thread; thread_0_counter++; TX_THREAD_GET_CURRENT(current_thread); tx_thread_terminate(current_thread); } // Task 1 entry void thread_1_entry(ULONG thread_input){ while(1) { /* Increment the thread counter. */ thread_1_counter++; while(1); }} // Create … Read more