change counter down io to bootloader enable
This commit is contained in:
parent
fb86f7ba7b
commit
d67158f523
@ -67,7 +67,7 @@ clean:
|
||||
|
||||
.PHONY: all clean interactive-isp interactive-serial launch-bootloader
|
||||
|
||||
flash:
|
||||
flash: bootloader.hex
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) -c $(ISP_PROG) -U flash:w:$<
|
||||
|
||||
flash-eeprom-%: %.eep.hex
|
||||
|
||||
@ -48,18 +48,17 @@ void system_init(void)
|
||||
| (1 << AVR_ADDR_SCK_PIN)
|
||||
| (1 << AVR_ADDR_SER_PIN)
|
||||
| (1 << AVR_ADDR_LOAD_PIN)
|
||||
| (1 << AVR_ADDR_DOWN_PIN)
|
||||
| (1 << AVR_ADDR_UP_PIN));
|
||||
| (1 << AVR_ADDR_UP_PIN));
|
||||
|
||||
DDRC &= ~ (1 << SNES_WR_PIN);
|
||||
DDRC &= ~ ((1 << SNES_WR_PIN)
|
||||
| (1 << AVR_BTLDR_EN_PIN));
|
||||
|
||||
PORTC &= ~((1 << AVR_ADDR_LATCH_PIN)
|
||||
| (1 << AVR_ADDR_SCK_PIN)
|
||||
| (1 << SNES_WR_PIN));
|
||||
|
||||
|
||||
PORTC |= ( (1 << AVR_ADDR_DOWN_PIN)
|
||||
| (1 << AVR_ADDR_UP_PIN)
|
||||
PORTC |= ( (1 << AVR_ADDR_UP_PIN)
|
||||
| (1 << AVR_ADDR_LOAD_PIN));
|
||||
|
||||
//| (1 << SNES_WR_PIN));
|
||||
|
||||
@ -40,14 +40,6 @@
|
||||
|
||||
#define avr_data_out() (AVR_DATA_DIR = 0xff)
|
||||
|
||||
#define LED_PORT PORTC
|
||||
#define LED_DIR DDRC
|
||||
#define LED_PIN PC7
|
||||
|
||||
#define led_on() ((LED_PORT &=~ (1 << LED_PIN)),\
|
||||
(LED_DIR &=~ (1 << LED_PIN)))
|
||||
#define led_off() ((LED_PORT &=~ (1 << LED_PIN)),\
|
||||
(LED_DIR |= (1 << LED_PIN)))
|
||||
|
||||
/* ---------------------------- PORT B ---------------------------- */
|
||||
|
||||
@ -129,12 +121,14 @@
|
||||
#define counter_load() ((AVR_ADDR_LOAD_PORT &= ~(1 << AVR_ADDR_LOAD_PIN)),\
|
||||
(AVR_ADDR_LOAD_PORT |= (1 << AVR_ADDR_LOAD_PIN)))
|
||||
|
||||
#define AVR_ADDR_DOWN_PORT PORTC
|
||||
#define AVR_ADDR_DOWN_DIR DDRC
|
||||
#define AVR_ADDR_DOWN_PIN PC1
|
||||
#define AVR_BTLDR_EN_PORT PORTC
|
||||
#define AVR_BTLDR_EN_DIR DDRC
|
||||
#define AVR_BTLDR_EN_PIN PC1
|
||||
|
||||
#define btldr_down() ((AVR_BTLDR_EN_PORT &= ~(1 << AVR_BTLDR_EN_PIN)),\
|
||||
(AVR_BTLDR_EN_PORT |= (1 << AVR_BTLDR_EN_PIN)))
|
||||
|
||||
|
||||
#define counter_down() ((AVR_ADDR_DOWN_PORT &= ~(1 << AVR_ADDR_DOWN_PIN)),\
|
||||
(AVR_ADDR_DOWN_PORT |= (1 << AVR_ADDR_DOWN_PIN)))
|
||||
|
||||
#define AVR_ADDR_UP_PORT PORTC
|
||||
#define AVR_ADDR_UP_DIR DDRC
|
||||
@ -147,6 +141,16 @@
|
||||
#define SNES_WR_DIR DDRC
|
||||
#define SNES_WR_PIN PC3
|
||||
|
||||
#define LED_PORT PORTC
|
||||
#define LED_DIR DDRC
|
||||
#define LED_PIN PC7
|
||||
|
||||
#define led_on() ((LED_PORT &=~ (1 << LED_PIN)),\
|
||||
(LED_DIR &=~ (1 << LED_PIN)))
|
||||
#define led_off() ((LED_PORT &=~ (1 << LED_PIN)),\
|
||||
(LED_DIR |= (1 << LED_PIN)))
|
||||
|
||||
|
||||
/* ---------------------------- PORT D ---------------------------- */
|
||||
|
||||
#define AVR_SNES_PORT PORTD
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user