This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SoftDevice interrupts and __WFI();

Hello! Is it possible to select to which interrupt types WFI (wake up from sleep mode) reacts?

I have a system with nRF51 where RTC clock initiates temperature measurements and I send them later over Bluetooth serial. My goal is to turn Bluetooth ON and put MCU to sleep. When temp gets measured, rtc interrupt will wake up the processor and data will be sent. Unfortunately the processor is being constantly woken up by SoftDevice interrupts, which generates more power usage. I know that I can't disable Softdevice and its interrupts, but is there a way to make WFI ignore them instead of doing unnecessary querries?

My pseudo code:

void RTC1_IRQHandler() {
	measure_temperature();
}

BLE_setup();
RTC1_setup();

void loop() {
  
  __WFI();    
  __SEV();    
  __WFI();    

  if(measurement_ready)
	send_over_ble();
}

Parents Reply Children
Related