Accurate with 16MHz crystal
This commit is contained in:
parent
4dd06dfa5f
commit
65cbd98027
2
avr.h
2
avr.h
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
// Make sure JIFFY_uS is going to be an integer and not a float!
|
// Make sure JIFFY_uS is going to be an integer and not a float!
|
||||||
#define JIFFIES_PER_SECOND 100
|
#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))
|
#define bit(pin, bit, on) pin = (on ? (pin | bit) : (pin & ~bit))
|
||||||
|
|
||||||
|
|
2
main.c
2
main.c
|
@ -249,7 +249,9 @@ loop()
|
||||||
update_controller();
|
update_controller();
|
||||||
|
|
||||||
if (jiffies % (JIFFIES_PER_SECOND / 10) == 0) {
|
if (jiffies % (JIFFIES_PER_SECOND / 10) == 0) {
|
||||||
|
if (jiffies % JIFFIES_PER_SECOND == 0) {
|
||||||
PORTB ^= 0xff;
|
PORTB ^= 0xff;
|
||||||
|
}
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case SETUP:
|
case SETUP:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue