From 6defee37f9939991bbf3152e2cd4e18593baa541 Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Tue, 29 Nov 2022 04:50:45 +0100 Subject: Fix pio uart integration with neopix pio --- src/util.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/util.h') diff --git a/src/util.h b/src/util.h index 376d132..9844360 100644 --- a/src/util.h +++ b/src/util.h @@ -5,13 +5,16 @@ #define ARRLEN(x) (sizeof(x) / sizeof((x)[0])) -#define ERR(...) stdio_log(LOG_ERR, __VA_ARGS__) -#define WARN(...) stdio_log(LOG_WARN, __VA_ARGS__) -#define INFO(...) stdio_log(LOG_INFO, __VA_ARGS__) -#define DEBUG(...) stdio_log(LOG_DEBUG, __VA_ARGS__) +#define ERR(...) stdio_log(LOG_ERR, "ERR : " __VA_ARGS__) +#define WARN(...) stdio_log(LOG_WARN, "WARN : " __VA_ARGS__) +#define INFO(...) stdio_log(LOG_INFO, "INFO : " __VA_ARGS__) +#define DEBUG(...) stdio_log(LOG_DEBUG, "DEBUG: " __VA_ARGS__) + #define PANIC(...) blink_panic(__VA_ARGS__); -#define ASSERT(cond) blink_panic("Assertion failed: (%s) in %s:%i", \ - #cond, __FILE__, __LINE__) +#define ASSERT(cond) do { \ + if (!(cond)) blink_panic("Assertion failed: (%s) in %s:%i", \ + #cond, __FILE__, __LINE__); \ + } while (0) enum { LOG_NONE, -- cgit v1.2.3-71-gd317