1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 14:25:20 +03:00

CF/BF - remove dependency on scheduler from battery.c by using local state.

This commit is contained in:
Hydra 2017-03-18 18:26:15 +00:00 committed by Dominic Clifton
parent 8e6c7fb9e3
commit abb6eb5b54

View file

@ -26,8 +26,6 @@
#include "common/maths.h"
#include "common/utils.h"
#include "scheduler/scheduler.h"
#include "config/feature.h"
#include "config/parameter_group.h"
#include "config/parameter_group_ids.h"
@ -328,7 +326,9 @@ void batteryUpdateCurrentMeter(timeUs_t currentTimeUs)
return;
}
int32_t lastUpdateAt = getTaskDeltaTime(TASK_SELF);
static uint32_t ibatLastServiced = 0;
const int32_t lastUpdateAt = cmp32(currentTimeUs, ibatLastServiced);
ibatLastServiced = currentTimeUs;
switch(batteryConfig()->currentMeterSource) {
case CURRENT_METER_ADC: