Conversation
Add an optional chg_current_normal_ma board setting next to the existing chg_current_ma and implement battery_set_fast_charge() so the charger can move between the two without a reboot. The charger is disabled around the BCHGISET write, as the PMIC requires, and only re-enabled if it was enabled before, so a paused charger is not silently resumed by a switch. Two consumers derived their scale from the board constant and now follow the live current instead: the charge-mode ADC full scale, which would otherwise misreport charge current, and the fuel gauge's charge current limit and termination current, which are re-informed on the next sample after a switch. Boards that leave the new field at 0 keep their fixed current. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Adrian Pascu <adrian@pascu.be>
Add a fastCharge shell preference, on by default, that selects between the board's fast and normal charge currents through battery_set_fast_charge(). It is synced from the phone through the settings blob db whitelist and applied once at boot after the prefs load. The setting is gated on CONFIG_FAST_CHARGE_SETTING, which depends on the nPM1300 driver, so boards without a switchable charger never expose the key. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Adrian Pascu <adrian@pascu.be>
Pebble Time 2 keeps 190 mA (1C, the cell's rapid-charge maximum) as its fast charge current and gains 96 mA (0.5C, the standard charge rate) as the normal current, selectable through the fastCharge setting. Charging at 0.5C halves the current stress on the cell and, on a watch running the charge limiter, halves the overshoot past the limit, at the cost of a 20 point top-up taking about 22 minutes instead of 11. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Adrian Pascu <adrian@pascu.be>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
fastChargesetting so the charge current can be chosen between the board's fast and normal rates from the phone, instead of changing the default for everyone. Follows @gmarull's review on #1841, where lowering Pebble Time 2 to 0.5C outright was nacked in favour of a setting. Draft while I run it on my own Pebble Time 2. The companion control is coredevices/mobileapp#419.drivers/pmic/npm1300: switch the charge current at runtime
Npm1300Configgains an optionalchg_current_normal_manext to the existingchg_current_ma, andbattery_set_fast_charge(), which was an empty stub on this PMIC, now moves the charger between the two. The nPM1300 wants the charger disabled whileBCHGISETchanges, so the switch disables it around the write and only re-enables it if it was enabled before, which keeps a charge-limit pause in place across the switch. The charge-mode ADC full scale follows the live current rather than the board constant, otherwise current readings would be scaled wrongly after a switch. Boards that leave the new field at 0 keep their fixed current.fw/shell: add the fastCharge setting
A
fastChargeshell preference, on by default so shipped behaviour does not change, drivesbattery_set_fast_charge()when synced from the phone and once at boot after the prefs load. It is whitelisted for settings sync and gated onCONFIG_FAST_CHARGE_SETTING, which depends on the nPM1300 driver, so boards without a switchable charger never expose the key.fw/board/obelix: enable the fast charge setting
Pebble Time 2 keeps 190 mA (1C, the cell's rapid-charge maximum) as its fast rate and gets 96 mA (0.5C, the standard charge rate) as the normal rate. From a month of logged charging on my watch, 0.5C halves the charge current and, with the limiter from #1841, halves the overshoot past the limit, at the cost of a 20 point top-up taking about 22 minutes instead of 11.
Written with AI assistance (Claude).
Aside: I am currently available for firmware contracting or full-time work. Contact: adrian@pascu.be.