From 57878e1cea9cf03de8c9e4670113eeccb1e11dee Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 4 Jul 2018 22:19:25 +0200 Subject: [PATCH] Adapt LED handling to MMDVM options --- Config.h | 6 ++++++ IOArduino.cpp | 10 ++++++++-- IOSTM.cpp | 10 ++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Config.h b/Config.h index 13ace8b..df112ef 100644 --- a/Config.h +++ b/Config.h @@ -70,6 +70,12 @@ // Constant Service LED once repeater is running // #define CONSTANT_SRV_LED +// Use the YSF and P25 LEDs for NXDN +// #define USE_ALTERNATE_NXDN_LEDS + +// Use the D-Star and DMR LEDs for POCSAG +// #define USE_ALTERNATE_POCSAG_LEDS + // Enable modem debug messages // #define ENABLE_DEBUG diff --git a/IOArduino.cpp b/IOArduino.cpp index 1887951..41042f1 100644 --- a/IOArduino.cpp +++ b/IOArduino.cpp @@ -313,15 +313,21 @@ void CIO::P25_pin(bool on) void CIO::NXDN_pin(bool on) { +#if defined(USE_ALTERNATE_NXDN_LEDS) + digitalWrite(PIN_YSF_LED, on ? HIGH : LOW); + digitalWrite(PIN_P25_LED, on ? HIGH : LOW); +#else digitalWrite(PIN_NXDN_LED, on ? HIGH : LOW); +#endif } void CIO::POCSAG_pin(bool on) { - // Use D-Star and DMR LED to indicate POCSAG mode - // TODO: add a separate LED pin for POCSAG mode +#if defined(USE_ALTERNATE_POCSAG_LEDS) digitalWrite(PIN_DSTAR_LED, on ? HIGH : LOW); digitalWrite(PIN_DMR_LED, on ? HIGH : LOW); +#endif + // TODO: add a separate LED pin for POCSAG mode } void CIO::PTT_pin(bool on) diff --git a/IOSTM.cpp b/IOSTM.cpp index 962fe29..ac2e26b 100644 --- a/IOSTM.cpp +++ b/IOSTM.cpp @@ -644,15 +644,21 @@ void CIO::P25_pin(bool on) void CIO::NXDN_pin(bool on) { +#if defined(USE_ALTERNATE_NXDN_LEDS) + GPIO_WriteBit(PORT_YSF_LED, PIN_YSF_LED, on ? Bit_SET : Bit_RESET); + GPIO_WriteBit(PORT_P25_LED, PIN_P25_LED, on ? Bit_SET : Bit_RESET); +#else GPIO_WriteBit(PORT_NXDN_LED, PIN_NXDN_LED, on ? Bit_SET : Bit_RESET); +#endif } void CIO::POCSAG_pin(bool on) { - // Use D-Star and DMR LED to indicate POCSAG mode - // TODO: add a separate LED pin for POCSAG mode +#if defined(USE_ALTERNATE_POCSAG_LEDS) GPIO_WriteBit(PORT_DSTAR_LED, PIN_DSTAR_LED, on ? Bit_SET : Bit_RESET); GPIO_WriteBit(PORT_DMR_LED, PIN_DMR_LED, on ? Bit_SET : Bit_RESET); +#endif + // TODO: add a separate LED pin for POCSAG mode } void CIO::PTT_pin(bool on)