This commit is contained in:
2025-11-20 23:06:50 -07:00
parent cf30a62011
commit 0c92a36bf8

View File

@@ -21,9 +21,12 @@
bool pmu_flag = 0;
XPowersPMU PMU;
const uint8_t i2c_sda = CONFIG_PMU_SDA;
const uint8_t i2c_scl = CONFIG_PMU_SCL;
//const uint8_t i2c_sda = CONFIG_PMU_SDA;
//const uint8_t i2c_scl = CONFIG_PMU_SCL;
#ifdef USE_ARDUINO
// TODO: Use esphome APIs (to allow I/O expanders, etc)
const uint8_t pmu_irq_pin = CONFIG_PMU_IRQ;
#endif
void setFlag(void)
{
@@ -249,8 +252,12 @@ void AXP2101Component::setup()
// Force add pull-up
#ifdef USE_ARDUINO
pinMode(pmu_irq_pin, INPUT_PULLUP);
attachInterrupt(pmu_irq_pin, setFlag, FALLING);
#else
#warning "IRQ support not ready in ESP-IDF" // TODO
#endif
// Disable all interrupts