/* * utility_assert.hpp * * Created on: Jun 25, 2021 * Author: erki */ #ifndef UTILITY_INC_UTILITY_ASSERT_HPP_ #define UTILITY_INC_UTILITY_ASSERT_HPP_ #ifdef __cplusplus extern "C" { #endif __attribute__((weak)) void SkullC_AssertHandler(const char* file, int line, const char* func, const char* failed_expr) { } void __assert_func(const char* file, int line, const char* func, const char* failed_expr) { #ifdef SKULLC_UTILITY_ASSERT_TO_ERRORHANDLER Error_Handler(); #else __disable_irq(); __asm("bkpt"); #ifdef SKULLC_UTILITY_ASSERT_CUSTOM_HANDLER SkullC_AssertHandler(file, line, func, failed_expr); #endif while (1) ; #endif } #ifdef __cplusplus } #endif #endif /* UTILITY_INC_UTILITY_ASSERT_HPP_ */