mirror of https://github.com/g4klx/MMDVM.git
Re-add the RSSI code with a different RSSI pin number.
This commit is contained in:
parent
a34b69a4dc
commit
0bfecf72a9
11
IO.cpp
11
IO.cpp
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +219,7 @@ void CIO::start()
|
||||||
t->TC_RA = 880; // Roughly square wave
|
t->TC_RA = 880; // Roughly square wave
|
||||||
#endif
|
#endif
|
||||||
t->TC_CMR = (t->TC_CMR & 0xFFF0FFFF) | TC_CMR_ACPA_CLEAR | TC_CMR_ACPC_SET; // Set clear and set from RA and RC compares
|
t->TC_CMR = (t->TC_CMR & 0xFFF0FFFF) | TC_CMR_ACPA_CLEAR | TC_CMR_ACPC_SET; // Set clear and set from RA and RC compares
|
||||||
t->TC_CCR = TC_CCR_CLKEN | TC_CCR_SWTRG ; // re-enable local clocking and switch to hardware trigger source.
|
t->TC_CCR = TC_CCR_CLKEN | TC_CCR_SWTRG; // re-enable local clocking and switch to hardware trigger source.
|
||||||
|
|
||||||
// Set up the DAC
|
// Set up the DAC
|
||||||
pmc_enable_periph_clk(DACC_INTERFACE_ID); // Start clocking DAC
|
pmc_enable_periph_clk(DACC_INTERFACE_ID); // Start clocking DAC
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue