diff --git a/gecko.c b/gecko.c index 3ffce78..b3d0df4 100644 --- a/gecko.c +++ b/gecko.c @@ -200,6 +200,7 @@ u8 gecko_enable_console(const u8 enable) return gecko_console_enabled; } +#ifndef NDEBUG int gecko_printf(const char *fmt, ...) { if (!gecko_console_enabled) @@ -215,6 +216,7 @@ int gecko_printf(const char *fmt, ...) return gecko_sendbuffer(buffer, i); } +#endif // irq context diff --git a/gecko.h b/gecko.h index ce10716..6b49af1 100644 --- a/gecko.h +++ b/gecko.h @@ -29,7 +29,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA void gecko_init(void); u8 gecko_enable_console(const u8 enable); + +#ifdef NDEBUG +#define gecko_printf(...) do { } while(0) +#else int gecko_printf(const char *fmt, ...) __attribute__((format (printf, 1, 2))); +#endif + void gecko_timer_initialize(void); void gecko_timer(void);