Flush the transfer before exiting from write function.
[bertos.git] / bertos / cpu / arm / drv / kdebug_at91.c
index b6ec8b199ac457ba71ebcf04f28338ab90b0313d..2f4a9c57825b1350370054ae3fa12a10c27c7fd6 100644 (file)
  *
  * \brief ARM debug support (implementation).
  *
- * \version $Id$
  * \author Francesco Sacchi <batt@develer.com>
  */
 
 #include "kdebug_at91.h"
-#include "hw/hw_cpu.h"     /* for CLOCK_FREQ */
+#include <hw/hw_cpufreq.h>     /* for CPU_FREQ */
 #include "hw/hw_ser.h"     /* Required for bus macros overrides */
 
 #include "cfg/cfg_debug.h"
@@ -72,7 +71,7 @@ INLINE void kdbg_hw_init(void)
                /* Reset DBGU */
                DBGU_CR =  BV(US_RSTRX) | BV(US_RSTTX) | BV(US_RXDIS) | BV(US_TXDIS);
                /* Set baudrate */
-               DBGU_BRGR = DIV_ROUND(CLOCK_FREQ, 16 * CONFIG_KDEBUG_BAUDRATE);
+               DBGU_BRGR = DIV_ROUND(CPU_FREQ, 16 * CONFIG_KDEBUG_BAUDRATE);
                /* Set DBGU mode to 8 data bits, no parity and 1 stop bit. */
                DBGU_MR =  US_CHMODE_NORMAL | US_CHRL_8 | US_PAR_NO | US_NBSTOP_1;
                /* Enable DBGU transmitter. */