Nikola Cvetković
/
19E042PIM_V2_Z4
Definisanje vise prekidnih rutina
Revision 1:4b541496f679, committed 2021-11-11
- 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