mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 06:45:16 +03:00
CF/BF - First cut of Current/Voltage/Battery cleanup.
many refactorings, bugs squished, concerns separated, single-responsibility violations fixed and performance optimizations.
This commit is contained in:
parent
b46e0fe46d
commit
067d3c0ac2
69 changed files with 1178 additions and 514 deletions
|
@ -51,6 +51,11 @@ extern "C" {
|
|||
#include "telemetry/hott.h"
|
||||
|
||||
PG_REGISTER(telemetryConfig_t, telemetryConfig, PG_TELEMETRY_CONFIG, 0);
|
||||
|
||||
uint16_t testBatteryVoltage = 0;
|
||||
int32_t testAmperage = 0;
|
||||
int32_t testMAhDrawn = 0;
|
||||
|
||||
}
|
||||
|
||||
#include "unittest_macros.h"
|
||||
|
@ -172,10 +177,7 @@ uint16_t GPS_speed; // speed in 0.1m/s
|
|||
uint16_t GPS_distanceToHome; // distance to home point in meters
|
||||
uint16_t GPS_altitude; // altitude in 0.1m
|
||||
int16_t GPS_directionToHome; // direction to home or hol point in degrees
|
||||
uint16_t vbat;
|
||||
|
||||
int32_t amperage;
|
||||
int32_t mAhDrawn;
|
||||
|
||||
uint32_t fixedMillis = 0;
|
||||
|
||||
|
@ -264,8 +266,17 @@ batteryState_e getBatteryState(void)
|
|||
return BATTERY_OK;
|
||||
}
|
||||
|
||||
uint16_t getVbat(void)
|
||||
uint16_t getBatteryVoltage(void)
|
||||
{
|
||||
return vbat;
|
||||
return testBatteryVoltage;
|
||||
}
|
||||
|
||||
int32_t getAmperage(void) {
|
||||
return testAmperage;
|
||||
}
|
||||
|
||||
int32_t getMAhDrawn(void) {
|
||||
return testMAhDrawn;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue