[FSK4] Use abs macro instead of abs function
This commit is contained in:
parent
2f85326fec
commit
05e35407f4
1 changed files with 2 additions and 3 deletions
|
@ -1,5 +1,4 @@
|
||||||
#include "FSK4.h"
|
#include "FSK4.h"
|
||||||
#include <stdlib.h>
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#if !RADIOLIB_EXCLUDE_FSK4
|
#if !RADIOLIB_EXCLUDE_FSK4
|
||||||
|
|
||||||
|
@ -113,12 +112,12 @@ int32_t FSK4Client::getRawShift(int32_t shift) {
|
||||||
int32_t step = round(phyLayer->getFreqStep());
|
int32_t step = round(phyLayer->getFreqStep());
|
||||||
|
|
||||||
// check minimum shift value
|
// check minimum shift value
|
||||||
if(abs(shift) < step / 2) {
|
if(RADIOLIB_ABS(shift) < step / 2) {
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// round shift to multiples of frequency step size
|
// round shift to multiples of frequency step size
|
||||||
if(abs(shift) % step < (step / 2)) {
|
if(RADIOLIB_ABS(shift) % step < (step / 2)) {
|
||||||
return(shift / step);
|
return(shift / step);
|
||||||
}
|
}
|
||||||
if(shift < 0) {
|
if(shift < 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue