LPC2xxx: add timer test.
authorbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 12 Apr 2010 21:34:37 +0000 (21:34 +0000)
committerbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 12 Apr 2010 21:34:37 +0000 (21:34 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3420 38d2e660-2303-0410-9eaa-f027e97ec537

examples/lpc2378/lpc2378.mk
examples/lpc2378/main.c

index 10217469008998a6159ea3983672cd75f63119ac..50532020dc30538bfceefe851f27dcea24257bba 100644 (file)
@@ -15,6 +15,9 @@ lpc2378_PROGRAMMER_PORT = none
 # Files included by the user.
 lpc2378_USER_CSRC = \
        examples/lpc2378/main.c \
+       bertos/drv/timer.c \
+       bertos/cpu/arm/drv/vic_lpc2.c \
+       bertos/cpu/arm/drv/timer_lpc2.c \
        #
 
 # Files included by the user.
index baf48c5c666e7e6655e4d9bb523589dd1e3e8368..7ab7b8594bdb31f6fac10102e2358d509635c751 100644 (file)
@@ -1,7 +1,7 @@
 // Emtpy main.c file generated by the wizard
 #include <cpu/irq.h>
 #include <cfg/debug.h>
-
+#include <drv/timer.h>
 #include <io/lpc23xx.h>
 
 #define STATUS_LED (1<<19)
@@ -12,6 +12,7 @@ static void init(void)
 {
        IRQ_ENABLE;
        kdbg_init();
+       timer_init();
        kprintf("NXP LPC2378 BeRTOS port test\n");
        /* Turn off boot led */
        IODIR0 = (1<<21);       
@@ -33,10 +34,10 @@ int main(void)
                kprintf("BeRTOS is up & running: %c\r",
                        spinner[i % countof(spinner)]);
                LED_ON();
-               for (int j = 0; j < 200000; j++ );
+               timer_delay(500);
                
                LED_OFF();
-               for (int j = 0; j < 200000; j++ );
+               timer_delay(500);
        }
 
        return 0;