mirror of
https://github.com/sandeepmistry/arduino-LoRa.git
synced 2025-04-20 23:47:47 +03:00
Use binary literals
Fix deprecated warnings
This commit is contained in:
parent
01bf044b76
commit
55d49c577a
@ -274,14 +274,14 @@ float LoRaClass::packetSnr()
|
||||
long LoRaClass::packetFrequencyError()
|
||||
{
|
||||
int32_t freqError = 0;
|
||||
freqError = static_cast<int32_t>(readRegister(REG_FREQ_ERROR_MSB) & B111);
|
||||
freqError = static_cast<int32_t>(readRegister(REG_FREQ_ERROR_MSB) & 0b111);
|
||||
freqError <<= 8L;
|
||||
freqError += static_cast<int32_t>(readRegister(REG_FREQ_ERROR_MID));
|
||||
freqError <<= 8L;
|
||||
freqError += static_cast<int32_t>(readRegister(REG_FREQ_ERROR_LSB));
|
||||
|
||||
if (readRegister(REG_FREQ_ERROR_MSB) & B1000) { // Sign bit is on
|
||||
freqError -= 524288; // B1000'0000'0000'0000'0000
|
||||
if (readRegister(REG_FREQ_ERROR_MSB) & 0b1000) { // Sign bit is on
|
||||
freqError -= 524288; // 0b1000'0000'0000'0000'0000
|
||||
}
|
||||
|
||||
const float fXtal = 32E6; // FXOSC: crystal oscillator (XTAL) frequency (2.5. Chip Specification, p. 14)
|
||||
|
Loading…
x
Reference in New Issue
Block a user