lewisxhe / AXP202X_Library

Arduino & ESP-IDF libraries written for AXP19x, 20x
MIT License
91 stars 40 forks source link

AXP20X_Class::isVbusRemoveIRQ() triggers only when PWRON pressed #35

Closed Cheddaru closed 3 years ago

Cheddaru commented 3 years ago

AXP20X_Class::isVbusRemoveIRQ() and AXP20X_Class::isAcinPlugInIRQ() don't trigger when USB is unplugged. They trigger only when USB is unplugged and PWRON is pressed. Is this a bug or a hardware limitation?

I'm using SIM800C_AXP192_VERSION_20200609

lewisxhe commented 3 years ago

For ACIN, you don’t need to turn on interrupt, because ACIN is not connected on the board, VBUS Remove you must turn on AXP VBUS remove enable

axp.enableIRQ(AXP202_VBUS_REMOVED_IRQ|AXP202_VBUS_CONNECT_IRQ, true);

I have tested the code before.

Cheddaru commented 3 years ago

I had enabled IRQs, but apparently had some buggy code. Rewrote it and now it's working.