libds/lib_misc: use b16abs()

This commit is contained in:
raiden00pl 2023-10-07 11:59:47 +02:00 committed by Xiang Xiao
parent 819bec0888
commit 4f8a2b3874
1 changed files with 1 additions and 5 deletions

View File

@ -31,10 +31,6 @@
#define VECTOR2D_SATURATE_MAG_MIN (1) #define VECTOR2D_SATURATE_MAG_MIN (1)
#define FAST_ATAN2_SMALLNUM (1) #define FAST_ATAN2_SMALLNUM (1)
#ifndef ABS
# define ABS(a) ((a) < 0 ? -(a) : (a))
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@ -327,7 +323,7 @@ b16_t fast_atan2_b16(b16_t y, b16_t x)
/* Get absolute value of y and add some small number to prevent 0/0 */ /* Get absolute value of y and add some small number to prevent 0/0 */
abs_y = ABS(y) + FAST_ATAN2_SMALLNUM; abs_y = b16abs(y) + FAST_ATAN2_SMALLNUM;
/* Calculate angle */ /* Calculate angle */