]> rtime.felk.cvut.cz Git - sysless.git/commitdiff
Make ledblink not depend on boot_fn library
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 24 Feb 2009 13:13:38 +0000 (14:13 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 24 Feb 2009 13:13:38 +0000 (14:13 +0100)
app/ledblink/Makefile.omk
app/ledblink/ledblink.c
app/ledblink/ledtimer.c

index 8fa16391fe67879ceeb7029b0f05425e9f6e6d7c..c324ee564f32acf8f3ac9149c2325fc6205f43d3 100644 (file)
@@ -3,9 +3,7 @@
 bin_PROGRAMS  = ledtimer ledblink
 
 ledblink_SOURCES = ledblink.c 
-ledblink_LIBS = boot_fn
 
 ledtimer_SOURCES = ledtimer.c 
-ledtimer_LIBS = boot_fn excptvec
+ledtimer_LIBS = excptvec
 
-ledblink_LIBS = boot_fn excptvec
index dc04707a516bc2477d243f9258c000be3d13af72..507d95d0cb8e1ac3d853350e7e3b9a8858e82e88 100644 (file)
@@ -26,6 +26,16 @@ static void deb_led_out(char val)
     DEB_LED_OFF(3);
 }
 
+void wait(long n)
+{
+  long i=0;
+  volatile long x;
+  while (i<n*2){
+    i++;
+    x+=i;
+  }    
+}
+
 int main()
 {
     DEB_LED_INIT(); /* Init port with LEDs */
@@ -33,6 +43,6 @@ int main()
     while (1) {
         i = (i + 1) & 7;
         deb_led_out(i);
-        FlWait(1*100000);
+        wait(1*100000);
     }
 };
index 61f447d590a883e5262b65c44ede210f8eea5e35..22dbc46af5709693951fde1d0e2c0f4f03ce5419 100644 (file)
@@ -61,6 +61,15 @@ void init_timer1()
     *TPU_TSTR |=TSTR_CST1m;     //start timer
 }
 
+void wait(long n)
+{
+  long i=0;
+  volatile long x;
+  while (i<n*2){
+    i++;
+    x+=i;
+  }    
+}
 
 int main()
 {
@@ -80,12 +89,12 @@ int main()
     init_timer1();
     sti();
 
-    FlWait(1*400000);
+    wait(1*400000);
   
     while (1){
         DEB_LED_ON(0);  // leds blink to show that the main program is still running
-        FlWait(100000);
+        wait(100000);
         DEB_LED_OFF(0);
-        FlWait(100000);
+        wait(100000);
     }
 }