Commit a4444850 authored by Bruno Randolf's avatar Bruno Randolf

better max and min for normalize_db

parent c4201cd2
......@@ -67,8 +67,15 @@ convert_string_to_mac(const char* string, unsigned char* mac);
int
normalize(float val, int max_val, int max);
#define normalize_db(_val, _max) \
normalize((_val) - 30, 70, (_max))
static inline int normalize_db(int val, int max)
{
if (val <= 30)
return 0;
else if (val >= 70)
return max;
else
return normalize(val - 30, 70, max);
}
char
get_packet_type_char(int type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment