简体   繁体   中英

How can I override #define OS_ISR_FIFO_QUEUE in my application

in the Mbed OS System there is a library called RTX_Config.h. I need to change the value of this define in the lib.

#ifndef OS_ISR_FIFO_QUEUE
#define OS_ISR_FIFO_QUEUE           16
#endif

could someone give me a hint, how the Mbed Configuring System works and if I'm able to overide this Value with the Configuring System?

Thanks !

Googling for the original source file I found that:

//   <o>ISR FIFO Queue 
//      <4=>  4 entries    <8=>   8 entries   <12=>  12 entries   <16=>  16 entries
//     <24=> 24 entries   <32=>  32 entries   <48=>  48 entries   <64=>  64 entries
//     <96=> 96 entries  <128=> 128 entries  <196=> 196 entries  <256=> 256 entries
//   <i> RTOS Functions called from ISR store requests to this buffer.
//   <i> Default: 16 entries
#ifndef OS_ISR_FIFO_QUEUE
#define OS_ISR_FIFO_QUEUE           16
#endif

The purpose of this file is to set the associated module's configuration. So you can go and modify it directly without any issue.

Now, if your concern is about not getting into the ifdef/if because this define already exists, then you can undefine it (although it might not be the proper way to go):

#ifdef OS_ISR_FIFO_QUEUE
#undef OS_ISR_FIFO_QUEUE
#endif

#ifndef OS_ISR_FIFO_QUEUE
#define OS_ISR_FIFO_QUEUE 1234 // your value
#endif

Indeed, if the define already exists, you should rather look for the place it is defined and modify the value there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM