This method installs an interrupt handler that ends up firing 30x per second, I’m not sure that’s so cool…
Update: I tried it out and it’s not working. My Boron does not rapidly switch between fast charge and charge done when there is no battery (the charge LED also does not flicker). My code properly shows whether there is a battery while the PowerCheck class claims that there is a battery when in fact there is none.
Update 2: weird, a few minutes after posting the above the (untouched) Boron started to flicker the charging LED, i.e. rapidly switching between charging and charge-done.
Update 3: there seems to be some timer in that charging stuff (surprise, surprise). When I apply power to the Boron the charging circuit does not oscillate. At some point it flips to oscillating. The output I see on my sketch (loops every 2 seconds) changes in that the fuel gauge sees a battery voltage jump:
PMIC: 0x45 on power, not charging
Battery: 0.07V 72.2%
PowerCheck starting
hasPower=1
hasBattery=1
getIsCharging=0
**********
PMIC: 0x45 on power, not charging
Battery: 0.07V 71.6%
PowerCheck starting
hasPower=1
hasBattery=1
getIsCharging=0
**********
PMIC: 0x64 on power, charging
Battery: 4.08V 71.3%
PowerCheck starting
hasPower=1
hasBattery=0
getIsCharging=0
**********
PMIC: 0x74 on power, full
Battery: 4.09V 71.3%
PowerCheck starting
hasPower=1
hasBattery=0
getIsCharging=0