From 04f4b667595194a4acd29871226dc22463714686 Mon Sep 17 00:00:00 2001 From: RJ Ryan Date: Wed, 14 Sep 2011 00:55:22 -0400 Subject: Add an __assert_func assertion handler so that libc does not use its default implementation. This allows the use of assert() from libc's assert.h. Signed-off-by: RJ Ryan --- libmaple/util.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libmaple/util.c b/libmaple/util.c index eead625..1a7c36d 100644 --- a/libmaple/util.c +++ b/libmaple/util.c @@ -108,6 +108,15 @@ void _fail(const char* file, int line, const char* exp) { __error(); } +/** + * @brief Provide an __assert_func handler to libc so that calls to assert() get + * redirected to _fail. + */ +void __assert_func(const char* file, int line, const char* method, + const char* expression) { + _fail(file, line, expression); +} + /** * @brief Fades the error LED on and off * @sideeffect Sets output push-pull on ERROR_LED_PIN. -- cgit v1.2.3