cancel
Showing results for 
Search instead for 
Did you mean: 

Low power mode in STM32l031k6

ADSB
Associate III

Hello community,

I am trying to use the capture feature on the comparator. I want to use it in low power mode. Right now I have something similar to the logic below:

enable capture; //just to say that the capture interrupt is enabled here
 
while(!captureFlag);// stuck here until the capture occurs, and serve the interrupt
 
the rest of the code;
 
 
 
// the interrupt routine
void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim){
	if(!isItCaptured){
		isItCaptured = TRUE;
        }
      save capture value;// just to say we did something with the value
}

Is there a command to be used instead of (while(!captureFlag)) to enter low power mode until the capture interrupt is served. Once it is served, it wakes up from low power mode and continues with the rest of the code.

In basic words, I order the MCU to enter LPM on the main body of the code until a specific interrupt is served then it continue with the code of the main body .

I really hope that you can help with this.

Thank you very much

0 REPLIES 0