aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@yeah.nah.nz>2020-12-13 20:50:12 +1300
committerDavid Phillips <david@yeah.nah.nz>2020-12-13 20:50:12 +1300
commitf8be5f4eeea8364a0df8ef878d06a7ff8814d405 (patch)
tree2ad7e62a2121619926500da70e85d02701f06b5f
parent7e26f31e221665ee059b02fc6beda025d39d6e75 (diff)
downloadaltimeter-f8be5f4eeea8364a0df8ef878d06a7ff8814d405.tar.xz
Derive OCR1A from F_CPU
-rw-r--r--altimeter.c2
1 files changed, 1 insertions, 1 deletions
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