From 5055ee55d1330b52182a35378f5b4f8055cefc54 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 22 Jul 2014 16:24:43 +0200 Subject: Convert printf into puts Removes ~1.5k code size, still not working. --- common.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'common.h') diff --git a/common.h b/common.h index 26b371d..5957da3 100644 --- a/common.h +++ b/common.h @@ -10,8 +10,18 @@ sleep_disable (); #define __unused__ __attribute__ ((unused)) -/* print assert messages */ -#define __ASSERT_USE_STDERR + +/* define lightweight assert (without printf) that halts the cpu */ +#include +#include +#include +#define assert(x) if (!(x)) { \ + puts("assert in " __FILE__ ":" #x); \ + sleep_enable (); \ + while (1) { \ + sleep_cpu (); \ + } \ + } #endif /* COMMON_H */ -- cgit v1.2.3