PreviousNext
DpaApiSleep
Help > Custom DPA Handler > DPA API > DpaApiSleep

void DpaApiSleep ( uns8 wdtcon )

 

Available at [N] devices only. Executes a controlled sleep with the specified watch dog timer setting. Such repeated periods of sleep are typically used for low power offline activities, e.g. beaming, waiting for sensor measurement, etc. Before the 1st call, a variable FirstDpaApiSleep must be set. After the last call the function DpaApiAfterSleep must be called. Please note the interrupts, integrated temperatures sensor, and external EEPROM are disabled after the call.

 

The following example shows a typical use:

 

case DpaEvent_Idle:

  if ( StartSleepMode() )

  {

    FirstDpaApiSleep = TRUE;

    do {

      DpaApiSleep( WDTCON_1s );

    } while ( !WakeUp() );

    DpaApiAfterSleep();

  }

  break;