Rename -> Inst. Cluster (user); power manager: deep sleep on link silence, wake on IO1 or 60 s probe boot; Ota::isBusy; sleep bit in shared header
Firmware / build (push) Successful in 2m59s
Firmware / build (push) Successful in 2m59s
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Serial console (Controller B) - line reader + command chain.
|
||||
* Serial console (Inst. Cluster) - line reader + command chain.
|
||||
*
|
||||
* Commands live in their modules (LinkPeer, Ota); this only splits lines and
|
||||
* asks each handler in turn. `help` lists them.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Debug Monitor Module for ESP32-S3-LCD-1.3 (Controller B)
|
||||
* Debug Monitor Module for ESP32-S3-LCD-1.3 (Inst. Cluster)
|
||||
*
|
||||
* Synchronizes LVGL performance and memory monitor visibility with Controller A.
|
||||
* Synchronizes LVGL performance and memory monitor visibility with Main CTRL.
|
||||
* Monitors are shown/hidden based on the debug_enabled flag received via UART.
|
||||
*/
|
||||
|
||||
@@ -23,7 +23,7 @@ void init();
|
||||
* @brief Set debug monitor visibility
|
||||
*
|
||||
* Controls the visibility of LVGL's built-in performance and memory monitors.
|
||||
* This should be called when receiving packets from Controller A to sync
|
||||
* This should be called when receiving packets from Main CTRL to sync
|
||||
* with the debug_enabled flag.
|
||||
*
|
||||
* @param enabled True to show monitors, false to hide them
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* ESP-NOW Receiver Module (Controller B)
|
||||
* ESP-NOW Receiver Module (Inst. Cluster)
|
||||
*
|
||||
* Wireless leg of the A -> B link. Frames are byte-identical to the UART ones
|
||||
* and are handed to UARTReceiver::processFrame(), which dedupes on packet_id.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Gauge Outputs Module (Controller B)
|
||||
* Gauge Outputs Module (Inst. Cluster)
|
||||
*
|
||||
* Drives the Nissan Patrol cluster from the data Controller A sends:
|
||||
* Drives the Nissan Patrol cluster from the data Main CTRL sends:
|
||||
* - tachometer: variable-frequency square wave on IO7 (LEDC timer 1)
|
||||
* - coolant gauge: fixed-frequency PWM with variable duty on IO8 (LEDC timer 2)
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Link Peer Module (Controller B) - the maintenance side of the link to A.
|
||||
* Link Peer Module (Inst. Cluster) - the maintenance side of the link to A.
|
||||
*
|
||||
* The data path (DATA/CONFIG frames) is UARTReceiver's. This module owns
|
||||
* everything else on the link, see wiki/pages/controller-b-ota.md:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* ota_update.h - Controller B pulls its own firmware from this repo's Gitea
|
||||
* releases. Port of Controller A's module (ESP32-S3-Touch-LCD-5B/src/modules/
|
||||
* ota_update.h - Inst. Cluster pulls its own firmware from this repo's Gitea
|
||||
* releases. Port of Main CTRL's module (ESP32-S3-Touch-LCD-5B/src/modules/
|
||||
* ota_update.cpp), see wiki/pages/controller-b-ota.md.
|
||||
*
|
||||
* Triggered by A (OTA_CMD inside a SECURE frame, behind A's parking gate and
|
||||
@@ -45,6 +45,9 @@ bool handleCommand(const char* line);
|
||||
|
||||
const char* version();
|
||||
|
||||
/** A check or install is queued or running (the power manager must not sleep). */
|
||||
bool isBusy();
|
||||
|
||||
} // namespace Ota
|
||||
|
||||
#endif // OTA_UPDATE_H
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Power Manager (Inst. Cluster) - deep sleep when the Main CTRL goes quiet.
|
||||
*
|
||||
* Controlled from the Main CTRL's Settings switch "Sleep when the car is off":
|
||||
* it arrives as the CFG_SLEEP_WHEN_SILENT bit of the CONFIG frame and is
|
||||
* cached in NVS with the rest of the gauge config, so it is known even while
|
||||
* the Main CTRL is already asleep.
|
||||
*
|
||||
* Sleep when: the bit is set, no DATA frame on any transport for
|
||||
* SLEEP_AFTER_MS, no update job running, up for at least SLEEP_AFTER_MS.
|
||||
* Gauges are driven low and the backlight off first.
|
||||
*
|
||||
* Wake:
|
||||
* - UART RX (IO1, RTC IO) goes low: the Main CTRL's first frame on the wire
|
||||
* - a timer every PROBE_PERIOD_S: a short "probe boot" with the backlight
|
||||
* off that listens for ESP-NOW frames for a few seconds and goes straight
|
||||
* back to sleep if nothing arrives. This is what wakes the board when the
|
||||
* link is radio-only (no wire in the car).
|
||||
*
|
||||
* Console: sleep status | now
|
||||
*/
|
||||
|
||||
#ifndef POWER_MANAGER_H
|
||||
#define POWER_MANAGER_H
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
namespace PowerManager {
|
||||
|
||||
/** Right after DisplayInit::init(): detects a probe boot and keeps the panel dark. */
|
||||
void init();
|
||||
|
||||
/** True during a timer-wake probe boot (setup() skips its waits). */
|
||||
bool isProbeBoot();
|
||||
|
||||
void tick();
|
||||
bool handleCommand(const char* line);
|
||||
|
||||
} // namespace PowerManager
|
||||
|
||||
#endif // POWER_MANAGER_H
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Link Receiver Module (Controller B)
|
||||
* Link Receiver Module (Inst. Cluster)
|
||||
*
|
||||
* Receives v2 frames from Controller A on two transports:
|
||||
* Receives v2 frames from Main CTRL on two transports:
|
||||
* - UART1 (byte stream, framed here with a state machine)
|
||||
* - ESP-NOW (whole frames, delivered by EspNowReceiver)
|
||||
* Both feed processFrame(). DATA frames are deduplicated on packet_id so a frame
|
||||
|
||||
Reference in New Issue
Block a user