Move bwm_battery_info_t into pm3_cmd.h (shared wire-protocol header)
bwm_charger.h is an armsrc-only header included after pm3_cmd.h in appmain.c, so a struct embedding bwm_battery_info_t by value (e.g. a future PM5 status command) couldn't see the type at the point it's needed. bwm_ble_status_t and bwm_autooff_status_t already live in pm3_cmd.h for the same reason - this just brings bwm_battery_info_t in line with them. bwm_charger.c/.h keep their function declarations unchanged; only the struct's home moves. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5661f21d60
commit
f2df3eba9d
2 files changed
+23
-21
No files matched your search
@@ -987,6 +987,23 @@ typedef struct {
|
||||
uint8_t bonded_count;
|
||||
uint8_t bonded[BWM_BLE_BONDED_MAX][7]; // addr[6] + type, first bonded_count valid
|
||||
} PACKED bwm_ble_status_t;
|
||||
// Compact battery telemetry shared by `hw status`'s underlying data source and
|
||||
// any client (e.g. the Flipper Zero FAP) wanting raw numbers instead of free-text
|
||||
// Dbprintf lines. All fields zeroed if bwm_present is false or gauge_ok is false.
|
||||
typedef struct {
|
||||
bool bwm_present;
|
||||
bool gauge_ok;
|
||||
uint16_t soc_pct;
|
||||
uint16_t voltage_mv;
|
||||
int16_t current_ma; // +charge / -discharge
|
||||
uint16_t remaining_mah;
|
||||
uint16_t full_charge_mah;
|
||||
uint16_t design_cap_mah;
|
||||
int16_t temp_c10; // tenths of a degree C
|
||||
uint8_t charger_fault; // 0 = none, else AW32001E REG09 bits masked 0x3F
|
||||
uint8_t charge_status; // 0=not charging,1=pre-charge,2=charging,3=done
|
||||
uint8_t health_pct;
|
||||
} PACKED bwm_battery_info_t;
|
||||
// PM5, read compact BWM battery telemetry (bwm_battery_info_t). Used by `hw status`'s
|
||||
// underlying data source and by clients (e.g. the Flipper Zero FAP) that want the raw
|
||||
// numbers instead of hw status's free-text Dbprintf lines.
|
||||
|
||||
Reference in new issue
Block a user