fsl_os_abstraction

cancel
Showing results for 
Search instead for 
Did you mean: 

fsl_os_abstraction

846 Views
oaf
Contributor IV

Hi,

 

After several hours in my debugger, I've found that I've forgotten to define the used OS, when include fsl_os_abstraction.h.

If no OS is defined it defaults to BearMetal, but as I linked with MQX I got some interesting results!

 

Suggestion:

The used OS should always be defined or else the compilation stops with an error message,

then this kind of problem could NOT occur.

 

ORIGINAL:

#if defined (FSL_RTOS_MQX)

    #define USE_RTOS 1

    #include "fsl_os_abstraction_mqx.h"

#elif defined (FSL_RTOS_FREE_RTOS)

    #define USE_RTOS 1

    #include "fsl_os_abstraction_free_rtos.h"

#elif defined (FSL_RTOS_UCOSII)

    #define USE_RTOS 1

    #include "fsl_os_abstraction_ucosii.h"

#elif defined (FSL_RTOS_UCOSIII)

    #define USE_RTOS 1

    #include "fsl_os_abstraction_ucosiii.h"

#else

    #define USE_RTOS 0

    #include "fsl_os_abstraction_bm.h"

#endif

 

SUGGESTION:

#if defined (FSL_RTOS_MQX)

    #define USE_RTOS 1

    #include "fsl_os_abstraction_mqx.h"

#elif defined (FSL_RTOS_FREE_RTOS)

    #define USE_RTOS 1

    #include "fsl_os_abstraction_free_rtos.h"

#elif defined (FSL_RTOS_UCOSII)

    #define USE_RTOS 1

    #include "fsl_os_abstraction_ucosii.h"

#elif defined (FSL_RTOS_UCOSIII)

    #define USE_RTOS 1

    #include "fsl_os_abstraction_ucosiii.h"   

#elif defined (FSL_BARE_METAL)

    #define USE_RTOS 0

    #include "fsl_os_abstraction_bm.h"

#else

    #error "Must define OS used"

#endif

Labels (1)
Tags (2)
1 Reply

223 Views
DavidS
NXP Employee
NXP Employee

Hi Ole,

Great suggestions.

I will pass it along to the KSDK team.

Regards,

David