]> oss.titaniummirror.com Git - rgblamp.git/blobdiff - isr.h
Save brightness to eeprom
[rgblamp.git] / isr.h
diff --git a/isr.h b/isr.h
index 7b1ede094537344a26c3e2e8e73b4a03919c8d49..220b38191c9ff82c3e2246771e829e35acf84db3 100644 (file)
--- a/isr.h
+++ b/isr.h
@@ -9,27 +9,14 @@
 
 #include <htc.h>
 
-extern bit isr_gie;
-extern unsigned char isr_di;
+extern bit _isr_gie;
+extern unsigned char _isr_di;
 
-/* Nested disable interrupts inline function, for use outside ISR */
-#define ndi() \
-  do { \
-    if (isr_di++ == 0) \
-      isr_gie = GIE; \
-      if (isr_gie) \
-        di(); \
-  } while (0)
+/* Nested disable interrupts inline function.  Should be OK even in ISR. */
+void ndi();
 
-/* Nested enable interrupts inline function, for use outside ISR */
-#define nei() \
-  do { \
-    if (--isr_di == 0) \
-      if (isr_gie) { \
-       isr_gie = 0; \
-        ei(); \
-      } \
-  } while (0)
+/* Nested enable interrupts inline function.  Should be OK even in ISR. */
+void nei();
 
 void interrupt isr();