X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Fkdebug.c;h=d929bbbf2cd611ca8adcb0210481f80127cdb655;hb=40c25a4b1d0f1c23478c2d681b74662de968f671;hp=c461b7281cbf2b496ef374119748fbdd082318d4;hpb=791e167e053bdd9250d34a9a5ccae6ccde4d6679;p=bertos.git diff --git a/bertos/drv/kdebug.c b/bertos/drv/kdebug.c index c461b728..d929bbbf 100644 --- a/bertos/drv/kdebug.c +++ b/bertos/drv/kdebug.c @@ -27,31 +27,28 @@ * the GNU General Public License. * * Copyright 2003, 2004, 2005, 2006, 2007 Develer S.r.l. (http://www.develer.com/) - * Copyright 2000, 2001, 2002 Bernardo Innocenti + * Copyright 2000, 2001, 2002 Bernie Innocenti * * --> * * \brief General pourpose debug support for embedded systems (implementation). * * \version $Id$ - * \author Bernardo Innocenti + * \author Bernie Innocenti * \author Stefano Fedrigo */ -#include -#include -#include - +#include "cfg/cfg_debug.h" #include /* for BV() */ #include +#include -#include -#warning what about these? -//#include /* for CLOCK_FREQ */ -//#include /* Required for bus macros overrides */ +#include +#include +#include #include /* for _formatted_write() */ -#include +#include #ifdef _DEBUG @@ -61,9 +58,10 @@ #if OS_HOSTED - #include + #include // write() + #define KDBG_WAIT_READY() do { /*nop*/ } while(0) - #define KDBG_WRITE_CHAR(c) putc((c), stderr) + #define KDBG_WRITE_CHAR(c) do { char __c = (c); write(STDERR_FILENO, &__c, sizeof(__c)); } while(0) #define KDBG_MASK_IRQ(old) do { (void)(old); } while(0) #define KDBG_RESTORE_IRQ(old) do { /*nop*/ } while(0) typedef char kdbg_irqsave_t; /* unused */ @@ -193,7 +191,7 @@ static void klocation(const char * PGM_ATTR file, int line) PGM_FUNC(kputs)(PGM_STR(": ")); } -int PGM_FUNC(__assert)(const char * PGM_ATTR cond, const char * PGM_ATTR file, int line) +int PGM_FUNC(__bassert)(const char * PGM_ATTR cond, const char * PGM_ATTR file, int line) { klocation(file, line); PGM_FUNC(kputs)(PGM_STR("Assertion failed: "));