From f8be5f4eeea8364a0df8ef878d06a7ff8814d405 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Sun, 13 Dec 2020 20:50:12 +1300 Subject: Derive OCR1A from F_CPU --- altimeter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/altimeter.c b/altimeter.c index 2aef956..3133d2a 100644 --- a/altimeter.c +++ b/altimeter.c @@ -84,7 +84,7 @@ int main(void) /* Initialise timers for /1024 prescaler, 1 Hz comparator val */ TCCR1B |= (1 << CS10) | (1 << CS12) | (1 << WGM12); TIMSK1 |= (1 << OCIE1A); - OCR1A = 15624; + OCR1A = F_CPU / 1024; #ifdef USBCON /* Disable USB controller if one is present - this spams (latches?) USB_GEN -- cgit v1.1