Rename myself
[bertos.git] / bertos / drv / timer_test.c
index 170105dea8a1ca9ba809e4305faa5bb10eeb01b2..905f9c90005b151abdf7bfd28b9a71e576819412 100644 (file)
  * \brief Hardware independent timer driver (implementation)
  *
  * \version $Id$
- * \author Bernardo Innocenti <bernie@develer.com>
+ * \author Bernie Innocenti <bernie@codewiz.org>
  */
 
-#include "timer.c"
-#include "mware/event.c"
-#include "os/hptime.c"
+#include <cfg/test.h>
+
+#include <drv/timer.h>
+#include <drv/wdt.h>
+
+#include <mware/event.h>
+
+#warning TODO:Refactor this test to comply whit BeRTOS test policy.
+
+#ifdef _TEST
 
 static void timer_test_constants(void)
 {
@@ -61,7 +68,7 @@ static void timer_test_constants(void)
        kprintf("ticks_to_us(100)=%lu\n", ticks_to_us(100));
        kprintf("ticks_to_us(10000)=%lu\n", ticks_to_us(10000));
        kprintf("\n");
-       kprintf("hptime_to_us(100)=%lu\n", hptime_to_us(100));
+       kprintf("hptime_to_us(100)=%ld\n", hptime_to_us(100));
        kprintf("hptime_to_us(10000)=%lu\n", hptime_to_us(10000));
        kprintf("us_to_hptime(100)=%lu\n", us_to_hptime(100));
        kprintf("us_to_hptime(10000)=%lu\n", us_to_hptime(10000));
@@ -122,6 +129,11 @@ static void timer_test_poll(void)
        }
 }
 
+
+#include "timer.c"
+#include "mware/event.c"
+#include "os/hptime.c"
+
 int main(void)
 {
        wdt_init(7);
@@ -132,3 +144,5 @@ int main(void)
        timer_test_poll();
        return 0;
 }
+#endif
+