1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

CMS power menu

Menu including:
- Voltage meter selection
- Current meter selection
- Max cell voltage (moved from MISC menu)
- Voltage scale adjust (moved from MISC menu)
- ADC current scale and offset adjust
- Virtual current scale and offset adjust
This commit is contained in:
Dan Nixon 2017-08-02 11:57:09 +01:00
parent 8738e7d623
commit 22874d8ba2
10 changed files with 170 additions and 20 deletions

View file

@ -36,6 +36,10 @@
#include "sensors/current.h"
#include "sensors/esc_sensor.h"
const char * const currentMeterSourceNames[CURRENT_METER_COUNT] = {
"NONE", "ADC", "VIRTUAL", "ESC", "MSP"
};
const uint8_t currentMeterIds[] = {
CURRENT_METER_ID_BATTERY_1,
#ifdef USE_VIRTUAL_CURRENT_METER

View file

@ -26,9 +26,11 @@ typedef enum {
CURRENT_METER_VIRTUAL,
CURRENT_METER_ESC,
CURRENT_METER_MSP,
CURRENT_METER_MAX = CURRENT_METER_ESC
CURRENT_METER_COUNT
} currentMeterSource_e;
extern const char * const currentMeterSourceNames[CURRENT_METER_COUNT];
typedef struct currentMeter_s {
int32_t amperage; // current read by current sensor in centiampere (1/100th A)
int32_t amperageLatest; // current read by current sensor in centiampere (1/100th A) (unfiltered)

View file

@ -37,6 +37,10 @@
#include "sensors/voltage.h"
#include "sensors/esc_sensor.h"
const char * const voltageMeterSourceNames[VOLTAGE_METER_COUNT] = {
"NONE", "ADC", "ESC"
};
const uint8_t voltageMeterIds[] = {
VOLTAGE_METER_ID_BATTERY_1,
#ifdef ADC_POWER_12V

View file

@ -26,9 +26,12 @@
typedef enum {
VOLTAGE_METER_NONE = 0,
VOLTAGE_METER_ADC,
VOLTAGE_METER_ESC
VOLTAGE_METER_ESC,
VOLTAGE_METER_COUNT
} voltageMeterSource_e;
extern const char * const voltageMeterSourceNames[VOLTAGE_METER_COUNT];
// WARNING - do not mix usage of VOLTAGE_METER_* and VOLTAGE_SENSOR_*, they are separate concerns.
typedef struct voltageMeter_s {