From 5beba354746abca89a08b0964df6e6633d3a8c2b Mon Sep 17 00:00:00 2001 From: bkleiner Date: Mon, 11 Sep 2023 18:13:57 +0200 Subject: [PATCH] add vbat and ibat scale to target --- src/core/profile.c | 2 ++ src/core/target.h | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/profile.c b/src/core/profile.c index 4a2311392..72c6ef517 100644 --- a/src/core/profile.c +++ b/src/core/profile.c @@ -525,6 +525,8 @@ void profile_set_defaults() { blackbox_preset_apply(&blackbox_presets[DEFAULT_BLACKBOX_PRESET], &profile.blackbox); profile.motor.gyro_orientation = target.gyro_orientation; + profile.voltage.vbat_scale = target.vbat_scale; + profile.voltage.ibat_scale = target.ibat_scale; } pid_rate_t *profile_current_pid_rates() { diff --git a/src/core/target.h b/src/core/target.h index e86775ffb..b88d0aa71 100644 --- a/src/core/target.h +++ b/src/core/target.h @@ -163,6 +163,9 @@ typedef struct { target_invert_pin_t sdcard_detect; target_invert_pin_t buzzer; gpio_pins_t motor_pins[MOTOR_PIN_MAX]; + + uint16_t vbat_scale; + uint16_t ibat_scale; } target_t; #define TARGET_MEMBERS \ @@ -184,7 +187,9 @@ typedef struct { MEMBER(ibat, gpio_pins_t) \ MEMBER(sdcard_detect, target_invert_pin_t) \ MEMBER(buzzer, target_invert_pin_t) \ - ARRAY_MEMBER(motor_pins, MOTOR_PIN_MAX, gpio_pins_t) + ARRAY_MEMBER(motor_pins, MOTOR_PIN_MAX, gpio_pins_t) \ + MEMBER(vbat_scale, uint16) \ + MEMBER(ibat_scale, uint16) typedef enum { FEATURE_BRUSHLESS = (1 << 1),