Skip to content
Snippets Groups Projects
Commit 8f5195d1 authored by Adrien van den Bossche's avatar Adrien van den Bossche
Browse files

Modify frequencyError() from last RadioHead

parent cfc9bc1e
No related branches found
No related tags found
No related merge requests found
...@@ -615,7 +615,7 @@ int RH_RF95::frequencyError() ...@@ -615,7 +615,7 @@ int RH_RF95::frequencyError()
freqerror |= 0xfff00000; freqerror |= 0xfff00000;
int error = 0; // In hertz int error = 0; // In hertz
float bw_tab[] = {7.81, 10.42, 15.62, 20.83, 31.25, 41.67, 62.50, 125.00, 250.00, 500.00}; float bw_tab[] = {7.8, 10.4, 15.6, 20.8, 31.25, 41.7, 62.5, 125, 250, 500};
uint8_t bwindex = spiRead(RH_RF95_REG_1D_MODEM_CONFIG1) >> 4; uint8_t bwindex = spiRead(RH_RF95_REG_1D_MODEM_CONFIG1) >> 4;
if (bwindex < (sizeof(bw_tab) / sizeof(float))) if (bwindex < (sizeof(bw_tab) / sizeof(float)))
error = (float)freqerror * bw_tab[bwindex] * ((float)(1L << 24) / (float)RH_RF95_FXOSC / 500.0); error = (float)freqerror * bw_tab[bwindex] * ((float)(1L << 24) / (float)RH_RF95_FXOSC / 500.0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment