added battery presets for changing chemistry types#542
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis change adds a Battery Type preset selector (Custom, LiPo, LiIon, LiHV) to the battery configuration page. A hidden scratch byte tracks UI edit-mode state during load, is stripped before saving, and preset selection auto-updates min/max/warn cell voltage fields. ChangesBattery Type Preset
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant FC as Flight Controller
participant postLoad
participant battTypeField
participant applyBatteryPreset
participant preSave
FC->>postLoad: provide min/max/warn cell values
postLoad->>battTypeField: set matched preset value
battTypeField->>applyBatteryPreset: postEdit triggered
applyBatteryPreset->>applyBatteryPreset: update min/max/warn fields
applyBatteryPreset-->>FC: pack scaled values into self.values
preSave->>preSave: strip scratch byte
preSave-->>FC: emit 13-byte MSP_SET_BATTERY_CONFIG payload
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Added Presets to the Battery page for easy switching of types.
The new betaflight battery profiles and switch option might make this unnecessary. But it's a nice option to see and confirm the settings before you arm as part of your preflight if you're a user that switches types frequently.
Summary by CodeRabbit