diff --git a/Config.h b/Config.h index 3eb0ed4..c68fba1 100644 --- a/Config.h +++ b/Config.h @@ -62,4 +62,3 @@ // #define SERIAL_REPEATER #endif - diff --git a/IODue.cpp b/IODue.cpp index 93faf35..4c41752 100644 --- a/IODue.cpp +++ b/IODue.cpp @@ -106,8 +106,10 @@ void CIO::startInt() ADC->ADC_IDR = 0xFFFFFFFF; // Disable interrupts ADC->ADC_IER = ADC_CHER_Chan; // Enable End-Of-Conv interrupt ADC->ADC_CHDR = 0xFFFF; // Disable all channels - ADC->ADC_CHER = ADC_CHER_Chan | // Enable rx input channel - RSSI_CHER_Chan; // and RSSI input + ADC->ADC_CHER = ADC_CHER_Chan; // Enable rx input channel +#if defined(RSSI_CHER_Chan) + ADC->ADC_CHER |= RSSI_CHER_Chan; // and RSSI input +#endif ADC->ADC_CGR = 0x15555555; // All gains set to x1 ADC->ADC_COR = 0x00000000; // All offsets off ADC->ADC_MR = (ADC->ADC_MR & 0xFFFFFFF0) | (1 << 1) | ADC_MR_TRGEN; // 1 = trig source TIO from TC0 @@ -172,7 +174,11 @@ void CIO::interrupt(uint8_t source) sample = ADC->ADC_CDR[ADC_CDR_Chan]; m_rxBuffer.put(sample, control); +#if defined(RSSI_CHER_Chan) && defined(SEND_RSSI_DATA) m_rssiBuffer.put(ADC->ADC_CDR[RSSI_CDR_Chan]); +#else + m_rssiBuffer.put(0U); +#endif m_watchdog++; } @@ -203,7 +209,7 @@ void CIO::setDStarInt(bool on) digitalWrite(PIN_DSTAR, on ? HIGH : LOW); } -void CIO::setDMRInt(bool on) +void CIO::setDMRInt(bool on) { digitalWrite(PIN_DMR, on ? HIGH : LOW); } @@ -213,10 +219,9 @@ void CIO::setYSFInt(bool on) digitalWrite(PIN_YSF, on ? HIGH : LOW); } -void CIO::setP25Int(bool on) +void CIO::setP25Int(bool on) { digitalWrite(PIN_P25, on ? HIGH : LOW); } #endif -