mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-10-25 01:32:36 +00:00
Update preference test fixtures for ESP32 clock settings
This commit is contained in:
1 parent
6e599d1709
commit
06b58d00f8
5 files changed
+32
-6
No files matched your search
@@ -110,11 +110,11 @@ radio2 experiments. They are held in RAM and reset at reboot:
|
||||
| Command | Values | Default |
|
||||
| --- | --- | --- |
|
||||
| `set powersaving.test sleep VALUE` | `on`, `off` | `on` |
|
||||
| `set powersaving.test slice_ms VALUE` | 2–20 ms | 10 ms |
|
||||
| `set powersaving.test guard_ms VALUE` | 0–20 ms | 4 ms |
|
||||
| `set powersaving.test min_ms VALUE` | 1–10 ms | 2 ms |
|
||||
| `set powersaving.test settle_ms VALUE` | `auto`, 1–50 ms | `auto` |
|
||||
| `set powersaving.test uart_quiet VALUE` | 5–300 seconds, `off` | inactive |
|
||||
| `set powersaving.test slice_ms VALUE` | 2-20 ms | 10 ms |
|
||||
| `set powersaving.test guard_ms VALUE` | 0-20 ms | 4 ms |
|
||||
| `set powersaving.test min_ms VALUE` | 1-10 ms | 2 ms |
|
||||
| `set powersaving.test settle_ms VALUE` | `auto`, 1-50 ms | `auto` |
|
||||
| `set powersaving.test uart_quiet VALUE` | 5-300 seconds, `off` | inactive |
|
||||
|
||||
`get powersaving.test` shows the current controls; `set powersaving.test reset`
|
||||
restores their defaults. Sleep on permits existing power-saving decisions; the
|
||||
|
||||
@@ -18,6 +18,11 @@ class File {
|
||||
bool open(const char* path, uint8_t mode);
|
||||
operator bool() const { return fs_ != nullptr; }
|
||||
size_t size() const;
|
||||
bool seek(size_t position) {
|
||||
if (!fs_ || position > size()) return false;
|
||||
cursor_ = position;
|
||||
return true;
|
||||
}
|
||||
size_t available() const { return size() - cursor_; }
|
||||
bool isDirectory() const { return false; }
|
||||
int read(uint8_t* data, size_t size);
|
||||
|
||||
@@ -20,6 +20,9 @@ HARNESS = r'''
|
||||
#include <helpers/AtomicFileWriter.h>
|
||||
#include <helpers/PrefsSaveRouting.h>
|
||||
#include <helpers/GpsPowerPolicy.h>
|
||||
#if defined(ESP32_PLATFORM)
|
||||
#include <helpers/esp32/CpuClockPolicy.h>
|
||||
#endif
|
||||
#define MESH_DEBUG_PRINTLN(...) ((void)0)
|
||||
#define MIN_LORA_TX_POWER -9
|
||||
#define MAX_LORA_TX_POWER 22
|
||||
@@ -44,6 +47,14 @@ struct Callbacks {
|
||||
void savePrefs(PrefsSaveRouting::Scope scope);
|
||||
};
|
||||
struct CommonCLI {
|
||||
#if defined(ESP32_PLATFORM)
|
||||
struct CpuBoard {
|
||||
bool supportsCpuFrequencyMHz(uint16_t mhz) const {
|
||||
return mhz == 80 || mhz == 160 || mhz == 240;
|
||||
}
|
||||
} cpu_board;
|
||||
CpuBoard* _board = &cpu_board;
|
||||
#endif
|
||||
MemoryFS fs;
|
||||
NodePrefs prefs{};
|
||||
NodePrefs* _prefs=&prefs;
|
||||
|
||||
@@ -37,6 +37,9 @@ class TestFS : public MemoryFS {
|
||||
#include <helpers/CLICommandUtils.h>
|
||||
#include <helpers/RepeaterRadioTiming.h>
|
||||
#include <helpers/GpsPowerPolicy.h>
|
||||
#if defined(ESP32_PLATFORM)
|
||||
#include <helpers/esp32/CpuClockPolicy.h>
|
||||
#endif
|
||||
#include <helpers/bridges/ESPNowBridgeFormat.h>
|
||||
#include <helpers/radiolib/LR2021SideDetectorConfig.h>
|
||||
#define MIN_LORA_TX_POWER -9
|
||||
@@ -87,6 +90,14 @@ struct Callbacks {
|
||||
void updateAdvertTimer() {}
|
||||
};
|
||||
struct CommonCLI {
|
||||
#if defined(ESP32_PLATFORM)
|
||||
struct CpuBoard {
|
||||
bool supportsCpuFrequencyMHz(uint16_t mhz) const {
|
||||
return mhz == 80 || mhz == 160 || mhz == 240;
|
||||
}
|
||||
} cpu_board;
|
||||
CpuBoard* _board = &cpu_board;
|
||||
#endif
|
||||
FILESYSTEM fs;
|
||||
NodePrefs prefs;
|
||||
NodePrefs* _prefs = &prefs;
|
||||
|
||||
@@ -19,7 +19,6 @@ def compile_run(code, macros=(), *, serializers=False):
|
||||
work = Path(directory)
|
||||
(work / "helpers").mkdir()
|
||||
fs = (ROOT / "test/fixtures/radio_profiles/mocks/helpers/IdentityStore.h").read_text()
|
||||
fs = fs.replace(" size_t available() const", " bool seek(size_t p) { if (p > size()) return false; cursor_ = p; return true; }\n size_t available() const")
|
||||
(work / "helpers/IdentityStore.h").write_text(fs)
|
||||
(work / "Utils.h").write_text("""#pragma once
|
||||
#include <Arduino.h>
|
||||
|
||||
Reference in new issue
Block a user