Still debugging
This commit is contained in:
parent
70baa5e4c4
commit
6b7bc46b7c
3
config.h
3
config.h
|
@ -1,7 +1,8 @@
|
|||
#ifndef __CONFIG_H__
|
||||
#define __CONFIG_H__
|
||||
|
||||
#define CLOCK_HZ 1600000
|
||||
#define CLOCK_MHZ 20
|
||||
#define CLOCK_HZ (CLOCK_MHZ * 1000000)
|
||||
|
||||
#define SCORE_DIGITS 2
|
||||
#define JAM_INDICATOR 1
|
||||
|
|
13
main.c
13
main.c
|
@ -8,10 +8,6 @@
|
|||
#include "avr.h"
|
||||
#include "config.h"
|
||||
|
||||
// Number of shift registers in your scoreboard
|
||||
// If you want scores to go over 199, you need 8
|
||||
const int nsr = 8;
|
||||
|
||||
//
|
||||
// Timing stuff
|
||||
//
|
||||
|
@ -22,7 +18,7 @@ const int nsr = 8;
|
|||
// As long as you unplug your scoreboard once every 10 years or so,
|
||||
// you're good.
|
||||
//
|
||||
volatile uint32_t jiffies = 0; // Elapsed time in deciseconds
|
||||
volatile uint32_t jiffies = 0; // Elapsed time in deciseconds (tenths of a second)
|
||||
volatile bool tick = false; // Set high when jiffy clock ticks
|
||||
|
||||
|
||||
|
@ -146,7 +142,7 @@ draw()
|
|||
int i;
|
||||
|
||||
for (i = 0; i < 12; i += 1) {
|
||||
write(test_pattern[jiffies % (sizeof test_pattern)]);;
|
||||
write(test_pattern[jiffies % (sizeof test_pattern)]);
|
||||
}
|
||||
|
||||
latch();
|
||||
|
@ -269,7 +265,6 @@ update_controller()
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Select means subtract
|
||||
if (cur & BTN_SELECT) {
|
||||
inc = -1;
|
||||
|
@ -334,12 +329,12 @@ setup()
|
|||
void
|
||||
loop()
|
||||
{
|
||||
update_controller();
|
||||
// update_controller();
|
||||
|
||||
if (tick) {
|
||||
tick = false;
|
||||
|
||||
if (1 && (jiffies % 50 == 0)) {
|
||||
if (jiffies % 5 == 0) {
|
||||
PORTB ^= 0xff;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue