Floating-point converted to fixed-point

The follwing were converted to fixed-point
- battery voltage
- board temperature
- filters for steer and speed
- mixer calculation

Starting from this moment, the firmware is floating point free, meaning it runs more efficiently.
This commit is contained in:
EmanuelFeru
2019-10-20 13:31:47 +02:00
parent f6fc825e5f
commit 8771742558
6 changed files with 471 additions and 116 deletions

View File

@@ -158,5 +158,6 @@ typedef struct {
} adc_buf_t;
// Define low-pass filter functions. Implementation is in main.c
int16_t filtLowPass16(int16_t u, uint16_t coef, int16_t yPrev);
int32_t filtLowPass32(int32_t u, uint16_t coef, int32_t yPrev);
void filtLowPass16(int16_t u, uint16_t coef, int16_t *y);
void filtLowPass32(int32_t u, uint16_t coef, int32_t *y);
void mixerFcn(int16_t rtu_speed, int16_t rtu_steer, int16_t *rty_speedR, int16_t *rty_speedL);