distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
assertHook.h File Reference

assertHook() header More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void assertHook (const char *file, int line, const char *function, const char *failedExpression)
 Hook function called on failed assertion. More...
 

Detailed Description

assertHook() header

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/.

Function Documentation

◆ assertHook()

void assertHook ( const char *  file,
int  line,
const char *  function,
const char *  failedExpression 
)

Hook function called on failed assertion.

This function is called at the beginning of __assert_func() when an assertion fails. It may be used to put the system into a safe state, log the failure, reset the device, etc. After this function returns, the system is halted by calling abort() with masked interrupts.

Note
Use of this function is optional - it may be left undefined, in which case it will not be called.
Parameters
[in]fileis a null-terminated string with the name of file in which assertion failed
[in]lineis a line number at which assertion failed
[in]functionis a null-terminated string with function in which assertion failed
[in]failedExpressionis a null-terminated string with the failed assert expression