Define macro HZ_TO_INTERVAL_US() and remove unneeded comments
This commit is contained in:
parent
2c4659c7cd
commit
0111949c63
|
@ -57,6 +57,8 @@
|
|||
|
||||
#define Q12 (1 << 12)
|
||||
|
||||
#define HZ_TO_INTERVAL_US(x) (1000000 / (x))
|
||||
|
||||
typedef int32_t fix12_t;
|
||||
|
||||
typedef struct stdev_s
|
||||
|
|
|
@ -140,7 +140,7 @@ currentMeterADCState_t currentMeterADCState;
|
|||
void currentMeterADCInit(void)
|
||||
{
|
||||
memset(¤tMeterADCState, 0, sizeof(currentMeterADCState_t));
|
||||
biquadFilterInitLPF(&adciBatFilter, IBAT_LPF_FREQ, 20000); //50HZ Update
|
||||
biquadFilterInitLPF(&adciBatFilter, IBAT_LPF_FREQ, HZ_TO_INTERVAL_US(50));
|
||||
}
|
||||
|
||||
void currentMeterADCRefresh(int32_t lastUpdateAt)
|
||||
|
|
|
@ -191,7 +191,7 @@ void voltageMeterADCInit(void)
|
|||
voltageMeterADCState_t *state = &voltageMeterADCStates[i];
|
||||
memset(state, 0, sizeof(voltageMeterADCState_t));
|
||||
|
||||
biquadFilterInitLPF(&state->filter, VBAT_LPF_FREQ, 20000); //50HZ Update
|
||||
biquadFilterInitLPF(&state->filter, VBAT_LPF_FREQ, HZ_TO_INTERVAL_US(50));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -215,7 +215,7 @@ void voltageMeterESCInit(void)
|
|||
{
|
||||
#ifdef USE_ESC_SENSOR
|
||||
memset(&voltageMeterESCState, 0, sizeof(voltageMeterESCState_t));
|
||||
biquadFilterInitLPF(&voltageMeterESCState.filter, VBAT_LPF_FREQ, 20000); //50HZ Update
|
||||
biquadFilterInitLPF(&voltageMeterESCState.filter, VBAT_LPF_FREQ, HZ_TO_INTERVAL_US(50));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue