Pull-up DATA to deal with controller unplug

This commit is contained in:
Neale Pickett 2014-02-03 19:53:46 -07:00
parent 01fa654c45
commit e3404275bb
2 changed files with 6 additions and 1 deletions

View File

@ -14,3 +14,4 @@ Fixed
6. Allow jam clock adjustments in setup 6. Allow jam clock adjustments in setup
7. Unified build with multiple firmware targets 7. Unified build with multiple firmware targets
8. Debounce buttons 8. Debounce buttons
9. Pull-up NES data to prevent going apeshit when you unplug the controller

4
avr.c
View File

@ -39,6 +39,10 @@ avr_init(void)
TCCR1B |= _BV(CS11) | _BV(CS10); // prescale: clk_io / 64 TCCR1B |= _BV(CS11) | _BV(CS10); // prescale: clk_io / 64
TIMSK1 |= _BV(OCIE1A); TIMSK1 |= _BV(OCIE1A);
// Pull-up NES data line
bit(PORTA, _BV(NESOUT), true);
// Turn on Power Supply
bit(PORTA, _BV(7), true); bit(PORTA, _BV(7), true);
PORTB = 0xff; PORTB = 0xff;