testing versxion (bat)
This commit is contained in:
@@ -44,17 +44,17 @@ menu "PrincessPiTracker Config"
|
||||
help
|
||||
Enable this option to use a random MAC address for BLE advertising instead of the public MAC address.
|
||||
|
||||
config DEEP_SLEEP_BURST_MODE
|
||||
configT_MODE
|
||||
bool "Enable Deep Sleep Burst Mode"
|
||||
default y
|
||||
help
|
||||
Enable this option to wake up, send multiple advertisements in a burst, then go back to deep sleep.
|
||||
|
||||
config DEEP_SLEEP_BURST_COUNT
|
||||
configT_COUNT
|
||||
int "Number of Advertisements per Burst"
|
||||
default 4
|
||||
range 1 100
|
||||
depends on DEEP_SLEEP_BURST_MODE
|
||||
depends onT_MODE
|
||||
help
|
||||
Int number of advertisements to send per burst min 1 max 100
|
||||
|
||||
@@ -62,7 +62,7 @@ menu "PrincessPiTracker Config"
|
||||
int "Deep Sleep Duration in seconds"
|
||||
default 120
|
||||
range 0 86400
|
||||
depends on DEEP_SLEEP_BURST_MODE
|
||||
depends onT_MODE
|
||||
help
|
||||
Int number of seconds (s) to deep sleep between advertisement cycles min 0 max 86400 (24 hours)
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
#include "freertos/FreeRTOS.h" // freertosbullshit
|
||||
#include "freertos/task.h"
|
||||
|
||||
// calculate da burst delay and burst delay microseconds
|
||||
#define DEEP_SLEEP_BURST_DELAY ((CONFIG_DEEP_SLEEP_BURST_COUNT * CONFIG_ADVERTISEMENT_INTERVAL) + CONFIG_ADVERTISEMENT_INTERVAL) // +CONFIG_ADVERTISEMENT_INTERVAL so the silly thing will be sure to boadcast dem all and not die before, using CONFIG_ADVERTISEMENT_INTERVAL because presumably it'll keep the extra time in rough check with the interval ig
|
||||
// calculate da burst delay live and burst delay microseconds
|
||||
#define DEEP_SLEEP_BURST_DELAY_LIVE_MS ((CONFIG_DEEP_SLEEP_BURST_COUNT * CONFIG_ADVERTISEMENT_INTERVAL) + ((CONFIG_DEEP_SLEEP_BURST_COUNT + 1) * CONFIG_ADVERTISEMENT_INTERVAL_JITTER_MS)) // +CONFIG_ADVERTISEMENT_INTERVAL so the silly thing will be sure to boadcast dem all and not die before, using CONFIG_ADVERTISEMENT_INTERVAL because presumably it'll keep the extra time in rough check with the interval ig
|
||||
#define DEEP_SLEEP_BURST_DELAY_MICROS (CONFIG_DEEP_SLEEP_DURATION_S * 1000000)
|
||||
#endif
|
||||
|
||||
@@ -208,7 +208,7 @@ static void deep_sleep_register_rtc_timer_wakeup(void) {
|
||||
|
||||
static void deep_sleep_wait_to_sleep() {
|
||||
vTaskDelay(pdMS_TO_TICKS(DEEP_SLEEP_BURST_DELAY));
|
||||
ESP_LOGI(TAG, "Waited %d ms, preparing to enter deep sleep\n", DEEP_SLEEP_BURST_DELAY);
|
||||
ESP_LOGI(TAG, "Waited %d ms, preparing to enter deep sleep\n", DEEP_SLEEP_BURST_DELAY_LIVE_MS);
|
||||
|
||||
ESP_LOGI(TAG, "Deiniting BTLE before deep sleep");
|
||||
ble_deinit();
|
||||
|
||||
Reference in New Issue
Block a user