projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
timer_delay(): Add a sanity check to avoid sleeping forever.
[bertos.git]
/
drv
/
kdebug.c
diff --git
a/drv/kdebug.c
b/drv/kdebug.c
index c64ab13921d4495630f099cae979d5992eeabc21..88554e9571faedaa94bb374540140b7e809c9956 100755
(executable)
--- a/
drv/kdebug.c
+++ b/
drv/kdebug.c
@@
-1,21
+1,26
@@
/*!
* \file
* <!--
/*!
* \file
* <!--
- * Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/)
- * Copyright 2000,
2001,
2002 Bernardo Innocenti <bernie@codewiz.org>
+ * Copyright 2003,
2004 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2000,
2001,
2002 Bernardo Innocenti <bernie@codewiz.org>
* This file is part of DevLib - See devlib/README for information.
* -->
*
* This file is part of DevLib - See devlib/README for information.
* -->
*
- * \brief General pourpose debug
functions
.
+ * \brief General pourpose debug
support for embedded systems (implementation)
.
*
* \version $Id$
*
* \version $Id$
- *
* \author Bernardo Innocenti <bernie@develer.com>
* \author Stefano Fedrigo <aleph@develer.com>
*/
/*#*
*#* $Log$
* \author Bernardo Innocenti <bernie@develer.com>
* \author Stefano Fedrigo <aleph@develer.com>
*/
/*#*
*#* $Log$
+ *#* Revision 1.17 2004/10/03 18:41:28 bernie
+ *#* Restore \version header killed by mistake in previous commit.
+ *#*
+ *#* Revision 1.16 2004/10/03 18:40:50 bernie
+ *#* Use new CPU macros.
+ *#*
*#* Revision 1.15 2004/09/14 21:03:46 bernie
*#* Use debug.h instead of kdebug.h.
*#*
*#* Revision 1.15 2004/09/14 21:03:46 bernie
*#* Use debug.h instead of kdebug.h.
*#*
@@
-110,13
+115,15
@@
#define KDBG_UART0_BUS_TX do {} while (0)
#endif
#define KDBG_UART0_BUS_TX do {} while (0)
#endif
- #if
defined(__AVR_ATmega64__)
+ #if
CPU_AVR_ATMEGA64
#define UCR UCSR0B
#define UDR UDR0
#define USR UCSR0A
#define UCR UCSR0B
#define UDR UDR0
#define USR UCSR0A
- #elif
defined(__AVR_ATmega8__)
+ #elif
CPU_AVR_ATMEGA8
#define UCR UCSRB
#define USR UCSRA
#define UCR UCSRB
#define USR UCSRA
+ #else
+ #error Unknown CPU
#endif
#define KDBG_WAIT_READY() do { loop_until_bit_is_set(USR, UDRE); } while(0)
#endif
#define KDBG_WAIT_READY() do { loop_until_bit_is_set(USR, UDRE); } while(0)
@@
-216,7
+223,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
defined(__AVR_ATmega64__)
+ #if
CPU_AVR_ATMEGA64
#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;
@@
-228,14
+235,14
@@
void kdbg_init(void)
#else
#error CONFIG_KDEBUG_PORT must be either 0 or 1
#endif
#else
#error CONFIG_KDEBUG_PORT must be either 0 or 1
#endif
- #elif
defined(__AVR_ATmega8__)
+ #elif
CPU_AVR_ATMEGA8
UBRRH = (uint8_t)(period>>8);
UBRRL = (uint8_t)period;
UBRRH = (uint8_t)(period>>8);
UBRRL = (uint8_t)period;
- #elif
defined(__AVR_ATmega103__)
+ #elif
CPU_AVR_ATMEGA103
UBRR = (uint8_t)period;
KDBG_UART0_BUS_INIT;
#else
UBRR = (uint8_t)period;
KDBG_UART0_BUS_INIT;
#else
- #error Unknown
arch
+ #error Unknown
CPU
#endif
#endif /* !CPU_I196 && !CPU_AVR */
#endif
#endif /* !CPU_I196 && !CPU_AVR */