00001 00014 #ifndef CRITICAL_NESTING_H_ 00015 #define CRITICAL_NESTING_H_ 00016 00017 #ifdef CFG_RTOS 00018 /* 00019 * In case an RTOS is used, the following two functions need to be defined. They are 00020 * used to increment and decrement the critical section nesting level possibly used 00021 * by the RTOS. 00022 * It allows continuing using our own critical section implementation (that has the 00023 * advantage to be usable in functions that can be executed both from interrupt and 00024 * background) while ensuring that a RTOS function called from a critical section 00025 * and itself using a critical section will not reenable the interrupts too early. 00026 */ 00032 void critical_nesting_inc(void); 00038 void critical_nesting_dec(void); 00039 00041 #define CRITICAL_NESTING_INC() critical_nesting_inc() 00043 #define CRITICAL_NESTING_DEC() critical_nesting_dec() 00044 #else 00046 #define CRITICAL_NESTING_INC() 00048 #define CRITICAL_NESTING_DEC() 00049 #endif 00050 00051 #endif // CRITICAL_NESTING_H_
1.6.1