[CC1101] Replace abs() with fabs()

pull/373/head
jgromes 2021-05-04 09:12:12 +02:00
rodzic b81a2d7549
commit 4be690b7e4
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -478,7 +478,7 @@ int16_t CC1101::setRxBandwidth(float rxBw) {
for(int8_t e = 3; e >= 0; e--) {
for(int8_t m = 3; m >= 0; m --) {
float point = (CC1101_CRYSTAL_FREQ * 1000000.0)/(8 * (m + 4) * ((uint32_t)1 << e));
if(abs((rxBw * 1000.0) - point) <= 1000) {
if(fabs(rxBw * 1000.0) - point) <= 1000) {
// set Rx channel filter bandwidth
return(SPIsetRegValue(CC1101_REG_MDMCFG4, (e << 6) | (m << 4), 7, 4));
}