distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
CHECK_FUNCTION_CONTEXT.hpp
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DISTORTOS_INTERNAL_CHECK_FUNCTION_CONTEXT_HPP_
13 #define INCLUDE_DISTORTOS_INTERNAL_CHECK_FUNCTION_CONTEXT_HPP_
14 
16 
17 #ifdef DISTORTOS_CHECK_FUNCTION_CONTEXT_ENABLE
18 
20 
21 #include "distortos/FATAL_ERROR.h"
22 
29 #define CHECK_FUNCTION_CONTEXT() (distortos::architecture::isInInterruptContext() == false ? static_cast<void>(0) : \
30  FATAL_ERROR("This function cannot be used from interrupt context!"))
31 
32 #else /* !def DISTORTOS_CHECK_FUNCTION_CONTEXT_ENABLE */
33 
34 #define CHECK_FUNCTION_CONTEXT()
35 
36 #endif /* !def DISTORTOS_CHECK_FUNCTION_CONTEXT_ENABLE */
37 
38 #endif /* INCLUDE_DISTORTOS_INTERNAL_CHECK_FUNCTION_CONTEXT_HPP_ */
distortos configuration
FATAL_ERROR() macro.
isInInterruptContext() declaration