Useful Macros

  • Builds the task identifier from the type and the index of that task:

    #define KE_BUILD_ID(type, index) ( (ke_task_id_t)(((index) << 8)|(type)) )

  • Retrieves task type from task id:

    #define KE_TYPE_GET(ke_task_id) ((ke_task_id) & 0xFF)

  • Retrieves task index number from task id:

    #define KE_IDX_GET(ke_task_id) (((ke_task_id) >> 8) & 0xFF)