aboutsummaryrefslogtreecommitdiff
path: root/test/stubbed/avr/interrupt.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/stubbed/avr/interrupt.h')
-rw-r--r--test/stubbed/avr/interrupt.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/stubbed/avr/interrupt.h b/test/stubbed/avr/interrupt.h
new file mode 100644
index 0000000..bcab79c
--- /dev/null
+++ b/test/stubbed/avr/interrupt.h
@@ -0,0 +1,20 @@
+#define ISR(INTER) void generated_interrupt_##INTER()
+
+static void cli() {}
+static void sei() {}
+
+#define stub_run_timers() \
+ { \
+ if (TCNT0 == OCR0A) { \
+ generated_interrupt_TIM0_OVF_vect(); \
+ TCNT0 = 0; \
+ } else { \
+ TCNT0++; \
+ } \
+ if (TCNT1L == OCR1AH) { \
+ generated_interrupt_TIM1_OVF_vect(); \
+ TCNT1L = 0; \
+ } else { \
+ TCNT1L++; \
+ } \
+ }