Accurate with 16MHz crystal

This commit is contained in:
Neale Pickett 2013-05-04 19:47:15 -06:00
parent 4dd06dfa5f
commit 65cbd98027
2 changed files with 4 additions and 2 deletions

2
avr.h
View File

@ -8,7 +8,7 @@
// Make sure JIFFY_uS is going to be an integer and not a float!
#define JIFFIES_PER_SECOND 100
#define JIFFY_uS (10000000 / JIFFIES_PER_SECOND)
#define JIFFY_uS (1000000 / JIFFIES_PER_SECOND)
#define bit(pin, bit, on) pin = (on ? (pin | bit) : (pin & ~bit))

4
main.c
View File

@ -249,7 +249,9 @@ loop()
update_controller();
if (jiffies % (JIFFIES_PER_SECOND / 10) == 0) {
PORTB ^= 0xff;
if (jiffies % JIFFIES_PER_SECOND == 0) {
PORTB ^= 0xff;
}
switch (state) {
case SETUP:
break;