X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Fkdebug.c;h=502711500c79f48cc36498df06a35b3e6cfa0a2b;hb=0c154bc0927a32f77467f32aac3cc3507baa97ca;hp=27e365116552155a5a85789215fd0f4e4a621eb2;hpb=24609d658e8c2c7795b8a5f8bef21512c020f1fb;p=bertos.git diff --git a/drv/kdebug.c b/drv/kdebug.c index 27e36511..50271150 100755 --- a/drv/kdebug.c +++ b/drv/kdebug.c @@ -15,6 +15,9 @@ /*#* *#* $Log$ + *#* Revision 1.25 2005/06/27 21:26:24 bernie + *#* Misc PGM fixes. + *#* *#* Revision 1.24 2005/04/12 01:36:37 bernie *#* Add hack to enable TX line at module initialization. *#* @@ -37,7 +40,7 @@ #include #include #include /* for BV() */ -#include +#include #include #include /* for _formatted_write() */ @@ -88,7 +91,7 @@ #define KDBG_UART0_BUS_TX do {} while (0) #endif - #if CPU_AVR_ATMEGA64 + #if CPU_AVR_ATMEGA64 || CPU_AVR_ATMEGA128 #define UCR UCSR0B #define UDR UDR0 #define USR UCSR0A @@ -203,7 +206,7 @@ void kdbg_init(void) /* Compute the baud rate */ uint16_t period = (((CLOCK_FREQ / 16UL) + (CONFIG_KDEBUG_BAUDRATE / 2)) / CONFIG_KDEBUG_BAUDRATE) - 1; - #if CPU_AVR_ATMEGA64 + #if CPU_AVR_ATMEGA64 || CPU_AVR_ATMEGA128 #if CONFIG_KDEBUG_PORT == 0 UBRR0H = (uint8_t)(period>>8); UBRR0L = (uint8_t)period; @@ -335,13 +338,13 @@ static void klocation(const char * PGM_ATTR file, int line) PGM_FUNC(kputs)(file); kputchar(':'); kputnum(line); - PGM_FUNC(kputs)(PSTR(": ")); + PGM_FUNC(kputs)(PGM_STR(": ")); } int PGM_FUNC(__assert)(const char * PGM_ATTR cond, const char * PGM_ATTR file, int line) { klocation(file, line); - PGM_FUNC(kputs)(PSTR("Assertion failed: ")); + PGM_FUNC(kputs)(PGM_STR("Assertion failed: ")); PGM_FUNC(kputs)(cond); kputchar('\n'); return 1; @@ -354,26 +357,27 @@ int PGM_FUNC(__assert)(const char * PGM_ATTR cond, const char * PGM_ATTR file, i */ void PGM_FUNC(__trace)(const char *name) { - PGM_FUNC(kprintf)(PSTR("%s()\n"), name); + PGM_FUNC(kprintf)(PGM_STR("%s()\n"), name); } void PGM_FUNC(__tracemsg)(const char *name, const char * PGM_ATTR fmt, ...) { va_list ap; - PGM_FUNC(kprintf)(PSTR("%s(): "), name); + PGM_FUNC(kprintf)(PGM_STR("%s(): "), name); va_start(ap, fmt); PGM_FUNC(kvprintf)(fmt, ap); va_end(ap); + kputchar('\n'); } int PGM_FUNC(__invalid_ptr)(void *value, const char * PGM_ATTR name, const char * PGM_ATTR file, int line) { klocation(file, line); - PGM_FUNC(kputs)(PSTR("Invalid ptr: ")); + PGM_FUNC(kputs)(PGM_STR("Invalid ptr: ")); PGM_FUNC(kputs)(name); #if CONFIG_PRINTF - PGM_FUNC(kprintf)(PSTR(" = 0x%x\n"), value); + PGM_FUNC(kprintf)(PGM_STR(" = 0x%x\n"), (unsigned int)value); #else (void)value; kputchar('\n'); @@ -398,10 +402,10 @@ int PGM_FUNC(__check_wall)(long *wall, int size, const char * PGM_ATTR name, con if (wall[i] != WALL_VALUE) { klocation(file, line); - PGM_FUNC(kputs)(PSTR("Wall broken: ")); + PGM_FUNC(kputs)(PGM_STR("Wall broken: ")); PGM_FUNC(kputs)(name); #if CONFIG_PRINTF - PGM_FUNC(kprintf)(PSTR("[%d] (0x%p) = 0x%lx\n"), i, wall + i, wall[i]); + PGM_FUNC(kprintf)(PGM_STR("[%d] (0x%p) = 0x%lx\n"), i, wall + i, wall[i]); #else kputchar('\n'); #endif