tanakamasayuki / ESP32LitePack

A lightweight compatibility library. You can use any combination of libraries.
Creative Commons Zero v1.0 Universal
30 stars 7 forks source link

RTC & GPIO0 mismatch #3

Open pguyot opened 3 years ago

pguyot commented 3 years ago

M5LiteAXP192::begin() and original AXP192::begin() currently do not have exactly the same signatures:

void M5LiteAXP192::begin(bool disableLDO2 = false, bool disableLDO3 = false, bool disableRTC = false, bool disableDCDC1 = false, bool disableDCDC3 = false)
void AXP192::begin(bool disableLDO2, bool disableLDO3, bool disableRTC, bool disableDCDC1, bool disableDCDC3, bool disableLDO0)

This is probaly because ESP32LitePack does not include this fix: https://github.com/m5stack/M5StickC/commit/fd10862adb15474d542d24a1b6ea703dec90490d

Indeed, in M5LiteAXP192::begin(), disableRTC parameter is used to drive GPIO0 (registers 0x90 & 0x91) https://github.com/tanakamasayuki/ESP32LitePack/blob/master/src/M5LiteAXP192.h#L26

In M5StickC original code, these Axp registers are now driven by parameter disableLDO0 and disableRTC parameter drives AXP register 35H (for (RTC) backup battery charging): https://github.com/m5stack/M5StickC/blob/master/src/AXP192.cpp#L36

tanakamasayuki commented 3 years ago

Thank you. I'll fix it next time. The official developer has created a library for multiple models. We recommend that you use it when it is completed.

https://twitter.com/lovyan03/status/1411832150962311171