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

Current consumption of if condition in for(;;) loop

Hello,

as I couldn't manage to get my SPI Measurement working flawlessly when called from inside a timer handler I tried to work around it by just setting a flag inside the timer handler and then call the measurement from inside the main()-function in the for(;;)-loop after the power_manage();-function by putting the code inside if(flag) { SPI-Stuff; flag=false; }

int main(void)
{ 

    for (;;)
    {
      power_manage();	
				
			if(test_flag) {
lots of code
				test_flag=false;
			}

    }
}

What is the current consumption of this? In what state is the chip when constantly checking the if flag?

Parents Reply Children
No Data
Related