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

Problem with __WFI ( )

Hi,

i have some trouble with the method __WFI (); I have the following code: while(device_status == false) // Gerät ist im Schlafmodus { checkPowerConnector ( ); __WFI ( ); }

this is the code of my sleepmode. The Application sleeps as long as device_status = false and if it is true it exit the loop and wakes up. this does work fine. the Method checkPowerConnector checks if the Device will be charged, and if i comment __WFI out, thes method works well. But if i run this Code it seams that WFI hang the process. Do i have to configure the RAM for Sleepmode ?

best regards Nils

Parents
  • Hi Nils,

    WFI means "wait for interrupt". The role of this function is wait that an interrupt has been processed to continue the code execution. It is a blocked function, but it is important to understand that the CPU is off during the waiting : in other words it is the "Sleep Mode".

    You didn't notice that you are using the softdevice, but FYI there is a specific method to do that if it is the case.

Reply
  • Hi Nils,

    WFI means "wait for interrupt". The role of this function is wait that an interrupt has been processed to continue the code execution. It is a blocked function, but it is important to understand that the CPU is off during the waiting : in other words it is the "Sleep Mode".

    You didn't notice that you are using the softdevice, but FYI there is a specific method to do that if it is the case.

Children
No Data
Related