Modify for 16MHz crystal, NES on pins 0-2

This commit is contained in:
Neale Pickett 2013-08-22 17:32:46 -06:00
parent a1c1e17331
commit 4667e6dbfb
2 changed files with 7 additions and 7 deletions

View File

@ -12,7 +12,7 @@ LDFLAGS += -mmcu=$(MCU)
AVDFLAGS += -p $(MCU)
AVDFLAGS += -c usbtiny
CLOCK_HZ = 2000000
CLOCK_HZ = 1600000
FUSES += -U lfuse:w:0x7f:m
FUSES += -U hfuse:w:0xdd:m
FUSES += -U efuse:w:0xff:m

12
avr.h
View File

@ -7,13 +7,13 @@
#define bit(pin, bit, on) pin = (on ? (pin | bit) : (pin & ~bit))
#define sin(on) bit(PORTA, _BV(0), on)
#define sclk(on) bit(PORTA, _BV(1), on)
#define sltch(on) bit(PORTA, _BV(2), on)
#define sin(on) bit(PORTA, _BV(3), on)
#define sclk(on) bit(PORTA, _BV(4), on)
#define sltch(on) bit(PORTA, _BV(5), on)
#define nesclk(on) bit(PORTA, _BV(3), on)
#define nesltch(on) bit(PORTA, _BV(4), on)
#define NESOUT 5
#define nesclk(on) bit(PORTA, _BV(0), on)
#define nesltch(on) bit(PORTA, _BV(1), on)
#define NESOUT 2
#define nesout() ((PINA & _BV(NESOUT)) << NESOUT)
void init(void);