Commit 3836be1c authored by aohui.li's avatar aohui.li

增加深度睡眠

parent 0099c5eb
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "led_strip.h" #include "led_strip.h"
#include "sdkconfig.h" #include "sdkconfig.h"
#include "lis2dw12.h" #include "lis2dw12.h"
#include "esp_sleep.h"
static const char *TAG = "example"; static const char *TAG = "example";
...@@ -101,11 +102,17 @@ static void configure_led(void) ...@@ -101,11 +102,17 @@ static void configure_led(void)
void app_main(void) void app_main(void)
{ {
ESP_LOGI(TAG, "Wake Up");
/* Configure the peripheral according to the LED type */ /* Configure the peripheral according to the LED type */
configure_led(); configure_led();
lis2dw12_init(); lis2dw12_init();
ESP_LOGI(TAG, "Start Sleep");
vTaskDelay(1000 / portTICK_PERIOD_MS);
esp_deep_sleep_start();
while(1);
while (1) { while (1) {
ESP_LOGI(TAG, "Turning the LED %s!", s_led_state == true ? "ON" : "OFF"); ESP_LOGI(TAG, "Turning the LED %s!", s_led_state == true ? "ON" : "OFF");
blink_led(); blink_led();
......
...@@ -144,7 +144,7 @@ void lis2dw12_init() ...@@ -144,7 +144,7 @@ void lis2dw12_init()
ESP_LOGI(TAG, "LIS2DW12 reset done"); ESP_LOGI(TAG, "LIS2DW12 reset done");
ESP_LOGI(TAG, "LIS2DW12 Start Config Regiseter"); ESP_LOGI(TAG, "LIS2DW12 Start Config Regiseter");
// WakeupEnable(); WakeupEnable();
lis2dw12_wake_config(); lis2dw12_wake_config();
ESP_LOGI(TAG, "LIS2DW12 Start Config Done"); ESP_LOGI(TAG, "LIS2DW12 Start Config Done");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment