Re-add the RSSI code with a different RSSI pin number.

This commit is contained in:
Jonathan Naylor 2016-08-11 10:59:49 +01:00 committed by GitHub
parent a34b69a4dc
commit 0bfecf72a9
1 changed files with 8 additions and 3 deletions

9
IO.cpp
View File

@ -61,6 +61,7 @@ const uint16_t DC_OFFSET = 2048U;
#define PIN_DSTAR 9 #define PIN_DSTAR 9
#define PIN_DMR 8 #define PIN_DMR 8
#define PIN_YSF 7 #define PIN_YSF 7
#define PIN_RSSI 60 // ADC on Due pin A6 - Due AD1
#define ADC_CHER_Chan (1<<13) // ADC on Due pin A11 - Due AD13 - (1 << 13) (PB20) #define ADC_CHER_Chan (1<<13) // ADC on Due pin A11 - Due AD13 - (1 << 13) (PB20)
#define ADC_ISR_EOC_Chan ADC_ISR_EOC13 #define ADC_ISR_EOC_Chan ADC_ISR_EOC13
#define ADC_CDR_Chan 13 #define ADC_CDR_Chan 13
@ -160,6 +161,11 @@ m_lockout(false)
pinMode(PIN_DMR, OUTPUT); pinMode(PIN_DMR, OUTPUT);
pinMode(PIN_YSF, OUTPUT); pinMode(PIN_YSF, OUTPUT);
#endif #endif
#if defined(SEND_RSSI_DATA)
pinMode(PIN_RSSI, INPUT);
analogReadResolution(12);
#endif
#endif #endif
} }
@ -567,7 +573,6 @@ bool CIO::hasLockout() const
#if defined(SEND_RSSI_DATA) #if defined(SEND_RSSI_DATA)
uint16_t CIO::getRSSIValue() uint16_t CIO::getRSSIValue()
{ {
return 0U; return analogRead(PIN_RSSI);
} }
#endif #endif