kopia lustrzana https://github.com/jgromes/RadioLib
[RF69] Disabled SPI verification when writing frequency regs (#162)
rodzic
db234a16af
commit
20193b784e
|
@ -382,11 +382,10 @@ int16_t RF69::setFrequency(float freq) {
|
|||
|
||||
//set carrier frequency
|
||||
uint32_t FRF = (freq * (uint32_t(1) << RF69_DIV_EXPONENT)) / RF69_CRYSTAL_FREQ;
|
||||
int16_t state = _mod->SPIsetRegValue(RF69_REG_FRF_MSB, (FRF & 0xFF0000) >> 16, 7, 0);
|
||||
state |= _mod->SPIsetRegValue(RF69_REG_FRF_MID, (FRF & 0x00FF00) >> 8, 7, 0);
|
||||
state |= _mod->SPIsetRegValue(RF69_REG_FRF_LSB, FRF & 0x0000FF, 7, 0);
|
||||
|
||||
return(state);
|
||||
_mod->SPIwriteRegister(RF69_REG_FRF_MSB, (FRF & 0xFF0000) >> 16);
|
||||
_mod->SPIwriteRegister(RF69_REG_FRF_MID, (FRF & 0x00FF00) >> 8);
|
||||
_mod->SPIwriteRegister(RF69_REG_FRF_LSB, FRF & 0x0000FF);
|
||||
return(ERR_NONE);
|
||||
}
|
||||
|
||||
int16_t RF69::setBitRate(float br) {
|
||||
|
|
Ładowanie…
Reference in New Issue