From 55d49c577ac678ed46bcebdba0365ad3b3cdf643 Mon Sep 17 00:00:00 2001 From: Pedro L Date: Sun, 19 Jun 2022 14:46:47 +0100 Subject: [PATCH] Use binary literals Fix deprecated warnings --- src/LoRa.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/LoRa.cpp b/src/LoRa.cpp index 210a589..44b4946 100644 --- a/src/LoRa.cpp +++ b/src/LoRa.cpp @@ -274,14 +274,14 @@ float LoRaClass::packetSnr() long LoRaClass::packetFrequencyError() { int32_t freqError = 0; - freqError = static_cast(readRegister(REG_FREQ_ERROR_MSB) & B111); + freqError = static_cast(readRegister(REG_FREQ_ERROR_MSB) & 0b111); freqError <<= 8L; freqError += static_cast(readRegister(REG_FREQ_ERROR_MID)); freqError <<= 8L; freqError += static_cast(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)