mirror of
				https://github.com/espressif/esp-idf.git
				synced 2025-11-04 06:11:06 +00:00 
			
		
		
		
	deep sleep: power down wifi and bt during deep sleep
This commit is contained in:
		@@ -622,8 +622,18 @@ void IRAM_ATTR esp_deep_sleep_start(void)
 | 
				
			|||||||
    // Correct the sleep time
 | 
					    // Correct the sleep time
 | 
				
			||||||
    s_config.sleep_time_adjustment = DEEP_SLEEP_TIME_OVERHEAD_US;
 | 
					    s_config.sleep_time_adjustment = DEEP_SLEEP_TIME_OVERHEAD_US;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    uint32_t force_pd_flags = RTC_SLEEP_PD_DIG | RTC_SLEEP_PD_VDDSDIO;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if SOC_PM_SUPPORT_WIFI_PD
 | 
				
			||||||
 | 
					    force_pd_flags |= RTC_SLEEP_PD_WIFI;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if SOC_PM_SUPPORT_BT_PD
 | 
				
			||||||
 | 
					    force_pd_flags |= RTC_SLEEP_PD_BT;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Enter sleep
 | 
					    // Enter sleep
 | 
				
			||||||
    esp_sleep_start(RTC_SLEEP_PD_DIG | RTC_SLEEP_PD_VDDSDIO | pd_flags);
 | 
					    esp_sleep_start(force_pd_flags | pd_flags);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Because RTC is in a slower clock domain than the CPU, it
 | 
					    // Because RTC is in a slower clock domain than the CPU, it
 | 
				
			||||||
    // can take several CPU cycles for the sleep mode to start.
 | 
					    // can take several CPU cycles for the sleep mode to start.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -135,3 +135,7 @@
 | 
				
			|||||||
#define SOC_PM_SUPPORT_BT_WAKEUP        (1)
 | 
					#define SOC_PM_SUPPORT_BT_WAKEUP        (1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SOC_PM_SUPPORT_CPU_PD           (1)
 | 
					#define SOC_PM_SUPPORT_CPU_PD           (1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define SOC_PM_SUPPORT_WIFI_PD          (1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define SOC_PM_SUPPORT_BT_PD            (1)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -314,5 +314,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#define SOC_PM_SUPPORT_WIFI_WAKEUP      (1)
 | 
					#define SOC_PM_SUPPORT_WIFI_WAKEUP      (1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define SOC_PM_SUPPORT_WIFI_PD          (1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* ---------------------------- Compatibility ------------------------------- */
 | 
					/* ---------------------------- Compatibility ------------------------------- */
 | 
				
			||||||
// No contents
 | 
					// No contents
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user