Question
Couple of days ago, I configured the mcu (stm8l-discovery) in low power mode to see the current consumption. But if i run the same code again, I was not able to see the same results. The mcu is not entering the low power mode
#include "iostm8l.h"
#include <stdint.h>
#include <stdio.h>
#include "defs.h"
main()
{
CLK_DIVR = 0x00; // Set the frequency to 16 MHz
while(1)
{
if (PWR_CSR2 & 0x01 == 0x01)
{
break;
}
}
PWR_CSR2 |= (1<<1);
while (1)
{
halt();
}
}
