Compare commits
21
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95be305143 | ||
|
|
0d72bcd44c | ||
|
|
e3c54039fe | ||
|
|
9652199464 | ||
|
|
cbb830b2b3 | ||
|
|
66a01a227f | ||
|
|
19728e43a5 | ||
|
|
6ec03df241 | ||
|
|
b30cda7936 | ||
|
|
ad701588d7 | ||
|
|
dad7186c5b | ||
|
|
54a88a307a | ||
|
|
6c45b94783 | ||
|
|
ce02d5a787 | ||
|
|
98f9e81681 | ||
|
|
69b335d700 | ||
|
|
1ad8ca230a | ||
|
|
b72fd0dd5e | ||
|
|
26ae484af8 | ||
|
|
d05ed2122c | ||
|
|
0b38bfd81a |
No files matched your search
@@ -113,6 +113,7 @@ stall watchdog", "Reboot into the bootloader" and "Why the board last reset".
|
||||
| `blink [n]` / `blink on\|off` | repeater | flash a spare LED (not the BLE or TX one) `n` times (default 6, max 999), or until `blink off` (gives up after 10 min); finds a board on a bench or a node on a mast |
|
||||
| `txpwr [dBm]` | repeater | LoRa output power until reboot, with RadioLib's status (`set tx` saves and says OK even when the radio refused) |
|
||||
| `i2c` | all | scan the I2C bus |
|
||||
| `get chip` | nRF52 (repeater, room server, sensor) | the silicon (`nRF52840 AAD0`; variant `xxF0` and later = rev3) and `UICR.APPROTECT`: `open` means SWD can read the whole flash, keys included ([locked-bootloader.md](locked-bootloader.md)) |
|
||||
| `dio1` | own build: `PIN_DIAG` | has the SX1262 raise TX_DONE and compares its IRQ register with the level on the DIO1 pin -- which end of a dead IRQ line is broken |
|
||||
| `radiostat` | own build: `RADIO_DIAG` | receiver state, interrupt and RX counters, without touching the radio |
|
||||
| `radiokick rx\|clrirq\|standby\|agc` | own build: `RADIO_DIAG` | one recovery step, gentlest first: re-arm RX, clear latched IRQs, standby + RX, AGC reset; the first that brings `recv` back names the broken layer |
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <helpers/IdentityStore.h>
|
||||
#include <helpers/ContactInfo.h>
|
||||
#include <helpers/ChannelDetails.h>
|
||||
#include "NodePrefs.h"
|
||||
#include <helpers/CompanionNodePrefs.h>
|
||||
|
||||
class DataStoreHost {
|
||||
public:
|
||||
|
||||
@@ -392,20 +392,6 @@ void MyMesh::onDiscoveredContact(ContactInfo &contact, bool is_new, uint8_t path
|
||||
if (!is_new) dirty_contacts_expiry = futureMillis(LAZY_CONTACTS_WRITE_DELAY); // only schedule lazy write for contacts that are in contacts[]
|
||||
}
|
||||
|
||||
static int sort_by_recent(const void *a, const void *b) {
|
||||
return ((AdvertPath *) b)->recv_timestamp - ((AdvertPath *) a)->recv_timestamp;
|
||||
}
|
||||
|
||||
int MyMesh::getRecentlyHeard(AdvertPath dest[], int max_num) {
|
||||
if (max_num > ADVERT_PATH_TABLE_SIZE) max_num = ADVERT_PATH_TABLE_SIZE;
|
||||
qsort(advert_paths, ADVERT_PATH_TABLE_SIZE, sizeof(advert_paths[0]), sort_by_recent);
|
||||
|
||||
for (int i = 0; i < max_num; i++) {
|
||||
dest[i] = advert_paths[i];
|
||||
}
|
||||
return max_num;
|
||||
}
|
||||
|
||||
void MyMesh::onContactPathUpdated(const ContactInfo &contact) {
|
||||
out_frame[0] = PUSH_CODE_PATH_UPDATED;
|
||||
memcpy(&out_frame[1], contact.id.pub_key, PUB_KEY_SIZE);
|
||||
@@ -2704,21 +2690,6 @@ void MyMesh::loop() {
|
||||
}
|
||||
}
|
||||
|
||||
bool MyMesh::advert() {
|
||||
mesh::Packet* pkt;
|
||||
if (_prefs.advert_loc_policy == ADVERT_LOC_NONE) {
|
||||
pkt = createSelfAdvert(_prefs.node_name);
|
||||
} else {
|
||||
pkt = createSelfAdvert(_prefs.node_name, sensors.node_lat, sensors.node_lon);
|
||||
}
|
||||
if (pkt) {
|
||||
sendZeroHop(pkt);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// To check if there is pending work
|
||||
bool MyMesh::hasPendingWork() const {
|
||||
return _mgr->getOutboundTotal() > 0 || dirty_contacts_expiry != 0;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#endif
|
||||
|
||||
#include "DataStore.h"
|
||||
#include "NodePrefs.h"
|
||||
#include <helpers/CompanionNodePrefs.h>
|
||||
|
||||
#include <RTClib.h>
|
||||
#include <helpers/ArduinoHelpers.h>
|
||||
@@ -68,6 +68,7 @@
|
||||
|
||||
#include <helpers/BaseChatMesh.h>
|
||||
#include <helpers/TransportKeyStore.h>
|
||||
#include <helpers/MeshEventListener.h>
|
||||
|
||||
/* -------------------------------------------------------------------------------------- */
|
||||
|
||||
@@ -75,10 +76,6 @@
|
||||
#define REQ_TYPE_KEEP_ALIVE 0x02
|
||||
#define REQ_TYPE_GET_TELEMETRY_DATA 0x03
|
||||
|
||||
// Copied from simple_repeater
|
||||
#define CTL_TYPE_NODE_DISCOVER_REQ 0x80
|
||||
#define CTL_TYPE_NODE_DISCOVER_RESP 0x90
|
||||
|
||||
struct AdvertPath {
|
||||
uint8_t pubkey_prefix[7];
|
||||
uint8_t path_len;
|
||||
@@ -89,30 +86,11 @@ struct AdvertPath {
|
||||
|
||||
class MyMesh : public BaseChatMesh, public DataStoreHost {
|
||||
public:
|
||||
class Listener {
|
||||
public:
|
||||
virtual void onMessageRecv(mesh::Packet *pkt, const ContactInfo &from, uint8_t txt_type, uint32_t sender_timestamp, const char* text) = 0;
|
||||
virtual void onChannelMessageRecv(mesh::Packet *pkt, ChannelDetails& channel_details, const char* text) = 0;
|
||||
virtual void onQueueSizeChanged(int msgcount) = 0;
|
||||
virtual void onDiscoveredContact(ContactInfo &contact, bool is_new, uint8_t path_len, const uint8_t* path) { }
|
||||
virtual void onControlDataRecv(const mesh::Packet* pkt) { }
|
||||
virtual void onChannelDataRecv(mesh::Packet *pkt, const mesh::GroupChannel &channel, uint16_t data_type,
|
||||
const uint8_t *data, size_t data_len) { }
|
||||
virtual void onACKRecv(uint32_t ack_crc) { }
|
||||
virtual uint8_t onUnhandledRequest(const ContactInfo &contact, uint32_t sender_timestamp, const uint8_t *data,
|
||||
uint8_t len, uint8_t *reply) { return 0; /* unknown request type */ }
|
||||
virtual bool onUnhandledResponse(const ContactInfo &from, uint32_t tag, const uint8_t* data, uint8_t len) { return false; /* not handled */ }
|
||||
virtual void onTraceRecv(mesh::Packet *pkt, uint32_t tag, uint32_t auth_code, uint8_t flags,
|
||||
const uint8_t *path_snrs, const uint8_t *path_hashes, uint8_t path_len) { }
|
||||
virtual void onRawDataRecv(mesh::Packet *pkt) { }
|
||||
virtual ~Listener() { }
|
||||
};
|
||||
|
||||
MyMesh(mesh::Radio &radio, mesh::RNG &rng, mesh::RTCClock &rtc, SimpleMeshTables &tables, DataStore& store);
|
||||
|
||||
void begin();
|
||||
void startInterface(BaseSerialInterface &serial);
|
||||
void setListener(Listener* listener) { _listener = listener; }
|
||||
void setListener(MeshEventListener* listener) { _listener = listener; }
|
||||
|
||||
const char *getNodeName();
|
||||
NodePrefs *getNodePrefs();
|
||||
@@ -121,10 +99,14 @@ public:
|
||||
|
||||
void loop();
|
||||
void handleCmdFrame(size_t len);
|
||||
bool advert();
|
||||
void enterCLIRescue();
|
||||
|
||||
int getRecentlyHeard(AdvertPath dest[], int max_num);
|
||||
void enterCLIRescue() override;
|
||||
void savePrefs() override {
|
||||
_prefs.node_lat = sensors.node_lat;
|
||||
_prefs.node_lon = sensors.node_lon;
|
||||
_store->savePrefs(_prefs);
|
||||
_prefs.clearDirty();
|
||||
}
|
||||
|
||||
protected:
|
||||
float getAirtimeBudgetFactor() const override;
|
||||
@@ -199,13 +181,6 @@ protected:
|
||||
}
|
||||
|
||||
public:
|
||||
void savePrefs() {
|
||||
_prefs.node_lat = sensors.node_lat;
|
||||
_prefs.node_lon = sensors.node_lon;
|
||||
_store->savePrefs(_prefs);
|
||||
_prefs.clearDirty();
|
||||
}
|
||||
|
||||
#if ENV_INCLUDE_GPS == 1
|
||||
void applyGpsPrefs() {
|
||||
if (_prefs.gps_interval > 0 &&
|
||||
@@ -255,7 +230,7 @@ private:
|
||||
uint32_t pending_telemetry, pending_discovery; // pending _TELEMETRY_REQ
|
||||
uint32_t pending_req; // pending _BINARY_REQ
|
||||
BaseSerialInterface *_serial;
|
||||
Listener* _listener;
|
||||
MeshEventListener* _listener;
|
||||
|
||||
ContactsIterator _iter;
|
||||
uint32_t _iter_filter_since;
|
||||
|
||||
@@ -112,11 +112,6 @@ MultiSerialInterface interface_manager;
|
||||
#endif
|
||||
|
||||
/* GLOBAL OBJECTS */
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include "UITask.h"
|
||||
UITask ui_task(&board, &interface_manager);
|
||||
#endif
|
||||
|
||||
StdRNG fast_rng;
|
||||
SimpleMeshTables tables;
|
||||
MyMesh the_mesh(radio_driver, fast_rng, rtc_clock, tables, store);
|
||||
@@ -328,7 +323,7 @@ void setup() {
|
||||
sensors.applyInaShunt(the_mesh.getNodePrefs()->ina_shunt_mohm); // CUSTOM (TeTeHacko)
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
ui_task.begin(disp, &sensors, the_mesh.getNodePrefs()); // still want to pass this in as dependency, as prefs might be moved
|
||||
ui_task.begin(disp, &sensors, the_mesh.getNodePrefs(), &interface_manager, &the_mesh, the_mesh.getBLEPin(), FIRMWARE_VERSION, FIRMWARE_BUILD_DATE);
|
||||
the_mesh.setListener(&ui_task);
|
||||
#ifdef EINK_REFRESH_LOOP
|
||||
if (disp != NULL) disp->setBusyHook(loopDuringDisplayRefresh);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "MyMesh.h"
|
||||
#include <algorithm>
|
||||
#include <helpers/sensors/LPPDataHelpers.h>
|
||||
|
||||
/* ------------------------------ Config -------------------------------- */
|
||||
|
||||
@@ -41,6 +42,14 @@
|
||||
#define TXT_ACK_DELAY 200
|
||||
#endif
|
||||
|
||||
#ifndef SENSOR_READ_INTERVAL_SECS
|
||||
#define SENSOR_READ_INTERVAL_SECS 60
|
||||
#endif
|
||||
|
||||
#ifndef TELEM_SUBSCRIBE_MAX_SECS
|
||||
#define TELEM_SUBSCRIBE_MAX_SECS 3600
|
||||
#endif
|
||||
|
||||
#define FIRMWARE_VER_LEVEL 2
|
||||
|
||||
#define REQ_TYPE_GET_STATUS 0x01 // same as _GET_STATS
|
||||
@@ -50,6 +59,9 @@
|
||||
#define REQ_TYPE_GET_NEIGHBOURS 0x06
|
||||
#define REQ_TYPE_GET_OWNER_INFO 0x07 // FIRMWARE_VER_LEVEL >= 2
|
||||
|
||||
#define REQ_TYPE_SUBSCRIBE 0x08
|
||||
#define REQ_TYPE_UNSUBSCRIBE 0x09
|
||||
|
||||
#define RESP_SERVER_LOGIN_OK 0 // response to ANON_REQ
|
||||
|
||||
#define ANON_REQ_TYPE_REGIONS 0x01
|
||||
@@ -482,6 +494,67 @@ uint8_t MyMesh::handleAnonClockReq(const mesh::Identity& sender, uint32_t sender
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* --------------------- Cayenne LPP helpers ----------------------------*/
|
||||
|
||||
static float findTelemValue(const uint8_t* buf, uint8_t size, uint8_t channel, uint8_t type, float def_value) {
|
||||
uint8_t i = 0;
|
||||
|
||||
while (i + 2 < size) {
|
||||
// Get channel #
|
||||
uint8_t ch = buf[i++];
|
||||
// Get data type
|
||||
uint8_t t = buf[i++];
|
||||
uint8_t sz = LPPData::getDataSize(t);
|
||||
|
||||
if (ch == channel && t == type) {
|
||||
return LPPData::getFloat(&buf[i], sz, LPPData::getMultiplier(t), LPPData::isSigned(t));
|
||||
}
|
||||
i += sz; // skip
|
||||
}
|
||||
return def_value; // not found
|
||||
}
|
||||
|
||||
/* ------------------ end Cayenne LPP helpers ----------------------*/
|
||||
|
||||
bool MyMesh::telemHasChanged(ClientInfo* c) {
|
||||
auto buf = telemetry.getBuffer();
|
||||
uint8_t size = telemetry.getSize();
|
||||
uint8_t i = 0;
|
||||
bool changed = false;
|
||||
|
||||
while (i + 2 < c->extra.sensor.min_deltas_len) {
|
||||
uint8_t ch = c->extra.sensor.min_deltas[i]; // Get channel #
|
||||
uint8_t t = c->extra.sensor.min_deltas[i + 1]; // Get data type
|
||||
uint8_t sz = LPPData::getDataSize(t);
|
||||
|
||||
float min_delta = LPPData::getFloat(&c->extra.sensor.min_deltas[i + 2], sz, LPPData::getMultiplier(t), LPPData::isSigned(t));
|
||||
float pv = LPPData::getFloat(&c->extra.sensor.prev_telem[i + 2], sz, LPPData::getMultiplier(t), LPPData::isSigned(t));
|
||||
|
||||
float v = findTelemValue(buf, size, ch, t, 0.0f);
|
||||
if (abs(v - pv) > min_delta) changed = true; // Yes, has changed
|
||||
|
||||
i += 2 + sz; // skip
|
||||
}
|
||||
if (changed) {
|
||||
// take snapshot of all _monitored_ telem values, for next cycle
|
||||
i = 0;
|
||||
while (i + 2 < c->extra.sensor.min_deltas_len) {
|
||||
uint8_t ch = c->extra.sensor.min_deltas[i]; // Get channel #
|
||||
uint8_t t = c->extra.sensor.min_deltas[i + 1]; // Get data type
|
||||
uint8_t sz = LPPData::getDataSize(t);
|
||||
|
||||
c->extra.sensor.prev_telem[i] = ch;
|
||||
c->extra.sensor.prev_telem[i + 1] = t;
|
||||
|
||||
float v = findTelemValue(buf, size, ch, t, 0.0f);
|
||||
LPPData::putFloat(&c->extra.sensor.prev_telem[i + 2], v, sz, LPPData::getMultiplier(t), LPPData::isSigned(t));
|
||||
|
||||
i += 2 + sz; // skip
|
||||
}
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
int MyMesh::handleRequest(ClientInfo *sender, uint32_t sender_timestamp, uint8_t *payload, size_t payload_len) {
|
||||
// uint32_t now = getRTCClock()->getCurrentTimeUnique();
|
||||
// memcpy(reply_data, &now, 4); // response packets always prefixed with timestamp
|
||||
@@ -660,6 +733,53 @@ int MyMesh::handleRequest(ClientInfo *sender, uint32_t sender_timestamp, uint8_t
|
||||
sprintf((char *) &reply_data[4], "%s\n%s\n%s", FIRMWARE_VERSION, _prefs.node_name, _prefs.owner_info);
|
||||
return 4 + strlen((char *) &reply_data[4]);
|
||||
}
|
||||
|
||||
return payload_len > 0 ? handleRequest(sender, sender_timestamp, payload[0], &payload[1], payload_len - 1) : 0;
|
||||
}
|
||||
|
||||
int MyMesh::handleRequest(ClientInfo *from, uint32_t sender_timestamp, uint8_t req_type, uint8_t *payload, size_t payload_len) {
|
||||
uint8_t perms = from->isAdmin() ? 0xFF : from->permissions;
|
||||
|
||||
if (req_type == REQ_TYPE_SUBSCRIBE && payload_len >= 8 && (perms & PERM_ACL_ROLE_MASK) >= PERM_ACL_READ_ONLY) {
|
||||
memcpy(&from->extra.sensor.push_tag, &payload[0], 4);
|
||||
uint16_t timeout_secs;
|
||||
memcpy(&timeout_secs, &payload[4], 2);
|
||||
uint8_t reserved = payload[6];
|
||||
uint8_t min_deltas_len = payload[7];
|
||||
RegionEntry* r;
|
||||
if (recv_pkt_region && !recv_pkt_region->isWildcard()) { // use request scope
|
||||
r = recv_pkt_region;
|
||||
} else { // use default scope
|
||||
r = region_map.getDefaultRegion();
|
||||
}
|
||||
uint8_t reply_len;
|
||||
if (r && min_deltas_len >= 3 && min_deltas_len <= sizeof(from->extra.sensor.min_deltas)) {
|
||||
if (timeout_secs > TELEM_SUBSCRIBE_MAX_SECS) timeout_secs = TELEM_SUBSCRIBE_MAX_SECS; // impose max
|
||||
from->extra.sensor.scope_region_id = r->id;
|
||||
from->extra.sensor.expiry_timestamp = getRTCClock()->getCurrentTime() + timeout_secs;
|
||||
from->extra.sensor.min_deltas_len = min_deltas_len;
|
||||
memcpy(from->extra.sensor.min_deltas, &payload[8], min_deltas_len);
|
||||
// reply with actual expiry seconds (we could modify/impose restriction)
|
||||
memcpy(&reply_data[4], &timeout_secs, 2);
|
||||
memset(&reply_data[6], 0, 2); // reserved
|
||||
strcpy((char *)&reply_data[8], r ? r->name : ""); // reply with name of scope that will be used
|
||||
reply_len = 8 + strlen((char *)&reply_data[8]);
|
||||
} else {
|
||||
memset(&reply_data[4], 0, 4); // expiry secs (0 for error)
|
||||
reply_len = 8;
|
||||
}
|
||||
return reply_len;
|
||||
}
|
||||
if (req_type == REQ_TYPE_UNSUBSCRIBE && (perms & PERM_ACL_ROLE_MASK) >= PERM_ACL_READ_ONLY) {
|
||||
from->extra.sensor.scope_region_id = 0;
|
||||
from->extra.sensor.push_tag = 0;
|
||||
from->extra.sensor.expiry_timestamp = 0;
|
||||
from->extra.sensor.min_deltas_len = 0;
|
||||
// REVISIT: maybe return some stats, eg total number of telemetry pushes since SUBSCRIBE?
|
||||
memset(&reply_data[4], 0, 8); // success
|
||||
getRNG()->random(&reply_data[12], 2); // just some entropy for better packet-hash uniqueness
|
||||
return 12 + 2;
|
||||
}
|
||||
return 0; // unknown command
|
||||
}
|
||||
|
||||
@@ -1340,6 +1460,7 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc
|
||||
next_local_advert = next_flood_advert = 0;
|
||||
next_fair_sender_normal_refill = next_fair_sender_low_refill = next_fair_group_refill = 0;
|
||||
dirty_contacts_expiry = 0;
|
||||
last_read_time = 0;
|
||||
set_radio_at = revert_radio_at = 0;
|
||||
_logging = false;
|
||||
region_load_active = false;
|
||||
@@ -1979,6 +2100,49 @@ void MyMesh::loop() {
|
||||
MESH_DEBUG_PRINTLN("Radio params restored");
|
||||
}
|
||||
|
||||
uint32_t curr = getRTCClock()->getCurrentTime();
|
||||
if (curr >= last_read_time + SENSOR_READ_INTERVAL_SECS) {
|
||||
telemetry.reset();
|
||||
telemetry.addVoltage(TELEM_CHANNEL_SELF, (float)board.getBattMilliVolts() / 1000.0f);
|
||||
// query other sensors -- target specific
|
||||
sensors.querySensors(0xFF, telemetry); // allow all telemetry permissions
|
||||
// This MCU temperature will be overridden by external sensors (if any)
|
||||
float temperature = board.getMCUTemperature();
|
||||
if (!isnan(temperature)) { // Supported boards with built-in temperature sensor. ESP32-C3 may return NAN
|
||||
telemetry.addTemperature(TELEM_CHANNEL_SELF, temperature); // Built-in MCU Temperature
|
||||
}
|
||||
|
||||
// compare with previous telemetry, check if any deltas are greater than subscriber minimums
|
||||
for (int i = 0; i < acl.getNumClients(); i++) {
|
||||
auto c = acl.getClientByIdx(i);
|
||||
if (c->permissions == 0 || c->extra.sensor.scope_region_id == 0 || c->extra.sensor.min_deltas_len == 0) continue; // skip deleted entries, or Not subscribed to deltas
|
||||
RegionEntry* r = region_map.findById(c->extra.sensor.scope_region_id);
|
||||
if (r == NULL) continue; // unknown region scope
|
||||
if (curr > c->extra.sensor.expiry_timestamp) continue; // subscription now expired
|
||||
if (telemHasChanged(c)) {
|
||||
TransportKey scope;
|
||||
if (region_map.getTransportKeysFor(*r, &scope, 1) > 0) {
|
||||
uint8_t tlen = telemetry.getSize();
|
||||
memcpy(reply_data, &c->extra.sensor.push_tag, 4);
|
||||
uint32_t timestamp = getRTCClock()->getCurrentTimeUnique();
|
||||
memcpy(&reply_data[4], ×tamp, 4);
|
||||
memcpy(&reply_data[8], telemetry.getBuffer(), tlen);
|
||||
|
||||
mesh::Packet* reply = createDatagram(PAYLOAD_TYPE_RESPONSE, c->id, c->shared_secret, reply_data, 8 + tlen);
|
||||
if (reply) {
|
||||
if (c->out_path_len != OUT_PATH_UNKNOWN) { // we have an out_path, so send DIRECT
|
||||
sendDirect(reply, c->out_path, c->out_path_len, 0);
|
||||
} else {
|
||||
sendFloodScoped(scope, reply, 0, _prefs.path_hash_mode + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
last_read_time = curr;
|
||||
}
|
||||
|
||||
// is pending dirty contacts write needed?
|
||||
if (dirty_contacts_expiry && millisHasNowPassed(dirty_contacts_expiry)) {
|
||||
acl.save(_fs);
|
||||
|
||||
@@ -186,8 +186,6 @@ struct PktFeedRec {
|
||||
#define FIRMWARE_VERSION "v1.18.0"
|
||||
#endif
|
||||
|
||||
#define FIRMWARE_ROLE "repeater"
|
||||
|
||||
#define PACKET_LOG_FILE "/packet_log"
|
||||
|
||||
class MyMesh : public mesh::Mesh, public CommonCLICallbacks {
|
||||
@@ -208,6 +206,7 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks {
|
||||
RegionEntry* load_stack[8];
|
||||
RegionEntry* recv_pkt_region;
|
||||
TransportKey default_scope;
|
||||
uint32_t last_read_time;
|
||||
RateLimiter discover_limiter, anon_limiter;
|
||||
// CUSTOM (TeTeHacko): token-bucket limiter over FORWARDED traffic (port of
|
||||
// upstream proposal #1502). Kill switch: _prefs.fairness_enabled.
|
||||
@@ -353,10 +352,12 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks {
|
||||
uint8_t handleAnonOwnerReq(const mesh::Identity& sender, uint32_t sender_timestamp, const uint8_t* data);
|
||||
uint8_t handleAnonClockReq(const mesh::Identity& sender, uint32_t sender_timestamp, const uint8_t* data);
|
||||
int handleRequest(ClientInfo* sender, uint32_t sender_timestamp, uint8_t* payload, size_t payload_len);
|
||||
int handleRequest(ClientInfo *sender, uint32_t sender_timestamp, uint8_t req_type, uint8_t *payload, size_t payload_len);
|
||||
mesh::Packet* createSelfAdvert();
|
||||
|
||||
File openAppend(const char* fname);
|
||||
bool isLooped(const mesh::Packet* packet, const uint8_t max_counters[]);
|
||||
bool telemHasChanged(ClientInfo* c);
|
||||
|
||||
protected:
|
||||
float getAirtimeBudgetFactor() const override {
|
||||
@@ -450,7 +451,7 @@ public:
|
||||
void sendNodeDiscoverReq();
|
||||
const char* getFirmwareVer() override { return FIRMWARE_VERSION; }
|
||||
const char* getBuildDate() override { return FIRMWARE_BUILD_DATE; }
|
||||
const char* getRole() override { return FIRMWARE_ROLE; }
|
||||
const char* getRole() override { return "repeater"; }
|
||||
const char* getNodeName() { return _prefs.node_name; }
|
||||
NodePrefs* getNodePrefs() {
|
||||
return &_prefs;
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <helpers/ui/DisplayDriver.h>
|
||||
#include <helpers/CommonCLI.h>
|
||||
|
||||
class UITask {
|
||||
mesh::MainBoard* _board;
|
||||
DisplayDriver* _display;
|
||||
unsigned long _next_read, _next_refresh, _auto_off;
|
||||
int _prevBtnState;
|
||||
NodePrefs* _node_prefs;
|
||||
char _version_info[32];
|
||||
unsigned long _powering_off_at = 0;
|
||||
unsigned long _started_at = 0;
|
||||
|
||||
void renderCurrScreen();
|
||||
public:
|
||||
UITask(mesh::MainBoard& board, DisplayDriver& display) : _board(&board), _display(&display) { _next_read = _next_refresh = 0; }
|
||||
void begin(NodePrefs* node_prefs, const char* build_date, const char* firmware_version);
|
||||
|
||||
void loop();
|
||||
};
|
||||
@@ -598,11 +598,6 @@ bool identHandleCommand(const char* command, char* reply) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include "UITask.h"
|
||||
static UITask ui_task(board, display);
|
||||
#endif
|
||||
|
||||
#ifdef ETHERNET_ENABLED
|
||||
#define ETHERNET_CLI_BANNER "MeshCore Repeater CLI"
|
||||
#include <helpers/nrf52/EthernetCLI.h>
|
||||
@@ -894,7 +889,7 @@ void setup() {
|
||||
maint.begin(fs, the_mesh.getNodePrefs(), &the_mesh); // CUSTOM (TeTeHacko): needs the prefs loaded by begin()
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION);
|
||||
ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION, "< Repeater >");
|
||||
#endif
|
||||
|
||||
#ifdef ETHERNET_ENABLED
|
||||
|
||||
@@ -78,8 +78,6 @@
|
||||
#define TXT_ACK_DELAY 200
|
||||
#endif
|
||||
|
||||
#define FIRMWARE_ROLE "room_server"
|
||||
|
||||
#define PACKET_LOG_FILE "/packet_log"
|
||||
|
||||
#define MAX_POST_TEXT_LEN (160-9)
|
||||
@@ -196,7 +194,7 @@ public:
|
||||
|
||||
const char* getFirmwareVer() override { return FIRMWARE_VERSION; }
|
||||
const char* getBuildDate() override { return FIRMWARE_BUILD_DATE; }
|
||||
const char* getRole() override { return FIRMWARE_ROLE; }
|
||||
const char* getRole() override { return "room_server"; }
|
||||
const char* getNodeName() { return _prefs.node_name; }
|
||||
NodePrefs* getNodePrefs() {
|
||||
return &_prefs;
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
#include "UITask.h"
|
||||
#include <Arduino.h>
|
||||
#include <helpers/CommonCLI.h>
|
||||
|
||||
#ifndef USER_BTN_PRESSED
|
||||
#define USER_BTN_PRESSED LOW
|
||||
#endif
|
||||
|
||||
#define AUTO_OFF_MILLIS 20000 // 20 seconds
|
||||
#define BOOT_SCREEN_MILLIS 4000 // 4 seconds
|
||||
|
||||
// 'meshcore', 128x13px
|
||||
static const uint8_t meshcore_logo [] PROGMEM = {
|
||||
0x3c, 0x01, 0xe3, 0xff, 0xc7, 0xff, 0x8f, 0x03, 0x87, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe,
|
||||
0x3c, 0x03, 0xe3, 0xff, 0xc7, 0xff, 0x8e, 0x03, 0x8f, 0xfe, 0x3f, 0xfe, 0x1f, 0xff, 0x1f, 0xfe,
|
||||
0x3e, 0x03, 0xc3, 0xff, 0x8f, 0xff, 0x0e, 0x07, 0x8f, 0xfe, 0x7f, 0xfe, 0x1f, 0xff, 0x1f, 0xfc,
|
||||
0x3e, 0x07, 0xc7, 0x80, 0x0e, 0x00, 0x0e, 0x07, 0x9e, 0x00, 0x78, 0x0e, 0x3c, 0x0f, 0x1c, 0x00,
|
||||
0x3e, 0x0f, 0xc7, 0x80, 0x1e, 0x00, 0x0e, 0x07, 0x1e, 0x00, 0x70, 0x0e, 0x38, 0x0f, 0x3c, 0x00,
|
||||
0x7f, 0x0f, 0xc7, 0xfe, 0x1f, 0xfc, 0x1f, 0xff, 0x1c, 0x00, 0x70, 0x0e, 0x38, 0x0e, 0x3f, 0xf8,
|
||||
0x7f, 0x1f, 0xc7, 0xfe, 0x0f, 0xff, 0x1f, 0xff, 0x1c, 0x00, 0xf0, 0x0e, 0x38, 0x0e, 0x3f, 0xf8,
|
||||
0x7f, 0x3f, 0xc7, 0xfe, 0x0f, 0xff, 0x1f, 0xff, 0x1c, 0x00, 0xf0, 0x1e, 0x3f, 0xfe, 0x3f, 0xf0,
|
||||
0x77, 0x3b, 0x87, 0x00, 0x00, 0x07, 0x1c, 0x0f, 0x3c, 0x00, 0xe0, 0x1c, 0x7f, 0xfc, 0x38, 0x00,
|
||||
0x77, 0xfb, 0x8f, 0x00, 0x00, 0x07, 0x1c, 0x0f, 0x3c, 0x00, 0xe0, 0x1c, 0x7f, 0xf8, 0x38, 0x00,
|
||||
0x73, 0xf3, 0x8f, 0xff, 0x0f, 0xff, 0x1c, 0x0e, 0x3f, 0xf8, 0xff, 0xfc, 0x70, 0x78, 0x7f, 0xf8,
|
||||
0xe3, 0xe3, 0x8f, 0xff, 0x1f, 0xfe, 0x3c, 0x0e, 0x3f, 0xf8, 0xff, 0xfc, 0x70, 0x3c, 0x7f, 0xf8,
|
||||
0xe3, 0xe3, 0x8f, 0xff, 0x1f, 0xfc, 0x3c, 0x0e, 0x1f, 0xf8, 0xff, 0xf8, 0x70, 0x3c, 0x7f, 0xf8,
|
||||
};
|
||||
|
||||
void UITask::begin(NodePrefs* node_prefs, const char* build_date, const char* firmware_version) {
|
||||
_prevBtnState = HIGH;
|
||||
_auto_off = millis() + AUTO_OFF_MILLIS;
|
||||
_node_prefs = node_prefs;
|
||||
_display->turnOn();
|
||||
|
||||
// strip off dash and commit hash by changing dash to null terminator
|
||||
// e.g: v1.2.3-abcdef -> v1.2.3
|
||||
char *version = strdup(firmware_version);
|
||||
char *dash = strchr(version, '-');
|
||||
if(dash){
|
||||
*dash = 0;
|
||||
}
|
||||
|
||||
// v1.2.3 (1 Jan 2025)
|
||||
snprintf(_version_info, sizeof(_version_info), "%s (%s)", version, build_date);
|
||||
free(version);
|
||||
}
|
||||
|
||||
void UITask::renderCurrScreen() {
|
||||
char tmp[80];
|
||||
if (millis() < BOOT_SCREEN_MILLIS) { // boot screen
|
||||
// meshcore logo
|
||||
_display->setColor(UIColor::corp_blue);
|
||||
int logoWidth = 128;
|
||||
_display->drawXbm((_display->width() - logoWidth) / 2, 3, meshcore_logo, logoWidth, 13);
|
||||
|
||||
// meshcore website
|
||||
const char* website = "https://meshcore.io";
|
||||
_display->setColor(UIColor::primary_txt);
|
||||
_display->setTextSize(1);
|
||||
uint16_t websiteWidth = _display->getTextWidth(website);
|
||||
_display->setCursor((_display->width() - websiteWidth) / 2, 22);
|
||||
_display->print(website);
|
||||
|
||||
// version info
|
||||
_display->setTextSize(1);
|
||||
uint16_t versionWidth = _display->getTextWidth(_version_info);
|
||||
_display->setCursor((_display->width() - versionWidth) / 2, 35);
|
||||
_display->print(_version_info);
|
||||
|
||||
// node type
|
||||
const char* node_type = "< Room Server >";
|
||||
uint16_t typeWidth = _display->getTextWidth(node_type);
|
||||
_display->setCursor((_display->width() - typeWidth) / 2, 48);
|
||||
_display->print(node_type);
|
||||
} else { // home screen
|
||||
// node name
|
||||
_display->setCursor(0, 0);
|
||||
_display->setTextSize(1);
|
||||
_display->setColor(UIColor::primary_txt);
|
||||
_display->print(_node_prefs->node_name);
|
||||
|
||||
// freq / sf
|
||||
_display->setCursor(0, 20);
|
||||
sprintf(tmp, "FREQ: %06.3f SF%d", _node_prefs->freq, _node_prefs->sf);
|
||||
_display->print(tmp);
|
||||
|
||||
// bw / cr
|
||||
_display->setCursor(0, 30);
|
||||
sprintf(tmp, "BW: %03.2f CR: %d", _node_prefs->bw, _node_prefs->cr);
|
||||
_display->print(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
void UITask::loop() {
|
||||
#ifdef PIN_USER_BTN
|
||||
if (millis() >= _next_read) {
|
||||
int btnState = digitalRead(PIN_USER_BTN);
|
||||
if (btnState != _prevBtnState) {
|
||||
if (btnState == USER_BTN_PRESSED) { // pressed?
|
||||
if (_display->isOn()) {
|
||||
// TODO: any action ?
|
||||
} else {
|
||||
_display->turnOn();
|
||||
}
|
||||
_auto_off = millis() + AUTO_OFF_MILLIS; // extend auto-off timer
|
||||
}
|
||||
_prevBtnState = btnState;
|
||||
}
|
||||
_next_read = millis() + 200; // 5 reads per second
|
||||
}
|
||||
#endif
|
||||
|
||||
if (_display->isOn()) {
|
||||
if (millis() >= _next_refresh) {
|
||||
_display->startFrame();
|
||||
renderCurrScreen();
|
||||
_display->endFrame();
|
||||
|
||||
_next_refresh = millis() + 1000; // refresh every second
|
||||
}
|
||||
if (millis() > _auto_off) {
|
||||
_display->turnOff();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <helpers/ui/DisplayDriver.h>
|
||||
#include <helpers/CommonCLI.h>
|
||||
|
||||
class UITask {
|
||||
DisplayDriver* _display;
|
||||
unsigned long _next_read, _next_refresh, _auto_off;
|
||||
int _prevBtnState;
|
||||
NodePrefs* _node_prefs;
|
||||
char _version_info[32];
|
||||
|
||||
void renderCurrScreen();
|
||||
public:
|
||||
UITask(DisplayDriver& display) : _display(&display) { _next_read = _next_refresh = 0; }
|
||||
void begin(NodePrefs* node_prefs, const char* build_date, const char* firmware_version);
|
||||
|
||||
void loop();
|
||||
};
|
||||
@@ -9,11 +9,6 @@
|
||||
#include <helpers/nrf52/EthernetCLI.h>
|
||||
#endif
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include "UITask.h"
|
||||
static UITask ui_task(display);
|
||||
#endif
|
||||
|
||||
StdRNG fast_rng;
|
||||
SimpleMeshTables tables;
|
||||
MyMesh the_mesh(board, radio_driver, *new ArduinoMillis(), fast_rng, rtc_clock, tables);
|
||||
@@ -102,7 +97,7 @@ void setup() {
|
||||
maint.begin(fs, the_mesh.getNodePrefs(), &the_mesh);
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION);
|
||||
ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION, "< Room Server >");
|
||||
#endif
|
||||
|
||||
#ifdef ETHERNET_ENABLED
|
||||
|
||||
@@ -42,8 +42,6 @@
|
||||
#define FIRMWARE_VERSION "v1.18.0"
|
||||
#endif
|
||||
|
||||
#define FIRMWARE_ROLE "sensor"
|
||||
|
||||
#define MAX_SEARCH_RESULTS 24
|
||||
#define MAX_CONCURRENT_ALERTS 4
|
||||
|
||||
@@ -57,7 +55,7 @@ public:
|
||||
// CommonCLI callbacks
|
||||
const char* getFirmwareVer() override { return FIRMWARE_VERSION; }
|
||||
const char* getBuildDate() override { return FIRMWARE_BUILD_DATE; }
|
||||
const char* getRole() override { return FIRMWARE_ROLE; }
|
||||
const char* getRole() override { return "sensor"; }
|
||||
const char* getNodeName() { return _prefs.node_name; }
|
||||
NodePrefs* getNodePrefs() { return &_prefs; }
|
||||
void savePrefs() override { _cli.savePrefs(_fs); }
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
#include "UITask.h"
|
||||
#include <Arduino.h>
|
||||
#include <helpers/CommonCLI.h>
|
||||
|
||||
#ifndef USER_BTN_PRESSED
|
||||
#define USER_BTN_PRESSED LOW
|
||||
#endif
|
||||
|
||||
#define AUTO_OFF_MILLIS 20000 // 20 seconds
|
||||
#define BOOT_SCREEN_MILLIS 4000 // 4 seconds
|
||||
|
||||
// 'meshcore', 128x13px
|
||||
static const uint8_t meshcore_logo [] PROGMEM = {
|
||||
0x3c, 0x01, 0xe3, 0xff, 0xc7, 0xff, 0x8f, 0x03, 0x87, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe,
|
||||
0x3c, 0x03, 0xe3, 0xff, 0xc7, 0xff, 0x8e, 0x03, 0x8f, 0xfe, 0x3f, 0xfe, 0x1f, 0xff, 0x1f, 0xfe,
|
||||
0x3e, 0x03, 0xc3, 0xff, 0x8f, 0xff, 0x0e, 0x07, 0x8f, 0xfe, 0x7f, 0xfe, 0x1f, 0xff, 0x1f, 0xfc,
|
||||
0x3e, 0x07, 0xc7, 0x80, 0x0e, 0x00, 0x0e, 0x07, 0x9e, 0x00, 0x78, 0x0e, 0x3c, 0x0f, 0x1c, 0x00,
|
||||
0x3e, 0x0f, 0xc7, 0x80, 0x1e, 0x00, 0x0e, 0x07, 0x1e, 0x00, 0x70, 0x0e, 0x38, 0x0f, 0x3c, 0x00,
|
||||
0x7f, 0x0f, 0xc7, 0xfe, 0x1f, 0xfc, 0x1f, 0xff, 0x1c, 0x00, 0x70, 0x0e, 0x38, 0x0e, 0x3f, 0xf8,
|
||||
0x7f, 0x1f, 0xc7, 0xfe, 0x0f, 0xff, 0x1f, 0xff, 0x1c, 0x00, 0xf0, 0x0e, 0x38, 0x0e, 0x3f, 0xf8,
|
||||
0x7f, 0x3f, 0xc7, 0xfe, 0x0f, 0xff, 0x1f, 0xff, 0x1c, 0x00, 0xf0, 0x1e, 0x3f, 0xfe, 0x3f, 0xf0,
|
||||
0x77, 0x3b, 0x87, 0x00, 0x00, 0x07, 0x1c, 0x0f, 0x3c, 0x00, 0xe0, 0x1c, 0x7f, 0xfc, 0x38, 0x00,
|
||||
0x77, 0xfb, 0x8f, 0x00, 0x00, 0x07, 0x1c, 0x0f, 0x3c, 0x00, 0xe0, 0x1c, 0x7f, 0xf8, 0x38, 0x00,
|
||||
0x73, 0xf3, 0x8f, 0xff, 0x0f, 0xff, 0x1c, 0x0e, 0x3f, 0xf8, 0xff, 0xfc, 0x70, 0x78, 0x7f, 0xf8,
|
||||
0xe3, 0xe3, 0x8f, 0xff, 0x1f, 0xfe, 0x3c, 0x0e, 0x3f, 0xf8, 0xff, 0xfc, 0x70, 0x3c, 0x7f, 0xf8,
|
||||
0xe3, 0xe3, 0x8f, 0xff, 0x1f, 0xfc, 0x3c, 0x0e, 0x1f, 0xf8, 0xff, 0xf8, 0x70, 0x3c, 0x7f, 0xf8,
|
||||
};
|
||||
|
||||
void UITask::begin(NodePrefs* node_prefs, const char* build_date, const char* firmware_version) {
|
||||
_prevBtnState = HIGH;
|
||||
_auto_off = millis() + AUTO_OFF_MILLIS;
|
||||
_node_prefs = node_prefs;
|
||||
_display->turnOn();
|
||||
|
||||
// strip off dash and commit hash by changing dash to null terminator
|
||||
// e.g: v1.2.3-abcdef -> v1.2.3
|
||||
char *version = strdup(firmware_version);
|
||||
char *dash = strchr(version, '-');
|
||||
if(dash){
|
||||
*dash = 0;
|
||||
}
|
||||
|
||||
// v1.2.3 (1 Jan 2025)
|
||||
snprintf(_version_info, sizeof(_version_info), "%s (%s)", version, build_date);
|
||||
free(version);
|
||||
}
|
||||
|
||||
void UITask::renderCurrScreen() {
|
||||
char tmp[80];
|
||||
if (millis() < BOOT_SCREEN_MILLIS) { // boot screen
|
||||
// meshcore logo
|
||||
_display->setColor(UIColor::corp_blue);
|
||||
int logoWidth = 128;
|
||||
_display->drawXbm((_display->width() - logoWidth) / 2, 3, meshcore_logo, logoWidth, 13);
|
||||
|
||||
// meshcore website
|
||||
const char* website = "https://meshcore.io";
|
||||
_display->setColor(UIColor::primary_txt);
|
||||
_display->setTextSize(1);
|
||||
uint16_t websiteWidth = _display->getTextWidth(website);
|
||||
_display->setCursor((_display->width() - websiteWidth) / 2, 22);
|
||||
_display->print(website);
|
||||
|
||||
// version info
|
||||
_display->setTextSize(1);
|
||||
uint16_t versionWidth = _display->getTextWidth(_version_info);
|
||||
_display->setCursor((_display->width() - versionWidth) / 2, 35);
|
||||
_display->print(_version_info);
|
||||
|
||||
// node type
|
||||
const char* node_type = "< Sensor >";
|
||||
uint16_t typeWidth = _display->getTextWidth(node_type);
|
||||
_display->setCursor((_display->width() - typeWidth) / 2, 48);
|
||||
_display->print(node_type);
|
||||
} else { // home screen
|
||||
// node name
|
||||
_display->setCursor(0, 0);
|
||||
_display->setTextSize(1);
|
||||
_display->setColor(UIColor::primary_txt);
|
||||
_display->print(_node_prefs->node_name);
|
||||
|
||||
// freq / sf
|
||||
_display->setCursor(0, 20);
|
||||
sprintf(tmp, "FREQ: %06.3f SF%d", _node_prefs->freq, _node_prefs->sf);
|
||||
_display->print(tmp);
|
||||
|
||||
// bw / cr
|
||||
_display->setCursor(0, 30);
|
||||
sprintf(tmp, "BW: %03.2f CR: %d", _node_prefs->bw, _node_prefs->cr);
|
||||
_display->print(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
void UITask::loop() {
|
||||
#ifdef PIN_USER_BTN
|
||||
if (millis() >= _next_read) {
|
||||
int btnState = digitalRead(PIN_USER_BTN);
|
||||
if (btnState != _prevBtnState) {
|
||||
if (btnState == USER_BTN_PRESSED) { // pressed?
|
||||
if (_display->isOn()) {
|
||||
// TODO: any action ?
|
||||
} else {
|
||||
_display->turnOn();
|
||||
}
|
||||
_auto_off = millis() + AUTO_OFF_MILLIS; // extend auto-off timer
|
||||
}
|
||||
_prevBtnState = btnState;
|
||||
}
|
||||
_next_read = millis() + 200; // 5 reads per second
|
||||
}
|
||||
#endif
|
||||
|
||||
if (_display->isOn()) {
|
||||
if (millis() >= _next_refresh) {
|
||||
_display->startFrame();
|
||||
renderCurrScreen();
|
||||
_display->endFrame();
|
||||
|
||||
_next_refresh = millis() + 1000; // refresh every second
|
||||
}
|
||||
if (millis() > _auto_off) {
|
||||
_display->turnOff();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <helpers/ui/DisplayDriver.h>
|
||||
#include <helpers/CommonCLI.h>
|
||||
|
||||
class UITask {
|
||||
DisplayDriver* _display;
|
||||
unsigned long _next_read, _next_refresh, _auto_off;
|
||||
int _prevBtnState;
|
||||
NodePrefs* _node_prefs;
|
||||
char _version_info[32];
|
||||
|
||||
void renderCurrScreen();
|
||||
public:
|
||||
UITask(DisplayDriver& display) : _display(&display) { _next_read = _next_refresh = 0; }
|
||||
void begin(NodePrefs* node_prefs, const char* build_date, const char* firmware_version);
|
||||
|
||||
void loop();
|
||||
};
|
||||
@@ -4,11 +4,6 @@
|
||||
// CUSTOM (TeTeHacko): dfu, radio silence watchdog, reset reason -- see NodeMaintenance.h.
|
||||
static NodeMaintenance maint(board, radio_driver);
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include "UITask.h"
|
||||
static UITask ui_task(display);
|
||||
#endif
|
||||
|
||||
class MyMesh : public SensorMesh {
|
||||
public:
|
||||
MyMesh(mesh::MainBoard& board, mesh::Radio& radio, mesh::MillisecondClock& ms, mesh::RNG& rng, mesh::RTCClock& rtc, mesh::MeshTables& tables)
|
||||
@@ -118,7 +113,7 @@ void setup() {
|
||||
maint.begin(fs, the_mesh.getNodePrefs(), &the_mesh);
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION);
|
||||
ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION, "< Sensor >");
|
||||
#endif
|
||||
|
||||
// send out initial zero hop Advertisement to the mesh
|
||||
|
||||
@@ -182,5 +182,8 @@ public:
|
||||
bool setChannel(int idx, const ChannelDetails& src);
|
||||
int findChannelIdx(const mesh::GroupChannel& ch);
|
||||
|
||||
virtual void savePrefs() { }
|
||||
virtual void enterCLIRescue() { }
|
||||
|
||||
void loop();
|
||||
};
|
||||
@@ -936,6 +936,20 @@ void CommonCLI::handleGetCmd(uint32_t sender_timestamp, char* command, char* rep
|
||||
strcpy(reply, "Error: locked build");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if defined(NRF52_PLATFORM)
|
||||
// CUSTOM (TeTeHacko): which silicon, and whether SWD can read the flash
|
||||
// (docs/locked-bootloader.md, point 5). Variant xxF0 and later = rev3, where
|
||||
// the hardware closes the debug port unless the firmware opens it on every
|
||||
// boot -- ours never does; rev1/rev2 obey UICR.APPROTECT alone (0xFF = open).
|
||||
if (memcmp(config, "chip", 4) == 0 && config[4] == 0) {
|
||||
uint32_t v = NRF_FICR->INFO.VARIANT;
|
||||
uint32_t ap = NRF_UICR->APPROTECT;
|
||||
sprintf(reply, "> nRF%lx %c%c%c%c, uicr.approtect %08lx (%s)", (unsigned long)NRF_FICR->INFO.PART,
|
||||
(char)(v >> 24), (char)(v >> 16), (char)(v >> 8), (char)v, (unsigned long)ap,
|
||||
(ap & 0xFF) == 0xFF ? "open" : "protected");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (memcmp(config, "allow.read.only", 15) == 0) {
|
||||
sprintf(reply, "> %s", _prefs->allow_read_only ? "on" : "off");
|
||||
|
||||
@@ -4,16 +4,10 @@
|
||||
#include "SensorManager.h"
|
||||
|
||||
class CommonGpsPrefs : public ConfigSerializer {
|
||||
bool _is_dirty = false;
|
||||
|
||||
protected:
|
||||
CommonGpsPrefs() = default;
|
||||
|
||||
public:
|
||||
void markDirty() { _is_dirty = true; }
|
||||
void clearDirty() { _is_dirty = false; }
|
||||
bool isDirty() const { return _is_dirty; }
|
||||
|
||||
virtual bool isGpsEnabled() const = 0;
|
||||
virtual void setGpsEnabled(bool enabled) = 0;
|
||||
virtual uint32_t getGpsPeriod() const = 0;
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#endif
|
||||
|
||||
class CommonRadioPrefs : public ConfigSerializer, public KeyValueStore {
|
||||
bool _is_dirty = false;
|
||||
#ifdef WITH_RX_POWERSAVING
|
||||
uint8_t _active_sf = 0; // what the radio runs now (tempradio differs from prefs)
|
||||
float _active_bw = 0;
|
||||
@@ -14,10 +13,6 @@ class CommonRadioPrefs : public ConfigSerializer, public KeyValueStore {
|
||||
protected:
|
||||
CommonRadioPrefs() { }
|
||||
public:
|
||||
void markDirty() { _is_dirty = true; }
|
||||
void clearDirty() { _is_dirty = false; }
|
||||
bool isDirty() const { return _is_dirty; }
|
||||
|
||||
virtual float getFreq() const = 0;
|
||||
virtual void setFreq(float f) = 0;
|
||||
|
||||
|
||||
File renamed without changes.
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include <MeshCore.h>
|
||||
#include <helpers/ContactInfo.h>
|
||||
#include <helpers/ChannelDetails.h>
|
||||
|
||||
class MeshEventListener {
|
||||
public:
|
||||
virtual void onMessageRecv(mesh::Packet *pkt, const ContactInfo &from, uint8_t txt_type, uint32_t sender_timestamp, const char* text) = 0;
|
||||
virtual void onChannelMessageRecv(mesh::Packet *pkt, ChannelDetails& channel_details, const char* text) = 0;
|
||||
virtual void onQueueSizeChanged(int msgcount) = 0;
|
||||
virtual void onDiscoveredContact(ContactInfo &contact, bool is_new, uint8_t path_len, const uint8_t* path) { }
|
||||
virtual void onControlDataRecv(const mesh::Packet* pkt) { }
|
||||
virtual void onChannelDataRecv(mesh::Packet *pkt, const mesh::GroupChannel &channel, uint16_t data_type,
|
||||
const uint8_t *data, size_t data_len) { }
|
||||
virtual void onACKRecv(uint32_t ack_crc) { }
|
||||
virtual uint8_t onUnhandledRequest(const ContactInfo &contact, uint32_t sender_timestamp, const uint8_t *data,
|
||||
uint8_t len, uint8_t *reply) { return 0; /* unknown request type */ }
|
||||
virtual bool onUnhandledResponse(const ContactInfo &from, uint32_t tag, const uint8_t* data, uint8_t len) { return false; /* not handled */ }
|
||||
virtual void onTraceRecv(mesh::Packet *pkt, uint32_t tag, uint32_t auth_code, uint8_t flags,
|
||||
const uint8_t *path_snrs, const uint8_t *path_hashes, uint8_t path_len) { }
|
||||
virtual void onRawDataRecv(mesh::Packet *pkt) { }
|
||||
virtual ~MeshEventListener() { }
|
||||
};
|
||||
@@ -5,15 +5,14 @@
|
||||
#include <helpers/ui/UIScreen.h>
|
||||
#include <helpers/SensorManager.h>
|
||||
#include <helpers/MultiSerialInterface.h>
|
||||
#include <helpers/MeshEventListener.h>
|
||||
#include <helpers/CompanionNodePrefs.h>
|
||||
#include <Arduino.h>
|
||||
|
||||
#ifdef PIN_BUZZER
|
||||
#include <helpers/ui/buzzer.h>
|
||||
#endif
|
||||
|
||||
#include "NodePrefs.h"
|
||||
#include "MyMesh.h"
|
||||
|
||||
enum class UIEventType {
|
||||
none,
|
||||
contactMessage,
|
||||
@@ -23,12 +22,12 @@ enum class UIEventType {
|
||||
ack
|
||||
};
|
||||
|
||||
class AbstractUITask : public MyMesh::Listener {
|
||||
class AbstractUITask : public MeshEventListener {
|
||||
protected:
|
||||
mesh::MainBoard* _board;
|
||||
MultiSerialInterface* _interfaceManager;
|
||||
|
||||
AbstractUITask(mesh::MainBoard* board, MultiSerialInterface* interfaceManager) : _board(board), _interfaceManager(interfaceManager) {
|
||||
AbstractUITask(mesh::MainBoard* board, MultiSerialInterface* interfaceManager = NULL) : _board(board), _interfaceManager(interfaceManager) {
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -0,0 +1,17 @@
|
||||
#include "BaseUITask.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
void BaseUITask::loop() {
|
||||
if (_display->isOn()) {
|
||||
if (millis() >= _next_refresh) {
|
||||
_display->startFrame();
|
||||
long interval = renderCurrScreen();
|
||||
_display->endFrame();
|
||||
|
||||
_next_refresh = millis() + interval;
|
||||
}
|
||||
if (millis() > _auto_off) {
|
||||
_display->turnOff();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <MeshCore.h>
|
||||
#include <helpers/ui/DisplayDriver.h>
|
||||
// #include <helpers/ui/UIScreen.h>
|
||||
|
||||
class BaseUITask {
|
||||
protected:
|
||||
mesh::MainBoard* _board;
|
||||
DisplayDriver* _display;
|
||||
unsigned long _next_refresh, _auto_off;
|
||||
|
||||
BaseUITask(mesh::MainBoard* board, DisplayDriver* display) : _board(board), _display(display) { _next_refresh = 0; }
|
||||
|
||||
virtual long renderCurrScreen() = 0;
|
||||
|
||||
public:
|
||||
virtual void loop();
|
||||
};
|
||||
+58
-20
@@ -1,8 +1,8 @@
|
||||
#include "UITask.h"
|
||||
#include <helpers/TxtDataHelpers.h>
|
||||
#include "../MyMesh.h"
|
||||
#include "target.h"
|
||||
#include <time.h>
|
||||
#include <RTClib.h>
|
||||
#ifdef ENABLE_WIFI_INTERFACE
|
||||
#include <WiFi.h>
|
||||
#endif
|
||||
@@ -31,18 +31,22 @@
|
||||
#define PRESS_LABEL "long press"
|
||||
#endif
|
||||
|
||||
// Copied from simple_repeater
|
||||
#define CTL_TYPE_NODE_DISCOVER_REQ 0x80
|
||||
#define CTL_TYPE_NODE_DISCOVER_RESP 0x90
|
||||
|
||||
#include "icons.h"
|
||||
|
||||
class SplashScreen : public UIScreen {
|
||||
UITask* _task;
|
||||
unsigned long dismiss_after;
|
||||
char _version_info[12];
|
||||
const char* _build_date;
|
||||
|
||||
public:
|
||||
SplashScreen(UITask* task) : _task(task) {
|
||||
SplashScreen(UITask* task, const char* ver, const char* build_date) : _task(task) {
|
||||
// strip off dash and commit hash by changing dash to null terminator
|
||||
// e.g: v1.2.3-abcdef -> v1.2.3
|
||||
const char *ver = FIRMWARE_VERSION;
|
||||
const char *dash = strchr(ver, '-');
|
||||
|
||||
int len = dash ? dash - ver : strlen(ver);
|
||||
@@ -50,6 +54,8 @@ public:
|
||||
memcpy(_version_info, ver, len);
|
||||
_version_info[len] = 0;
|
||||
|
||||
_build_date = build_date;
|
||||
|
||||
dismiss_after = millis() + BOOT_SCREEN_MILLIS;
|
||||
}
|
||||
|
||||
@@ -74,7 +80,7 @@ public:
|
||||
|
||||
display.setColor(UIColor::secondary_txt);
|
||||
display.setTextSize(1);
|
||||
display.drawTextCentered(display.width()/2, 48, FIRMWARE_BUILD_DATE);
|
||||
display.drawTextCentered(display.width()/2, 48, _build_date);
|
||||
|
||||
return 1000;
|
||||
}
|
||||
@@ -110,6 +116,11 @@ static void formatFixAge(char* buf, size_t size, uint32_t seconds) {
|
||||
}
|
||||
#endif
|
||||
|
||||
struct AdvertPath {
|
||||
char name[32];
|
||||
uint32_t recv_timestamp;
|
||||
};
|
||||
|
||||
class HomeScreen : public UIScreen {
|
||||
enum HomePage {
|
||||
FIRST,
|
||||
@@ -140,6 +151,7 @@ class HomeScreen : public UIScreen {
|
||||
NodePrefs* _node_prefs;
|
||||
uint8_t _page;
|
||||
bool _shutdown_init;
|
||||
int recent_next_idx;
|
||||
AdvertPath recent[UI_RECENT_LIST_SIZE];
|
||||
#if UI_DISCOVER_SCREEN
|
||||
DiscoveredNode discovered[DISCOVERED_NODES_TABLE_SIZE]; // not circular, latest discovered nodes are not kept
|
||||
@@ -230,19 +242,31 @@ class HomeScreen : public UIScreen {
|
||||
public:
|
||||
HomeScreen(UITask* task, mesh::RTCClock* rtc, SensorManager* sensors, NodePrefs* node_prefs)
|
||||
: _task(task), _rtc(rtc), _sensors(sensors), _node_prefs(node_prefs), _page(0),
|
||||
_shutdown_init(false), sensors_lpp(200) { }
|
||||
_shutdown_init(false), sensors_lpp(200)
|
||||
{
|
||||
memset(recent, 0, sizeof(recent));
|
||||
recent_next_idx = 0;
|
||||
}
|
||||
|
||||
void addToRecents(ContactInfo &contact) {
|
||||
auto p = &recent[recent_next_idx];
|
||||
recent_next_idx = (recent_next_idx + 1) % UI_RECENT_LIST_SIZE;
|
||||
|
||||
strcpy(p->name, contact.name);
|
||||
p->recv_timestamp = _rtc->getCurrentTime();
|
||||
}
|
||||
|
||||
#if UI_DISCOVER_SCREEN
|
||||
bool sendDiscoverRequest() {
|
||||
uint8_t cmd_bytes[6];
|
||||
cmd_bytes[0] = CTL_TYPE_NODE_DISCOVER_REQ | 1; // DISCOVER_REQ | prefix only
|
||||
cmd_bytes[1] = 0xFF; // Repeaters
|
||||
the_mesh.getRNG()->random((uint8_t *) &disc_node_req_tag, 4); // generate random tag
|
||||
_task->getMesh()->getRNG()->random((uint8_t *) &disc_node_req_tag, 4); // generate random tag
|
||||
memcpy(&cmd_bytes[2], &disc_node_req_tag, 4);
|
||||
disc_nodes_count = 0;
|
||||
mesh::Packet* req = the_mesh.createControlData(cmd_bytes, sizeof(cmd_bytes));
|
||||
mesh::Packet* req = _task->getMesh()->createControlData(cmd_bytes, sizeof(cmd_bytes));
|
||||
if (req) {
|
||||
the_mesh.sendZeroHop(req);
|
||||
_task->getMesh()->sendZeroHop(req);
|
||||
discovery_req_time = millis();
|
||||
return true;
|
||||
}
|
||||
@@ -256,7 +280,7 @@ public:
|
||||
d->type = packet->payload[0] & 0xF;
|
||||
d->snr_out = ((int8_t)packet->payload[1]) / 4.0;
|
||||
d->snr_in = radio_driver.getLastSNR();
|
||||
ContactInfo* c = the_mesh.lookupContactByPubKey(&packet->payload[6], 8);
|
||||
ContactInfo* c = _task->getMesh()->lookupContactByPubKey(&packet->payload[6], 8);
|
||||
if (c != NULL) {
|
||||
strncpy(d->name, c->name, 32);
|
||||
} else {
|
||||
@@ -342,9 +366,9 @@ public:
|
||||
display.drawTextCentered(display.width() / 2, 43, "< Connected >");
|
||||
// CUSTOM (TeTeHacko): jen kdyz BT opravdu bezi -- jinak displej nabizi PIN
|
||||
// k parovani, ktere neni jak navazat.
|
||||
} else if (the_mesh.getBLEPin() != 0 && _task->isBluetoothEnabled()) { // BT pin
|
||||
} else if (_task->getBLEPin() != 0 && _task->isBluetoothEnabled()) { // BT pin
|
||||
display.setColor(UIColor::warning_txt);
|
||||
sprintf(tmp, "Pin:%d", the_mesh.getBLEPin());
|
||||
sprintf(tmp, "Pin:%d", _task->getBLEPin());
|
||||
if (_node_prefs->ui_show_clock) {
|
||||
display.setTextSize(1);
|
||||
display.drawTextCentered(display.width() / 2, 110, tmp);
|
||||
@@ -354,11 +378,10 @@ public:
|
||||
}
|
||||
}
|
||||
} else if (_page == HomePage::RECENT) {
|
||||
the_mesh.getRecentlyHeard(recent, UI_RECENT_LIST_SIZE);
|
||||
display.setColor(UIColor::primary_txt);
|
||||
int y = 20;
|
||||
for (int i = 0; i < UI_RECENT_LIST_SIZE; i++, y += 11) {
|
||||
auto a = &recent[i];
|
||||
for (int i = 0, k = recent_next_idx; i < UI_RECENT_LIST_SIZE; i++, y += 11, k = (k + 1) % UI_RECENT_LIST_SIZE) {
|
||||
auto a = &recent[k];
|
||||
if (a->name[0] == 0) continue; // empty slot
|
||||
int secs = _rtc->getCurrentTime() - a->recv_timestamp;
|
||||
if (secs < 60) {
|
||||
@@ -625,7 +648,15 @@ public:
|
||||
#endif
|
||||
if (c == KEY_ENTER && _page == HomePage::ADVERT) {
|
||||
_task->notify(UIEventType::ack);
|
||||
if (the_mesh.advert()) {
|
||||
|
||||
mesh::Packet* pkt;
|
||||
if (_node_prefs->advert_loc_policy == ADVERT_LOC_NONE) {
|
||||
pkt = _task->getMesh()->createSelfAdvert(_node_prefs->node_name);
|
||||
} else {
|
||||
pkt = _task->getMesh()->createSelfAdvert(_node_prefs->node_name, sensors.node_lat, sensors.node_lon);
|
||||
}
|
||||
if (pkt) {
|
||||
_task->getMesh()->sendZeroHop(pkt);
|
||||
_task->showAlert("Advert sent!", 1000);
|
||||
} else {
|
||||
_task->showAlert("Advert failed..", 1000);
|
||||
@@ -758,9 +789,14 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs) {
|
||||
void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs, MultiSerialInterface* serial,
|
||||
BaseChatMesh* mesh, uint32_t ble_pin, const char* ver, const char* build_date)
|
||||
{
|
||||
_display = display;
|
||||
_sensors = sensors;
|
||||
_interfaceManager = serial;
|
||||
the_mesh = mesh;
|
||||
_ble_pin = ble_pin;
|
||||
|
||||
#if defined(PIN_USER_BTN)
|
||||
user_btn.begin();
|
||||
@@ -793,7 +829,7 @@ void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* no
|
||||
ui_started_at = millis();
|
||||
_alert_expiry = 0;
|
||||
|
||||
splash = new SplashScreen(this);
|
||||
splash = new SplashScreen(this, ver, build_date);
|
||||
home = new HomeScreen(this, &rtc_clock, sensors, node_prefs);
|
||||
msg_preview = new MsgPreviewScreen(this, &rtc_clock);
|
||||
setCurrScreen(splash);
|
||||
@@ -890,6 +926,8 @@ void UITask::onDiscoveredContact(ContactInfo &contact, bool is_new, uint8_t path
|
||||
if (!hasConnection()) {
|
||||
notify(UIEventType::newContactMessage);
|
||||
}
|
||||
|
||||
((HomeScreen *) home)->addToRecents(contact);
|
||||
}
|
||||
|
||||
void UITask::onControlDataRecv(const mesh::Packet* packet) {
|
||||
@@ -1180,7 +1218,7 @@ char UITask::checkDisplayOn(char c) {
|
||||
|
||||
char UITask::handleLongPress(char c) {
|
||||
if (millis() - ui_started_at < 8000) { // long press in first 8 seconds since startup -> CLI/rescue
|
||||
the_mesh.enterCLIRescue();
|
||||
the_mesh->enterCLIRescue();
|
||||
c = 0; // consume event
|
||||
}
|
||||
return c;
|
||||
@@ -1225,7 +1263,7 @@ void UITask::toggleGPS() {
|
||||
_node_prefs->getGpsPrefs()->setGpsEnabled(*_sensors, true);
|
||||
notify(UIEventType::ack);
|
||||
}
|
||||
the_mesh.savePrefs();
|
||||
the_mesh->savePrefs();
|
||||
showAlert(_node_prefs->getGpsPrefs()->isGpsEnabled() ? "GPS: Enabled" : "GPS: Disabled", 800);
|
||||
_next_refresh = 0;
|
||||
break;
|
||||
@@ -1253,7 +1291,7 @@ void UITask::toggleBuzzer() {
|
||||
buzzer.quiet(true);
|
||||
}
|
||||
_node_prefs->buzzer_quiet = buzzer.isQuiet();
|
||||
the_mesh.savePrefs();
|
||||
the_mesh->savePrefs();
|
||||
showAlert(buzzer.isQuiet() ? "Buzzer: OFF" : "Buzzer: ON", 800);
|
||||
_next_refresh = 0; // trigger refresh
|
||||
#endif
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <helpers/ui/DisplayDriver.h>
|
||||
#include <helpers/ui/UIScreen.h>
|
||||
#include <helpers/SensorManager.h>
|
||||
#include <helpers/BaseChatMesh.h>
|
||||
#include <helpers/MultiSerialInterface.h>
|
||||
#include <Arduino.h>
|
||||
#include <helpers/sensors/LPPDataHelpers.h>
|
||||
@@ -19,8 +20,8 @@
|
||||
#include <helpers/ui/GenericVibration.h>
|
||||
#endif
|
||||
|
||||
#include "../AbstractUITask.h"
|
||||
#include "../NodePrefs.h"
|
||||
#include <helpers/ui/AbstractUITask.h>
|
||||
#include <helpers/CompanionNodePrefs.h>
|
||||
|
||||
#ifdef UI_NO_DISCOVER_SCREEN
|
||||
#error "UI_NO_DISCOVER_SCREEN is obsolete - use -D UI_DISCOVER_SCREEN=0 instead"
|
||||
@@ -49,6 +50,8 @@ struct DiscoveredNode {
|
||||
class UITask : public AbstractUITask {
|
||||
DisplayDriver* _display;
|
||||
SensorManager* _sensors;
|
||||
BaseChatMesh* the_mesh;
|
||||
uint32_t _ble_pin;
|
||||
#ifdef PIN_BUZZER
|
||||
genericBuzzer buzzer;
|
||||
#endif
|
||||
@@ -90,12 +93,13 @@ class UITask : public AbstractUITask {
|
||||
|
||||
public:
|
||||
|
||||
UITask(mesh::MainBoard* board, MultiSerialInterface* serial) : AbstractUITask(board, serial), _display(NULL), _sensors(NULL) {
|
||||
UITask(mesh::MainBoard* board, DisplayDriver* display = NULL) : AbstractUITask(board), _display(display), _sensors(NULL) {
|
||||
next_batt_chck = _next_refresh = 0;
|
||||
ui_started_at = 0;
|
||||
curr = NULL;
|
||||
}
|
||||
void begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs);
|
||||
void begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs, MultiSerialInterface* serial,
|
||||
BaseChatMesh* mesh, uint32_t ble_pin, const char* ver, const char* build_date);
|
||||
|
||||
void gotoHomeScreen() { setCurrScreen(home); }
|
||||
void showAlert(const char* text, int duration_millis);
|
||||
@@ -103,6 +107,9 @@ public:
|
||||
bool hasDisplay() const { return _display != NULL; }
|
||||
bool isButtonPressed() const;
|
||||
|
||||
BaseChatMesh* getMesh() const { return the_mesh; }
|
||||
uint32_t getBLEPin() const { return _ble_pin; }
|
||||
|
||||
bool isBuzzerQuiet() {
|
||||
#ifdef PIN_BUZZER
|
||||
return buzzer.isQuiet();
|
||||
@@ -116,7 +123,7 @@ public:
|
||||
void toggleGPS();
|
||||
void triggerGPS();
|
||||
|
||||
// MyMesh::Listener
|
||||
// MeshEventListener
|
||||
void onMessageRecv(mesh::Packet *pkt, const ContactInfo &from, uint8_t txt_type, uint32_t sender_timestamp, const char* text) override;
|
||||
void onChannelMessageRecv(mesh::Packet *pkt, ChannelDetails& channel_details, const char* text) override;
|
||||
void onQueueSizeChanged(int offline_queue_size) override;
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
+24
-11
@@ -1,7 +1,7 @@
|
||||
#include "UITask.h"
|
||||
#include <Arduino.h>
|
||||
#include <helpers/TxtDataHelpers.h>
|
||||
#include "../MyMesh.h"
|
||||
#include "target.h"
|
||||
|
||||
#define AUTO_OFF_MILLIS 15000 // 15 seconds
|
||||
#define BOOT_SCREEN_MILLIS 3000 // 3 seconds
|
||||
@@ -40,9 +40,15 @@ static const uint8_t meshcore_logo [] PROGMEM = {
|
||||
0xe3, 0xe3, 0x8f, 0xff, 0x1f, 0xfc, 0x3c, 0x0e, 0x1f, 0xf8, 0xff, 0xf8, 0x70, 0x3c, 0x7f, 0xf8,
|
||||
};
|
||||
|
||||
void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs) {
|
||||
void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs, MultiSerialInterface* serial,
|
||||
BaseChatMesh* mesh, uint32_t ble_pin, const char* ver, const char* build_date)
|
||||
{
|
||||
_display = display;
|
||||
_sensors = sensors;
|
||||
_interfaceManager = serial;
|
||||
the_mesh = mesh;
|
||||
_ble_pin = ble_pin;
|
||||
|
||||
_auto_off = millis() + AUTO_OFF_MILLIS;
|
||||
clearMsgPreview();
|
||||
_node_prefs = node_prefs;
|
||||
@@ -52,14 +58,14 @@ void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* no
|
||||
|
||||
// strip off dash and commit hash by changing dash to null terminator
|
||||
// e.g: v1.2.3-abcdef -> v1.2.3
|
||||
char *version = strdup(FIRMWARE_VERSION);
|
||||
char *version = strdup(ver);
|
||||
char *dash = strchr(version, '-');
|
||||
if (dash) {
|
||||
*dash = 0;
|
||||
}
|
||||
|
||||
// v1.2.3 (1 Jan 2025)
|
||||
sprintf(_version_info, "%s (%s)", version, FIRMWARE_BUILD_DATE);
|
||||
sprintf(_version_info, "%s (%s)", version, build_date);
|
||||
|
||||
#ifdef PIN_BUZZER
|
||||
buzzer.begin();
|
||||
@@ -300,11 +306,11 @@ void UITask::renderCurrScreen() {
|
||||
_display->print(tmp);
|
||||
|
||||
// BT pin
|
||||
if (!hasConnection() && the_mesh.getBLEPin() != 0) {
|
||||
if (!hasConnection() && _ble_pin != 0) {
|
||||
_display->setColor(UIColor::warning_txt);
|
||||
_display->setTextSize(2);
|
||||
_display->setCursor(0, 43);
|
||||
sprintf(tmp, "Pin:%d", the_mesh.getBLEPin());
|
||||
sprintf(tmp, "Pin:%d", _ble_pin);
|
||||
_display->print(tmp);
|
||||
_display->setColor(UIColor::primary_txt);
|
||||
} else {
|
||||
@@ -555,7 +561,14 @@ void UITask::handleButtonDoublePress() {
|
||||
#ifdef PIN_BUZZER
|
||||
notify(UIEventType::ack);
|
||||
#endif
|
||||
if (the_mesh.advert()) {
|
||||
mesh::Packet* pkt;
|
||||
if (_node_prefs->advert_loc_policy == ADVERT_LOC_NONE) {
|
||||
pkt = the_mesh->createSelfAdvert(_node_prefs->node_name);
|
||||
} else {
|
||||
pkt = the_mesh->createSelfAdvert(_node_prefs->node_name, sensors.node_lat, sensors.node_lon);
|
||||
}
|
||||
if (pkt) {
|
||||
the_mesh->sendZeroHop(pkt);
|
||||
MESH_DEBUG_PRINTLN("Advert sent!");
|
||||
sprintf(_alert, "Advert sent!");
|
||||
} else {
|
||||
@@ -584,7 +597,7 @@ void UITask::handleButtonTriplePress() {
|
||||
case 2: sprintf(_alert, "Alerts: Vibe only"); break;
|
||||
default: sprintf(_alert, "Alerts: Silent"); break;
|
||||
}
|
||||
the_mesh.savePrefs();
|
||||
the_mesh->savePrefs();
|
||||
_need_refresh = true;
|
||||
#elif defined(PIN_BUZZER)
|
||||
if (buzzer.isQuiet()) {
|
||||
@@ -596,7 +609,7 @@ void UITask::handleButtonTriplePress() {
|
||||
sprintf(_alert, "Buzzer: OFF");
|
||||
}
|
||||
_node_prefs->buzzer_quiet = buzzer.isQuiet();
|
||||
the_mesh.savePrefs();
|
||||
the_mesh->savePrefs();
|
||||
_need_refresh = true;
|
||||
#endif
|
||||
}
|
||||
@@ -617,7 +630,7 @@ void UITask::handleButtonQuadruplePress() {
|
||||
notify(UIEventType::ack);
|
||||
sprintf(_alert, "GPS: Enabled");
|
||||
}
|
||||
the_mesh.savePrefs();
|
||||
the_mesh->savePrefs();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -628,7 +641,7 @@ void UITask::handleButtonQuadruplePress() {
|
||||
void UITask::handleButtonLongPress() {
|
||||
MESH_DEBUG_PRINTLN("UITask: long press triggered");
|
||||
if (millis() - ui_started_at < 8000) { // long press in first 8 seconds since startup -> CLI/rescue
|
||||
the_mesh.enterCLIRescue();
|
||||
the_mesh->enterCLIRescue();
|
||||
} else {
|
||||
shutdown();
|
||||
}
|
||||
@@ -3,14 +3,15 @@
|
||||
#include <MeshCore.h>
|
||||
#include <helpers/ui/DisplayDriver.h>
|
||||
#include <helpers/SensorManager.h>
|
||||
#include <helpers/BaseChatMesh.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef PIN_BUZZER
|
||||
#include <helpers/ui/buzzer.h>
|
||||
#endif
|
||||
|
||||
#include "../AbstractUITask.h"
|
||||
#include "../NodePrefs.h"
|
||||
#include <helpers/ui/AbstractUITask.h>
|
||||
#include <helpers/CompanionNodePrefs.h>
|
||||
|
||||
#include "Button.h"
|
||||
|
||||
@@ -21,6 +22,8 @@
|
||||
class UITask : public AbstractUITask {
|
||||
DisplayDriver* _display;
|
||||
SensorManager* _sensors;
|
||||
BaseChatMesh* the_mesh;
|
||||
uint32_t _ble_pin;
|
||||
#ifdef PIN_BUZZER
|
||||
genericBuzzer buzzer;
|
||||
#endif
|
||||
@@ -57,20 +60,20 @@ class UITask : public AbstractUITask {
|
||||
void handleButtonTriplePress();
|
||||
void handleButtonQuadruplePress();
|
||||
void handleButtonLongPress();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
UITask(mesh::MainBoard* board, MultiSerialInterface* serial) : AbstractUITask(board, serial), _display(NULL), _sensors(NULL) {
|
||||
UITask(mesh::MainBoard* board, DisplayDriver* display = NULL) : AbstractUITask(board), _display(display), _sensors(NULL) {
|
||||
_next_refresh = 0;
|
||||
ui_started_at = 0;
|
||||
}
|
||||
void begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs);
|
||||
void begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs, MultiSerialInterface* serial,
|
||||
BaseChatMesh* mesh, uint32_t ble_pin, const char* ver, const char* build_date);
|
||||
|
||||
bool hasDisplay() const { return _display != NULL; }
|
||||
void clearMsgPreview();
|
||||
|
||||
// MyMesh::Listener
|
||||
// MeshEventListener
|
||||
void onMessageRecv(mesh::Packet *pkt, const ContactInfo &from, uint8_t txt_type, uint32_t sender_timestamp, const char* text) override;
|
||||
void onChannelMessageRecv(mesh::Packet *pkt, ChannelDetails& channel_details, const char* text) override;
|
||||
void onQueueSizeChanged(int offline_queue_size) override;
|
||||
File renamed without changes.
+47
-17
@@ -1,6 +1,5 @@
|
||||
#include "UITask.h"
|
||||
#include <helpers/TxtDataHelpers.h>
|
||||
#include "../MyMesh.h"
|
||||
#include "target.h"
|
||||
#include "u8g2_icons.h"
|
||||
|
||||
@@ -36,12 +35,12 @@ class SplashScreen : public UIScreen {
|
||||
unsigned long dismiss_after;
|
||||
unsigned long version_after;
|
||||
char _version_info[12];
|
||||
const char* _build_date;
|
||||
|
||||
public:
|
||||
SplashScreen(UITask* task) : _task(task) {
|
||||
SplashScreen(UITask* task, const char* ver, const char* build_date) : _task(task) {
|
||||
// strip off dash and commit hash by changing dash to null terminator
|
||||
// e.g: v1.2.3-abcdef -> v1.2.3
|
||||
const char *ver = FIRMWARE_VERSION;
|
||||
const char *dash = strchr(ver, '-');
|
||||
|
||||
int len = dash ? dash - ver : strlen(ver);
|
||||
@@ -49,6 +48,8 @@ public:
|
||||
memcpy(_version_info, ver, len);
|
||||
_version_info[len] = 0;
|
||||
|
||||
_build_date = build_date;
|
||||
|
||||
version_after = millis() + BOOT_SCREEN_MILLIS / 2;
|
||||
dismiss_after = millis() + BOOT_SCREEN_MILLIS;
|
||||
}
|
||||
@@ -75,7 +76,7 @@ public:
|
||||
|
||||
display.setColor(UIColor::secondary_txt);
|
||||
display.setTextSize(1);
|
||||
display.drawTextCentered(display.width()/2, 27, FIRMWARE_BUILD_DATE);
|
||||
display.drawTextCentered(display.width()/2, 27, _build_date);
|
||||
}
|
||||
return 1000;
|
||||
}
|
||||
@@ -87,6 +88,11 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
struct AdvertPath {
|
||||
char name[32];
|
||||
uint32_t recv_timestamp;
|
||||
};
|
||||
|
||||
class HomeScreen : public UIScreen {
|
||||
enum HomePage {
|
||||
FIRST,
|
||||
@@ -110,6 +116,7 @@ class HomeScreen : public UIScreen {
|
||||
NodePrefs* _node_prefs;
|
||||
uint8_t _page;
|
||||
bool _shutdown_init;
|
||||
int recent_next_idx;
|
||||
AdvertPath recent[UI_RECENT_LIST_SIZE];
|
||||
|
||||
CayenneLPP sensors_lpp;
|
||||
@@ -142,7 +149,19 @@ class HomeScreen : public UIScreen {
|
||||
public:
|
||||
HomeScreen(UITask* task, mesh::RTCClock* rtc, SensorManager* sensors, NodePrefs* node_prefs)
|
||||
: _task(task), _rtc(rtc), _sensors(sensors), _node_prefs(node_prefs), _page(0),
|
||||
_shutdown_init(false), sensors_lpp(200) { }
|
||||
_shutdown_init(false), sensors_lpp(200)
|
||||
{
|
||||
memset(recent, 0, sizeof(recent));
|
||||
recent_next_idx = 0;
|
||||
}
|
||||
|
||||
void addToRecents(ContactInfo &contact) {
|
||||
auto p = &recent[recent_next_idx];
|
||||
recent_next_idx = (recent_next_idx + 1) % UI_RECENT_LIST_SIZE;
|
||||
|
||||
strcpy(p->name, contact.name);
|
||||
p->recv_timestamp = _rtc->getCurrentTime();
|
||||
}
|
||||
|
||||
void poll() override {
|
||||
if (_shutdown_init && !_task->isButtonPressed()) { // must wait for USR button to be released
|
||||
@@ -184,18 +203,17 @@ public:
|
||||
display.setTextSize(1);
|
||||
display.drawTextCentered(display.width() / 2, display.height()-8, "< Connected >");
|
||||
|
||||
} else if (the_mesh.getBLEPin() != 0) { // BT pin
|
||||
} else if (_task->getBLEPin() != 0) { // BT pin
|
||||
display.setColor(UIColor::warning_txt);
|
||||
display.setTextSize(2);
|
||||
sprintf(tmp, "Pin:%d", the_mesh.getBLEPin());
|
||||
sprintf(tmp, "Pin:%d", _task->getBLEPin());
|
||||
display.drawTextCentered(display.width() / 2, display.height()-8, tmp);
|
||||
}
|
||||
} else if (_page == HomePage::RECENT) {
|
||||
the_mesh.getRecentlyHeard(recent, UI_RECENT_LIST_SIZE);
|
||||
display.setColor(UIColor::primary_txt);
|
||||
int y = 8;
|
||||
for (int i = 0; i < UI_RECENT_LIST_SIZE; i++, y += 11) {
|
||||
auto a = &recent[i];
|
||||
for (int i = 0, k = recent_next_idx; i < UI_RECENT_LIST_SIZE; i++, y += 11, k = (k + 1) % UI_RECENT_LIST_SIZE) {
|
||||
auto a = &recent[k];
|
||||
if (a->name[0] == 0) continue; // empty slot
|
||||
int secs = _rtc->getCurrentTime() - a->recv_timestamp;
|
||||
if (secs < 60) {
|
||||
@@ -400,7 +418,14 @@ public:
|
||||
}
|
||||
if (c == KEY_ENTER && _page == HomePage::ADVERT) {
|
||||
_task->notify(UIEventType::ack);
|
||||
if (the_mesh.advert()) {
|
||||
mesh::Packet* pkt;
|
||||
if (_node_prefs->advert_loc_policy == ADVERT_LOC_NONE) {
|
||||
pkt = _task->getMesh()->createSelfAdvert(_node_prefs->node_name);
|
||||
} else {
|
||||
pkt = _task->getMesh()->createSelfAdvert(_node_prefs->node_name, sensors.node_lat, sensors.node_lon);
|
||||
}
|
||||
if (pkt) {
|
||||
_task->getMesh()->sendZeroHop(pkt);
|
||||
_task->showAlert("Advert sent!", 1000);
|
||||
} else {
|
||||
_task->showAlert("Advert failed..", 1000);
|
||||
@@ -428,10 +453,14 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs) {
|
||||
void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs, MultiSerialInterface* serial,
|
||||
BaseChatMesh* mesh, uint32_t ble_pin, const char* ver, const char* build_date)
|
||||
{
|
||||
_display = display;
|
||||
_sensors = sensors;
|
||||
_interfaceManager = serial;
|
||||
the_mesh = mesh;
|
||||
_ble_pin = ble_pin;
|
||||
_auto_off = millis() + AUTO_OFF_MILLIS;
|
||||
_cached_batt_mv = getBattMilliVolts();
|
||||
|
||||
@@ -463,7 +492,7 @@ void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* no
|
||||
ui_started_at = millis();
|
||||
_alert_expiry = 0;
|
||||
|
||||
splash = new SplashScreen(this);
|
||||
splash = new SplashScreen(this, ver, build_date);
|
||||
home = new HomeScreen(this, &rtc_clock, sensors, node_prefs);
|
||||
setCurrScreen(splash);
|
||||
}
|
||||
@@ -547,6 +576,7 @@ void UITask::onDiscoveredContact(ContactInfo &contact, bool is_new, uint8_t path
|
||||
if (!hasConnection()) {
|
||||
notify(UIEventType::newContactMessage);
|
||||
}
|
||||
((HomeScreen *) home)->addToRecents(contact);
|
||||
}
|
||||
|
||||
void UITask::userLedHandler() {
|
||||
@@ -794,7 +824,7 @@ char UITask::checkDisplayOn(char c) {
|
||||
|
||||
char UITask::handleLongPress(char c) {
|
||||
if (millis() - ui_started_at < 8000) { // long press in first 8 seconds since startup -> CLI/rescue
|
||||
the_mesh.enterCLIRescue();
|
||||
the_mesh->enterCLIRescue();
|
||||
c = 0; // consume event
|
||||
}
|
||||
return c;
|
||||
@@ -839,7 +869,7 @@ void UITask::toggleGPS() {
|
||||
_node_prefs->getGpsPrefs()->setGpsEnabled(*_sensors, true);
|
||||
notify(UIEventType::ack);
|
||||
}
|
||||
the_mesh.savePrefs();
|
||||
the_mesh->savePrefs();
|
||||
showAlert(_node_prefs->getGpsPrefs()->isGpsEnabled() ? "GPS: Enabled" : "GPS: Disabled", 800);
|
||||
_next_refresh = 0;
|
||||
break;
|
||||
@@ -858,7 +888,7 @@ void UITask::toggleBuzzer() {
|
||||
buzzer.quiet(true);
|
||||
}
|
||||
_node_prefs->buzzer_quiet = buzzer.isQuiet();
|
||||
the_mesh.savePrefs();
|
||||
the_mesh->savePrefs();
|
||||
showAlert(buzzer.isQuiet() ? "Buzzer: OFF" : "Buzzer: ON", 800);
|
||||
_next_refresh = 0; // trigger refresh
|
||||
#endif
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <helpers/ui/DisplayDriver.h>
|
||||
#include <helpers/ui/UIScreen.h>
|
||||
#include <helpers/SensorManager.h>
|
||||
#include <helpers/BaseChatMesh.h>
|
||||
#include <helpers/MultiSerialInterface.h>
|
||||
#include <Arduino.h>
|
||||
#include <helpers/sensors/LPPDataHelpers.h>
|
||||
@@ -22,12 +23,14 @@
|
||||
#include <helpers/ui/GenericVibration.h>
|
||||
#endif
|
||||
|
||||
#include "../AbstractUITask.h"
|
||||
#include "../NodePrefs.h"
|
||||
#include <helpers/ui/AbstractUITask.h>
|
||||
#include <helpers/CompanionNodePrefs.h>
|
||||
|
||||
class UITask : public AbstractUITask {
|
||||
DisplayDriver* _display;
|
||||
SensorManager* _sensors;
|
||||
BaseChatMesh* the_mesh;
|
||||
uint32_t _ble_pin;
|
||||
ScrollingStatusBar _statusBar;
|
||||
#ifdef PIN_BUZZER
|
||||
genericBuzzer buzzer;
|
||||
@@ -71,13 +74,14 @@ class UITask : public AbstractUITask {
|
||||
|
||||
public:
|
||||
|
||||
UITask(mesh::MainBoard* board, MultiSerialInterface* serial) : AbstractUITask(board, serial), _display(NULL), _sensors(NULL) {
|
||||
UITask(mesh::MainBoard* board, DisplayDriver* display = NULL) : AbstractUITask(board), _display(display), _sensors(NULL) {
|
||||
next_batt_chck = _next_refresh = 0;
|
||||
_cached_batt_mv = 0;
|
||||
ui_started_at = 0;
|
||||
curr = NULL;
|
||||
}
|
||||
void begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs);
|
||||
void begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs, MultiSerialInterface* serial,
|
||||
BaseChatMesh* mesh, uint32_t ble_pin, const char* ver, const char* build_date);
|
||||
|
||||
void gotoHomeScreen() { setCurrScreen(home); }
|
||||
void showAlert(const char* text, int duration_millis);
|
||||
@@ -86,6 +90,9 @@ public:
|
||||
bool hasDisplay() const { return _display != NULL; }
|
||||
bool isButtonPressed() const;
|
||||
|
||||
BaseChatMesh* getMesh() const { return the_mesh; }
|
||||
uint32_t getBLEPin() const { return _ble_pin; }
|
||||
|
||||
bool isBuzzerQuiet() {
|
||||
#ifdef PIN_BUZZER
|
||||
return buzzer.isQuiet();
|
||||
@@ -98,7 +105,7 @@ public:
|
||||
bool getGPSState();
|
||||
void toggleGPS();
|
||||
|
||||
// MyMesh::Listener
|
||||
// MeshEventListener
|
||||
void onMessageRecv(mesh::Packet *pkt, const ContactInfo &from, uint8_t txt_type, uint32_t sender_timestamp, const char* text) override;
|
||||
void onChannelMessageRecv(mesh::Packet *pkt, ChannelDetails& channel_details, const char* text) override;
|
||||
void onQueueSizeChanged(int offline_queue_size) override;
|
||||
File renamed without changes.
@@ -29,7 +29,7 @@ static const uint8_t meshcore_logo [] PROGMEM = {
|
||||
0xe3, 0xe3, 0x8f, 0xff, 0x1f, 0xfc, 0x3c, 0x0e, 0x1f, 0xf8, 0xff, 0xf8, 0x70, 0x3c, 0x7f, 0xf8,
|
||||
};
|
||||
|
||||
void UITask::begin(NodePrefs* node_prefs, const char* build_date, const char* firmware_version) {
|
||||
void UITask::begin(NodePrefs* node_prefs, const char* build_date, const char* firmware_version, const char* role_lbl) {
|
||||
_prevBtnState = HIGH;
|
||||
_auto_off = millis() + AUTO_OFF_MILLIS;
|
||||
_started_at = millis();
|
||||
@@ -44,16 +44,18 @@ void UITask::begin(NodePrefs* node_prefs, const char* build_date, const char* fi
|
||||
// e.g: v1.2.3-abcdef -> v1.2.3
|
||||
char *version = strdup(firmware_version);
|
||||
char *dash = strchr(version, '-');
|
||||
if(dash){
|
||||
if (dash){
|
||||
*dash = 0;
|
||||
}
|
||||
|
||||
// v1.2.3 (1 Jan 2025)
|
||||
snprintf(_version_info, sizeof(_version_info), "%s (%s)", version, build_date);
|
||||
free(version);
|
||||
|
||||
_role_label = role_lbl;
|
||||
}
|
||||
|
||||
void UITask::renderCurrScreen() {
|
||||
long UITask::renderCurrScreen() {
|
||||
char tmp[80];
|
||||
if (millis() < _started_at + BOOT_SCREEN_MILLIS) { // boot screen
|
||||
// meshcore logo
|
||||
@@ -72,8 +74,7 @@ void UITask::renderCurrScreen() {
|
||||
_display->drawTextCentered(_display->width() / 2, 35, _version_info);
|
||||
|
||||
// node type
|
||||
const char* node_type = "< Repeater >";
|
||||
_display->drawTextCentered(_display->width() / 2, 48, node_type);
|
||||
_display->drawTextCentered(_display->width() / 2, 48, _role_label);
|
||||
} else if (_powering_off_at > 0) {
|
||||
// meshcore logo
|
||||
_display->setColor(UIColor::corp_blue);
|
||||
@@ -107,6 +108,7 @@ void UITask::renderCurrScreen() {
|
||||
sprintf(tmp, "BW: %03.2f CR: %d", _node_prefs->bw, _node_prefs->cr);
|
||||
_display->print(tmp);
|
||||
}
|
||||
return 1000; // 1 sec interval
|
||||
}
|
||||
|
||||
void UITask::loop() {
|
||||
@@ -126,18 +128,7 @@ void UITask::loop() {
|
||||
}
|
||||
#endif
|
||||
|
||||
if (_display->isOn()) {
|
||||
if (millis() >= _next_refresh) {
|
||||
_display->startFrame();
|
||||
renderCurrScreen();
|
||||
_display->endFrame();
|
||||
|
||||
_next_refresh = millis() + 1000; // refresh every second
|
||||
}
|
||||
if (millis() > _auto_off) {
|
||||
_display->turnOff();
|
||||
}
|
||||
}
|
||||
BaseUITask::loop();
|
||||
|
||||
if (_powering_off_at > 0) { // power off timer armed
|
||||
#if defined(LED_PIN) && defined(LED_STATE_ON)
|
||||
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <helpers/ui/BaseUITask.h>
|
||||
#include <helpers/CommonCLI.h>
|
||||
|
||||
class UITask : public BaseUITask {
|
||||
unsigned long _next_read;
|
||||
int _prevBtnState;
|
||||
NodePrefs* _node_prefs;
|
||||
char _version_info[32];
|
||||
const char* _role_label;
|
||||
unsigned long _powering_off_at = 0;
|
||||
unsigned long _started_at = 0;
|
||||
|
||||
protected:
|
||||
long renderCurrScreen() override;
|
||||
|
||||
public:
|
||||
UITask(mesh::MainBoard* board, DisplayDriver* display) : BaseUITask(board, display) { _next_read = 0; }
|
||||
void begin(NodePrefs* node_prefs, const char* build_date, const char* firmware_version, const char* role_lbl);
|
||||
|
||||
void loop() override;
|
||||
};
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
#include "../../examples/companion_radio/NodePrefs.h"
|
||||
#include "../../src/helpers/CompanionNodePrefs.h"
|
||||
|
||||
class ReplayStream : public Stream {
|
||||
const char* _text;
|
||||
|
||||
@@ -52,7 +52,7 @@ extends = DFRobot_LoRaWAN_ESP32S3
|
||||
build_flags =
|
||||
${DFRobot_LoRaWAN_ESP32S3.build_flags}
|
||||
-I src/helpers/ui
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_ROTATION=3
|
||||
-D DISPLAY_CLASS=ST7735Display
|
||||
-D MAX_CONTACTS=350
|
||||
@@ -67,7 +67,7 @@ build_src_filter = ${DFRobot_LoRaWAN_ESP32S3.build_src_filter}
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/ST7735Display.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${DFRobot_LoRaWAN_ESP32S3.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -19,6 +19,7 @@ SensorManager sensors;
|
||||
DISPLAY_CLASS display(&board.periph_power);
|
||||
// Active-low button, internal pull-up.
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true, true);
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/ST7735Display.h>
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#include <UITask.h>
|
||||
#endif
|
||||
|
||||
extern DFRobotLoRaBoard board;
|
||||
@@ -20,6 +21,7 @@ extern SensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern MomentaryButton user_btn;
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
||||
@@ -37,6 +37,7 @@ build_flags =
|
||||
-D SX126X_RX_BOOSTED_GAIN=1
|
||||
build_src_filter = ${esp32_base.build_src_filter}
|
||||
+<../variants/ebyte_eora_s3>
|
||||
+<helpers/ui/BaseUITask.cpp>
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
adafruit/Adafruit SSD1306 @ ^2.5.13
|
||||
@@ -46,6 +47,7 @@ lib_deps =
|
||||
extends = Ebyte_EoRa-S3
|
||||
build_flags =
|
||||
${Ebyte_EoRa-S3.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"EORA_S3-1262 Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -57,6 +59,7 @@ build_flags =
|
||||
build_src_filter = ${Ebyte_EoRa-S3.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Ebyte_EoRa-S3.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -79,6 +82,7 @@ lib_deps =
|
||||
extends = Ebyte_EoRa-S3
|
||||
build_flags =
|
||||
${Ebyte_EoRa-S3.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"EORA_S3-1262 Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -90,6 +94,7 @@ build_flags =
|
||||
build_src_filter = ${Ebyte_EoRa-S3.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<../examples/simple_room_server>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Ebyte_EoRa-S3.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -98,7 +103,7 @@ lib_deps =
|
||||
extends = Ebyte_EoRa-S3
|
||||
build_flags =
|
||||
${Ebyte_EoRa-S3.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -109,7 +114,7 @@ build_src_filter = ${Ebyte_EoRa-S3.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Ebyte_EoRa-S3.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -118,7 +123,7 @@ lib_deps =
|
||||
extends = Ebyte_EoRa-S3
|
||||
build_flags =
|
||||
${Ebyte_EoRa-S3.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -132,7 +137,7 @@ build_src_filter = ${Ebyte_EoRa-S3.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Ebyte_EoRa-S3.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
@@ -19,6 +19,7 @@ SensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
#ifndef LORA_CR
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/SSD1306Display.h>
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#include <UITask.h>
|
||||
#endif
|
||||
|
||||
extern ESP32Board board;
|
||||
@@ -20,6 +21,7 @@ extern SensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern MomentaryButton user_btn;
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
||||
@@ -23,6 +23,7 @@ build_src_filter = ${nrf52_base.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/sensors>
|
||||
+<helpers/ui/BaseUITask.cpp>
|
||||
lib_deps =
|
||||
${nrf52_base.lib_deps}
|
||||
${sensor_base.lib_deps}
|
||||
@@ -34,7 +35,7 @@ lib_deps =
|
||||
extends = GAT562_30S_Mesh_Kit
|
||||
build_flags =
|
||||
${GAT562_30S_Mesh_Kit.build_flags}
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"GAT562 Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -45,12 +46,14 @@ build_flags =
|
||||
build_src_filter = ${GAT562_30S_Mesh_Kit.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
|
||||
|
||||
[env:GAT562_30S_Mesh_Kit_room_server]
|
||||
extends = GAT562_30S_Mesh_Kit
|
||||
build_flags =
|
||||
${GAT562_30S_Mesh_Kit.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"GAT562 Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -62,6 +65,7 @@ build_flags =
|
||||
build_src_filter = ${GAT562_30S_Mesh_Kit.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<../examples/simple_room_server>
|
||||
+<helpers/ui/server>
|
||||
|
||||
|
||||
[env:GAT562_30S_Mesh_Kit_companion_radio_usb]
|
||||
@@ -70,7 +74,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${GAT562_30S_Mesh_Kit.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -79,7 +83,7 @@ build_flags =
|
||||
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
|
||||
build_src_filter = ${GAT562_30S_Mesh_Kit.build_src_filter}
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
lib_deps =
|
||||
${GAT562_30S_Mesh_Kit.lib_deps}
|
||||
@@ -93,7 +97,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${GAT562_30S_Mesh_Kit.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -106,7 +110,7 @@ build_src_filter = ${GAT562_30S_Mesh_Kit.build_src_filter}
|
||||
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${GAT562_30S_Mesh_Kit.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
@@ -15,6 +15,7 @@ GAT56230SMeshKitBoard board;
|
||||
MomentaryButton joystick_left(JOYSTICK_LEFT, 1000, true, false, false);
|
||||
MomentaryButton joystick_right(JOYSTICK_RIGHT, 1000, true, false, false);
|
||||
MomentaryButton back_btn(PIN_BACK_BTN, 1000, true, false, true);
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -10,12 +10,14 @@
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/SSD1306Display.h>
|
||||
#include <UITask.h>
|
||||
extern DISPLAY_CLASS display;
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
extern MomentaryButton user_btn;
|
||||
extern MomentaryButton joystick_left;
|
||||
extern MomentaryButton joystick_right;
|
||||
extern MomentaryButton back_btn;
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
extern GAT56230SMeshKitBoard board;
|
||||
|
||||
@@ -12,8 +12,8 @@ GAT562EVBProBoard board;
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true, false, false);
|
||||
|
||||
MomentaryButton back_btn(PIN_BACK_BTN, 1000, true, false, true);
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -10,11 +10,13 @@
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/SSD1306Display.h>
|
||||
#include <UITask.h>
|
||||
extern DISPLAY_CLASS display;
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
extern MomentaryButton user_btn;
|
||||
|
||||
extern MomentaryButton back_btn;
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
extern GAT562EVBProBoard board;
|
||||
|
||||
@@ -19,6 +19,7 @@ build_src_filter = ${nrf52_base.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/sensors>
|
||||
+<helpers/ui/BaseUITask.cpp>
|
||||
lib_deps =
|
||||
${nrf52_base.lib_deps}
|
||||
${sensor_base.lib_deps}
|
||||
@@ -30,6 +31,7 @@ lib_deps =
|
||||
extends = GAT562_Mesh_Tracker_Pro
|
||||
build_flags =
|
||||
${GAT562_Mesh_Tracker_Pro.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"GAT562 Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -41,12 +43,14 @@ build_flags =
|
||||
build_src_filter = ${GAT562_Mesh_Tracker_Pro.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
|
||||
|
||||
[env:GAT562_Mesh_Tracker_Pro_room_server]
|
||||
extends = GAT562_Mesh_Tracker_Pro
|
||||
build_flags =
|
||||
${GAT562_Mesh_Tracker_Pro.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"GAT562 Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -58,6 +62,7 @@ build_flags =
|
||||
build_src_filter = ${GAT562_Mesh_Tracker_Pro.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<../examples/simple_room_server>
|
||||
+<helpers/ui/server>
|
||||
|
||||
|
||||
[env:GAT562_Mesh_Tracker_Pro_companion_radio_usb]
|
||||
@@ -66,7 +71,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${GAT562_Mesh_Tracker_Pro.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -75,7 +80,7 @@ build_flags =
|
||||
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
|
||||
build_src_filter = ${GAT562_Mesh_Tracker_Pro.build_src_filter}
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${GAT562_Mesh_Tracker_Pro.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -88,7 +93,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${GAT562_Mesh_Tracker_Pro.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -101,7 +106,7 @@ build_src_filter = ${GAT562_Mesh_Tracker_Pro.build_src_filter}
|
||||
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${GAT562_Mesh_Tracker_Pro.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
@@ -15,6 +15,7 @@ GAT562MeshTrackerProBoard board;
|
||||
MomentaryButton joystick_left(JOYSTICK_LEFT, 1000, true, false, false);
|
||||
MomentaryButton joystick_right(JOYSTICK_RIGHT, 1000, true, false, false);
|
||||
MomentaryButton back_btn(PIN_BACK_BTN, 1000, true, false, true);
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/SSD1306Display.h>
|
||||
#include <UITask.h>
|
||||
extern DISPLAY_CLASS display;
|
||||
extern UITask ui_task;
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
extern MomentaryButton user_btn;
|
||||
extern MomentaryButton joystick_left;
|
||||
|
||||
@@ -22,6 +22,7 @@ build_src_filter = ${nrf52_base.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/sensors>
|
||||
+<helpers/ui/BaseUITask.cpp>
|
||||
lib_deps =
|
||||
${nrf52_base.lib_deps}
|
||||
${sensor_base.lib_deps}
|
||||
@@ -66,7 +67,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${GAT562_Mesh_Watch13.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -81,7 +82,7 @@ build_src_filter = ${GAT562_Mesh_Watch13.build_src_filter}
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/GenericVibration.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${GAT562_Mesh_Watch13.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
@@ -12,6 +12,7 @@ GAT56MeshWatch13Board board;
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true, false, true);
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/SSD1306Display.h>
|
||||
#include <UITask.h>
|
||||
extern UITask ui_task;
|
||||
extern DISPLAY_CLASS display;
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
extern MomentaryButton user_btn;
|
||||
|
||||
@@ -37,6 +37,7 @@ build_flags =
|
||||
-D DISP_MOSI=6
|
||||
build_src_filter = ${esp32_base.build_src_filter}
|
||||
+<../variants/heltec_e213>
|
||||
+<helpers/ui/BaseUITask.cpp>
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
https://github.com/Quency-D/heltec-eink-modules/archive/563dd41fd850a1bc3039b8723da4f3a20fe1c800.zip
|
||||
@@ -45,7 +46,7 @@ lib_deps =
|
||||
extends = Heltec_E213_base
|
||||
build_flags =
|
||||
${Heltec_E213_base.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D DISPLAY_CLASS=E213Display
|
||||
@@ -57,7 +58,7 @@ build_src_filter = ${Heltec_E213_base.build_src_filter}
|
||||
+<helpers/ui/E213Display.cpp>
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_E213_base.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -67,7 +68,7 @@ lib_deps =
|
||||
extends = Heltec_E213_base
|
||||
build_flags =
|
||||
${Heltec_E213_base.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D DISPLAY_CLASS=E213Display
|
||||
@@ -78,7 +79,7 @@ build_src_filter = ${Heltec_E213_base.build_src_filter}
|
||||
+<helpers/ui/E213Display.cpp>
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_E213_base.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -88,6 +89,7 @@ lib_deps =
|
||||
extends = Heltec_E213_base
|
||||
build_flags =
|
||||
${Heltec_E213_base.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=E213Display
|
||||
-D ADVERT_NAME='"Heltec E213 Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -97,6 +99,7 @@ build_flags =
|
||||
build_src_filter = ${Heltec_E213_base.build_src_filter}
|
||||
+<helpers/ui/E213Display.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_E213_base.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -131,6 +134,7 @@ lib_deps =
|
||||
extends = Heltec_E213_base
|
||||
build_flags =
|
||||
${Heltec_E213_base.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=E213Display
|
||||
-D ADVERT_NAME='"ESPNow Bridge"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -145,6 +149,7 @@ build_src_filter = ${Heltec_E213_base.build_src_filter}
|
||||
+<helpers/bridges/ESPNowBridge.cpp>
|
||||
+<helpers/ui/E213Display.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_E213_base.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -154,6 +159,7 @@ lib_deps =
|
||||
extends = Heltec_E213_base
|
||||
build_flags =
|
||||
${Heltec_E213_base.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=E213Display
|
||||
-D ADVERT_NAME='"Heltec E213 Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -163,6 +169,7 @@ build_flags =
|
||||
build_src_filter = ${Heltec_E213_base.build_src_filter}
|
||||
+<helpers/ui/E213Display.cpp>
|
||||
+<../examples/simple_room_server>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_E213_base.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
@@ -20,6 +20,7 @@ SensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display(&board.periph_power);
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/E213Display.h>
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#include <UITask.h>
|
||||
#endif
|
||||
|
||||
extern HeltecE213Board board;
|
||||
@@ -20,6 +21,7 @@ extern SensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern MomentaryButton user_btn;
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
||||
@@ -31,6 +31,7 @@ build_flags =
|
||||
-D PIN_BOARD_SCL=38
|
||||
build_src_filter = ${esp32_base.build_src_filter}
|
||||
+<../variants/heltec_e290>
|
||||
+<helpers/ui/BaseUITask.cpp>
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
https://github.com/Quency-D/heltec-eink-modules/archive/563dd41fd850a1bc3039b8723da4f3a20fe1c800.zip
|
||||
@@ -39,7 +40,7 @@ lib_deps =
|
||||
extends = Heltec_E290_base
|
||||
build_flags =
|
||||
${Heltec_E290_base.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D DISPLAY_CLASS=E290Display
|
||||
@@ -51,7 +52,7 @@ build_src_filter = ${Heltec_E290_base.build_src_filter}
|
||||
+<helpers/ui/E290Display.cpp>
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_E290_base.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -61,7 +62,7 @@ lib_deps =
|
||||
extends = Heltec_E290_base
|
||||
build_flags =
|
||||
${Heltec_E290_base.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D DISPLAY_CLASS=E290Display
|
||||
@@ -72,7 +73,7 @@ build_src_filter = ${Heltec_E290_base.build_src_filter}
|
||||
+<helpers/ui/E290Display.cpp>
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_E290_base.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -82,6 +83,7 @@ lib_deps =
|
||||
extends = Heltec_E290_base
|
||||
build_flags =
|
||||
${Heltec_E290_base.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=E290Display
|
||||
-D ADVERT_NAME='"Heltec E290 Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -91,6 +93,7 @@ build_flags =
|
||||
build_src_filter = ${Heltec_E290_base.build_src_filter}
|
||||
+<helpers/ui/E290Display.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_E290_base.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -125,6 +128,7 @@ lib_deps =
|
||||
extends = Heltec_E290_base
|
||||
build_flags =
|
||||
${Heltec_E290_base.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=E290Display
|
||||
-D ADVERT_NAME='"ESPNow Bridge"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -139,6 +143,7 @@ build_src_filter = ${Heltec_E290_base.build_src_filter}
|
||||
+<helpers/bridges/ESPNowBridge.cpp>
|
||||
+<helpers/ui/E290Display.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_E290_base.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -148,6 +153,7 @@ lib_deps =
|
||||
extends = Heltec_E290_base
|
||||
build_flags =
|
||||
${Heltec_E290_base.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=E290Display
|
||||
-D ADVERT_NAME='"Heltec E290 Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -157,6 +163,7 @@ build_flags =
|
||||
build_src_filter = ${Heltec_E290_base.build_src_filter}
|
||||
+<helpers/ui/E290Display.cpp>
|
||||
+<../examples/simple_room_server>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_E290_base.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
@@ -20,6 +20,7 @@ SensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display(&board.periph_power);
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/E290Display.h>
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#include <UITask.h>
|
||||
#endif
|
||||
|
||||
extern HeltecE290Board board;
|
||||
@@ -20,6 +21,7 @@ extern SensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern MomentaryButton user_btn;
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
||||
@@ -18,6 +18,7 @@ SolarExternalWatchdog external_watchdog;
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <helpers/ExternalWatchdogManager.h>
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/ST7789Display.h>
|
||||
#include <UITask.h>
|
||||
#endif
|
||||
|
||||
class SolarSensorManager : public SensorManager {
|
||||
@@ -47,6 +48,7 @@ extern SolarExternalWatchdog external_watchdog;
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
||||
@@ -72,6 +72,7 @@ build_flags =
|
||||
build_src_filter = ${Heltec_RC32.build_src_filter}
|
||||
+<helpers/ui/NV3001BDisplay.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/BaseUITask.cpp>
|
||||
lib_deps =
|
||||
${Heltec_RC32.lib_deps}
|
||||
|
||||
@@ -127,7 +128,7 @@ lib_deps =
|
||||
extends = Heltec_RC32
|
||||
build_flags =
|
||||
${Heltec_RC32.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_CLASS=NullDisplayDriver
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -138,7 +139,7 @@ build_src_filter = ${Heltec_RC32.build_src_filter}
|
||||
+<helpers/ui/NullDisplayDriver.cpp>
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_RC32.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -148,7 +149,7 @@ lib_deps =
|
||||
extends = Heltec_RC32
|
||||
build_flags =
|
||||
${Heltec_RC32.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_CLASS=NullDisplayDriver
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -162,7 +163,7 @@ build_src_filter = ${Heltec_RC32.build_src_filter}
|
||||
+<helpers/ui/NullDisplayDriver.cpp>
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_RC32.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -172,7 +173,7 @@ lib_deps =
|
||||
extends = Heltec_RC32
|
||||
build_flags =
|
||||
${Heltec_RC32.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D ENABLE_WIFI_INTERFACE
|
||||
-D DISPLAY_CLASS=NullDisplayDriver
|
||||
-D MAX_CONTACTS=350
|
||||
@@ -188,7 +189,7 @@ build_src_filter = ${Heltec_RC32.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/wifi/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_RC32.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -214,6 +215,7 @@ lib_deps =
|
||||
extends = Heltec_RC32_with_display
|
||||
build_flags =
|
||||
${Heltec_RC32_with_display.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"Heltec RC32 Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -221,6 +223,7 @@ build_flags =
|
||||
-D MAX_NEIGHBOURS=50
|
||||
build_src_filter = ${Heltec_RC32_with_display.build_src_filter}
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_RC32_with_display.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -230,6 +233,7 @@ lib_deps =
|
||||
extends = Heltec_RC32_with_display
|
||||
build_flags =
|
||||
${Heltec_RC32_with_display.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"ESPNow Bridge"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -239,6 +243,7 @@ build_flags =
|
||||
build_src_filter = ${Heltec_RC32_with_display.build_src_filter}
|
||||
+<helpers/bridges/ESPNowBridge.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_RC32_with_display.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -247,6 +252,7 @@ lib_deps =
|
||||
extends = Heltec_RC32_with_display
|
||||
build_flags =
|
||||
${Heltec_RC32_with_display.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"Heltec RC32 Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -254,6 +260,7 @@ build_flags =
|
||||
-D ROOM_PASSWORD='"hello"'
|
||||
build_src_filter = ${Heltec_RC32_with_display.build_src_filter}
|
||||
+<../examples/simple_room_server>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_RC32_with_display.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -274,7 +281,7 @@ lib_deps =
|
||||
extends = Heltec_RC32_with_display
|
||||
build_flags =
|
||||
${Heltec_RC32_with_display.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D UI_HAS_ROTARY_INPUT
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -283,7 +290,7 @@ build_src_filter = ${Heltec_RC32_with_display.build_src_filter}
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_RC32_with_display.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -293,7 +300,7 @@ lib_deps =
|
||||
extends = Heltec_RC32_with_display
|
||||
build_flags =
|
||||
${Heltec_RC32_with_display.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D UI_HAS_ROTARY_INPUT
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -305,7 +312,7 @@ build_src_filter = ${Heltec_RC32_with_display.build_src_filter}
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_RC32_with_display.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -315,7 +322,7 @@ lib_deps =
|
||||
extends = Heltec_RC32_with_display
|
||||
build_flags =
|
||||
${Heltec_RC32_with_display.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D ENABLE_WIFI_INTERFACE
|
||||
-D UI_HAS_ROTARY_INPUT
|
||||
-D MAX_CONTACTS=350
|
||||
@@ -329,7 +336,7 @@ build_src_filter = ${Heltec_RC32_with_display.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/wifi/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_RC32_with_display.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -338,17 +345,17 @@ lib_deps =
|
||||
[env:heltec_rc32_sensor]
|
||||
extends = Heltec_RC32_with_display
|
||||
build_flags =
|
||||
${Heltec_RC32_with_display.build_flags}
|
||||
${Heltec_RC32.build_flags}
|
||||
-D ADVERT_NAME='"Heltec RC32 Sensor"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D ENV_PIN_SDA=21
|
||||
-D ENV_PIN_SCL=18
|
||||
build_src_filter = ${Heltec_RC32_with_display.build_src_filter}
|
||||
build_src_filter = ${Heltec_RC32.build_src_filter}
|
||||
+<../examples/simple_sensor>
|
||||
lib_deps =
|
||||
${Heltec_RC32_with_display.lib_deps}
|
||||
${Heltec_RC32.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
[env:heltec_rc32_kiss_modem]
|
||||
|
||||
@@ -35,6 +35,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||
static HeltecRC32RotaryInput rotaryInputImpl(&board.periph_power);
|
||||
RotaryInput& rotary_input = rotaryInputImpl;
|
||||
#endif
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#else
|
||||
#include <helpers/ui/NullDisplayDriver.h>
|
||||
#endif
|
||||
#include <UITask.h>
|
||||
#endif
|
||||
|
||||
extern HeltecRC32Board board;
|
||||
@@ -31,6 +32,7 @@ extern EnvironmentSensorManager sensors;
|
||||
#if defined(UI_HAS_ROTARY_INPUT)
|
||||
extern RotaryInput& rotary_input;
|
||||
#endif
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
||||
@@ -66,7 +66,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${heltec_rc52.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-orig
|
||||
-D DISPLAY_CLASS=NullDisplayDriver
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -76,7 +76,7 @@ build_src_filter = ${heltec_rc52.build_src_filter}
|
||||
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
+<helpers/ui/NullDisplayDriver.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-orig>
|
||||
lib_deps =
|
||||
${heltec_rc52.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -87,7 +87,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${heltec_rc52.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-orig
|
||||
-D DISPLAY_CLASS=NullDisplayDriver
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -95,7 +95,7 @@ build_src_filter = ${heltec_rc52.build_src_filter}
|
||||
+<helpers/nrf52/*.cpp>
|
||||
+<helpers/ui/NullDisplayDriver.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-orig>
|
||||
lib_deps =
|
||||
${heltec_rc52.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -113,6 +113,7 @@ build_flags =
|
||||
build_src_filter = ${heltec_rc52.build_src_filter}
|
||||
+<helpers/ui/NV3001BDisplay.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/BaseUITask.cpp>
|
||||
lib_deps =
|
||||
${heltec_rc52.lib_deps}
|
||||
|
||||
@@ -120,8 +121,10 @@ lib_deps =
|
||||
extends = heltec_rc52_with_display
|
||||
build_src_filter = ${heltec_rc52_with_display.build_src_filter}
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
build_flags =
|
||||
${heltec_rc52_with_display.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"Heltec RC52 Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -132,8 +135,10 @@ build_flags =
|
||||
extends = heltec_rc52_with_display
|
||||
build_src_filter = ${heltec_rc52_with_display.build_src_filter}
|
||||
+<../examples/simple_room_server>
|
||||
+<helpers/ui/server>
|
||||
build_flags =
|
||||
${heltec_rc52_with_display.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"Heltec RC52 Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -146,7 +151,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${heltec_rc52_with_display.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D PIN_BUZZER=5
|
||||
-D UI_HAS_ROTARY_INPUT
|
||||
-D MAX_CONTACTS=350
|
||||
@@ -158,7 +163,7 @@ build_src_filter = ${heltec_rc52_with_display.build_src_filter}
|
||||
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${heltec_rc52_with_display.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -170,7 +175,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${heltec_rc52_with_display.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D PIN_BUZZER=5
|
||||
-D UI_HAS_ROTARY_INPUT
|
||||
-D MAX_CONTACTS=350
|
||||
@@ -180,7 +185,7 @@ build_src_filter = ${heltec_rc52_with_display.build_src_filter}
|
||||
+<helpers/nrf52/*.cpp>
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${heltec_rc52_with_display.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
@@ -39,6 +39,7 @@ MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
static HeltecRC52RotaryInput rotaryInputImpl(&board.periph_power);
|
||||
RotaryInput& rotary_input = rotaryInputImpl;
|
||||
#endif
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
bool radio_init()
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#else
|
||||
#include <helpers/ui/NullDisplayDriver.h>
|
||||
#endif
|
||||
#include <UITask.h>
|
||||
#endif
|
||||
|
||||
extern HeltecRC52Board board;
|
||||
@@ -32,6 +33,7 @@ extern MomentaryButton user_btn;
|
||||
#if defined(UI_HAS_ROTARY_INPUT)
|
||||
extern RotaryInput& rotary_input;
|
||||
#endif
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
||||
@@ -47,6 +47,7 @@ build_src_filter = ${nrf52_base.build_src_filter}
|
||||
+<../variants/heltec_t096>
|
||||
+<helpers/ui/ST7735Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/BaseUITask.cpp>
|
||||
lib_deps =
|
||||
${nrf52_base.lib_deps}
|
||||
${sensor_base.lib_deps}
|
||||
@@ -58,9 +59,10 @@ upload_protocol = nrfutil
|
||||
extends = Heltec_t096
|
||||
build_src_filter = ${Heltec_t096.build_src_filter}
|
||||
+<../examples/simple_repeater>
|
||||
|
||||
+<helpers/ui/server>
|
||||
build_flags =
|
||||
${Heltec_t096.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"Heltec_t096 Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -73,6 +75,7 @@ build_flags =
|
||||
extends = Heltec_t096
|
||||
build_flags =
|
||||
${Heltec_t096.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"RS232 Bridge"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -87,13 +90,16 @@ build_flags =
|
||||
build_src_filter = ${Heltec_t096.build_src_filter}
|
||||
+<helpers/bridges/RS232Bridge.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
|
||||
[env:Heltec_t096_room_server]
|
||||
extends = Heltec_t096
|
||||
build_src_filter = ${Heltec_t096.build_src_filter}
|
||||
+<../examples/simple_room_server>
|
||||
+<helpers/ui/server>
|
||||
build_flags =
|
||||
${Heltec_t096.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"Heltec_t096 Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -125,7 +131,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${Heltec_t096.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D BLE_PIN_CODE=123456
|
||||
@@ -137,7 +143,7 @@ build_flags =
|
||||
build_src_filter = ${Heltec_t096.build_src_filter}
|
||||
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_t096.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -148,7 +154,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${Heltec_t096.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D ENABLE_USB_INTERFACE
|
||||
@@ -159,12 +165,15 @@ build_flags =
|
||||
build_src_filter = ${Heltec_t096.build_src_filter}
|
||||
+<helpers/nrf52/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_t096.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
[env:Heltec_t096_kiss_modem]
|
||||
extends = Heltec_t096
|
||||
build_flags =
|
||||
${Heltec_t096.build_flags}
|
||||
-U DISPLAY_CLASS
|
||||
build_src_filter = ${Heltec_t096.build_src_filter}
|
||||
+<../examples/kiss_modem/>
|
||||
@@ -33,6 +33,7 @@ EnvironmentSensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display(&board.periph_power);
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#include <helpers/ui/ST7735Display.h>
|
||||
#include <UITask.h>
|
||||
#else
|
||||
#include "helpers/ui/NullDisplayDriver.h"
|
||||
#endif
|
||||
@@ -24,6 +25,7 @@ extern EnvironmentSensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern MomentaryButton user_btn;
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
||||
@@ -20,6 +20,7 @@ build_src_filter = ${nrf52_base.build_src_filter}
|
||||
+<../variants/heltec_t1>
|
||||
+<helpers/ui/ST7735Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/BaseUITask.cpp>
|
||||
lib_deps =
|
||||
${nrf52_base.lib_deps}
|
||||
${sensor_base.lib_deps}
|
||||
@@ -31,9 +32,10 @@ upload_protocol = nrfutil
|
||||
extends = Heltec_t1
|
||||
build_src_filter = ${Heltec_t1.build_src_filter}
|
||||
+<../examples/simple_repeater>
|
||||
|
||||
+<helpers/ui/server>
|
||||
build_flags =
|
||||
${Heltec_t1.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"Heltec_t1 Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -46,8 +48,10 @@ build_flags =
|
||||
extends = Heltec_t1
|
||||
build_src_filter = ${Heltec_t1.build_src_filter}
|
||||
+<../examples/simple_room_server>
|
||||
+<helpers/ui/server>
|
||||
build_flags =
|
||||
${Heltec_t1.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"Heltec_t1 Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -62,7 +66,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${Heltec_t1.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D BLE_PIN_CODE=123456
|
||||
@@ -75,7 +79,7 @@ build_src_filter = ${Heltec_t1.build_src_filter}
|
||||
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_t1.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -87,7 +91,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${Heltec_t1.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D ENABLE_USB_INTERFACE
|
||||
@@ -97,7 +101,7 @@ build_src_filter = ${Heltec_t1.build_src_filter}
|
||||
+<helpers/nrf52/*.cpp>
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_t1.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -105,5 +109,8 @@ lib_deps =
|
||||
|
||||
[env:Heltec_t1_kiss_modem]
|
||||
extends = Heltec_t1
|
||||
build_flags =
|
||||
${Heltec_t1.build_flags}
|
||||
-U DISPLAY_CLASS
|
||||
build_src_filter = ${Heltec_t1.build_src_filter}
|
||||
+<../examples/kiss_modem/>
|
||||
@@ -32,6 +32,7 @@ EnvironmentSensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display(&board.periph_power);
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#include <helpers/ui/ST7735Display.h>
|
||||
#include <UITask.h>
|
||||
#else
|
||||
#include "helpers/ui/NullDisplayDriver.h"
|
||||
#endif
|
||||
@@ -24,6 +25,7 @@ extern EnvironmentSensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern MomentaryButton user_btn;
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
||||
@@ -98,7 +98,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${Heltec_t114.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_CLASS=NullDisplayDriver
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -111,7 +111,7 @@ build_src_filter = ${Heltec_t114.build_src_filter}
|
||||
+<helpers/ui/NullDisplayDriver.cpp>
|
||||
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_t114.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -122,7 +122,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${Heltec_t114.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_CLASS=NullDisplayDriver
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -131,7 +131,7 @@ build_src_filter = ${Heltec_t114.build_src_filter}
|
||||
+<helpers/nrf52/*.cpp>
|
||||
+<helpers/ui/NullDisplayDriver.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_t114.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -152,6 +152,7 @@ build_src_filter = ${Heltec_t114.build_src_filter}
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/OLEDDisplay.cpp>
|
||||
+<helpers/ui/OLEDDisplayFonts.cpp>
|
||||
+<helpers/ui/BaseUITask.cpp>
|
||||
lib_deps =
|
||||
${Heltec_t114.lib_deps}
|
||||
adafruit/Adafruit SSD1306 @ ^2.5.13
|
||||
@@ -162,9 +163,10 @@ upload_protocol = nrfutil
|
||||
extends = Heltec_t114_with_display
|
||||
build_src_filter = ${Heltec_t114_with_display.build_src_filter}
|
||||
+<../examples/simple_repeater>
|
||||
|
||||
+<helpers/ui/server>
|
||||
build_flags =
|
||||
${Heltec_t114_with_display.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"Heltec_T114 Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -177,6 +179,7 @@ build_flags =
|
||||
extends = Heltec_t114
|
||||
build_flags =
|
||||
${Heltec_t114.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"RS232 Bridge"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -191,13 +194,16 @@ build_flags =
|
||||
build_src_filter = ${Heltec_t114_with_display.build_src_filter}
|
||||
+<helpers/bridges/RS232Bridge.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
|
||||
[env:Heltec_t114_room_server]
|
||||
extends = Heltec_t114_with_display
|
||||
build_src_filter = ${Heltec_t114_with_display.build_src_filter}
|
||||
+<../examples/simple_room_server>
|
||||
+<helpers/ui/server>
|
||||
build_flags =
|
||||
${Heltec_t114_with_display.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"Heltec_T114 Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -212,7 +218,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${Heltec_t114_with_display.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D BLE_PIN_CODE=123456
|
||||
@@ -224,7 +230,7 @@ build_flags =
|
||||
build_src_filter = ${Heltec_t114_with_display.build_src_filter}
|
||||
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_t114_with_display.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -235,7 +241,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${Heltec_t114_with_display.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D ENABLE_USB_INTERFACE
|
||||
@@ -246,12 +252,15 @@ build_flags =
|
||||
build_src_filter = ${Heltec_t114_with_display.build_src_filter}
|
||||
+<helpers/nrf52/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_t114_with_display.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
[env:Heltec_t114_kiss_modem]
|
||||
extends = Heltec_t114
|
||||
build_flags =
|
||||
${Heltec_t114.build_flags}
|
||||
-U DISPLAY_CLASS
|
||||
build_src_filter = ${Heltec_t114.build_src_filter}
|
||||
+<../examples/kiss_modem/>
|
||||
@@ -32,6 +32,7 @@ EnvironmentSensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#else
|
||||
#include "helpers/ui/NullDisplayDriver.h"
|
||||
#endif
|
||||
#include <UITask.h>
|
||||
#endif
|
||||
|
||||
extern T114Board board;
|
||||
@@ -26,6 +27,7 @@ extern EnvironmentSensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern MomentaryButton user_btn;
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
||||
@@ -44,6 +44,7 @@ build_src_filter = ${esp32_base.build_src_filter}
|
||||
+<helpers/ui/ST7789Display.cpp>
|
||||
+<helpers/ui/OLEDDisplay.cpp>
|
||||
+<helpers/ui/OLEDDisplayFonts.cpp>
|
||||
+<helpers/ui/BaseUITask.cpp>
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
adafruit/Adafruit GFX Library @ ^1.12.1
|
||||
@@ -52,7 +53,7 @@ lib_deps =
|
||||
extends = Heltec_T190_base
|
||||
build_flags =
|
||||
${Heltec_T190_base.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D BLE_PIN_CODE=123456 ; dynamic, random PIN
|
||||
@@ -61,7 +62,7 @@ build_flags =
|
||||
build_src_filter = ${Heltec_T190_base.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_T190_base.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -70,7 +71,7 @@ lib_deps =
|
||||
extends = Heltec_T190_base
|
||||
build_flags =
|
||||
${Heltec_T190_base.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D OFFLINE_QUEUE_SIZE=256
|
||||
@@ -78,7 +79,7 @@ build_flags =
|
||||
build_src_filter = ${Heltec_T190_base.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_T190_base.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -87,6 +88,7 @@ lib_deps =
|
||||
extends = Heltec_T190_base
|
||||
build_flags =
|
||||
${Heltec_T190_base.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"Heltec T190 Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -94,6 +96,7 @@ build_flags =
|
||||
-D MAX_NEIGHBOURS=50
|
||||
build_src_filter = ${Heltec_T190_base.build_src_filter}
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_T190_base.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -124,6 +127,7 @@ lib_deps =
|
||||
extends = Heltec_T190_base
|
||||
build_flags =
|
||||
${Heltec_T190_base.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"ESPNow Bridge"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -136,6 +140,7 @@ build_flags =
|
||||
build_src_filter = ${Heltec_T190_base.build_src_filter}
|
||||
+<helpers/bridges/ESPNowBridge.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_T190_base.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -144,6 +149,7 @@ lib_deps =
|
||||
extends = Heltec_T190_base
|
||||
build_flags =
|
||||
${Heltec_T190_base.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"Heltec T190 Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -151,11 +157,15 @@ build_flags =
|
||||
-D ROOM_PASSWORD='"hello"'
|
||||
build_src_filter = ${Heltec_T190_base.build_src_filter}
|
||||
+<../examples/simple_room_server>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_T190_base.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
[env:Heltec_T190_kiss_modem]
|
||||
extends = Heltec_T190_base
|
||||
build_flags =
|
||||
${Heltec_T190_base.build_flags}
|
||||
-U DISPLAY_CLASS
|
||||
build_src_filter = ${Heltec_T190_base.build_src_filter}
|
||||
+<../examples/kiss_modem/>
|
||||
@@ -20,6 +20,7 @@ SensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/ST7789Display.h>
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#include <UITask.h>
|
||||
#endif
|
||||
|
||||
extern HeltecT190Board board;
|
||||
@@ -20,6 +21,7 @@ extern SensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern MomentaryButton user_btn;
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
||||
@@ -59,7 +59,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${Heltec_tower_v2.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_CLASS=NullDisplayDriver
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -72,7 +72,7 @@ build_src_filter = ${Heltec_tower_v2.build_src_filter}
|
||||
+<helpers/ui/NullDisplayDriver.cpp>
|
||||
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_tower_v2.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -83,7 +83,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${Heltec_tower_v2.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_CLASS=NullDisplayDriver
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -96,7 +96,7 @@ build_src_filter = ${Heltec_tower_v2.build_src_filter}
|
||||
+<helpers/ui/NullDisplayDriver.cpp>
|
||||
+<helpers/nrf52/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_tower_v2.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
@@ -20,6 +20,7 @@ TowerV2ExternalWatchdog external_watchdog;
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#include "helpers/ui/NullDisplayDriver.h"
|
||||
#include <UITask.h>
|
||||
#endif
|
||||
|
||||
class TowerV2ExternalWatchdog : public ExternalWatchdogManager {
|
||||
@@ -33,6 +34,7 @@ extern TowerV2ExternalWatchdog external_watchdog;
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern MomentaryButton user_btn;
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
||||
@@ -44,6 +44,7 @@ build_flags =
|
||||
-D SX126X_RX_BOOSTED_GAIN=1
|
||||
build_src_filter = ${esp32_base.build_src_filter}
|
||||
+<../variants/heltec_tracker>
|
||||
+<helpers/ui/BaseUITask.cpp>
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
stevemarple/MicroNMEA @ ^2.0.6
|
||||
@@ -54,7 +55,7 @@ extends = Heltec_tracker_base
|
||||
build_flags =
|
||||
${Heltec_tracker_base.build_flags}
|
||||
-I src/helpers/ui
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_ROTATION=1
|
||||
-D DISPLAY_CLASS=ST7735Display
|
||||
-D MAX_CONTACTS=350
|
||||
@@ -69,7 +70,7 @@ build_src_filter = ${Heltec_tracker_base.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
+<helpers/ui/ST7735Display.cpp>
|
||||
lib_deps =
|
||||
${Heltec_tracker_base.lib_deps}
|
||||
@@ -80,7 +81,7 @@ extends = Heltec_tracker_base
|
||||
build_flags =
|
||||
${Heltec_tracker_base.build_flags}
|
||||
-I src/helpers/ui
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_ROTATION=1
|
||||
-D DISPLAY_CLASS=ST7735Display
|
||||
-D MAX_CONTACTS=350
|
||||
@@ -94,7 +95,7 @@ build_src_filter = ${Heltec_tracker_base.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
+<helpers/ui/ST7735Display.cpp>
|
||||
lib_deps =
|
||||
${Heltec_tracker_base.lib_deps}
|
||||
@@ -104,6 +105,7 @@ lib_deps =
|
||||
extends = Heltec_tracker_base
|
||||
build_flags =
|
||||
${Heltec_tracker_base.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_ROTATION=1
|
||||
-D DISPLAY_CLASS=ST7735Display
|
||||
-D ADVERT_NAME='"Heltec Repeater"'
|
||||
@@ -116,6 +118,7 @@ build_flags =
|
||||
build_src_filter = ${Heltec_tracker_base.build_src_filter}
|
||||
+<helpers/ui/ST7735Display.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_tracker_base.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -149,6 +152,7 @@ lib_deps =
|
||||
extends = Heltec_tracker_base
|
||||
build_flags =
|
||||
${Heltec_tracker_base.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_ROTATION=1
|
||||
-D DISPLAY_CLASS=ST7735Display
|
||||
-D ADVERT_NAME='"ESPNow Bridge"'
|
||||
@@ -164,6 +168,7 @@ build_src_filter = ${Heltec_tracker_base.build_src_filter}
|
||||
+<helpers/bridges/ESPNowBridge.cpp>
|
||||
+<helpers/ui/ST7735Display.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_tracker_base.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -172,6 +177,7 @@ lib_deps =
|
||||
extends = Heltec_tracker_base
|
||||
build_flags =
|
||||
${Heltec_tracker_base.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_ROTATION=1
|
||||
-D DISPLAY_CLASS=ST7735Display
|
||||
-D ADVERT_NAME='"Heltec Room"'
|
||||
@@ -184,6 +190,7 @@ build_flags =
|
||||
build_src_filter = ${Heltec_tracker_base.build_src_filter}
|
||||
+<helpers/ui/ST7735Display.cpp>
|
||||
+<../examples/simple_room_server>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_tracker_base.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
@@ -41,6 +41,7 @@ HWTSensorManager sensors = HWTSensorManager(nmea);
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display(&board.periph_power); // peripheral power pin is shared
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/ST7735Display.h>
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#include <UITask.h>
|
||||
#endif
|
||||
|
||||
class HWTSensorManager : public SensorManager {
|
||||
@@ -38,6 +39,7 @@ extern HWTSensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern MomentaryButton user_btn;
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
||||
@@ -52,6 +52,7 @@ build_flags =
|
||||
build_src_filter = ${esp32_base.build_src_filter}
|
||||
+<../variants/heltec_tracker_v2>
|
||||
+<helpers/sensors>
|
||||
+<helpers/ui/BaseUITask.cpp>
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
${sensor_base.lib_deps}
|
||||
@@ -61,6 +62,7 @@ lib_deps =
|
||||
extends = Heltec_tracker_v2
|
||||
build_flags =
|
||||
${Heltec_tracker_v2.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=ST7735Display
|
||||
-D ADVERT_NAME='"Heltec Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -72,6 +74,7 @@ build_flags =
|
||||
build_src_filter = ${Heltec_tracker_v2.build_src_filter}
|
||||
+<helpers/ui/ST7735Display.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_tracker_v2.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -81,6 +84,7 @@ lib_deps =
|
||||
extends = Heltec_tracker_v2
|
||||
build_flags =
|
||||
${Heltec_tracker_v2.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=ST7735Display
|
||||
-D ADVERT_NAME='"ESPNow Bridge"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -95,6 +99,7 @@ build_src_filter = ${Heltec_tracker_v2.build_src_filter}
|
||||
+<helpers/bridges/ESPNowBridge.cpp>
|
||||
+<helpers/ui/ST7735Display.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_tracker_v2.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -103,6 +108,7 @@ lib_deps =
|
||||
extends = Heltec_tracker_v2
|
||||
build_flags =
|
||||
${Heltec_tracker_v2.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=ST7735Display
|
||||
-D ADVERT_NAME='"Heltec Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -114,6 +120,7 @@ build_flags =
|
||||
build_src_filter = ${Heltec_tracker_v2.build_src_filter}
|
||||
+<helpers/ui/ST7735Display.cpp>
|
||||
+<../examples/simple_room_server>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_tracker_v2.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -136,7 +143,7 @@ lib_deps =
|
||||
extends = Heltec_tracker_v2
|
||||
build_flags =
|
||||
${Heltec_tracker_v2.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D DISPLAY_CLASS=ST7735Display
|
||||
@@ -147,7 +154,7 @@ build_src_filter = ${Heltec_tracker_v2.build_src_filter}
|
||||
+<helpers/ui/ST7735Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_tracker_v2.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -156,7 +163,7 @@ lib_deps =
|
||||
extends = Heltec_tracker_v2
|
||||
build_flags =
|
||||
${Heltec_tracker_v2.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D DISPLAY_CLASS=ST7735Display
|
||||
@@ -172,7 +179,7 @@ build_src_filter = ${Heltec_tracker_v2.build_src_filter}
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_tracker_v2.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -181,7 +188,7 @@ lib_deps =
|
||||
extends = Heltec_tracker_v2
|
||||
build_flags =
|
||||
${Heltec_tracker_v2.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D ENABLE_WIFI_INTERFACE
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -198,7 +205,7 @@ build_src_filter = ${Heltec_tracker_v2.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/wifi/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_tracker_v2.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -211,7 +218,7 @@ build_flags =
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D DISPLAY_CLASS=ST7735Display
|
||||
; -D DISPLAY_CLASS=ST7735Display
|
||||
; -D MESH_PACKET_LOGGING=1
|
||||
; -D MESH_DEBUG=1
|
||||
build_src_filter = ${Heltec_tracker_v2.build_src_filter}
|
||||
|
||||
@@ -28,6 +28,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display(&board.periph_power); // peripheral power pin is shared
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/ST7735Display.h>
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#include <UITask.h>
|
||||
#endif
|
||||
|
||||
extern HeltecTrackerV2Board board;
|
||||
@@ -21,6 +22,7 @@ extern EnvironmentSensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern MomentaryButton user_btn;
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
||||
@@ -23,6 +23,7 @@ build_flags =
|
||||
-D PIN_OLED_RESET=16
|
||||
build_src_filter = ${esp32_base.build_src_filter}
|
||||
+<../variants/heltec_v2>
|
||||
+<helpers/ui/BaseUITask.cpp>
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
adafruit/Adafruit SSD1306 @ ^2.5.13
|
||||
@@ -31,6 +32,7 @@ lib_deps =
|
||||
extends = Heltec_lora32_v2
|
||||
build_flags =
|
||||
${Heltec_lora32_v2.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"Heltec Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -43,6 +45,7 @@ build_src_filter = ${Heltec_lora32_v2.build_src_filter}
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_lora32_v2.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -76,6 +79,7 @@ lib_deps =
|
||||
extends = Heltec_lora32_v2
|
||||
build_flags =
|
||||
${Heltec_lora32_v2.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"ESPNow Bridge"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -91,6 +95,7 @@ build_src_filter = ${Heltec_lora32_v2.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_lora32_v2.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -99,6 +104,7 @@ lib_deps =
|
||||
extends = Heltec_lora32_v2
|
||||
build_flags =
|
||||
${Heltec_lora32_v2.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"Heltec Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -111,6 +117,7 @@ build_src_filter = ${Heltec_lora32_v2.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/simple_room_server>
|
||||
+<helpers/ui/server>
|
||||
lib_deps =
|
||||
${Heltec_lora32_v2.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -133,7 +140,7 @@ lib_deps =
|
||||
extends = Heltec_lora32_v2
|
||||
build_flags =
|
||||
${Heltec_lora32_v2.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D MAX_CONTACTS=160
|
||||
-D MAX_GROUP_CHANNELS=8
|
||||
@@ -145,7 +152,7 @@ build_src_filter = ${Heltec_lora32_v2.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_lora32_v2.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -154,7 +161,7 @@ lib_deps =
|
||||
extends = Heltec_lora32_v2
|
||||
build_flags =
|
||||
${Heltec_lora32_v2.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D MAX_CONTACTS=160
|
||||
-D MAX_GROUP_CHANNELS=8
|
||||
@@ -168,7 +175,7 @@ build_src_filter = ${Heltec_lora32_v2.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_lora32_v2.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -177,7 +184,7 @@ lib_deps =
|
||||
extends = Heltec_lora32_v2
|
||||
build_flags =
|
||||
${Heltec_lora32_v2.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D ENABLE_WIFI_INTERFACE
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D MAX_CONTACTS=160
|
||||
@@ -194,7 +201,7 @@ build_src_filter = ${Heltec_lora32_v2.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
lib_deps =
|
||||
${Heltec_lora32_v2.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
@@ -19,6 +19,7 @@ SensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/SSD1306Display.h>
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#include <UITask.h>
|
||||
#endif
|
||||
|
||||
extern HeltecV2Board board;
|
||||
@@ -20,6 +21,7 @@ extern SensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern MomentaryButton user_btn;
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
||||
@@ -31,7 +31,8 @@ build_flags =
|
||||
-D PIN_GPS_TX=48
|
||||
-D PIN_GPS_EN=26
|
||||
build_src_filter = ${esp32_base.build_src_filter}
|
||||
+<../variants/heltec_v3>
|
||||
+<../variants/heltec_v3/*.cpp>
|
||||
+<helpers/ui/BaseUITask.cpp>
|
||||
+<helpers/sensors>
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
@@ -41,6 +42,7 @@ lib_deps =
|
||||
extends = Heltec_lora32_v3
|
||||
build_flags =
|
||||
${Heltec_lora32_v3.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"Heltec Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -51,7 +53,9 @@ build_flags =
|
||||
; -D MESH_DEBUG=1
|
||||
build_src_filter = ${Heltec_lora32_v3.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/server>
|
||||
+<../examples/simple_repeater>
|
||||
+<../variants/heltec_v3/ui-other/*.cpp>
|
||||
lib_deps =
|
||||
${Heltec_lora32_v3.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -61,6 +65,7 @@ lib_deps =
|
||||
extends = Heltec_lora32_v3
|
||||
build_flags =
|
||||
${Heltec_lora32_v3.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"RS232 Bridge"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -76,7 +81,9 @@ build_flags =
|
||||
build_src_filter = ${Heltec_lora32_v3.build_src_filter}
|
||||
+<helpers/bridges/RS232Bridge.cpp>
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/server>
|
||||
+<../examples/simple_repeater>
|
||||
+<../variants/heltec_v3/ui-other/*.cpp>
|
||||
lib_deps =
|
||||
${Heltec_lora32_v3.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -98,7 +105,9 @@ build_flags =
|
||||
build_src_filter = ${Heltec_lora32_v3.build_src_filter}
|
||||
+<helpers/bridges/ESPNowBridge.cpp>
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/server>
|
||||
+<../examples/simple_repeater>
|
||||
+<../variants/heltec_v3/ui-other/*.cpp>
|
||||
lib_deps =
|
||||
${Heltec_lora32_v3.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -107,6 +116,7 @@ lib_deps =
|
||||
extends = Heltec_lora32_v3
|
||||
build_flags =
|
||||
${Heltec_lora32_v3.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"Heltec Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
@@ -117,7 +127,9 @@ build_flags =
|
||||
; -D MESH_DEBUG=1
|
||||
build_src_filter = ${Heltec_lora32_v3.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/server>
|
||||
+<../examples/simple_room_server>
|
||||
+<../variants/heltec_v3/ui-other/*.cpp>
|
||||
lib_deps =
|
||||
${Heltec_lora32_v3.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
@@ -140,7 +152,7 @@ lib_deps =
|
||||
extends = Heltec_lora32_v3
|
||||
build_flags =
|
||||
${Heltec_lora32_v3.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
@@ -150,8 +162,9 @@ build_flags =
|
||||
build_src_filter = ${Heltec_lora32_v3.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<../variants/heltec_v3/ui-companion/*.cpp>
|
||||
lib_deps =
|
||||
${Heltec_lora32_v3.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -160,7 +173,7 @@ lib_deps =
|
||||
extends = Heltec_lora32_v3
|
||||
build_flags =
|
||||
${Heltec_lora32_v3.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
@@ -174,10 +187,11 @@ build_flags =
|
||||
build_src_filter = ${Heltec_lora32_v3.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/wifi/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<../variants/heltec_v3/ui-companion/*.cpp>
|
||||
lib_deps =
|
||||
${Heltec_lora32_v3.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -186,7 +200,7 @@ lib_deps =
|
||||
extends = Heltec_lora32_v3
|
||||
build_flags =
|
||||
${Heltec_lora32_v3.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-I src/helpers/ui/companion-new
|
||||
-D ENABLE_WIFI_INTERFACE
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
@@ -200,10 +214,11 @@ build_flags =
|
||||
build_src_filter = ${Heltec_lora32_v3.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/companion-new>
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/wifi/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<../variants/heltec_v3/ui-companion/*.cpp>
|
||||
lib_deps =
|
||||
${Heltec_lora32_v3.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -212,6 +227,7 @@ lib_deps =
|
||||
extends = Heltec_lora32_v3
|
||||
build_flags =
|
||||
${Heltec_lora32_v3.build_flags}
|
||||
-I src/helpers/ui/server
|
||||
-D ADVERT_NAME='"Heltec v3 Sensor"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
@@ -223,7 +239,9 @@ build_flags =
|
||||
; -D MESH_DEBUG=1
|
||||
build_src_filter = ${Heltec_lora32_v3.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/server>
|
||||
+<../examples/simple_sensor>
|
||||
+<../variants/heltec_v3/ui-other/*.cpp>
|
||||
lib_deps =
|
||||
${Heltec_lora32_v3.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
@@ -24,11 +24,6 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||
EnvironmentSensorManager sensors;
|
||||
#endif
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
fallback_clock.begin();
|
||||
rtc_clock.begin(Wire);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/SSD1306Display.h>
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#include <UITask.h> // needs -I(nclude) path setting
|
||||
#endif
|
||||
|
||||
extern HeltecV3Board board;
|
||||
@@ -21,6 +22,7 @@ extern EnvironmentSensorManager sensors;
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern MomentaryButton user_btn;
|
||||
extern UITask ui_task;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#include <Arduino.h>
|
||||
#include "target.h"
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
|
||||
UITask ui_task(&board);
|
||||
#endif
|
||||
@@ -0,0 +1,9 @@
|
||||
#include <Arduino.h>
|
||||
#include "target.h"
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
|
||||
UITask ui_task(&board, &display);
|
||||
#endif
|
||||
Loaded 100 of 267 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user