Fix X1 charge status LED always showing charged - #3125
Conversation
|
I tried this out and can confirm that the LED breathes amber when charging now but it never seems to complete charge? Voltage is showing 4.41v when plugged in and ~4.3v when unplugged but the device still hasn't changed to dim green LED. I'll leave it on charge overnight, maybe it'll be green in the morning? edit: No luck, unless I'm missing something this just seems to swap one behaviour (always green when plugged in) for another (always breathing orange when plugged in). |
|
It turns out that the BQ24045 only signals charge complete on the first charge cycle, which explains the behaviour I was seeing.
Thanks for your work on this @Hacuchino-hash 👍 |
|
Happy to help! Sorry for the late reply! |
Summary
Follow up to #3122, correcting the charge complete handling on the MeshTracker X1.
The charge status logic gives priority to the charger's second status line (P1.4) as a "done" signal, but on this board that pin reads low regardless of charge state, so the complete branch always wins and the LED sits on the charged colour from the moment it is plugged in.
Charge state now comes from P1.3 alone, which behaves correctly. P1.4 is left unused with a comment explaining why, the same choice Meshtastic makes in their X1 variant where the equivalent define is commented out.
Testing
Verified on hardware across a full charge cycle: with this change the LED shows the charging animation while charging and switches to the charged colour when the charger terminates. Pin readings taken during charging confirm the cause, P1.3 reads low as expected while charging and P1.4 also reads low, which is what sends the merged code down the wrong branch. All four X1 environments build clean.