Fixed conflicts

This commit is contained in:
Federico Maggi 2020-07-14 15:50:55 +02:00
parent 02d8b336ab
commit 7535faad32
4 changed files with 28 additions and 19 deletions

View file

@ -880,18 +880,10 @@ class CC1101: public PhysicalLayer {
#endif #endif
Module* _mod; Module* _mod;
<<<<<<< HEAD
float _freq;
float _br;
uint8_t _rawRSSI;
uint8_t _rawLQI;
uint8_t _modulation;
=======
float _freq = 0; float _freq = 0;
uint8_t _rawRSSI = 0; uint8_t _rawRSSI = 0;
uint8_t _rawLQI = 0; uint8_t _rawLQI = 0;
uint8_t _modulation = CC1101_MOD_FORMAT_2_FSK; uint8_t _modulation = CC1101_MOD_FORMAT_2_FSK;
>>>>>>> upstream/master
size_t _packetLength = 0; size_t _packetLength = 0;
bool _packetLengthQueried = false; bool _packetLengthQueried = false;

View file

@ -369,6 +369,25 @@ int16_t RF69::readData(uint8_t* data, size_t len) {
return(ERR_NONE); return(ERR_NONE);
} }
int16_t CC1101::setOOK(bool enableOOK) {
// Change modulation
if(enableOOK) {
int16_t state = SPIsetRegValue(RF69_REG_DATA_MODUL, RF69_OOK, 4, 3);
RADIOLIB_ASSERT(state);
// update current modulation
_modulation = CC1101_MOD_FORMAT_ASK_OOK;
} else {
int16_t state = SPIsetRegValue(RF69_REG_DATA_MODUL, RF69_FSK, 4, 3);
RADIOLIB_ASSERT(state);
// update current modulation
_modulation = CC1101_MOD_FORMAT_2_FSK;
}
return(setOutputPower(_power));
}
int16_t RF69::setFrequency(float freq) { int16_t RF69::setFrequency(float freq) {
// check allowed frequency range // check allowed frequency range
if(!(((freq > 290.0) && (freq < 340.0)) || if(!(((freq > 290.0) && (freq < 340.0)) ||

View file

@ -614,6 +614,15 @@ class RF69: public PhysicalLayer {
// configuration methods // configuration methods
/*!
\brief Enables/disables OOK modulation instead of FSK.
\param enableOOK Enable (true) or disable (false) OOK.
\returns \ref status_codes
*/
int16_t setOOK(bool enableOOK);
/*! /*!
\brief Sets carrier frequency. Allowed values are in bands 290.0 to 340.0 MHz, 431.0 to 510.0 MHz and 862.0 to 1020.0 MHz. \brief Sets carrier frequency. Allowed values are in bands 290.0 to 340.0 MHz, 431.0 to 510.0 MHz and 862.0 to 1020.0 MHz.

View file

@ -240,22 +240,11 @@ int16_t nRF24::readData(uint8_t* data, size_t len) {
} }
int16_t nRF24::setFrequency(int16_t freq) { int16_t nRF24::setFrequency(int16_t freq) {
<<<<<<< HEAD
// check allowed range
if(!((freq >= 2400) && (freq <= 2525))) {
return(ERR_INVALID_FREQUENCY);
}
// set frequency
uint8_t freqRaw = freq - 2400;
return _mod->SPIsetRegValue(NRF24_REG_RF_CH, freqRaw, 6, 0);
=======
RADIOLIB_CHECK_RANGE(freq, 2400, 2525, ERR_INVALID_FREQUENCY); RADIOLIB_CHECK_RANGE(freq, 2400, 2525, ERR_INVALID_FREQUENCY);
// set frequency // set frequency
uint8_t freqRaw = freq - 2400; uint8_t freqRaw = freq - 2400;
return(_mod->SPIsetRegValue(NRF24_REG_RF_CH, freqRaw, 6, 0)); return(_mod->SPIsetRegValue(NRF24_REG_RF_CH, freqRaw, 6, 0));
>>>>>>> upstream/master
} }
int16_t nRF24::setDataRate(int16_t dataRate) { int16_t nRF24::setDataRate(int16_t dataRate) {