Add initial SPIFFS library (#627)

* Add initial SPIFFS library

* Fix Deep Sleep Examples

* Missed one example
This commit is contained in:
Me No Dev
2017-09-12 11:09:59 +03:00
committed by GitHub
parent 39fb8c3044
commit 29a253ac98
8 changed files with 324 additions and 11 deletions

View File

@ -30,9 +30,9 @@ Method to print the reason by which ESP32
has been awaken from sleep
*/
void print_wakeup_reason(){
esp_deep_sleep_wakeup_cause_t wakeup_reason;
esp_sleep_wakeup_cause_t wakeup_reason;
wakeup_reason = esp_deep_sleep_get_wakeup_cause();
wakeup_reason = esp_sleep_get_wakeup_cause();
switch(wakeup_reason)
{
@ -66,7 +66,7 @@ void setup(){
Note that using internal pullups/pulldowns also requires
RTC peripherals to be turned on.
*/
esp_deep_sleep_enable_ext0_wakeup(GPIO_NUM_33,1); //1 = High, 0 = Low
esp_sleep_enable_ext0_wakeup(GPIO_NUM_33,1); //1 = High, 0 = Low
//If you were to use ext1, you would use it like
//esp_deep_sleep_enable_ext1_wakeup(BUTTON_PIN_BITMASK,ESP_EXT1_WAKEUP_ANY_HIGH);

View File

@ -29,9 +29,9 @@ Method to print the reason by which ESP32
has been awaken from sleep
*/
void print_wakeup_reason(){
esp_deep_sleep_wakeup_cause_t wakeup_reason;
esp_sleep_wakeup_cause_t wakeup_reason;
wakeup_reason = esp_deep_sleep_get_wakeup_cause();
wakeup_reason = esp_sleep_get_wakeup_cause();
switch(wakeup_reason)
{
@ -59,7 +59,7 @@ void setup(){
First we configure the wake up source
We set our ESP32 to wake up every 5 seconds
*/
esp_deep_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
Serial.println("Setup ESP32 to sleep for every " + String(TIME_TO_SLEEP) +
" Seconds");

View File

@ -20,9 +20,9 @@ Method to print the reason by which ESP32
has been awaken from sleep
*/
void print_wakeup_reason(){
esp_deep_sleep_wakeup_cause_t wakeup_reason;
esp_sleep_wakeup_cause_t wakeup_reason;
wakeup_reason = esp_deep_sleep_get_wakeup_cause();
wakeup_reason = esp_sleep_get_wakeup_cause();
switch(wakeup_reason)
{
@ -42,7 +42,7 @@ has been awaken from sleep
void print_wakeup_touchpad(){
touch_pad_t pin;
touchPin = esp_deep_sleep_get_touchpad_wakeup_status();
touchPin = esp_sleep_get_touchpad_wakeup_status();
switch(touchPin)
{
@ -80,7 +80,7 @@ void setup(){
touchAttachInterrupt(T3, callback, Threshold);
//Configure Touchpad as wakeup source
esp_deep_sleep_enable_touchpad_wakeup();
esp_sleep_enable_touchpad_wakeup();
//Go to sleep now
Serial.println("Going to sleep now");

View File

@ -77,7 +77,7 @@ void setup() {
// Set ESP32 to go to deep sleep to see a variation
// in the reset reason. Device will sleep for 5 seconds.
esp_deep_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_OFF);
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_OFF);
Serial.println("Going to sleep");
esp_deep_sleep(5 * uS_TO_S_FACTOR);
}