Still debugging

This commit is contained in:
Neale Pickett 2014-01-12 08:49:38 -07:00
parent 70baa5e4c4
commit 6b7bc46b7c
2 changed files with 14 additions and 18 deletions

View File

@ -1,7 +1,8 @@
#ifndef __CONFIG_H__ #ifndef __CONFIG_H__
#define __CONFIG_H__ #define __CONFIG_H__
#define CLOCK_HZ 1600000 #define CLOCK_MHZ 20
#define CLOCK_HZ (CLOCK_MHZ * 1000000)
#define SCORE_DIGITS 2 #define SCORE_DIGITS 2
#define JAM_INDICATOR 1 #define JAM_INDICATOR 1

15
main.c
View File

@ -8,10 +8,6 @@
#include "avr.h" #include "avr.h"
#include "config.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 // Timing stuff
// //
@ -22,7 +18,7 @@ const int nsr = 8;
// As long as you unplug your scoreboard once every 10 years or so, // As long as you unplug your scoreboard once every 10 years or so,
// you're good. // 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 volatile bool tick = false; // Set high when jiffy clock ticks
@ -146,7 +142,7 @@ draw()
int i; int i;
for (i = 0; i < 12; i += 1) { for (i = 0; i < 12; i += 1) {
write(test_pattern[jiffies % (sizeof test_pattern)]);; write(test_pattern[jiffies % (sizeof test_pattern)]);
} }
latch(); latch();
@ -172,7 +168,7 @@ draw()
} }
if (period_clock == 0) { if (period_clock == 0) {
period_clock = - (30 * 60 * 10); period_clock = -(30 * 60 * 10);
jam_clock = jam_duration; jam_clock = jam_duration;
state = JAM; state = JAM;
} }
@ -269,7 +265,6 @@ update_controller()
return; return;
} }
} }
// Select means subtract // Select means subtract
if (cur & BTN_SELECT) { if (cur & BTN_SELECT) {
inc = -1; inc = -1;
@ -334,12 +329,12 @@ setup()
void void
loop() loop()
{ {
update_controller(); // update_controller();
if (tick) { if (tick) {
tick = false; tick = false;
if (1 && (jiffies % 50 == 0)) { if (jiffies % 5 == 0) {
PORTB ^= 0xff; PORTB ^= 0xff;
} }