Skip to content

Commit

Permalink
add vbat and ibat scale to target
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Sep 11, 2023
1 parent c79209c commit 5beba35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/core/profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
7 changes: 6 additions & 1 deletion src/core/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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),
Expand Down

0 comments on commit 5beba35

Please sign in to comment.