mristau / Arduino_nRF5x_lowPower

Arduino Power Management Library for nRF5x
43 stars 10 forks source link

Does this library support the nRF52840? #2

Closed dsteinman closed 5 years ago

dsteinman commented 5 years ago

I can put the Adafruit nRF52840 feather board into power off mode just fine, but I'm not able to wake from an interrupt. In my case it's a button pulled low, and I'm trying to detect a RISING interrupt to wake. This code worked just fine on the Adafruit nRF52832 but I think something has changed and I'm having trouble finding any other way to do this in Arduino IDE.

nRF5x_lowPower.enableWakeupByInterrupt(11, RISING);  // not working, doesn't wake
nRF5x_lowPower.powerMode(POWER_MODE_OFF);  // working

Any help or hints is appreciated.

dsteinman commented 5 years ago

I found the interrupt wakeup code to support nRF52840 in case you wanted to update your library:

uint32_t pin = A0; pin = g_ADigitalPinMap[pin]; nrf_gpio_cfg_sense_input(pin, NRF_GPIO_PIN_PULLDOWN, NRF_GPIO_PIN_SENSE_HIGH); sd_power_system_off();

diogo24m commented 2 years ago

@dsteinman Where did you put this code?