Definisanje vise prekidnih rutina

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
tzwell
Date:
Thu Nov 11 19:17:33 2021 +0000
Parent:
0:bda289aee5eb
Commit message:
Added interrupt priority demonstration;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r bda289aee5eb -r 4b541496f679 main.cpp
--- a/main.cpp	Thu Nov 11 19:08:01 2021 +0000
+++ b/main.cpp	Thu Nov 11 19:17:33 2021 +0000
@@ -18,6 +18,14 @@
 /*
  * Definisanje makroa:
  */
+ 
+// Sledeci kod otkomentarisati
+// da bi se videla demonstracija prioriteta prekida.
+ /*
+#define ON_TIME                                                                2
+#define LED_ON                                                                 1
+#define LED_OFF                                                                0
+*/
 
 /*
  * Globalne promenljive:
@@ -57,8 +65,22 @@
 void ISR_button_sw1()
 {
     led1_mb = !led1_mb;
+    // Prethodnu liniju zakomentarisati, a sledeci kod otkomentarisati
+    // da bi se videla demonstracija prioriteta prekida.
+    /*
+    led1_mb.write(LED_ON);
+    wait(ON_TIME);
+    led1_mb.write(LED_OFF);
+    */
 }
 void ISR_button_sw2()
 {
     led2_mb = !led2_mb;
+    // Prethodnu liniju zakomentarisati, a sledeci kod otkomentarisati
+    // da bi se videla demonstracija prioriteta prekida.
+    /*
+    led2_mb.write(LED_ON);
+    wait(ON_TIME);
+    led2_mb.write(LED_OFF);
+    */
 }
\ No newline at end of file