From 4949827f50386695020259e7a045836e9fbf11eb Mon Sep 17 00:00:00 2001
From: jgromes <jgromes@users.noreply.github.com>
Date: Tue, 4 May 2021 09:20:46 +0200
Subject: [PATCH] [SX128x] Replace abs() with fabs()

---
 src/modules/SX128x/SX128x.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/modules/SX128x/SX128x.cpp b/src/modules/SX128x/SX128x.cpp
index 24967274..1e9c6d0f 100644
--- a/src/modules/SX128x/SX128x.cpp
+++ b/src/modules/SX128x/SX128x.cpp
@@ -605,13 +605,13 @@ int16_t SX128x::setBandwidth(float bw) {
     return(ERR_WRONG_MODEM);
   }
 
-  if(abs(bw - 203.125) <= 0.001) {
+  if(fabs(bw - 203.125) <= 0.001) {
     _bw = SX128X_LORA_BW_203_125;
-  } else if(abs(bw - 406.25) <= 0.001) {
+  } else if(fabs(bw - 406.25) <= 0.001) {
     _bw = SX128X_LORA_BW_406_25;
-  } else if(abs(bw - 812.5) <= 0.001) {
+  } else if(fabs(bw - 812.5) <= 0.001) {
     _bw = SX128X_LORA_BW_812_50;
-  } else if(abs(bw - 1625.0) <= 0.001) {
+  } else if(fabs(bw - 1625.0) <= 0.001) {
     _bw = SX128X_LORA_BW_1625_00;
   } else {
     return(ERR_INVALID_BANDWIDTH);