From fada51f5b3dca1c1bee470bd0bb2c3b56b73121e Mon Sep 17 00:00:00 2001 From: "gruvin@gmail.com" Date: Tue, 18 Dec 2012 21:35:14 +0000 Subject: [PATCH] G9Xv4 Board: Committing TX_CADDY feature to trunk. This feature allows use of a transmitter module 'caddy' PCB, which facilitates automatic DSM2(X) or Fr-Sky transmitter module switching, without having to swap TX module on the back of the radio. Two antennas are installed on the radio instead of attempting to switch 2.4GHz RF signals, for reliability. The TX Caddy circuit schematic and PCB layout can be found in the gruvin9x hardware project. I am not really expecting anyone else to implement this feature. But it's there for those who might and adding it to trunk prevent me having to manually port the feature to new versions, each time I update my field radio. -- Gruvin --- src/Makefile | 9 +++++++++ src/pulses_avr.cpp | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/src/Makefile b/src/Makefile index 7fd88283b..233414ed4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -157,6 +157,11 @@ PXX = NO # Values = NO, SERIAL, PPM DSM2 = NO +# DSM/PPM TX caddy PCB (Gruvin) +# For auto-switching switching between DSM2/X and Fr-Sky transmitter modules +# Values = YES, NO +TX_CADDY = NO + #IR protocols (SILV / TRAC09 / PICZ / SWIFT) IRPROTOS = NO @@ -662,6 +667,10 @@ ifeq ($(DSM2), PPM) CPPDEFS += -DDSM2 -DDSM2_PPM endif +ifeq ($(TX_CADDY), YES) + CPPDEFS += -DTX_CADDY +endif + ifeq ($(IRPROTOS), YES) CPPDEFS += -DIRPROTOS endif diff --git a/src/pulses_avr.cpp b/src/pulses_avr.cpp index ba4cde6a3..65c998567 100644 --- a/src/pulses_avr.cpp +++ b/src/pulses_avr.cpp @@ -736,6 +736,13 @@ void setupPulses() PORTH |= 0x80; // PORTH:7 LOW->HIGH signals start of setupPulses() #endif +#if defined (PCBGRUVIN9X) && defined(TX_CADDY) + if (required_protocol == PROTO_DSM2) + PORTH &= ~0x80; + else + PORTH |= 0x80; +#endif + if (s_pulses_paused) required_protocol = PROTO_NONE;