Define macro HZ_TO_INTERVAL_US() and remove unneeded comments

This commit is contained in:
jirif 2018-07-27 20:59:19 +02:00
parent 2c4659c7cd
commit 0111949c63
3 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -140,7 +140,7 @@ currentMeterADCState_t currentMeterADCState;
void currentMeterADCInit(void)
{
memset(&currentMeterADCState, 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)

View File

@ -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
}