projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Doxygen fix.
[bertos.git]
/
drv
/
kdebug.c
diff --git
a/drv/kdebug.c
b/drv/kdebug.c
index 27e365116552155a5a85789215fd0f4e4a621eb2..1bf07e43eda21ded245be6abc51e5ee5c29b78ef 100755
(executable)
--- a/
drv/kdebug.c
+++ b/
drv/kdebug.c
@@
-15,6
+15,12
@@
/*#*
*#* $Log$
/*#*
*#* $Log$
+ *#* Revision 1.26 2006/04/27 05:40:27 bernie
+ *#* Break on assertion failures.
+ *#*
+ *#* 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.
*#*
*#* Revision 1.24 2005/04/12 01:36:37 bernie
*#* Add hack to enable TX line at module initialization.
*#*
@@
-37,7
+43,7
@@
#include <cfg/debug.h>
#include <cfg/cpu.h>
#include <cfg/macros.h> /* for BV() */
#include <cfg/debug.h>
#include <cfg/cpu.h>
#include <cfg/macros.h> /* for BV() */
-#include <
cfg/
config.h>
+#include <
app
config.h>
#include <hw.h>
#include <mware/formatwr.h> /* for _formatted_write() */
#include <hw.h>
#include <mware/formatwr.h> /* for _formatted_write() */
@@
-88,7
+94,7
@@
#define KDBG_UART0_BUS_TX do {} while (0)
#endif
#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
#define UCR UCSR0B
#define UDR UDR0
#define USR UCSR0A
@@
-203,7
+209,7
@@
void kdbg_init(void)
/* Compute the baud rate */
uint16_t period = (((CLOCK_FREQ / 16UL) + (CONFIG_KDEBUG_BAUDRATE / 2)) / CONFIG_KDEBUG_BAUDRATE) - 1;
/* 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;
#if CONFIG_KDEBUG_PORT == 0
UBRR0H = (uint8_t)(period>>8);
UBRR0L = (uint8_t)period;
@@
-335,15
+341,16
@@
static void klocation(const char * PGM_ATTR file, int line)
PGM_FUNC(kputs)(file);
kputchar(':');
kputnum(line);
PGM_FUNC(kputs)(file);
kputchar(':');
kputnum(line);
- PGM_FUNC(kputs)(PSTR(": "));
+ PGM_FUNC(kputs)(P
GM_
STR(": "));
}
int PGM_FUNC(__assert)(const char * PGM_ATTR cond, const char * PGM_ATTR file, int line)
{
klocation(file, line);
}
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)(P
GM_
STR("Assertion failed: "));
PGM_FUNC(kputs)(cond);
kputchar('\n');
PGM_FUNC(kputs)(cond);
kputchar('\n');
+ BREAKPOINT;
return 1;
}
return 1;
}
@@
-354,26
+361,27
@@
int PGM_FUNC(__assert)(const char * PGM_ATTR cond, const char * PGM_ATTR file, i
*/
void PGM_FUNC(__trace)(const char *name)
{
*/
void PGM_FUNC(__trace)(const char *name)
{
- PGM_FUNC(kprintf)(PSTR("%s()\n"), name);
+ PGM_FUNC(kprintf)(P
GM_
STR("%s()\n"), name);
}
void PGM_FUNC(__tracemsg)(const char *name, const char * PGM_ATTR fmt, ...)
{
va_list ap;
}
void PGM_FUNC(__tracemsg)(const char *name, const char * PGM_ATTR fmt, ...)
{
va_list ap;
- PGM_FUNC(kprintf)(PSTR("%s(): "), name);
+ PGM_FUNC(kprintf)(P
GM_
STR("%s(): "), name);
va_start(ap, fmt);
PGM_FUNC(kvprintf)(fmt, ap);
va_end(ap);
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);
}
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)(P
GM_
STR("Invalid ptr: "));
PGM_FUNC(kputs)(name);
#if CONFIG_PRINTF
PGM_FUNC(kputs)(name);
#if CONFIG_PRINTF
- PGM_FUNC(kprintf)(P
STR(" = 0x%x\n"),
value);
+ PGM_FUNC(kprintf)(P
GM_STR(" = 0x%x\n"), (unsigned int)
value);
#else
(void)value;
kputchar('\n');
#else
(void)value;
kputchar('\n');
@@
-398,10
+406,10
@@
int PGM_FUNC(__check_wall)(long *wall, int size, const char * PGM_ATTR name, con
if (wall[i] != WALL_VALUE)
{
klocation(file, line);
if (wall[i] != WALL_VALUE)
{
klocation(file, line);
- PGM_FUNC(kputs)(PSTR("Wall broken: "));
+ PGM_FUNC(kputs)(P
GM_
STR("Wall broken: "));
PGM_FUNC(kputs)(name);
#if CONFIG_PRINTF
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)(P
GM_
STR("[%d] (0x%p) = 0x%lx\n"), i, wall + i, wall[i]);
#else
kputchar('\n');
#endif
#else
kputchar('\n');
#endif