Hi,
The user guide shows a table of values for task priorities 0-7. The "writing your first MQX application" document suggests that any task defined by the application should not be between 0-8.
What is BASEPRI for tasks above 8?
What is the range of values for priorities? What is the highest numerical value?
A queue is created for each priority so I understand that it will increase memory but is this done dynamically or statically (by a configuration constant)?
I chose to define a single spawn task in the task template. My other tasks are created dynamically.
Thanks,
Kenny
Solved! Go to Solution.
Hi Kenny:
The BASEPRI for tasks above 8 is 0x0;
As you said, a queue is created for each priority queue, it will increase memory. it is done statically.
you can refer to the following code, in function _psp_init_readyqs
q_ptr = (READY_Q_STRUCT_PTR)_mem_alloc_zero(sizeof(READY_Q_STRUCT) * priority_levels);
so the highest priority is determined by how much memory you allocated. I have tried this in TWR-K60F120, the highest priority is between 7500-7800
Have a great day,
Daniel
Hi Kenny:
The BASEPRI for tasks above 8 is 0x0;
As you said, a queue is created for each priority queue, it will increase memory. it is done statically.
you can refer to the following code, in function _psp_init_readyqs
q_ptr = (READY_Q_STRUCT_PTR)_mem_alloc_zero(sizeof(READY_Q_STRUCT) * priority_levels);
so the highest priority is determined by how much memory you allocated. I have tried this in TWR-K60F120, the highest priority is between 7500-7800
Have a great day,
Daniel
Thanks for the clarification. I think that is a dynamic run-time initialization using a custom memory manager. 7500-7800! I hope I don't need that many.
BASEPRI, for others reading this, disables the masking function allowing any interrupt to run.
I feel like I have a good grasp of the tasking now. I have a C++ Task class that gives me some key functions and I've ported the QP state machine framework which makes use of the lightweight queues. I'm ready to start building on top of this. TCP/IP is next!
K