From e3404275bbab95fc189410f67e9d3e520646ead9 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Mon, 3 Feb 2014 19:53:46 -0700 Subject: [PATCH] Pull-up DATA to deal with controller unplug --- ISSUES.txt | 3 ++- avr.c | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ISSUES.txt b/ISSUES.txt index 6b5dc97..cb9e6e3 100644 --- a/ISSUES.txt +++ b/ISSUES.txt @@ -13,4 +13,5 @@ Fixed 5. Make setup mode less confusing 6. Allow jam clock adjustments in setup 7. Unified build with multiple firmware targets -8. Debounce buttons \ No newline at end of file +8. Debounce buttons +9. Pull-up NES data to prevent going apeshit when you unplug the controller diff --git a/avr.c b/avr.c index 4d793b0..ff24fbb 100644 --- a/avr.c +++ b/avr.c @@ -39,6 +39,10 @@ avr_init(void) TCCR1B |= _BV(CS11) | _BV(CS10); // prescale: clk_io / 64 TIMSK1 |= _BV(OCIE1A); + // Pull-up NES data line + bit(PORTA, _BV(NESOUT), true); + + // Turn on Power Supply bit(PORTA, _BV(7), true); PORTB = 0xff;