PreviousNext
sleepWOC
Help > Macros > Control > sleepWOC

Macro

 

TR Sleep with wake-up on change at dedicated TR pin enabled

Purpose

 

Put TR into power saving mode and enable wake-up on external event

Syntax

 

void sleepWOC()

Parameters

 

 –

Return value

 

 –

Output values

 

TR sleeping and waiting for pin change

Preconditions

 

The same as for iqrfSleep

Remarks

 

     Wake-up can be caused on C5 (for TR modules for SIM mounting, e.g. TR-72G) or Q12 (for SMT mounting, e.g.TR-76G) pin change.

     Both rising and falling edge on the pin is active. The macro can easily be modified in the source code for only one of these edges.

Side effects

 

     MCU watchdog is disabled and not reenabled after wake-up.

     MCU global interrupt is enabled after wake-up.

See also

 

iqrfSleep, iqrfDeepSleep, buttonPressed

Example

 

stopLEDR();        // Disable all power consuming HW resources under user’s control

sleepWOC();        // Sleep with wake-up on pin change

if (buttonPressed) // If button is pressed

{

   pulseLEDR();    //   Indicate wake-up by red LED

      ...          //   and continue

}