distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
CHECK_FUNCTION_CONTEXT.hpp File Reference

CHECK_FUNCTION_CONTEXT() macro. More...

Include dependency graph for CHECK_FUNCTION_CONTEXT.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CHECK_FUNCTION_CONTEXT()
 Macro used to check whether the function is executed from thread context. More...
 

Detailed Description

CHECK_FUNCTION_CONTEXT() macro.

Author
Copyright (C) 2016 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
License
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Macro Definition Documentation

◆ CHECK_FUNCTION_CONTEXT

#define CHECK_FUNCTION_CONTEXT ( )
Value:
(distortos::architecture::isInInterruptContext() == false ? static_cast<void>(0) : \
FATAL_ERROR("This function cannot be used from interrupt context!"))
bool isInInterruptContext()
Architecture-specific check of context.
Definition: ARMv6-M-ARMv7-M-isInInterruptContext.cpp:26
#define FATAL_ERROR(message)
Macro used for handling fatal errors - wrapper for fatalErrorHandler()
Definition: FATAL_ERROR.h:46

Macro used to check whether the function is executed from thread context.

If the function using this macro is executed from interrupt context, FATAL_ERROR() is called.