mirror of
https://github.com/nealey/hw-rollerderby-scoreboard
synced 2025-01-16 20:05:00 -07:00
trying to figure out how to get 1s in .1s intervals
This commit is contained in:
parent
65cbd98027
commit
27a9eb281a
4 changed files with 5 additions and 7 deletions
|
@ -12,7 +12,7 @@ LDFLAGS += -mmcu=$(MCU)
|
|||
AVDFLAGS += -p $(MCU)
|
||||
AVDFLAGS += -c usbtiny
|
||||
|
||||
FUSES += -U lfuse:w:0x7f:m
|
||||
FUSES += -U lfuse:w:0xff:m
|
||||
FUSES += -U hfuse:w:0xd9:m
|
||||
FUSES += -U efuse:w:0xff:m
|
||||
|
||||
|
|
2
avr.c
2
avr.c
|
@ -20,7 +20,7 @@ ISR(TIM0_OVF_vect)
|
|||
|
||||
m += (256 * 64);
|
||||
if (m >= JIFFY_uS) {
|
||||
m %= JIFFY_uS;
|
||||
m -= JIFFY_uS;
|
||||
tick = true;
|
||||
jiffies += 1;
|
||||
}
|
||||
|
|
1
avr.h
1
avr.h
|
@ -5,7 +5,6 @@
|
|||
#include <avr/io.h>
|
||||
#include <avr/interrupt.h>
|
||||
|
||||
|
||||
// Make sure JIFFY_uS is going to be an integer and not a float!
|
||||
#define JIFFIES_PER_SECOND 100
|
||||
#define JIFFY_uS (1000000 / JIFFIES_PER_SECOND)
|
||||
|
|
7
main.c
7
main.c
|
@ -241,17 +241,16 @@ void
|
|||
loop()
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
|
||||
if (tick) {
|
||||
tick = false;
|
||||
|
||||
update_controller();
|
||||
|
||||
if (jiffies % 66 == 0) {
|
||||
PORTB ^= 0xff;
|
||||
}
|
||||
if (jiffies % (JIFFIES_PER_SECOND / 10) == 0) {
|
||||
if (jiffies % JIFFIES_PER_SECOND == 0) {
|
||||
PORTB ^= 0xff;
|
||||
}
|
||||
switch (state) {
|
||||
case SETUP:
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue