Example use of the sleep manager API.

Fork of SleepManager_Example_1 by Russ Butler

main.cpp

Committer:
c1728p9
Date:
20 months ago
Revision:
0:e85412b4147e

File content as of revision 0:e85412b4147e:

#include "mbed.h"

int main()
{
    // Deep sleep for 1 second
    printf("Deep sleep allowed: %i\r\n", sleep_manager_can_deep_sleep());
    wait(1.0);
    
    // Lock deep sleep
    printf("Locking deep sleep\r\n");
    sleep_manager_lock_deep_sleep();
    
    // Sleep for 1 second
    printf("Deep sleep allowed: %i\r\n", sleep_manager_can_deep_sleep());
    wait(1.0);
}