aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2026-02-06 16:46:28 +0530
committerAkshay Nair <phenax5@gmail.com>2026-02-07 17:53:19 +0530
commiteef689b2e209dcf84c149ee4866c2a007676dc71 (patch)
treec814443ad4b19bebe8396d645520ce3db50bc04b /test
parentd544925cf75a05b681cadfc11b7d8a2d98de6679 (diff)
downloaddaft-watch-eef689b2e209dcf84c149ee4866c2a007676dc71.tar.gz
daft-watch-eef689b2e209dcf84c149ee4866c2a007676dc71.zip
Fix timer interrupt priority + refactor
Diffstat (limited to 'test')
-rw-r--r--test/stubbed/avr/interrupt.h12
-rw-r--r--test/stubbed/avr/io.h12
2 files changed, 14 insertions, 10 deletions
diff --git a/test/stubbed/avr/interrupt.h b/test/stubbed/avr/interrupt.h
index bcab79c..19dfa36 100644
--- a/test/stubbed/avr/interrupt.h
+++ b/test/stubbed/avr/interrupt.h
@@ -1,4 +1,4 @@
-#define ISR(INTER) void generated_interrupt_##INTER()
+#define ISR(INTER, ...) void generated_interrupt_##INTER()
static void cli() {}
static void sei() {}
@@ -6,15 +6,15 @@ static void sei() {}
#define stub_run_timers() \
{ \
if (TCNT0 == OCR0A) { \
- generated_interrupt_TIM0_OVF_vect(); \
+ generated_interrupt_TIM0_COMPA_vect(); \
TCNT0 = 0; \
} else { \
TCNT0++; \
} \
- if (TCNT1L == OCR1AH) { \
- generated_interrupt_TIM1_OVF_vect(); \
- TCNT1L = 0; \
+ if (TCNT1 == OCR1A) { \
+ generated_interrupt_TIM1_COMPA_vect(); \
+ TCNT1 = 0; \
} else { \
- TCNT1L++; \
+ TCNT1++; \
} \
}
diff --git a/test/stubbed/avr/io.h b/test/stubbed/avr/io.h
index 8c1ee92..40cc460 100644
--- a/test/stubbed/avr/io.h
+++ b/test/stubbed/avr/io.h
@@ -36,10 +36,8 @@ static int TCCR1B = 0;
static int TCCR1A = 0;
static int TIMSK1 = 0;
static int TIFR1 = 0;
-static int OCR1AH = 0;
-static int OCR1BH = 0;
-static int OCR1AL = 0;
-static int OCR1BL = 0;
+static int OCR1A = 0;
+static int OCR1B = 0;
static int TCNT1 = 0;
static int TCNT1H = 0;
static int TCNT1L = 0;
@@ -63,4 +61,10 @@ static int TCNT1L = 0;
#define TOV1 0
#define OCF1A 0
#define OCF1B 0
+#define OCF0A 0
+#define OCF0B 0
+#define OCIE0A 0
+#define OCIE0B 0
+#define OCIE1A 0
+#define OCIE1B 0
#endif