diff options
author | David Phillips <david@yeah.nah.nz> | 2020-12-13 20:50:12 +1300 |
---|---|---|
committer | David Phillips <david@yeah.nah.nz> | 2020-12-13 20:50:12 +1300 |
commit | f8be5f4eeea8364a0df8ef878d06a7ff8814d405 (patch) | |
tree | 2ad7e62a2121619926500da70e85d02701f06b5f | |
parent | 7e26f31e221665ee059b02fc6beda025d39d6e75 (diff) | |
download | altimeter-f8be5f4eeea8364a0df8ef878d06a7ff8814d405.tar.xz |
Derive OCR1A from F_CPU
-rw-r--r-- | altimeter.c | 2 |
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 |