mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-17 00:51:30 +10:00
nimble WIP - writes kinda work now
This commit is contained in:
+9
-9
@@ -5,9 +5,9 @@
|
||||
#include "NodeDB.h"
|
||||
#include "configuration.h"
|
||||
#include "error.h"
|
||||
#include "timing.h"
|
||||
#include "main.h"
|
||||
#include "target_specific.h"
|
||||
#include "timing.h"
|
||||
|
||||
#ifndef NO_ESP32
|
||||
#include "esp32/pm.h"
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <driver/rtc_io.h>
|
||||
#include <driver/uart.h>
|
||||
|
||||
#include "BluetoothUtil.h"
|
||||
#include "nimble/BluetoothUtil.h"
|
||||
|
||||
esp_sleep_source_t wakeCause; // the reason we booted this time
|
||||
#endif
|
||||
@@ -294,18 +294,18 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r
|
||||
|
||||
/**
|
||||
* enable modem sleep mode as needed and available. Should lower our CPU current draw to an average of about 20mA.
|
||||
*
|
||||
*
|
||||
* per https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/system/power_management.html
|
||||
*
|
||||
*
|
||||
* supposedly according to https://github.com/espressif/arduino-esp32/issues/475 this is already done in arduino
|
||||
*/
|
||||
void enableModemSleep()
|
||||
{
|
||||
static esp_pm_config_esp32_t config; // filled with zeros because bss
|
||||
static esp_pm_config_esp32_t config; // filled with zeros because bss
|
||||
|
||||
config.max_freq_mhz = CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ;
|
||||
config.min_freq_mhz = 20; // 10Mhz is minimum recommended
|
||||
config.light_sleep_enable = false;
|
||||
DEBUG_MSG("Sleep request result %x\n", esp_pm_configure(&config));
|
||||
config.max_freq_mhz = CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ;
|
||||
config.min_freq_mhz = 20; // 10Mhz is minimum recommended
|
||||
config.light_sleep_enable = false;
|
||||
DEBUG_MSG("Sleep request result %x\n", esp_pm_configure(&config));
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user