Scope charger controls to T-Beam and Mesh Solar flash budgets
This commit is contained in:
1 parent
79167af8e6
commit
1adf0c6d01
8 files changed
+56
-2
No files matched your search
@@ -4,6 +4,7 @@
|
||||
#include <stddef.h>
|
||||
#include <math.h>
|
||||
#include "helpers/UsbLogging.h"
|
||||
#include "helpers/BatteryChargeSupport.h"
|
||||
|
||||
#define MAX_HASH_SIZE 8
|
||||
#define PUB_KEY_SIZE 32
|
||||
@@ -239,6 +240,7 @@ public:
|
||||
// True while a board can identify an active battery-charging source.
|
||||
virtual bool isChargerActive() { return false; }
|
||||
|
||||
#if MESH_BATTERY_CHARGE_CONTROL
|
||||
// Actual charger voltage, in millivolts. Battery reporting and protection
|
||||
// thresholds are separate capabilities. A successful setter must verify
|
||||
// hardware readback and persist the setting for the next boot.
|
||||
@@ -250,6 +252,7 @@ public:
|
||||
virtual const char* getBatteryChargeTargetUnsupportedReason() const {
|
||||
return "charge.voltage is not supported on this board";
|
||||
}
|
||||
#endif
|
||||
|
||||
// Optional, source-specific power detection. Boards that can distinguish a USB
|
||||
// supply from a solar charger override these; defaults keep every other board
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "BatteryChargeSupport.h"
|
||||
|
||||
namespace mesh {
|
||||
namespace power {
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
// Keep charger commands and virtual hooks off boards which cannot implement
|
||||
// them. Small STM32 images have no flash budget for unused charger controls.
|
||||
#if defined(TBEAM_SUPREME_SX1262) || defined(TBEAM_SX1262) || \
|
||||
defined(TBEAM_SX1276) || defined(HELTEC_MESH_SOLAR)
|
||||
#define MESH_BATTERY_CHARGE_CONTROL 1
|
||||
#else
|
||||
#define MESH_BATTERY_CHARGE_CONTROL 0
|
||||
#endif
|
||||
@@ -2841,7 +2841,9 @@ uint8_t CommonCLI::buildAdvertData(uint8_t node_type, uint8_t* app_data) {
|
||||
void CommonCLI::handleCommand(uint32_t sender_timestamp, char* command, char* reply) {
|
||||
PrefsSaveReplyGuard save_reply(_prefs_save_failures, reply);
|
||||
mesh::cli::normalizeCommandVerb(command);
|
||||
#if MESH_BATTERY_CHARGE_CONTROL
|
||||
if (mesh::power::handleBatteryChargeCommand(*_board, command, reply, 160)) return;
|
||||
#endif
|
||||
if (mesh::handleUsbLoggingWatchdogCommand(command, reply, 160)) return;
|
||||
if (handleManagementCommand(command, reply)) return;
|
||||
if (mesh::wireless::control().handle(command, reply, 160, millis(),
|
||||
|
||||
Reference in new issue
Block a user