- Replace delay() with light_sleep_chunked_ms() in sender idle path (100ms chunks preserve UART FIFO safety at 9600 baud) - Add ENABLE_LIGHT_SLEEP_IDLE build flag (default: on, fallback: =0) - Meter reader task: exponential backoff on consecutive poll failures (METER_FAIL_BACKOFF_BASE_MS..MAX_MS) to reduce idle Core-0 wakeups - Configurable SENDER_DIAG_LOG_INTERVAL_MS (5s debug / 30s prod) - Configurable METER_FRAME_TIMEOUT_CFG_MS, SENDER_CPU_MHZ - New PlatformIO envs: lowpower, 868-lowpower, lowpower-debug - Add docs/POWER_OPTIMIZATION.md with measurement plan and Go/No-Go
14 lines
390 B
C
14 lines
390 B
C
#pragma once
|
|
|
|
#include <Arduino.h>
|
|
#include "data_model.h"
|
|
|
|
void power_sender_init();
|
|
void power_receiver_init();
|
|
void power_configure_unused_pins_sender();
|
|
void read_battery(MeterData &data);
|
|
uint8_t battery_percent_from_voltage(float voltage_v);
|
|
void light_sleep_ms(uint32_t ms);
|
|
void light_sleep_chunked_ms(uint32_t total_ms, uint32_t chunk_ms);
|
|
void go_to_deep_sleep(uint32_t seconds);
|