From 3eb0c3a95355df6d312ec727765d40bcbc0c0aaf Mon Sep 17 00:00:00 2001 From: Andre Bernet Date: Tue, 22 Mar 2016 12:18:09 +0400 Subject: [PATCH] [9X/2650] Fix occasional interaction between JTAG port and POT3 (fix from Mike following openrcforums discussion) --- radio/src/opentx.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 8cffffa0e..dac1c4f38 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -2663,9 +2663,13 @@ int main() #if defined(CPUM2560) || defined(CPUM2561) uint8_t mcusr = MCUSR; // save the WDT (etc) flags MCUSR = 0; // must be zeroed before disabling the WDT + MCUCR = 0x80 ; // Disable JTAG port that can interfere with POT3 + MCUCR = 0x80 ; // Must be done twice #elif defined(PCBSTD) uint8_t mcusr = MCUCSR; MCUCSR = 0; + MCUCSR = 0x80 ; // Disable JTAG port that can interfere with POT3 + MCUCSR = 0x80 ; // Must be done twice #endif #if defined(PCBTARANIS) g_eeGeneral.contrast = 30;