Added missing conditions for preprocessor

This commit is contained in:
Paweł Gomułka 2016-12-21 01:55:35 +01:00
parent 2c76d67098
commit bef0d9cfd6
2 changed files with 10 additions and 6 deletions

View File

@ -62,4 +62,3 @@
// #define SERIAL_REPEATER // #define SERIAL_REPEATER
#endif #endif

View File

@ -106,8 +106,10 @@ void CIO::startInt()
ADC->ADC_IDR = 0xFFFFFFFF; // Disable interrupts ADC->ADC_IDR = 0xFFFFFFFF; // Disable interrupts
ADC->ADC_IER = ADC_CHER_Chan; // Enable End-Of-Conv interrupt ADC->ADC_IER = ADC_CHER_Chan; // Enable End-Of-Conv interrupt
ADC->ADC_CHDR = 0xFFFF; // Disable all channels ADC->ADC_CHDR = 0xFFFF; // Disable all channels
ADC->ADC_CHER = ADC_CHER_Chan | // Enable rx input channel ADC->ADC_CHER = ADC_CHER_Chan; // Enable rx input channel
RSSI_CHER_Chan; // and RSSI input #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_CGR = 0x15555555; // All gains set to x1
ADC->ADC_COR = 0x00000000; // All offsets off 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 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]; sample = ADC->ADC_CDR[ADC_CDR_Chan];
m_rxBuffer.put(sample, control); m_rxBuffer.put(sample, control);
#if defined(RSSI_CHER_Chan) && defined(SEND_RSSI_DATA)
m_rssiBuffer.put(ADC->ADC_CDR[RSSI_CDR_Chan]); m_rssiBuffer.put(ADC->ADC_CDR[RSSI_CDR_Chan]);
#else
m_rssiBuffer.put(0U);
#endif
m_watchdog++; m_watchdog++;
} }
@ -219,4 +225,3 @@ void CIO::setP25Int(bool on)
} }
#endif #endif