Add ESP::deepSleep(us)

fixes: https://github.com/espressif/arduino-esp32/issues/51
This commit is contained in:
me-no-dev 2017-02-08 20:32:49 +02:00
parent fdc4f53eb6
commit 7a7b697ff9
2 changed files with 7 additions and 0 deletions

View File

@ -20,6 +20,7 @@
#include "Arduino.h" #include "Arduino.h"
#include "Esp.h" #include "Esp.h"
#include "rom/spi_flash.h" #include "rom/spi_flash.h"
#include "esp_deep_sleep.h"
#include <memory> #include <memory>
//#define DEBUG_SERIAL Serial //#define DEBUG_SERIAL Serial
@ -80,6 +81,11 @@ unsigned long long operator"" _GB(unsigned long long x)
EspClass ESP; EspClass ESP;
void EspClass::deepSleep(uint32_t time_us)
{
esp_deep_sleep(time_us);
}
uint32_t EspClass::getCycleCount() uint32_t EspClass::getCycleCount()
{ {
uint32_t ccount; uint32_t ccount;

View File

@ -60,6 +60,7 @@ public:
const char * getSdkVersion(); const char * getSdkVersion();
void deepSleep(uint32_t time_us);
uint8_t getCpuFreqMHz(); uint8_t getCpuFreqMHz();