PER Firmware
Loading...
Searching...
No Matches
common_defs.h File Reference

Common defs for the entire firmware repository. Dont let this get too out of control please. More...

#include <stdint.h>

Go to the source code of this file.

Macros

#define MIN(x, y)
 
#define MAX(x, y)
 
#define CLAMP(x, min, max)
 
#define ABS(x)
 
#define MAX2(x, y)
 
#define MAX4(a, b, c, d)
 
#define DEG_TO_RAD   (PI / 180.0f)
 
#define G_TO_M_S   (9.80665f)
 
#define HSI_TRIM_TORQUE_VECTOR   15
 
#define HSI_TRIM_MAIN_MODULE   15
 
#define HSI_TRIM_PDU   16
 
#define HSI_TRIM_DASHBOARD   15
 
#define HSI_TRIM_DAQ   17
 
#define HSI_TRIM_A_BOX   16
 

Detailed Description

Common defs for the entire firmware repository. Dont let this get too out of control please.

Author
Adam Busch (busch.nosp@m.8@pu.nosp@m.rdue..nosp@m.edu)
Version
0.1
Date
2022-01-26

Macro Definition Documentation

◆ ABS

#define ABS ( x)
Value:
_Generic((x), float: abs_f, double: abs_f, default: abs_i)(x)

◆ CLAMP

#define CLAMP ( x,
min,
max )
Value:
_Generic((x), \
float: clamp_f, \
double: clamp_f, \
default: clamp_i \
)((x), (min), (max))

◆ MAX

#define MAX ( x,
y )
Value:
_Generic((x), float: max_f, double: max_f, default: max_i)((x), (y))

◆ MAX2

#define MAX2 ( x,
y )
Value:
((x) > (y) ? (x) : (y))

◆ MAX4

#define MAX4 ( a,
b,
c,
d )
Value:
(MAX2(MAX2((a), (b)), MAX2((c), (d))))

◆ MIN

#define MIN ( x,
y )
Value:
_Generic((x), float: min_f, double: min_f, default: min_i)((x), (y))