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:
parent
8e6c7fb9e3
commit
abb6eb5b54
1 changed files with 3 additions and 3 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue