mirror of https://github.com/rusefi/bldc.git
Sign macro fix
This commit is contained in:
parent
c5c309e227
commit
40c2842aa8
4
utils.h
4
utils.h
|
@ -67,8 +67,8 @@ uint16_t utils_median_filter_uint16_run(uint16_t *buffer,
|
||||||
unsigned int *buffer_index, unsigned int filter_len, uint16_t sample);
|
unsigned int *buffer_index, unsigned int filter_len, uint16_t sample);
|
||||||
const char* utils_hw_type_to_string(HW_TYPE hw);
|
const char* utils_hw_type_to_string(HW_TYPE hw);
|
||||||
|
|
||||||
// Return the sign of the argument. -1 if negative, 1 if zero or positive.
|
// Return the sign of the argument. -1.0 if negative, 1.0 if zero or positive.
|
||||||
#define SIGN(x) ((x < 0) ? -1 : 1)
|
#define SIGN(x) (((x) < 0.0) ? -1.0 : 1.0)
|
||||||
|
|
||||||
// Squared
|
// Squared
|
||||||
#define SQ(x) ((x) * (x))
|
#define SQ(x) ((x) * (x))
|
||||||
|
|
Loading…
Reference in New Issue