1 /* Keyword "critical" tests.
5 #if defined(SDCC_mcs51)
18 //must be at least 2 bytes big and volatile
19 volatile big global_var = { 0 };
21 unsigned int get_global (void) critical
30 #if defined(SDCC_mcs51)
34 //enable the interrupt and set it
39 critical x.a = global_var.a;
47 critical x.a = global_var.a;
53 //check the interrupt has run at all
60 #if defined(SDCC_mcs51)
61 void T2_isr (void) interrupt 5 using 2
63 //do not clear flag ET2 so it keeps interrupting !
65 if (global_var.b == 0)
67 global_var.c = global_var.b;