I have a 3 channel setup on my SAADC module, which I sample according to a LFCLK timer. I notice after the first called to nrf_drv_saadc_sample() and receipt of the ADC results, it seems the HFCLK is not shutting off. The idle current is approximately 400uA.
My SAADC configuration is:
- Two buffer setup
- Low Power Mode = True
- 12bit
- No Oversampling
- Buffer Size = 3
The configuration for each channel uses the NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE macro.
Just as a not I do have some floating point math in my code so the FPU is technically used. I've added the following to address this:
void SETUP_FPU_HANDLER()
{
NVIC_SetPriority(FPU_IRQn, APP_IRQ_PRIORITY_LOW);
NVIC_EnableIRQ(FPU_IRQn);
}
void FPU_IRQHandler(void)
{
uint32_t *fpscr = (uint32_t *)(FPU->FPCAR+0x40);
(void)__get_FPSCR();
*fpscr = *fpscr & ~(FPU_EXCEPTION_MASK);
interrupt_calls_counter++;
}
How can I get the HFCLK to shutoff properly?