SWRU271I October 2010 – January 2020 CC2540 , CC2540T , CC2541 , CC2541-Q1 , CC2640R2F
To use OSAL, locate a call to osal_start_system() at the end of the main() function. This function call is the OSAL routine that starts the system. This routine starts the system and calls the osalInitTasks() function defined by the application. In the SimpleBLEPeripheral project, you can find this function in OSAL_SimpleBLEPeripheral.c:
Each layer of software using OSAL must have an initialization routine called from the function osalInitTasks(). Within this function, the initialization routine for every layer of software is called within the osalInitTasks(). As each task initialization routine is called, an 8-bit task ID value is assigned to the task. The task ID determines the priority of the tasks. The task ID gives lower values higher priority. The protocol stack tasks must have the highest priority. The initialization function of the SimpleBLEPeripheral application, SimpleBLEPeripheral_Init(), has the highest task ID and the lowest priority.
NOTE
When creating an application, add this 8-bit task ID value to the end of the list and ensure that the task ID is greater than the other task ID values. OSAL and HAL components are provided in source form.