feat(wifi): refactor wifi power management

This commit is contained in:
Zhang Jun Hao
2019-11-04 15:53:43 +08:00
parent da3362ecab
commit 98df026b68
4 changed files with 54 additions and 10 deletions

View File

@ -15,6 +15,7 @@
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "esp_err.h"
#include "driver/gpio.h"
@ -261,6 +262,22 @@ esp_err_t esp_sleep_enable_gpio_wakeup(void);
*/
esp_err_t esp_sleep_disable_wakeup_source(esp_sleep_source_t source);
/**
* @brief Print power consumption information
*
* @note This function is used to print power consumption data. The current
* when the RF and CPU are both turned on is 70 mA. The current when
* only the CPU is turned on is 18 mA. 900uA when both CPU and RF are off.
* There may be some errors compared to the actual power consumption.
* The power consumption is based on the actual measurement, and the printing
* in the function is for reference only.
*
* @param clear_old_data - Recalculate power consumption info or not.
*
* @return null
*/
void esp_power_consumption_info(bool clear_old_data);
#ifdef __cplusplus
}
#endif