From c107643d69574c7fe6083edecc5d7c791eaa335d Mon Sep 17 00:00:00 2001 From: "bernet.andre@gmail.com" Date: Mon, 20 May 2013 11:38:48 +0000 Subject: [PATCH] [Taranis] Bitmap loaded upon USB disconnection, A2 never valid if proto==X16 --- src/opentx.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/opentx.cpp b/src/opentx.cpp index 54d93a624..67ad403b4 100644 --- a/src/opentx.cpp +++ b/src/opentx.cpp @@ -1040,6 +1040,11 @@ bool __getSwitch(int8_t swtch) if (cs->v1 >= MIXSRC_FIRST_TELEM) { if (!TELEMETRY_STREAMING() && cs->v1 >= MIXSRC_FIRST_TELEM+TELEM_TM2) return swtch > 0 ? false : true; + +#if defined (PCBTARANIS) + if (cs->v1 == MIXSRC_FIRST_TELEM+TELEM_A2-1 && g_model.moduleData[INTERNAL_MODULE].rfProtocol == RF_PROTO_X16) + return swtch > 0 ? false : true; +#endif y = convertCswTelemValue(cs); @@ -3661,8 +3666,8 @@ void perMain() #if defined(PCBTARANIS) if (usbState == USB_DISCONNECTING) { eeReadAll(); - eeLoadModel(g_eeGeneral.currModel); sdInit(); + eeLoadModel(g_eeGeneral.currModel); usbState = USB_DISCONNECTED; } #endif