Initialization is a core component. It differs from the initialization component of the standard MQX. The _mqx() function of the standard MQX is split into two functions in MQXLite:
- _mqxlite_init() - This function is called during the Processor Expert internal initialization. Based on the values in MQX Lite initialization structure that is passed as _mqxlite() function argument, MQX Lite does the following:
- It sets up and initializes the data that MQX Lite uses internally, including MQX Lite kernel data structure, ready queues, and the interrupt stack.
- It creates lightweight semaphore for internal synchronization needs.
- It starts the tick timer.
- _mqxlite() - This function starts MQX Lite and should be called from the user application, typically in main(), after the Processor Expert internal initialization code (PE_low_level_init() function). The _mqxlite() function:
- Creates the idle task, which is active if no other task is ready.
- Creates tasks that the task template list defines as autostart tasks.
- Starts the task scheduler.