diff --git a/docs/cli_commands.md b/docs/cli_commands.md index 945fa1ba45f..090a16ffd28 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md @@ -172,6 +172,18 @@ Find more information in [neighbour_discovery_reference.md](neighbour_discovery_ **Serial Only:** Yes +**Note:** Output format: `{"battery_mv":,"uptime_secs":,"errors":,"queue_len":}` + +**Note:** `errors` is a bitmask shown as "Debug flags" in the app's repeater status. + +| Value | Flag | Meaning | +|-------|------|---------| +| 1 | `ERR_EVENT_FULL` | A packet failed to send because the memory pool was full. | +| 2 | `ERR_EVENT_CAD_TIMEOUT` | After waiting 4 seconds for a gap, a packet was transmitted into a busy network. | +| 4 | `ERR_EVENT_STARTRX_TIMEOUT` | The radio was out of receive mode for more than 8 seconds. | + +Flags stay set until the node reboots or `clear stats` is run. + --- ### Radio Stats - Noise floor, Last RSSI/SNR, Airtime, Receive errors @@ -415,6 +427,10 @@ Find more information in [companion_snmp_ota_reference.md](companion_snmp_ota_re **Note:** Requires reboot to apply +**Notes:** These settings control the setup of the radio parameters. +Refer to the node's manual for the correct settings to use. +**Setting a value too high or too low may violate the laws in your country.** + --- #### View or change this node's transmit power @@ -429,7 +445,9 @@ Find more information in [companion_snmp_ota_reference.md](companion_snmp_ota_re **Default:** Varies by board -**Notes:** This setting only controls the power level of the LoRa chip. Some nodes have an additional power amplifier stage which increases the total output. Refer to the node's manual for the correct setting to use. **Setting a value too high may violate the laws in your country.** +**Notes:** This setting only controls the power level of the LoRa chip. Some nodes have an additional power amplifier stage which increases the total output. +Refer to the node's manual for the correct setting to use. +**Setting a value too high may violate the laws in your country.** --- @@ -444,6 +462,10 @@ Find more information in [companion_snmp_ota_reference.md](companion_snmp_ota_re - `cr`: Coding rate (5-8) - `timeout_mins`: Duration in minutes (must be > 0) +**Notes:** These settings control the setup of the radio parameters. +Refer to the node's manual for the correct settings to use. +**Setting a value too high or too low may violate the laws in your country.** + **Note:** This is not saved to preferences and will clear on reboot --- @@ -918,6 +940,9 @@ congestion response. Region gating is off by default, so enabling it layers on top of an existing filter configuration without disturbing it. Directed (non-flood) traffic is never region-gated. +**Notes:** Refer to the node's manual for the correct settings to use. +**Setting a value too high may violate the laws in your country.** + --- #### View or change the airtime factor (duty cycle limit) diff --git a/docs/companion_cli.md b/docs/companion_cli.md index 212eb905c3a..796309ecbb4 100644 --- a/docs/companion_cli.md +++ b/docs/companion_cli.md @@ -80,6 +80,20 @@ Since version 1.18 meshcore companion radio firmware has a CLI interface, which --- +#### View or change the buzzer state +**Usage:** +- `get buzzer` +- `set buzzer ` + +**Parameters:** +- `state`: `on`|`off` + +**Default:** `on` + +**Note:** Only available on boards with a buzzer (`PIN_BUZZER`). This is the same setting as the buzzer toggle in the device UI. + +--- + ### Radio Radio parameters are common to all roles and handled by `CommonRadioPrefs`. diff --git a/examples/companion_radio/DataStore.h b/examples/companion_radio/DataStore.h index e0a145caf1e..b2100fed5e9 100644 --- a/examples/companion_radio/DataStore.h +++ b/examples/companion_radio/DataStore.h @@ -3,7 +3,7 @@ #include #include #include -#include "NodePrefs.h" +#include class DataStoreHost { public: diff --git a/examples/companion_radio/MyMesh.cpp b/examples/companion_radio/MyMesh.cpp index f198b73f423..2c7181473f1 100644 --- a/examples/companion_radio/MyMesh.cpp +++ b/examples/companion_radio/MyMesh.cpp @@ -408,20 +408,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); @@ -2716,21 +2702,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; diff --git a/examples/companion_radio/MyMesh.h b/examples/companion_radio/MyMesh.h index 62a82748010..2d80f5b607c 100644 --- a/examples/companion_radio/MyMesh.h +++ b/examples/companion_radio/MyMesh.h @@ -26,7 +26,7 @@ #include "CompanionNet.h" #include "MeshcomodPrefs.h" #include "DataStore.h" -#include "NodePrefs.h" +#include #include #include @@ -75,6 +75,7 @@ #ifdef WITH_MQTT_BRIDGE #include #endif +#include /* -------------------------------------------------------------------------------------- */ @@ -82,10 +83,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; @@ -100,30 +97,11 @@ class MyMesh : public BaseChatMesh, public DataStoreHost, public NodeDiagHost #endif { 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(); @@ -132,10 +110,14 @@ class MyMesh : public BaseChatMesh, public DataStoreHost, public NodeDiagHost 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(); + } // NodeDiagHost (memory, stats-radio-diag) int getDiagQueueSize() override; @@ -237,13 +219,6 @@ class MyMesh : public BaseChatMesh, public DataStoreHost, public NodeDiagHost } 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 && @@ -299,7 +274,7 @@ class MyMesh : public BaseChatMesh, public DataStoreHost, public NodeDiagHost 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; diff --git a/examples/companion_radio/main.cpp b/examples/companion_radio/main.cpp index 41b2334d60c..7949e40eef5 100644 --- a/examples/companion_radio/main.cpp +++ b/examples/companion_radio/main.cpp @@ -115,11 +115,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; #ifdef COMPANION_MESH_IN_PSRAM @@ -384,7 +379,10 @@ void setup() { #endif #ifdef DISPLAY_CLASS - ui_task.begin(disp, &sensors, the_mesh.getNodePrefs()); // still want to pass this in as dependency, as prefs might be moved +#ifdef WITH_MQTT_BRIDGE + ui_task.setObserver(&the_mesh.getObserver()); +#endif + 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); diff --git a/examples/simple_repeater/MyMesh.cpp b/examples/simple_repeater/MyMesh.cpp index 6bc280396c6..167285bf882 100644 --- a/examples/simple_repeater/MyMesh.cpp +++ b/examples/simple_repeater/MyMesh.cpp @@ -16,6 +16,7 @@ #ifdef WITH_MQTT_BRIDGE #include // buildFilterStatsMessage + MQTTFilterStatsView #endif +#include /* ------------------------------ Config -------------------------------- */ @@ -64,6 +65,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 @@ -73,6 +82,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 @@ -264,6 +276,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 @@ -434,6 +507,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 } @@ -1037,6 +1157,7 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc uptime_millis = 0; next_local_advert = next_flood_advert = 0; dirty_contacts_expiry = 0; + last_read_time = 0; set_radio_at = revert_radio_at = 0; _logging = false; region_load_active = false; @@ -2084,6 +2205,48 @@ void MyMesh::loop() { } } #endif + 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)) { diff --git a/examples/simple_repeater/MyMesh.h b/examples/simple_repeater/MyMesh.h index f2fe94564f6..d68f8919bbe 100644 --- a/examples/simple_repeater/MyMesh.h +++ b/examples/simple_repeater/MyMesh.h @@ -90,8 +90,6 @@ struct NeighbourInfo { #define FIRMWARE_VERSION "v1.18.0.01" #endif -#define FIRMWARE_ROLE "repeater" - #define PACKET_LOG_FILE "/packet_log" class MyMesh : public mesh::Mesh, public CommonCLICallbacks @@ -121,6 +119,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; uint32_t pending_discover_tag; unsigned long pending_discover_until; @@ -227,10 +226,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 { @@ -317,7 +318,7 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks 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; diff --git a/examples/simple_repeater/main.cpp b/examples/simple_repeater/main.cpp index 8465dd3a03d..406e143feb1 100644 --- a/examples/simple_repeater/main.cpp +++ b/examples/simple_repeater/main.cpp @@ -5,8 +5,7 @@ #include #ifdef DISPLAY_CLASS - #include "UITask.h" - static UITask ui_task(board, display); + // ui_task is created by the variant (target.cpp), as upstream does. static bool display_ready = false; #endif @@ -120,7 +119,7 @@ void setup() { #ifdef WITH_MQTT_BRIDGE ui_task.setObserverPrefs(the_mesh.getObserverPrefs()); #endif - ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION); + ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION, "< Repeater >"); #ifdef DISPLAY_ACTIVITY_DASHBOARD ui_task.setActivityWindow(the_mesh.getActivityWindow()); #endif diff --git a/examples/simple_room_server/MyMesh.h b/examples/simple_room_server/MyMesh.h index bd149545306..cfbdf000f75 100644 --- a/examples/simple_room_server/MyMesh.h +++ b/examples/simple_room_server/MyMesh.h @@ -94,8 +94,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) @@ -315,7 +313,7 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks 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; diff --git a/examples/simple_room_server/UITask.cpp b/examples/simple_room_server/UITask.cpp deleted file mode 100644 index 475d20a3c95..00000000000 --- a/examples/simple_room_server/UITask.cpp +++ /dev/null @@ -1,432 +0,0 @@ -#include "UITask.h" -#include -#include - -#ifdef DISPLAY_REDRAW_ON_CHANGE -#include -#endif - -#ifndef USER_BTN_PRESSED -#define USER_BTN_PRESSED LOW -#endif - -#ifdef WITH_MQTT_BRIDGE -#include -#include // defines WITH_WEBCONFIG on ESP32 -#endif - -#ifndef AUTO_OFF_MILLIS -#define AUTO_OFF_MILLIS 20000 // 20 seconds; 0 keeps the screen on -#endif - -#ifdef DISPLAY_TOUCH_TOGGLE -#define TOUCH_POLL_MILLIS 50 -#endif - -// Wrap-safe deadline test. `millis() >= deadline` fires early for the whole -// interval before a rollover, because the deadline has already wrapped to a -// small value while millis() is still near UINT32_MAX; the signed difference -// stays correct across it. -static inline bool millisReached(unsigned long now, unsigned long deadline) { - return (int32_t)((uint32_t)now - (uint32_t)deadline) >= 0; -} - -// Applies `display.flip` when it changes, forcing a complete repaint because -// the panel's existing contents are now the wrong way up. -void UITask::applyDisplayFlip() { -#ifdef WITH_MQTT_BRIDGE - if (_observer_prefs == NULL || _observer_prefs->display_flip == _flip_seen) return; - _flip_seen = _observer_prefs->display_flip; - _display->setFlipped(_flip_seen != 0); - // Logged unconditionally: this is persisted config, so it survives a reflash - // and is otherwise invisible when someone is chasing a wrong orientation. - Serial.printf("Display: flip %s\n", _flip_seen ? "on (rotated 180)" : "off"); -#ifdef DISPLAY_REDRAW_ON_CHANGE - _frame_valid = false; -#endif -#ifdef DISPLAY_ACTIVITY_DASHBOARD - _rows_valid = false; -#endif - _next_refresh = 0; -#endif -} - -// `display.timeout` when the observer prefs are available, otherwise the -// compiled-in default. Read on every use so a `set display.timeout` takes -// effect immediately. -unsigned long UITask::displayTimeoutMillis() const { -#ifdef WITH_MQTT_BRIDGE - if (_observer_prefs) return (unsigned long)_observer_prefs->display_timeout_secs * 1000UL; -#endif - return AUTO_OFF_MILLIS; -} -#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; - _timeout_seen = displayTimeoutMillis(); - _auto_off = millis() + displayTimeoutMillis(); - _node_prefs = node_prefs; -#ifdef DISPLAY_ACTIVITY_DASHBOARD - ObserverDashboard::applyDarkPalette(); // retunes UIColor for this target only -#endif - _display->turnOn(); - applyDisplayFlip(); -#ifdef DISPLAY_TOUCH_TOGGLE - _touch.begin(); -#endif -#ifdef DISPLAY_REDRAW_ON_CHANGE - _frame_valid = false; -#endif - - // 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]; -#ifdef DISPLAY_ACTIVITY_DASHBOARD - _rows_valid = false; -#endif - 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 -#ifdef WITH_WEBCONFIG - if (WebConfigServer::isRebootPending()) { - // save confirmed on-device: show ground truth even if the browser - // lost its connection before the confirmation reached it - _display->setTextSize(1); - _display->setColor(UIColor::corp_blue); - _display->setCursor(0, 14); - _display->print("Config saved!"); - _display->setColor(UIColor::primary_txt); - _display->setCursor(0, 30); - _display->print("Rebooting..."); - return; - } - char wc_ssid[33], wc_ip[16]; - if (WebConfigServer::getSetupInfo(wc_ssid, sizeof(wc_ssid), wc_ip, sizeof(wc_ip))) { - const bool lan_setup = WebConfigServer::isLanSetup(); - // setup portal active: show join instructions instead of the home screen - _display->setTextSize(1); - _display->setColor(UIColor::corp_blue); - _display->setCursor(0, 0); - _display->print(lan_setup ? "Observer Ethernet Setup" : "Observer WiFi Setup"); - - _display->setColor(UIColor::primary_txt); - _display->setCursor(0, 14); - _display->print(lan_setup ? "Login code:" : "Join WiFi:"); - _display->setColor(UIColor::warning_txt); - _display->setCursor(6, 24); - _display->print(wc_ssid); - - _display->setColor(UIColor::primary_txt); - _display->setCursor(0, 40); - _display->print("Then browse to:"); - _display->setColor(UIColor::warning_txt); - _display->setCursor(6, 50); - _display->print(wc_ip); - return; - } -#endif -#ifdef DISPLAY_ACTIVITY_DASHBOARD - renderDashboard(); - return; -#endif - // 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); - -#ifdef WITH_MQTT_BRIDGE - // Display IP address for MQTT bridge devices - if (WiFi.status() == WL_CONNECTED) { - IPAddress ip = WiFi.localIP(); - _display->setCursor(0, 40); - _display->setColor(UIColor::primary_txt); - snprintf(tmp, sizeof(tmp), "IP: %d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); - _display->print(tmp); - } -#endif - } -} - -#ifdef DISPLAY_REDRAW_ON_CHANGE -uint32_t UITask::getFrameSignature() { - uint32_t signature = DisplayFrameSignature::INITIAL; - char tmp[80]; - - if (millis() < BOOT_SCREEN_MILLIS) { - signature = DisplayFrameSignature::append(signature, "boot"); - return DisplayFrameSignature::append(signature, _version_info); - } - -#ifdef WITH_WEBCONFIG - if (WebConfigServer::isRebootPending()) { - return DisplayFrameSignature::append(signature, "rebooting"); - } - - char wc_ssid[33], wc_ip[16]; - if (WebConfigServer::getSetupInfo(wc_ssid, sizeof(wc_ssid), wc_ip, sizeof(wc_ip))) { - signature = DisplayFrameSignature::append(signature, "setup"); - signature = DisplayFrameSignature::append(signature, wc_ssid); - return DisplayFrameSignature::append(signature, wc_ip); - } -#endif - - signature = DisplayFrameSignature::append(signature, "home"); - signature = DisplayFrameSignature::append(signature, _node_prefs->node_name); - snprintf(tmp, sizeof(tmp), "FREQ: %06.3f SF%d", _node_prefs->freq, _node_prefs->sf); - signature = DisplayFrameSignature::append(signature, tmp); - snprintf(tmp, sizeof(tmp), "BW: %03.2f CR: %d", _node_prefs->bw, _node_prefs->cr); - signature = DisplayFrameSignature::append(signature, tmp); - -#if defined(WITH_MQTT_BRIDGE) && !defined(DISPLAY_ACTIVITY_DASHBOARD) - if (WiFi.status() == WL_CONNECTED) { - IPAddress ip = WiFi.localIP(); - snprintf(tmp, sizeof(tmp), "IP: %d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); - signature = DisplayFrameSignature::append(signature, tmp); - } else { - signature = DisplayFrameSignature::append(signature, "wifi-disconnected"); - } -#endif - - return signature; -} -#endif - -#ifdef DISPLAY_ACTIVITY_DASHBOARD -#define ACTIVITY_REFRESH_MILLIS 5000 - -bool UITask::buildDashboardContext(ObserverDashboard::Context* ctx) { - if (_node_prefs == NULL) return false; - ctx->node_name = _node_prefs->node_name; - ctx->role_label = "ROOM SERVER"; - ctx->freq = _node_prefs->freq; - ctx->sf = _node_prefs->sf; - ctx->bw = _node_prefs->bw; -#ifdef WITH_MQTT_BRIDGE - ctx->link_up = (WiFi.status() == WL_CONNECTED); -#else - ctx->link_up = false; -#endif - return true; -} - -void UITask::renderDashboard() { - ObserverDashboard::Context ctx; - if (!buildDashboardContext(&ctx)) return; - - RadioActivitySnapshot snap; - if (_activity) { - _activity->snapshot(millis(), &snap); - } else { - memset(&snap, 0, sizeof(snap)); - } - - const ObserverDashboard::Layout& layout = ObserverDashboard::activeLayout(); - ObserverDashboard::drawFull(*_display, layout, ctx, snap); - ObserverDashboard::allRowSignatures(layout, ctx, snap, _row_signatures); - _rows_valid = true; - _next_activity = millis() + ACTIVITY_REFRESH_MILLIS; -} - -// Repaints just the analytics rows whose contents moved. No startFrame(), so -// the header, the radio strip and the rest of the panel are never cleared. -void UITask::updateActivityRows() { - if (!_rows_valid || _activity == NULL) return; // not showing the dashboard - - ObserverDashboard::Context ctx; - if (!buildDashboardContext(&ctx)) return; - - RadioActivitySnapshot snap; - _activity->snapshot(millis(), &snap); - ObserverDashboard::drawChangedRows(*_display, ObserverDashboard::activeLayout(), ctx, snap, - _row_signatures); -} -#endif - -#ifdef DISPLAY_TOUCH_TOGGLE -void UITask::toggleDisplay(const char* source) { - if (_display->isOn()) { - _display->turnOff(); - } else { - _display->turnOn(); - } -#ifdef DISPLAY_TOUCH_DEBUG - Serial.printf("Display: %s -> %s\n", source, _display->isOn() ? "on" : "off"); -#else - (void)source; -#endif -#ifdef DISPLAY_REDRAW_ON_CHANGE - _frame_valid = false; // wake draws one complete current frame -#endif -#ifdef DISPLAY_ACTIVITY_DASHBOARD - _rows_valid = false; -#endif - _next_refresh = 0; // redraw at once rather than showing the stale frame - _auto_off = millis() + displayTimeoutMillis(); -} -#endif - -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? -#ifdef DISPLAY_TOUCH_TOGGLE - toggleDisplay("button"); // same action as tapping the panel -#else - if (_display->isOn()) { - // TODO: any action ? - } else { - _display->turnOn(); -#ifdef DISPLAY_REDRAW_ON_CHANGE - _frame_valid = false; -#endif -#ifdef DISPLAY_ACTIVITY_DASHBOARD - _rows_valid = false; -#endif - } - _auto_off = millis() + displayTimeoutMillis(); // extend auto-off timer -#endif - } - _prevBtnState = btnState; - } - _next_read = millis() + 200; // 5 reads per second - } -#endif - -#ifdef WITH_WEBCONFIG - // While the setup portal is up there's no user button to wake the screen - // reliably - keep it on so the join instructions stay visible. - if (WebConfigServer::getSetupInfo(NULL, 0, NULL, 0)) { - if (!_display->isOn()) { - _display->turnOn(); -#ifdef DISPLAY_REDRAW_ON_CHANGE - _frame_valid = false; -#endif -#ifdef DISPLAY_ACTIVITY_DASHBOARD - _rows_valid = false; -#endif - } - _auto_off = millis() + displayTimeoutMillis(); - } -#endif - -#ifdef DISPLAY_TOUCH_TOGGLE - { - unsigned long now = millis(); - if (millisReached(now, _next_touch)) { - _next_touch = now + TOUCH_POLL_MILLIS; - if (_touch.checkTap(now)) toggleDisplay("touch"); - } - } -#endif - - if (_display->isOn()) { - if (millis() >= _next_refresh) { - bool redraw = true; -#ifdef DISPLAY_REDRAW_ON_CHANGE - uint32_t frame_signature = getFrameSignature(); - redraw = !_frame_valid || frame_signature != _last_frame_signature; -#endif - if (redraw) { - _display->startFrame(); - renderCurrScreen(); - _display->endFrame(); -#ifdef DISPLAY_REDRAW_ON_CHANGE - _last_frame_signature = frame_signature; - _frame_valid = true; -#endif - } -#ifdef DISPLAY_ACTIVITY_DASHBOARD - else if (millisReached(millis(), _next_activity)) { - updateActivityRows(); - _next_activity = millis() + ACTIVITY_REFRESH_MILLIS; - } -#endif - - _next_refresh = millis() + 1000; // check for visible changes every second - } - // `_auto_off` is only armed on activity, so a timeout changed at runtime has - // to restart the countdown here - otherwise 0 -> 60 blanks instantly off a - // boot-time deadline, and 60 -> 3600 still blanks at the old 60 s mark. - applyDisplayFlip(); - unsigned long timeout = displayTimeoutMillis(); - if (timeout != _timeout_seen) { - _timeout_seen = timeout; - _auto_off = millis() + timeout; - } - if (timeout > 0 && millisReached(millis(), _auto_off)) { - _display->turnOff(); -#ifdef DISPLAY_REDRAW_ON_CHANGE - _frame_valid = false; -#endif -#ifdef DISPLAY_ACTIVITY_DASHBOARD - _rows_valid = false; -#endif - } - } -} diff --git a/examples/simple_room_server/UITask.h b/examples/simple_room_server/UITask.h deleted file mode 100644 index 04704679496..00000000000 --- a/examples/simple_room_server/UITask.h +++ /dev/null @@ -1,76 +0,0 @@ -#pragma once - -#include -#include - -#ifdef DISPLAY_ACTIVITY_DASHBOARD - #ifndef DISPLAY_REDRAW_ON_CHANGE - #error "DISPLAY_ACTIVITY_DASHBOARD needs DISPLAY_REDRAW_ON_CHANGE: without it every frame clears the whole screen" - #endif - #include - #include - -#endif - -#ifdef DISPLAY_TOUCH_TOGGLE - #include -#endif - -class UITask { - DisplayDriver* _display; - unsigned long _next_read, _next_refresh, _auto_off; - int _prevBtnState; - NodePrefs* _node_prefs; - char _version_info[32]; - -#ifdef DISPLAY_REDRAW_ON_CHANGE - uint32_t _last_frame_signature = 0; - bool _frame_valid = false; - - uint32_t getFrameSignature(); -#endif - -#ifdef DISPLAY_ACTIVITY_DASHBOARD - RadioActivityWindow* _activity = NULL; - unsigned long _next_activity = 0; - uint32_t _row_signatures[ObserverDashboard::ROW_COUNT] = {0}; - bool _rows_valid = false; // true only while the dashboard is the drawn screen - - bool buildDashboardContext(ObserverDashboard::Context* ctx); - void renderDashboard(); - void updateActivityRows(); -#endif - -#ifdef DISPLAY_TOUCH_TOGGLE - CHSC6XTouch _touch; - unsigned long _next_touch = 0; - - void toggleDisplay(const char* source); -#endif - -#ifdef WITH_MQTT_BRIDGE - MQTTPrefs* _observer_prefs = NULL; -#endif - unsigned long _timeout_seen = 0; // to notice a live `display.timeout` change - uint8_t _flip_seen = 0xFF; // 0xFF forces the first apply - void applyDisplayFlip(); - - unsigned long displayTimeoutMillis() const; - - 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); - -#ifdef WITH_MQTT_BRIDGE - // Supplies `display.timeout`, which is read live so a config change applies - // without a reboot. Call before begin(). - void setObserverPrefs(MQTTPrefs* prefs) { _observer_prefs = prefs; } -#endif - -#ifdef DISPLAY_ACTIVITY_DASHBOARD - void setActivityWindow(RadioActivityWindow* activity) { _activity = activity; } -#endif - - void loop(); -}; diff --git a/examples/simple_room_server/main.cpp b/examples/simple_room_server/main.cpp index 80f87060b2f..b88603fcb8b 100644 --- a/examples/simple_room_server/main.cpp +++ b/examples/simple_room_server/main.cpp @@ -10,8 +10,7 @@ #endif #ifdef DISPLAY_CLASS - #include "UITask.h" - static UITask ui_task(display); + // ui_task is created by the variant (target.cpp), as upstream does. static bool display_ready = false; #endif @@ -96,7 +95,7 @@ void setup() { #ifdef WITH_MQTT_BRIDGE ui_task.setObserverPrefs(the_mesh.getObserverPrefs()); #endif - ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION); + ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION, "< Room Server >"); #ifdef DISPLAY_ACTIVITY_DASHBOARD ui_task.setActivityWindow(the_mesh.getActivityWindow()); #endif diff --git a/examples/simple_sensor/SensorMesh.h b/examples/simple_sensor/SensorMesh.h index e6746d470c7..2dc610cc0f2 100644 --- a/examples/simple_sensor/SensorMesh.h +++ b/examples/simple_sensor/SensorMesh.h @@ -41,8 +41,6 @@ #define FIRMWARE_VERSION "v1.18.0" #endif -#define FIRMWARE_ROLE "sensor" - #define MAX_SEARCH_RESULTS 24 #define MAX_CONCURRENT_ALERTS 4 @@ -56,7 +54,7 @@ class SensorMesh : public mesh::Mesh, public CommonCLICallbacks { // 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); } diff --git a/examples/simple_sensor/UITask.cpp b/examples/simple_sensor/UITask.cpp deleted file mode 100644 index 75a0b465098..00000000000 --- a/examples/simple_sensor/UITask.cpp +++ /dev/null @@ -1,125 +0,0 @@ -#include "UITask.h" -#include -#include - -#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(); - } - } -} diff --git a/examples/simple_sensor/UITask.h b/examples/simple_sensor/UITask.h deleted file mode 100644 index a27259f1177..00000000000 --- a/examples/simple_sensor/UITask.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -#include -#include - -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(); -}; \ No newline at end of file diff --git a/examples/simple_sensor/main.cpp b/examples/simple_sensor/main.cpp index b4399f370c9..a284a9c15b8 100644 --- a/examples/simple_sensor/main.cpp +++ b/examples/simple_sensor/main.cpp @@ -1,10 +1,5 @@ #include "SensorMesh.h" -#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) @@ -111,7 +106,7 @@ void setup() { the_mesh.begin(fs); #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 diff --git a/src/helpers/BaseChatMesh.cpp b/src/helpers/BaseChatMesh.cpp index 58c08deaa3f..a4dcafeaeb1 100644 --- a/src/helpers/BaseChatMesh.cpp +++ b/src/helpers/BaseChatMesh.cpp @@ -380,12 +380,13 @@ void BaseChatMesh::onAckRecv(mesh::Packet* packet, uint32_t ack_crc) { ContactInfo* from; if ((from = processAck((uint8_t *)&ack_crc)) != NULL) { txt_send_timeout = 0; // matched one we're waiting for, cancel timeout timer - packet->markDoNotRetransmit(); // ACK was for this node, so don't retransmit if (packet->isRouteFlood() && from->out_path_len != OUT_PATH_UNKNOWN) { // we have direct path, but other node is still sending flood, so maybe they didn't receive reciprocal path properly(?) handleReturnPathRetry(*from, packet->path, packet->path_len); } + // NOTE: must come after the isRouteFlood() test, as it overwrites the header + packet->markDoNotRetransmit(); // ACK was for this node, so don't retransmit } } diff --git a/src/helpers/BaseChatMesh.h b/src/helpers/BaseChatMesh.h index 835384b7415..b6aa79a8e51 100644 --- a/src/helpers/BaseChatMesh.h +++ b/src/helpers/BaseChatMesh.h @@ -182,5 +182,8 @@ class BaseChatMesh : public mesh::Mesh { bool setChannel(int idx, const ChannelDetails& src); int findChannelIdx(const mesh::GroupChannel& ch); + virtual void savePrefs() { } + virtual void enterCLIRescue() { } + void loop(); }; diff --git a/src/helpers/CommonGpsPrefs.h b/src/helpers/CommonGpsPrefs.h index 5502cba8022..11adc678524 100644 --- a/src/helpers/CommonGpsPrefs.h +++ b/src/helpers/CommonGpsPrefs.h @@ -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; diff --git a/src/helpers/CommonRadioPrefs.h b/src/helpers/CommonRadioPrefs.h index 53401adad94..cc86a7d02a7 100644 --- a/src/helpers/CommonRadioPrefs.h +++ b/src/helpers/CommonRadioPrefs.h @@ -3,14 +3,9 @@ #include "KeyValueStore.h" class CommonRadioPrefs : public ConfigSerializer, public KeyValueStore { - bool _is_dirty = false; protected: CommonRadioPrefs() { } public: - void markDirty() { _is_dirty = true; } - void clearDirty() override { _is_dirty = false; } - bool isDirty() const override { return _is_dirty; } - virtual float getFreq() const = 0; virtual void setFreq(float f) = 0; diff --git a/examples/companion_radio/NodePrefs.h b/src/helpers/CompanionNodePrefs.h similarity index 100% rename from examples/companion_radio/NodePrefs.h rename to src/helpers/CompanionNodePrefs.h diff --git a/src/helpers/MeshEventListener.h b/src/helpers/MeshEventListener.h new file mode 100644 index 00000000000..86c4e03f0e3 --- /dev/null +++ b/src/helpers/MeshEventListener.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include +#include + +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() { } +}; diff --git a/src/helpers/sensors/RakLocationProvider.h b/src/helpers/sensors/RakLocationProvider.h index f395530f29c..87fec0f2d30 100644 --- a/src/helpers/sensors/RakLocationProvider.h +++ b/src/helpers/sensors/RakLocationProvider.h @@ -8,6 +8,7 @@ class RakLocationProvider : public LocationProvider { RakI2cGpsDriver& _driver; // RAK12500 (I2C) NmeaGpsDriver _nmeaDriver; // serial NMEA module MicroNMEALocationProvider _nmea; + mesh::RTCClock* _clock; bool _detected = false; bool _useI2c = false; uint32_t _gpsPeriodSeconds = 0; @@ -31,7 +32,7 @@ class RakLocationProvider : public LocationProvider { // serialPower, if given, switches the serial module's supply (WB_IO2 on WisBlock bases). RakLocationProvider(RakI2cGpsDriver& driver, mesh::RTCClock* clock = nullptr, UART_TYPE& serial = Serial1, RefCountedDigitalPin* serialPower = nullptr) - : _driver(driver), _nmeaDriver(serial, PIN_GPS_TX, PIN_GPS_RX, GPS_RESET, GPS_EN, serialPower), + : _driver(driver), _clock(clock), _nmeaDriver(serial, PIN_GPS_TX, PIN_GPS_RX, GPS_RESET, GPS_EN, serialPower), _nmea(_nmeaDriver, clock) {} void syncTime() override { @@ -177,6 +178,10 @@ class RakLocationProvider : public LocationProvider { fixStatsFix((uint32_t)(millis() - _acquisitionStarted)); } saveRak12500Fix(); + if (_time_sync_needed && _clock != nullptr && _lastFix.timestamp > 0) { + _clock->setCurrentTime(_lastFix.timestamp); + _time_sync_needed = false; + } } if (_gpsPeriodSeconds > 0 && _acquiringPeriodically && hasCurrentFix) { diff --git a/examples/companion_radio/AbstractUITask.h b/src/helpers/ui/AbstractUITask.h similarity index 83% rename from examples/companion_radio/AbstractUITask.h rename to src/helpers/ui/AbstractUITask.h index d927c1a3faf..98343aa762f 100644 --- a/examples/companion_radio/AbstractUITask.h +++ b/src/helpers/ui/AbstractUITask.h @@ -5,15 +5,14 @@ #include #include #include +#include +#include #include #ifdef PIN_BUZZER #include #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: diff --git a/src/helpers/ui/BaseUITask.cpp b/src/helpers/ui/BaseUITask.cpp new file mode 100644 index 00000000000..4df2d37bbbb --- /dev/null +++ b/src/helpers/ui/BaseUITask.cpp @@ -0,0 +1,17 @@ +#include "BaseUITask.h" +#include + +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(); + } + } +} \ No newline at end of file diff --git a/src/helpers/ui/BaseUITask.h b/src/helpers/ui/BaseUITask.h new file mode 100644 index 00000000000..433e8ba509d --- /dev/null +++ b/src/helpers/ui/BaseUITask.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include +// #include + +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(); +}; diff --git a/examples/companion_radio/ui-new/UITask.cpp b/src/helpers/ui/companion-new/UITask.cpp similarity index 94% rename from examples/companion_radio/ui-new/UITask.cpp rename to src/helpers/ui/companion-new/UITask.cpp index a7b231ce62e..1cf81b127ca 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/src/helpers/ui/companion-new/UITask.cpp @@ -1,8 +1,8 @@ #include "UITask.h" #include -#include "../MyMesh.h" #include "target.h" #include +#include #ifdef ENABLE_WIFI_INTERFACE #include #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 @@ class SplashScreen : public UIScreen { memcpy(_version_info, ver, len); _version_info[len] = 0; + _build_date = build_date; + dismiss_after = millis() + BOOT_SCREEN_MILLIS; } @@ -74,7 +80,7 @@ class SplashScreen : public UIScreen { 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 @@ class HomeScreen : public UIScreen { 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 { @@ -341,15 +365,16 @@ class HomeScreen : public UIScreen { else display.drawTextCentered(display.width() / 2, 43, "< Connected >"); #ifdef WITH_MQTT_BRIDGE - } else if (!_node_prefs->ui_show_clock && the_mesh.getObserver().configuredSlots() > 0) { // MQTT observer uplink + } else if (!_node_prefs->ui_show_clock && _task->getObserver() != NULL && + _task->getObserver()->configuredSlots() > 0) { // MQTT observer uplink display.setTextSize(1); - snprintf(tmp, sizeof(tmp), "MQTT %d/%d up", the_mesh.getObserver().connectedSlots(), - the_mesh.getObserver().configuredSlots()); + snprintf(tmp, sizeof(tmp), "MQTT %d/%d up", _task->getObserver()->connectedSlots(), + _task->getObserver()->configuredSlots()); display.drawTextCentered(display.width() / 2, 43, tmp); #endif - } else if (the_mesh.getBLEPin() != 0) { // BT pin + } else if (_task->getBLEPin() != 0) { // 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); @@ -359,11 +384,10 @@ class HomeScreen : public UIScreen { } } } 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) { @@ -630,7 +654,15 @@ class HomeScreen : public UIScreen { #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); @@ -763,9 +795,14 @@ class MsgPreviewScreen : public UIScreen { } }; -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(); @@ -798,7 +835,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); @@ -895,6 +932,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) { @@ -1185,7 +1224,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; @@ -1230,7 +1269,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; @@ -1258,7 +1297,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 diff --git a/examples/companion_radio/ui-new/UITask.h b/src/helpers/ui/companion-new/UITask.h similarity index 75% rename from examples/companion_radio/ui-new/UITask.h rename to src/helpers/ui/companion-new/UITask.h index 045b1060cfd..f87cf512e5c 100644 --- a/examples/companion_radio/ui-new/UITask.h +++ b/src/helpers/ui/companion-new/UITask.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -19,8 +20,11 @@ #include #endif -#include "../AbstractUITask.h" -#include "../NodePrefs.h" +#include +#include +#ifdef WITH_MQTT_BRIDGE + #include // companion observer: "MQTT n/m up" on the home screen +#endif #ifdef UI_NO_DISCOVER_SCREEN #error "UI_NO_DISCOVER_SCREEN is obsolete - use -D UI_DISCOVER_SCREEN=0 instead" @@ -49,6 +53,11 @@ struct DiscoveredNode { class UITask : public AbstractUITask { DisplayDriver* _display; SensorManager* _sensors; + BaseChatMesh* the_mesh; + uint32_t _ble_pin; +#ifdef WITH_MQTT_BRIDGE + const CompanionObserver* _observer = NULL; +#endif #ifdef PIN_BUZZER genericBuzzer buzzer; #endif @@ -90,12 +99,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 +113,14 @@ class UITask : public AbstractUITask { bool hasDisplay() const { return _display != NULL; } bool isButtonPressed() const; + BaseChatMesh* getMesh() const { return the_mesh; } + uint32_t getBLEPin() const { return _ble_pin; } +#ifdef WITH_MQTT_BRIDGE + // The mesh is held as BaseChatMesh*, so the companion observer is handed in separately. + void setObserver(const CompanionObserver* observer) { _observer = observer; } + const CompanionObserver* getObserver() const { return _observer; } +#endif + bool isBuzzerQuiet() { #ifdef PIN_BUZZER return buzzer.isQuiet(); @@ -116,7 +134,7 @@ class UITask : public AbstractUITask { 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; diff --git a/examples/companion_radio/ui-new/icons.h b/src/helpers/ui/companion-new/icons.h similarity index 100% rename from examples/companion_radio/ui-new/icons.h rename to src/helpers/ui/companion-new/icons.h diff --git a/examples/companion_radio/ui-orig/Button.cpp b/src/helpers/ui/companion-orig/Button.cpp similarity index 100% rename from examples/companion_radio/ui-orig/Button.cpp rename to src/helpers/ui/companion-orig/Button.cpp diff --git a/examples/companion_radio/ui-orig/Button.h b/src/helpers/ui/companion-orig/Button.h similarity index 100% rename from examples/companion_radio/ui-orig/Button.h rename to src/helpers/ui/companion-orig/Button.h diff --git a/examples/companion_radio/ui-orig/UITask.cpp b/src/helpers/ui/companion-orig/UITask.cpp similarity index 96% rename from examples/companion_radio/ui-orig/UITask.cpp rename to src/helpers/ui/companion-orig/UITask.cpp index c2fd80fb2a1..2c5abff7ba0 100644 --- a/examples/companion_radio/ui-orig/UITask.cpp +++ b/src/helpers/ui/companion-orig/UITask.cpp @@ -1,7 +1,7 @@ #include "UITask.h" #include #include -#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(); } diff --git a/examples/companion_radio/ui-orig/UITask.h b/src/helpers/ui/companion-orig/UITask.h similarity index 82% rename from examples/companion_radio/ui-orig/UITask.h rename to src/helpers/ui/companion-orig/UITask.h index d5f798986fd..1dc6ccb72b9 100644 --- a/examples/companion_radio/ui-orig/UITask.h +++ b/src/helpers/ui/companion-orig/UITask.h @@ -3,14 +3,15 @@ #include #include #include +#include #include #ifdef PIN_BUZZER #include #endif -#include "../AbstractUITask.h" -#include "../NodePrefs.h" +#include +#include #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; diff --git a/examples/companion_radio/ui-tiny/ScrollingStatusBar.h b/src/helpers/ui/companion-tiny/ScrollingStatusBar.h similarity index 100% rename from examples/companion_radio/ui-tiny/ScrollingStatusBar.h rename to src/helpers/ui/companion-tiny/ScrollingStatusBar.h diff --git a/examples/companion_radio/ui-tiny/UITask.cpp b/src/helpers/ui/companion-tiny/UITask.cpp similarity index 93% rename from examples/companion_radio/ui-tiny/UITask.cpp rename to src/helpers/ui/companion-tiny/UITask.cpp index 1b48cca84f9..a26c50e0e7b 100644 --- a/examples/companion_radio/ui-tiny/UITask.cpp +++ b/src/helpers/ui/companion-tiny/UITask.cpp @@ -1,6 +1,5 @@ #include "UITask.h" #include -#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 @@ class SplashScreen : public UIScreen { 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 @@ class SplashScreen : public UIScreen { 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 @@ class SplashScreen : public UIScreen { } }; +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 @@ class HomeScreen : public UIScreen { 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 @@ class HomeScreen : public UIScreen { } 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 @@ class HomeScreen : public UIScreen { } }; - -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 diff --git a/examples/companion_radio/ui-tiny/UITask.h b/src/helpers/ui/companion-tiny/UITask.h similarity index 82% rename from examples/companion_radio/ui-tiny/UITask.h rename to src/helpers/ui/companion-tiny/UITask.h index 084919aa6c3..c45b83b6e15 100644 --- a/examples/companion_radio/ui-tiny/UITask.h +++ b/src/helpers/ui/companion-tiny/UITask.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -22,12 +23,14 @@ #include #endif -#include "../AbstractUITask.h" -#include "../NodePrefs.h" +#include +#include 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 @@ class UITask : public AbstractUITask { 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 @@ class UITask : public AbstractUITask { 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; diff --git a/examples/companion_radio/ui-tiny/u8g2_icons.h b/src/helpers/ui/companion-tiny/u8g2_icons.h similarity index 100% rename from examples/companion_radio/ui-tiny/u8g2_icons.h rename to src/helpers/ui/companion-tiny/u8g2_icons.h diff --git a/examples/simple_repeater/UITask.cpp b/src/helpers/ui/server/UITask.cpp similarity index 98% rename from examples/simple_repeater/UITask.cpp rename to src/helpers/ui/server/UITask.cpp index a646dbc2474..dea1da1d8c1 100644 --- a/examples/simple_repeater/UITask.cpp +++ b/src/helpers/ui/server/UITask.cpp @@ -82,7 +82,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; _timeout_seen = displayTimeoutMillis(); _auto_off = millis() + displayTimeoutMillis(); @@ -108,16 +108,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]; #ifdef DISPLAY_ACTIVITY_DASHBOARD _rows_valid = false; @@ -139,8 +141,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); @@ -170,7 +171,7 @@ void UITask::renderCurrScreen() { _display->setColor(UIColor::primary_txt); _display->setCursor(0, 30); _display->print("Rebooting..."); - return; + return 1000; } char wc_ssid[33], wc_ip[16]; if (WebConfigServer::getSetupInfo(wc_ssid, sizeof(wc_ssid), wc_ip, sizeof(wc_ip))) { @@ -194,12 +195,12 @@ void UITask::renderCurrScreen() { _display->setColor(UIColor::warning_txt); _display->setCursor(6, 50); _display->print(wc_ip); - return; + return 1000; } #endif #ifdef DISPLAY_ACTIVITY_DASHBOARD renderDashboard(); - return; + return 1000; #endif // node name _display->setCursor(0, 0); @@ -228,6 +229,7 @@ void UITask::renderCurrScreen() { } #endif } + return 1000; // 1 sec interval } #ifdef DISPLAY_REDRAW_ON_CHANGE diff --git a/examples/simple_repeater/UITask.h b/src/helpers/ui/server/UITask.h similarity index 72% rename from examples/simple_repeater/UITask.h rename to src/helpers/ui/server/UITask.h index 9c7a05ef9be..7f4732b8f45 100644 --- a/examples/simple_repeater/UITask.h +++ b/src/helpers/ui/server/UITask.h @@ -1,6 +1,12 @@ #pragma once -#include +// Server-role (repeater / room server / sensor) display task. Upstream moved this +// here from examples/simple_repeater and examples/simple_room_server; the observer +// build extends it with the activity dashboard, live display.timeout / flip, the +// WebConfig setup screen and touch toggle. Each variant's target.cpp creates +// `UITask ui_task(&board, &display)`. + +#include #include #ifdef DISPLAY_ACTIVITY_DASHBOARD @@ -16,13 +22,12 @@ #include #endif -class UITask { - mesh::MainBoard* _board; - DisplayDriver* _display; - unsigned long _next_read, _next_refresh, _auto_off; +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; @@ -60,10 +65,12 @@ class UITask { unsigned long displayTimeoutMillis() const; - void renderCurrScreen(); +protected: + long renderCurrScreen() override; + 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); + 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); #ifdef WITH_MQTT_BRIDGE // Supplies `display.timeout`, which is read live so a config change applies @@ -75,5 +82,5 @@ class UITask { void setActivityWindow(RadioActivityWindow* activity) { _activity = activity; } #endif - void loop(); + void loop() override; }; diff --git a/test/test_companion_node_prefs/test_companion_node_prefs.cpp b/test/test_companion_node_prefs/test_companion_node_prefs.cpp index 433c9710601..fa1390af5e7 100644 --- a/test/test_companion_node_prefs/test_companion_node_prefs.cpp +++ b/test/test_companion_node_prefs/test_companion_node_prefs.cpp @@ -4,7 +4,7 @@ #include #include -#include "../../examples/companion_radio/NodePrefs.h" +#include "../../src/helpers/CompanionNodePrefs.h" class ReplayStream : public Stream { const char* _text; diff --git a/test/test_gps_default/test_gps_default.cpp b/test/test_gps_default/test_gps_default.cpp index 9a77f332996..fd0161ee7f4 100644 --- a/test/test_gps_default/test_gps_default.cpp +++ b/test/test_gps_default/test_gps_default.cpp @@ -5,7 +5,7 @@ #include #include "helpers/GpsDefault.h" -#include "../../examples/companion_radio/NodePrefs.h" +#include "../../src/helpers/CompanionNodePrefs.h" // upstream moved examples/companion_radio/NodePrefs.h here // CommonRadioPrefs::setByKey/getByKey come from test/mocks/CommonRadioPrefs.cpp on this branch. diff --git a/variants/dfrobot_lorawan_esp32s3/platformio.ini b/variants/dfrobot_lorawan_esp32s3/platformio.ini index 0f69e2761de..f7861cc34bb 100644 --- a/variants/dfrobot_lorawan_esp32s3/platformio.ini +++ b/variants/dfrobot_lorawan_esp32s3/platformio.ini @@ -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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${DFRobot_LoRaWAN_ESP32S3.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/dfrobot_lorawan_esp32s3/target.cpp b/variants/dfrobot_lorawan_esp32s3/target.cpp index bf723516657..e2f20359fbc 100644 --- a/variants/dfrobot_lorawan_esp32s3/target.cpp +++ b/variants/dfrobot_lorawan_esp32s3/target.cpp @@ -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() { diff --git a/variants/dfrobot_lorawan_esp32s3/target.h b/variants/dfrobot_lorawan_esp32s3/target.h index 07cec79ba79..377377434b5 100644 --- a/variants/dfrobot_lorawan_esp32s3/target.h +++ b/variants/dfrobot_lorawan_esp32s3/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #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(); diff --git a/variants/ebyte_eora_s3/platformio.ini b/variants/ebyte_eora_s3/platformio.ini index 258d7193724..e2bb5784af2 100644 --- a/variants/ebyte_eora_s3/platformio.ini +++ b/variants/ebyte_eora_s3/platformio.ini @@ -37,6 +37,7 @@ build_flags = -D SX126X_RX_BOOSTED_GAIN=1 build_src_filter = ${esp32_base.build_src_filter} +<../variants/ebyte_eora_s3> + + 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} + +<../examples/simple_repeater> + + 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} + +<../examples/simple_room_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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Ebyte_EoRa-S3.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -165,12 +170,14 @@ build_flags = ; -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D ESP32_CPU_FREQ=160 + -I src/helpers/ui/server build_src_filter = ${Ebyte_EoRa-S3.build_src_filter} + + + + +<../examples/simple_repeater> + + lib_deps = ${Ebyte_EoRa-S3.lib_deps} ${esp32_ota.lib_deps} @@ -204,12 +211,14 @@ build_flags = ; -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D ESP32_CPU_FREQ=160 + -I src/helpers/ui/server build_src_filter = ${Ebyte_EoRa-S3.build_src_filter} + + + + +<../examples/simple_room_server> + + lib_deps = ${Ebyte_EoRa-S3.lib_deps} ${esp32_ota.lib_deps} diff --git a/variants/ebyte_eora_s3/target.cpp b/variants/ebyte_eora_s3/target.cpp index 91d851ff3e2..f66fc224a4c 100644 --- a/variants/ebyte_eora_s3/target.cpp +++ b/variants/ebyte_eora_s3/target.cpp @@ -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 diff --git a/variants/ebyte_eora_s3/target.h b/variants/ebyte_eora_s3/target.h index b64694f5d36..6ee9d3e2ca2 100644 --- a/variants/ebyte_eora_s3/target.h +++ b/variants/ebyte_eora_s3/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #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(); diff --git a/variants/gat562_30s_mesh_kit/platformio.ini b/variants/gat562_30s_mesh_kit/platformio.ini index 326e3f705cb..8196c36f820 100644 --- a/variants/gat562_30s_mesh_kit/platformio.ini +++ b/variants/gat562_30s_mesh_kit/platformio.ini @@ -23,6 +23,7 @@ build_src_filter = ${nrf52_base.build_src_filter} + + + + + 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} + +<../examples/simple_repeater> + + [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} + +<../examples/simple_room_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> + + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${GAT562_30S_Mesh_Kit.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/gat562_30s_mesh_kit/target.cpp b/variants/gat562_30s_mesh_kit/target.cpp index 96e38a79ee6..3cbdfbb1af0 100644 --- a/variants/gat562_30s_mesh_kit/target.cpp +++ b/variants/gat562_30s_mesh_kit/target.cpp @@ -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 diff --git a/variants/gat562_30s_mesh_kit/target.h b/variants/gat562_30s_mesh_kit/target.h index d526a5d0379..6cd99be49a7 100644 --- a/variants/gat562_30s_mesh_kit/target.h +++ b/variants/gat562_30s_mesh_kit/target.h @@ -10,12 +10,14 @@ #ifdef DISPLAY_CLASS #include + #include extern DISPLAY_CLASS display; #include extern MomentaryButton user_btn; extern MomentaryButton joystick_left; extern MomentaryButton joystick_right; extern MomentaryButton back_btn; + extern UITask ui_task; #endif extern GAT56230SMeshKitBoard board; diff --git a/variants/gat562_mesh_evb_pro/target.cpp b/variants/gat562_mesh_evb_pro/target.cpp index 0aac297a027..215bdc79301 100644 --- a/variants/gat562_mesh_evb_pro/target.cpp +++ b/variants/gat562_mesh_evb_pro/target.cpp @@ -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 diff --git a/variants/gat562_mesh_evb_pro/target.h b/variants/gat562_mesh_evb_pro/target.h index 9111704fca2..c09d89ab7f1 100644 --- a/variants/gat562_mesh_evb_pro/target.h +++ b/variants/gat562_mesh_evb_pro/target.h @@ -10,11 +10,13 @@ #ifdef DISPLAY_CLASS #include + #include extern DISPLAY_CLASS display; #include extern MomentaryButton user_btn; extern MomentaryButton back_btn; + extern UITask ui_task; #endif extern GAT562EVBProBoard board; diff --git a/variants/gat562_mesh_tracker_pro/platformio.ini b/variants/gat562_mesh_tracker_pro/platformio.ini index 1141cee622f..622e3ccadb5 100644 --- a/variants/gat562_mesh_tracker_pro/platformio.ini +++ b/variants/gat562_mesh_tracker_pro/platformio.ini @@ -19,6 +19,7 @@ build_src_filter = ${nrf52_base.build_src_filter} + + + + + 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} + +<../examples/simple_repeater> + + [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} + +<../examples/simple_room_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> + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${GAT562_Mesh_Tracker_Pro.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/gat562_mesh_tracker_pro/target.cpp b/variants/gat562_mesh_tracker_pro/target.cpp index 225aa161964..e2f8fa83acb 100644 --- a/variants/gat562_mesh_tracker_pro/target.cpp +++ b/variants/gat562_mesh_tracker_pro/target.cpp @@ -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 diff --git a/variants/gat562_mesh_tracker_pro/target.h b/variants/gat562_mesh_tracker_pro/target.h index 0d3b7d76ea9..52b31b35fca 100644 --- a/variants/gat562_mesh_tracker_pro/target.h +++ b/variants/gat562_mesh_tracker_pro/target.h @@ -10,7 +10,9 @@ #ifdef DISPLAY_CLASS #include + #include extern DISPLAY_CLASS display; + extern UITask ui_task; #include extern MomentaryButton user_btn; extern MomentaryButton joystick_left; diff --git a/variants/gat562_mesh_watch13/platformio.ini b/variants/gat562_mesh_watch13/platformio.ini index d8ca3052786..469a761bff7 100644 --- a/variants/gat562_mesh_watch13/platformio.ini +++ b/variants/gat562_mesh_watch13/platformio.ini @@ -22,6 +22,7 @@ build_src_filter = ${nrf52_base.build_src_filter} + + + + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${GAT562_Mesh_Watch13.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/gat562_mesh_watch13/target.cpp b/variants/gat562_mesh_watch13/target.cpp index 95bcf6dc280..679a63f0e95 100644 --- a/variants/gat562_mesh_watch13/target.cpp +++ b/variants/gat562_mesh_watch13/target.cpp @@ -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 diff --git a/variants/gat562_mesh_watch13/target.h b/variants/gat562_mesh_watch13/target.h index 9ed5cda7172..412ee2118cd 100644 --- a/variants/gat562_mesh_watch13/target.h +++ b/variants/gat562_mesh_watch13/target.h @@ -10,6 +10,8 @@ #ifdef DISPLAY_CLASS #include + #include + extern UITask ui_task; extern DISPLAY_CLASS display; #include extern MomentaryButton user_btn; diff --git a/variants/heltec_e213/platformio.ini b/variants/heltec_e213/platformio.ini index 7f77cfe906a..d1a311efde3 100644 --- a/variants/heltec_e213/platformio.ini +++ b/variants/heltec_e213/platformio.ini @@ -37,6 +37,7 @@ build_flags = -D DISP_MOSI=6 build_src_filter = ${esp32_base.build_src_filter} +<../variants/heltec_e213> + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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} + +<../examples/simple_repeater> + + 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} + + +<../examples/simple_repeater> + + 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} + +<../examples/simple_room_server> + + lib_deps = ${Heltec_E213_base.lib_deps} ${esp32_ota.lib_deps} @@ -197,6 +204,7 @@ build_flags = -D ESP32_CPU_FREQ=160 -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${Heltec_E213_base.build_src_filter} + + @@ -204,6 +212,7 @@ build_src_filter = ${Heltec_E213_base.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${Heltec_E213_base.lib_deps} ${esp32_ota.lib_deps} @@ -240,6 +249,7 @@ build_flags = -D ESP32_CPU_FREQ=160 -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${Heltec_E213_base.build_src_filter} + + @@ -247,6 +257,7 @@ build_src_filter = ${Heltec_E213_base.build_src_filter} + + +<../examples/simple_room_server> + + lib_deps = ${Heltec_E213_base.lib_deps} ${esp32_ota.lib_deps} diff --git a/variants/heltec_e213/target.cpp b/variants/heltec_e213/target.cpp index 6914769d9c8..6ec3c2b2778 100644 --- a/variants/heltec_e213/target.cpp +++ b/variants/heltec_e213/target.cpp @@ -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() { diff --git a/variants/heltec_e213/target.h b/variants/heltec_e213/target.h index 6f2c291bb8d..71b62813eaa 100644 --- a/variants/heltec_e213/target.h +++ b/variants/heltec_e213/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include #include +#include #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(); diff --git a/variants/heltec_e290/platformio.ini b/variants/heltec_e290/platformio.ini index 1a310e34899..73beec7489e 100644 --- a/variants/heltec_e290/platformio.ini +++ b/variants/heltec_e290/platformio.ini @@ -31,6 +31,7 @@ build_flags = -D PIN_BOARD_SCL=38 build_src_filter = ${esp32_base.build_src_filter} +<../variants/heltec_e290> + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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} + +<../examples/simple_repeater> + + 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} + + +<../examples/simple_repeater> + + 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} + +<../examples/simple_room_server> + + lib_deps = ${Heltec_E290_base.lib_deps} ${esp32_ota.lib_deps} @@ -191,6 +198,7 @@ build_flags = -D ESP32_CPU_FREQ=160 -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${Heltec_E290_base.build_src_filter} + + @@ -198,6 +206,7 @@ build_src_filter = ${Heltec_E290_base.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${Heltec_E290_base.lib_deps} ${esp32_ota.lib_deps} @@ -234,6 +243,7 @@ build_flags = -D ESP32_CPU_FREQ=160 -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${Heltec_E290_base.build_src_filter} + + @@ -241,6 +251,7 @@ build_src_filter = ${Heltec_E290_base.build_src_filter} + + +<../examples/simple_room_server> + + lib_deps = ${Heltec_E290_base.lib_deps} ${esp32_ota.lib_deps} diff --git a/variants/heltec_e290/target.cpp b/variants/heltec_e290/target.cpp index f23279548f9..41457ebdc02 100644 --- a/variants/heltec_e290/target.cpp +++ b/variants/heltec_e290/target.cpp @@ -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() { diff --git a/variants/heltec_e290/target.h b/variants/heltec_e290/target.h index d78521fcfb8..b93e03fc61b 100644 --- a/variants/heltec_e290/target.h +++ b/variants/heltec_e290/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include #include +#include #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(); diff --git a/variants/heltec_mesh_solar/target.cpp b/variants/heltec_mesh_solar/target.cpp index 9e7fb04d189..315ddbd64b6 100644 --- a/variants/heltec_mesh_solar/target.cpp +++ b/variants/heltec_mesh_solar/target.cpp @@ -18,6 +18,7 @@ SolarExternalWatchdog external_watchdog; #ifdef DISPLAY_CLASS DISPLAY_CLASS display; + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/heltec_mesh_solar/target.h b/variants/heltec_mesh_solar/target.h index 97550a00530..31ddbee05c0 100644 --- a/variants/heltec_mesh_solar/target.h +++ b/variants/heltec_mesh_solar/target.h @@ -11,6 +11,7 @@ #include #ifdef DISPLAY_CLASS #include + #include #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(); diff --git a/variants/heltec_rc32/platformio.ini b/variants/heltec_rc32/platformio.ini index 2a730af4620..47a524a56ca 100644 --- a/variants/heltec_rc32/platformio.ini +++ b/variants/heltec_rc32/platformio.ini @@ -72,6 +72,7 @@ build_flags = build_src_filter = ${Heltec_RC32.build_src_filter} + + + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Heltec_RC32.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -215,6 +216,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 @@ -222,6 +224,7 @@ build_flags = -D MAX_NEIGHBOURS=50 build_src_filter = ${Heltec_RC32_with_display.build_src_filter} +<../examples/simple_repeater> + + lib_deps = ${Heltec_RC32_with_display.lib_deps} ${esp32_ota.lib_deps} @@ -231,6 +234,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 @@ -240,6 +244,7 @@ build_flags = build_src_filter = ${Heltec_RC32_with_display.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${Heltec_RC32_with_display.lib_deps} ${esp32_ota.lib_deps} @@ -248,6 +253,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 @@ -255,6 +261,7 @@ build_flags = -D ROOM_PASSWORD='"hello"' build_src_filter = ${Heltec_RC32_with_display.build_src_filter} +<../examples/simple_room_server> + + lib_deps = ${Heltec_RC32_with_display.lib_deps} ${esp32_ota.lib_deps} @@ -275,7 +282,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 @@ -284,7 +291,7 @@ build_src_filter = ${Heltec_RC32_with_display.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Heltec_RC32_with_display.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -294,7 +301,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 @@ -306,7 +313,7 @@ build_src_filter = ${Heltec_RC32_with_display.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Heltec_RC32_with_display.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -316,7 +323,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 @@ -330,7 +337,7 @@ build_src_filter = ${Heltec_RC32_with_display.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Heltec_RC32_with_display.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -340,17 +347,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] @@ -380,12 +387,14 @@ build_flags = -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${Heltec_RC32_with_display.build_src_filter} + + + + +<../examples/simple_repeater> + + lib_deps = ${Heltec_RC32_with_display.lib_deps} ${esp32_ota.lib_deps} @@ -420,12 +429,14 @@ build_flags = -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${Heltec_RC32_with_display.build_src_filter} + + + + +<../examples/simple_room_server> + + lib_deps = ${Heltec_RC32_with_display.lib_deps} ${esp32_ota.lib_deps} diff --git a/variants/heltec_rc32/target.cpp b/variants/heltec_rc32/target.cpp index e095baab814..242e171294b 100644 --- a/variants/heltec_rc32/target.cpp +++ b/variants/heltec_rc32/target.cpp @@ -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() { diff --git a/variants/heltec_rc32/target.h b/variants/heltec_rc32/target.h index 04cb6d94a49..02ceca6166d 100644 --- a/variants/heltec_rc32/target.h +++ b/variants/heltec_rc32/target.h @@ -18,6 +18,7 @@ #else #include #endif +#include #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(); diff --git a/variants/heltec_rc52/platformio.ini b/variants/heltec_rc52/platformio.ini index d652649450e..4dec0afd8c3 100644 --- a/variants/heltec_rc52/platformio.ini +++ b/variants/heltec_rc52/platformio.ini @@ -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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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} + + + + 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> + + 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> + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${heltec_rc52_with_display.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/heltec_rc52/target.cpp b/variants/heltec_rc52/target.cpp index dc5652d8062..d6437dea84f 100644 --- a/variants/heltec_rc52/target.cpp +++ b/variants/heltec_rc52/target.cpp @@ -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() diff --git a/variants/heltec_rc52/target.h b/variants/heltec_rc52/target.h index efb7fdcb319..0d93e929e5e 100644 --- a/variants/heltec_rc52/target.h +++ b/variants/heltec_rc52/target.h @@ -19,6 +19,7 @@ #else #include #endif +#include #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(); diff --git a/variants/heltec_t096/platformio.ini b/variants/heltec_t096/platformio.ini index 1f572fc9baa..0bd9066ebff 100644 --- a/variants/heltec_t096/platformio.ini +++ b/variants/heltec_t096/platformio.ini @@ -47,6 +47,7 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_t096> + + + + 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> - + + 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} + +<../examples/simple_repeater> + + [env:Heltec_t096_room_server] extends = Heltec_t096 build_src_filter = ${Heltec_t096.build_src_filter} +<../examples/simple_room_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} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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/> diff --git a/variants/heltec_t096/target.cpp b/variants/heltec_t096/target.cpp index d0c2c07e143..91e5e0fccbd 100644 --- a/variants/heltec_t096/target.cpp +++ b/variants/heltec_t096/target.cpp @@ -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() { diff --git a/variants/heltec_t096/target.h b/variants/heltec_t096/target.h index 137d8db5ec4..c993615969b 100644 --- a/variants/heltec_t096/target.h +++ b/variants/heltec_t096/target.h @@ -12,6 +12,7 @@ #ifdef DISPLAY_CLASS #include #include +#include #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(); diff --git a/variants/heltec_t1/platformio.ini b/variants/heltec_t1/platformio.ini index 28ed67edba8..7c890076e5b 100644 --- a/variants/heltec_t1/platformio.ini +++ b/variants/heltec_t1/platformio.ini @@ -20,6 +20,7 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_t1> + + + + 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> - + + 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> + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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/> diff --git a/variants/heltec_t1/target.cpp b/variants/heltec_t1/target.cpp index 1d9c8baafc8..05bccae7471 100644 --- a/variants/heltec_t1/target.cpp +++ b/variants/heltec_t1/target.cpp @@ -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() { diff --git a/variants/heltec_t1/target.h b/variants/heltec_t1/target.h index ffd9434fac4..6cf78c37bc0 100644 --- a/variants/heltec_t1/target.h +++ b/variants/heltec_t1/target.h @@ -12,6 +12,7 @@ #ifdef DISPLAY_CLASS #include #include +#include #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(); diff --git a/variants/heltec_t114/platformio.ini b/variants/heltec_t114/platformio.ini index e795bc7fa5c..a91febe966c 100644 --- a/variants/heltec_t114/platformio.ini +++ b/variants/heltec_t114/platformio.ini @@ -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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Heltec_t114.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -152,6 +152,7 @@ build_src_filter = ${Heltec_t114.build_src_filter} + + + + + 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> - + + 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} + +<../examples/simple_repeater> + + [env:Heltec_t114_room_server] extends = Heltec_t114_with_display build_src_filter = ${Heltec_t114_with_display.build_src_filter} +<../examples/simple_room_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} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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/> diff --git a/variants/heltec_t114/target.cpp b/variants/heltec_t114/target.cpp index dc62f83bbb3..2f12ad42b30 100644 --- a/variants/heltec_t114/target.cpp +++ b/variants/heltec_t114/target.cpp @@ -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() { diff --git a/variants/heltec_t114/target.h b/variants/heltec_t114/target.h index 5aac84dbe22..d5cfd30e5d1 100644 --- a/variants/heltec_t114/target.h +++ b/variants/heltec_t114/target.h @@ -16,6 +16,7 @@ #else #include "helpers/ui/NullDisplayDriver.h" #endif +#include #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(); diff --git a/variants/heltec_t190/platformio.ini b/variants/heltec_t190/platformio.ini index f24291e76aa..5e50608df68 100644 --- a/variants/heltec_t190/platformio.ini +++ b/variants/heltec_t190/platformio.ini @@ -44,6 +44,7 @@ build_src_filter = ${esp32_base.build_src_filter} + + + + + 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} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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> + + lib_deps = ${Heltec_T190_base.lib_deps} ${esp32_ota.lib_deps} @@ -118,11 +121,13 @@ build_flags = -D MESH_PACKET_LOGGING=1 -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y + -I src/helpers/ui/server build_src_filter = ${Heltec_T190_base.build_src_filter} + + + +<../examples/simple_repeater> + + lib_deps = ${Heltec_T190_base.lib_deps} ${esp32_ota.lib_deps} @@ -158,6 +163,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 @@ -170,6 +176,7 @@ build_flags = build_src_filter = ${Heltec_T190_base.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${Heltec_T190_base.lib_deps} ${esp32_ota.lib_deps} @@ -178,6 +185,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 @@ -185,6 +193,7 @@ build_flags = -D ROOM_PASSWORD='"hello"' build_src_filter = ${Heltec_T190_base.build_src_filter} +<../examples/simple_room_server> + + lib_deps = ${Heltec_T190_base.lib_deps} ${esp32_ota.lib_deps} @@ -210,11 +219,13 @@ build_flags = -D MESH_PACKET_LOGGING=1 -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y + -I src/helpers/ui/server build_src_filter = ${Heltec_T190_base.build_src_filter} + + + +<../examples/simple_room_server> + + lib_deps = ${Heltec_T190_base.lib_deps} ${esp32_ota.lib_deps} @@ -226,5 +237,8 @@ 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/> diff --git a/variants/heltec_t190/target.cpp b/variants/heltec_t190/target.cpp index 6a2eab7d847..24ba3825a05 100644 --- a/variants/heltec_t190/target.cpp +++ b/variants/heltec_t190/target.cpp @@ -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() { diff --git a/variants/heltec_t190/target.h b/variants/heltec_t190/target.h index cde63220a84..97828dbf0f8 100644 --- a/variants/heltec_t190/target.h +++ b/variants/heltec_t190/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include #include +#include #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(); diff --git a/variants/heltec_tower_v2/platformio.ini b/variants/heltec_tower_v2/platformio.ini index 207e0a508da..45791ae73e0 100644 --- a/variants/heltec_tower_v2/platformio.ini +++ b/variants/heltec_tower_v2/platformio.ini @@ -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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Heltec_tower_v2.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/heltec_tower_v2/target.cpp b/variants/heltec_tower_v2/target.cpp index ae627a0b52d..df4dbea1b7e 100644 --- a/variants/heltec_tower_v2/target.cpp +++ b/variants/heltec_tower_v2/target.cpp @@ -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() { diff --git a/variants/heltec_tower_v2/target.h b/variants/heltec_tower_v2/target.h index 0b9de40ca44..b0c0acee260 100644 --- a/variants/heltec_tower_v2/target.h +++ b/variants/heltec_tower_v2/target.h @@ -13,6 +13,7 @@ #ifdef DISPLAY_CLASS #include #include "helpers/ui/NullDisplayDriver.h" +#include #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(); diff --git a/variants/heltec_tracker/platformio.ini b/variants/heltec_tracker/platformio.ini index 72b0692321a..0bc25df00d3 100644 --- a/variants/heltec_tracker/platformio.ini +++ b/variants/heltec_tracker/platformio.ini @@ -44,6 +44,7 @@ build_flags = -D SX126X_RX_BOOSTED_GAIN=1 build_src_filter = ${esp32_base.build_src_filter} +<../variants/heltec_tracker> + + 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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.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} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.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} + +<../examples/simple_repeater> + + lib_deps = ${Heltec_tracker_base.lib_deps} ${esp32_ota.lib_deps} @@ -153,6 +156,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"' @@ -168,6 +172,7 @@ build_src_filter = ${Heltec_tracker_base.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${Heltec_tracker_base.lib_deps} ${esp32_ota.lib_deps} @@ -176,6 +181,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"' @@ -188,6 +194,7 @@ build_flags = build_src_filter = ${Heltec_tracker_base.build_src_filter} + +<../examples/simple_room_server> + + lib_deps = ${Heltec_tracker_base.lib_deps} ${esp32_ota.lib_deps} @@ -224,6 +231,7 @@ build_flags = -D ESP32_CPU_FREQ=240 -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${Heltec_tracker_base.build_src_filter} + + @@ -231,6 +239,7 @@ build_src_filter = ${Heltec_tracker_base.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${Heltec_tracker_base.lib_deps} ${esp32_ota.lib_deps} @@ -269,6 +278,7 @@ build_flags = -D ESP32_CPU_FREQ=240 -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${Heltec_tracker_base.build_src_filter} + + @@ -276,6 +286,7 @@ build_src_filter = ${Heltec_tracker_base.build_src_filter} + + +<../examples/simple_room_server> + + lib_deps = ${Heltec_tracker_base.lib_deps} ${esp32_ota.lib_deps} diff --git a/variants/heltec_tracker/target.cpp b/variants/heltec_tracker/target.cpp index 67f98306c9d..e8208a78cbd 100644 --- a/variants/heltec_tracker/target.cpp +++ b/variants/heltec_tracker/target.cpp @@ -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() { diff --git a/variants/heltec_tracker/target.h b/variants/heltec_tracker/target.h index f6fea637103..d369a2ed5c1 100644 --- a/variants/heltec_tracker/target.h +++ b/variants/heltec_tracker/target.h @@ -11,6 +11,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #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(); diff --git a/variants/heltec_tracker_v2/platformio.ini b/variants/heltec_tracker_v2/platformio.ini index 93b11f26ec9..15cbb111234 100644 --- a/variants/heltec_tracker_v2/platformio.ini +++ b/variants/heltec_tracker_v2/platformio.ini @@ -53,6 +53,7 @@ build_flags = build_src_filter = ${esp32_base.build_src_filter} +<../variants/heltec_tracker_v2> + + + lib_deps = ${esp32_base.lib_deps} ${sensor_base.lib_deps} @@ -112,6 +113,7 @@ lib_deps = ${Heltec_tracker_v2.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 @@ -123,6 +125,7 @@ build_flags = build_src_filter = ${Heltec_tracker_v2.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${Heltec_tracker_v2.lib_deps} ${esp32_ota.lib_deps} @@ -132,6 +135,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 @@ -146,6 +150,7 @@ build_src_filter = ${Heltec_tracker_v2.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${Heltec_tracker_v2.lib_deps} ${esp32_ota.lib_deps} @@ -154,6 +159,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 @@ -165,6 +171,7 @@ build_flags = build_src_filter = ${Heltec_tracker_v2.build_src_filter} + +<../examples/simple_room_server> + + lib_deps = ${Heltec_tracker_v2.lib_deps} ${esp32_ota.lib_deps} @@ -191,12 +198,14 @@ build_flags = -D MQTT_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm + -I src/helpers/ui/server build_src_filter = ${Heltec_tracker_v1_1.build_src_filter} + + + + +<../examples/simple_repeater> + + lib_deps = ${Heltec_tracker_v1_1.lib_deps} ${esp32_ota.lib_deps} @@ -228,12 +237,14 @@ build_flags = -D MQTT_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm + -I src/helpers/ui/server build_src_filter = ${Heltec_tracker_v2.build_src_filter} + + + + +<../examples/simple_repeater> + + lib_deps = ${Heltec_tracker_v2.lib_deps} ${esp32_ota.lib_deps} @@ -266,12 +277,14 @@ build_flags = -D MQTT_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm + -I src/helpers/ui/server build_src_filter = ${Heltec_tracker_v1_1.build_src_filter} + + + + +<../examples/simple_room_server> + + lib_deps = ${Heltec_tracker_v1_1.lib_deps} ${esp32_ota.lib_deps} @@ -304,12 +317,14 @@ build_flags = -D MQTT_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm + -I src/helpers/ui/server build_src_filter = ${Heltec_tracker_v2.build_src_filter} + + + + +<../examples/simple_room_server> + + lib_deps = ${Heltec_tracker_v2.lib_deps} ${esp32_ota.lib_deps} @@ -337,7 +352,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 @@ -348,7 +363,7 @@ build_src_filter = ${Heltec_tracker_v2.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Heltec_tracker_v2.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -357,7 +372,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 @@ -373,7 +388,7 @@ build_src_filter = ${Heltec_tracker_v2.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Heltec_tracker_v2.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -382,7 +397,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 @@ -399,7 +414,7 @@ build_src_filter = ${Heltec_tracker_v2.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Heltec_tracker_v2.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -413,7 +428,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} diff --git a/variants/heltec_tracker_v2/target.cpp b/variants/heltec_tracker_v2/target.cpp index 12b01bcc6c6..1472979ff2b 100644 --- a/variants/heltec_tracker_v2/target.cpp +++ b/variants/heltec_tracker_v2/target.cpp @@ -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() { diff --git a/variants/heltec_tracker_v2/target.h b/variants/heltec_tracker_v2/target.h index 240d9d4c58e..1e4b0f04176 100644 --- a/variants/heltec_tracker_v2/target.h +++ b/variants/heltec_tracker_v2/target.h @@ -11,6 +11,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #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(); diff --git a/variants/heltec_v2/platformio.ini b/variants/heltec_v2/platformio.ini index 16389a27ee2..d9bbcc09b85 100644 --- a/variants/heltec_v2/platformio.ini +++ b/variants/heltec_v2/platformio.ini @@ -23,6 +23,7 @@ build_flags = -D PIN_OLED_RESET=16 build_src_filter = ${esp32_base.build_src_filter} +<../variants/heltec_v2> + + 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> + + + + 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} + + +<../examples/simple_repeater> + + 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} + + +<../examples/simple_room_server> + + lib_deps = ${Heltec_lora32_v2.lib_deps} ${esp32_ota.lib_deps} @@ -142,6 +149,7 @@ build_flags = -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D ESP32_CPU_FREQ=160 -D WITH_SNMP=1 + -I src/helpers/ui/server # -D WIFI_SSID='"ssid"' # -D WIFI_PWD='"password"' build_src_filter = ${Heltec_lora32_v2.build_src_filter} @@ -152,6 +160,7 @@ build_src_filter = ${Heltec_lora32_v2.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${Heltec_lora32_v2.lib_deps} ${esp32_ota.lib_deps} @@ -186,6 +195,7 @@ build_flags = -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D ESP32_CPU_FREQ=160 -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${Heltec_lora32_v2.build_src_filter} + + @@ -194,6 +204,7 @@ build_src_filter = ${Heltec_lora32_v2.build_src_filter} + + +<../examples/simple_room_server> + + lib_deps = ${Heltec_lora32_v2.lib_deps} ${esp32_ota.lib_deps} @@ -222,7 +233,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 @@ -234,7 +245,7 @@ build_src_filter = ${Heltec_lora32_v2.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Heltec_lora32_v2.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -243,7 +254,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 @@ -257,7 +268,7 @@ build_src_filter = ${Heltec_lora32_v2.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Heltec_lora32_v2.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -266,7 +277,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 @@ -283,7 +294,7 @@ build_src_filter = ${Heltec_lora32_v2.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Heltec_lora32_v2.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/heltec_v2/target.cpp b/variants/heltec_v2/target.cpp index 585b0a37749..30cdb7cf22f 100644 --- a/variants/heltec_v2/target.cpp +++ b/variants/heltec_v2/target.cpp @@ -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() { diff --git a/variants/heltec_v2/target.h b/variants/heltec_v2/target.h index cdffc18a172..cf2ca366ece 100644 --- a/variants/heltec_v2/target.h +++ b/variants/heltec_v2/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #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(); diff --git a/variants/heltec_v3/platformio.ini b/variants/heltec_v3/platformio.ini index a1ef46ec938..cb58f24ade5 100644 --- a/variants/heltec_v3/platformio.ini +++ b/variants/heltec_v3/platformio.ini @@ -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> + + + 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,10 +53,12 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${Heltec_lora32_v3.build_src_filter} + + + +<../examples/simple_repeater> - - - + +<../variants/heltec_v3/ui-other/*.cpp> lib_deps = ${Heltec_lora32_v3.lib_deps} ${esp32_ota.lib_deps} @@ -64,6 +68,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 @@ -79,7 +84,9 @@ build_flags = build_src_filter = ${Heltec_lora32_v3.build_src_filter} + + + + +<../examples/simple_repeater> + +<../variants/heltec_v3/ui-other/*.cpp> lib_deps = ${Heltec_lora32_v3.lib_deps} ${esp32_ota.lib_deps} @@ -101,7 +108,9 @@ build_flags = build_src_filter = ${Heltec_lora32_v3.build_src_filter} + + + + +<../examples/simple_repeater> + +<../variants/heltec_v3/ui-other/*.cpp> lib_deps = ${Heltec_lora32_v3.lib_deps} ${esp32_ota.lib_deps} @@ -137,6 +146,7 @@ build_flags = -D ESP32_CPU_FREQ=160 -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm -D WITH_SNMP=1 + -I src/helpers/ui/server # -D WIFI_SSID='"ssid"' # -D WIFI_PWD='"password"' # -D MQTT_SERVER='"your-mqtt-broker.com"' @@ -152,6 +162,8 @@ build_src_filter = ${Heltec_lora32_v3.build_src_filter} + + +<../examples/simple_repeater> + + + +<../variants/heltec_v3/ui-other/*.cpp> lib_deps = ${Heltec_lora32_v3.lib_deps} ${esp32_ota.lib_deps} @@ -176,6 +188,7 @@ build_flags = 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 @@ -186,7 +199,9 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${Heltec_lora32_v3.build_src_filter} + + + +<../examples/simple_room_server> + +<../variants/heltec_v3/ui-other/*.cpp> lib_deps = ${Heltec_lora32_v3.lib_deps} ${esp32_ota.lib_deps} @@ -221,6 +236,7 @@ build_flags = -D WITH_SNMP=1 -D ENV_PIN_SDA=33 -D ENV_PIN_SCL=34 + -I src/helpers/ui/server build_src_filter = ${Heltec_lora32_v3.build_src_filter} + + @@ -228,6 +244,8 @@ build_src_filter = ${Heltec_lora32_v3.build_src_filter} + + +<../examples/simple_room_server> + + + +<../variants/heltec_v3/ui-other/*.cpp> lib_deps = ${Heltec_lora32_v3.lib_deps} ${esp32_ota.lib_deps} @@ -256,7 +274,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 @@ -266,8 +284,9 @@ build_flags = build_src_filter = ${Heltec_lora32_v3.build_src_filter} + + + + +<../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 @@ -276,7 +295,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 @@ -290,10 +309,11 @@ build_flags = build_src_filter = ${Heltec_lora32_v3.build_src_filter} + + + + + + +<../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 @@ -303,7 +323,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 @@ -317,10 +337,11 @@ build_flags = build_src_filter = ${Heltec_lora32_v3.build_src_filter} + + + + + + +<../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 @@ -340,7 +361,7 @@ board_ssl_cert_source = adafruit board_build.embed_files = src/certs/x509_crt_bundle.bin build_flags = ${Heltec_lora32_v3.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D ENABLE_WIFI_INTERFACE ; No PSRAM: the companion's contact table and offline queue share internal DRAM ; with WiFi and mbedTLS (~40 KB per TLS slot), so both are trimmed. Measured with @@ -367,7 +388,8 @@ build_src_filter = ${Heltec_lora32_v3.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + + +<../variants/heltec_v3/ui-companion/*.cpp> lib_deps = ${Heltec_lora32_v3.lib_deps} ${esp32_ota.lib_deps} @@ -382,6 +404,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 @@ -393,7 +416,9 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${Heltec_lora32_v3.build_src_filter} + + + +<../examples/simple_sensor> + +<../variants/heltec_v3/ui-other/*.cpp> lib_deps = ${Heltec_lora32_v3.lib_deps} ${esp32_ota.lib_deps} diff --git a/variants/heltec_v3/target.cpp b/variants/heltec_v3/target.cpp index 9824830eafe..85eb647f732 100644 --- a/variants/heltec_v3/target.cpp +++ b/variants/heltec_v3/target.cpp @@ -28,11 +28,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); diff --git a/variants/heltec_v3/target.h b/variants/heltec_v3/target.h index 3ef7b2d708c..a134a54014b 100644 --- a/variants/heltec_v3/target.h +++ b/variants/heltec_v3/target.h @@ -18,6 +18,7 @@ #ifdef DISPLAY_CLASS #include #include + #include // needs -I(nclude) path setting #endif extern HeltecV3Board board; @@ -32,6 +33,7 @@ extern EnvironmentSensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/heltec_v3/ui-companion/target.cpp b/variants/heltec_v3/ui-companion/target.cpp new file mode 100644 index 00000000000..c8b9f0c7955 --- /dev/null +++ b/variants/heltec_v3/ui-companion/target.cpp @@ -0,0 +1,9 @@ +#include +#include "target.h" + +#ifdef DISPLAY_CLASS + DISPLAY_CLASS display; + MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + + UITask ui_task(&board); +#endif diff --git a/variants/heltec_v3/ui-other/target.cpp b/variants/heltec_v3/ui-other/target.cpp new file mode 100644 index 00000000000..77de97881e9 --- /dev/null +++ b/variants/heltec_v3/ui-other/target.cpp @@ -0,0 +1,9 @@ +#include +#include "target.h" + +#ifdef DISPLAY_CLASS + DISPLAY_CLASS display; + MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + + UITask ui_task(&board, &display); +#endif diff --git a/variants/heltec_v4/platformio.ini b/variants/heltec_v4/platformio.ini index 1b59587e4fa..10fcf236fae 100644 --- a/variants/heltec_v4/platformio.ini +++ b/variants/heltec_v4/platformio.ini @@ -45,6 +45,7 @@ build_flags = build_src_filter = ${esp32_base.build_src_filter} +<../variants/heltec_v4> + + + lib_deps = ${esp32_base.lib_deps} ${sensor_base.lib_deps} @@ -86,6 +87,7 @@ lib_deps = extends = heltec_v4_oled build_flags = ${heltec_v4_oled.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"Heltec Repeater"' -D ADVERT_LAT=0.0 @@ -97,6 +99,7 @@ build_flags = build_src_filter = ${heltec_v4_oled.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${heltec_v4_oled.lib_deps} ${esp32_ota.lib_deps} @@ -106,6 +109,7 @@ lib_deps = extends = heltec_v4_oled build_flags = ${heltec_v4_oled.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"Heltec Repeater"' -D ADVERT_LAT=0.0 @@ -119,6 +123,7 @@ build_flags = build_src_filter = ${heltec_v4_oled.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${heltec_v4_oled.lib_deps} ${esp32_ota.lib_deps} @@ -128,6 +133,7 @@ lib_deps = extends = heltec_v4_oled build_flags = ${heltec_v4_oled.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"ESPNow Bridge"' -D ADVERT_LAT=0.0 @@ -142,6 +148,7 @@ build_src_filter = ${heltec_v4_oled.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${heltec_v4_oled.lib_deps} ${esp32_ota.lib_deps} @@ -173,6 +180,7 @@ build_flags = -D ESP32_CPU_FREQ=160 -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm -D WITH_SNMP=1 + -I src/helpers/ui/server # -D WIFI_SSID='"ssid"' # -D WIFI_PWD='"password"' # -D MQTT_SERVER='"your-mqtt-broker.com"' @@ -186,6 +194,7 @@ build_src_filter = ${heltec_v4_oled.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${heltec_v4_oled.lib_deps} ${esp32_ota.lib_deps} @@ -225,6 +234,7 @@ build_flags = -D WITH_SNMP=1 -D ENV_PIN_SDA=4 -D ENV_PIN_SCL=3 + -I src/helpers/ui/server # -D WIFI_SSID='"ssid"' # -D WIFI_PWD='"password"' # -D MQTT_SERVER='"your-mqtt-broker.com"' @@ -238,6 +248,7 @@ build_src_filter = ${heltec_v4_oled.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${heltec_v4_oled.lib_deps} ${esp32_ota.lib_deps} @@ -322,6 +333,7 @@ build_flags = -D ESP32_CPU_FREQ=160 -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${heltec_v4_oled.build_src_filter} + + @@ -329,6 +341,7 @@ build_src_filter = ${heltec_v4_oled.build_src_filter} + + +<../examples/simple_room_server> + + lib_deps = ${heltec_v4_oled.lib_deps} ${esp32_ota.lib_deps} @@ -366,6 +379,7 @@ build_flags = -D ENV_PIN_SDA=4 -D ENV_PIN_SCL=3 -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${heltec_v4_oled.build_src_filter} + + @@ -373,6 +387,7 @@ build_src_filter = ${heltec_v4_oled.build_src_filter} + + +<../examples/simple_room_server> + + lib_deps = ${heltec_v4_oled.lib_deps} ${esp32_ota.lib_deps} @@ -387,6 +402,7 @@ lib_deps = extends = heltec_v4_oled build_flags = ${heltec_v4_oled.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"Heltec Room"' -D ADVERT_LAT=0.0 @@ -398,6 +414,7 @@ build_flags = build_src_filter = ${heltec_v4_oled.build_src_filter} + +<../examples/simple_room_server> + + lib_deps = ${heltec_v4_oled.lib_deps} ${esp32_ota.lib_deps} @@ -420,7 +437,7 @@ lib_deps = extends = heltec_v4_oled build_flags = ${heltec_v4_oled.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 @@ -431,7 +448,7 @@ build_src_filter = ${heltec_v4_oled.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${heltec_v4_oled.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -440,7 +457,7 @@ lib_deps = extends = heltec_v4_oled build_flags = ${heltec_v4_oled.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 @@ -458,7 +475,7 @@ build_src_filter = ${heltec_v4_oled.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${heltec_v4_oled.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -468,7 +485,7 @@ lib_deps = extends = heltec_v4_oled build_flags = ${heltec_v4_oled.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D ENABLE_WIFI_INTERFACE -D ENABLE_ESP_MDNS -D MAX_CONTACTS=350 @@ -486,7 +503,7 @@ build_src_filter = ${heltec_v4_oled.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${heltec_v4_oled.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -506,7 +523,7 @@ board_ssl_cert_source = adafruit-full board_build.embed_files = src/certs/x509_crt_bundle.bin build_flags = ${heltec_v4_oled.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D ENABLE_WIFI_INTERFACE -D ENABLE_ESP_MDNS -D MAX_CONTACTS=350 @@ -531,7 +548,7 @@ build_src_filter = ${heltec_v4_oled.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${heltec_v4_oled.lib_deps} ${esp32_ota.lib_deps} @@ -560,7 +577,7 @@ build_flags = -D ADMIN_PASSWORD='"password"' -D ENV_PIN_SDA=3 -D ENV_PIN_SCL=4 - -D DISPLAY_CLASS=SSD1306Display + ;-D DISPLAY_CLASS=SSD1306Display ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 build_src_filter = ${heltec_v4_oled.build_src_filter} @@ -575,6 +592,7 @@ lib_deps = extends = heltec_v4_tft build_flags = ${heltec_v4_tft.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=ST7789LCDDisplay -D ADVERT_NAME='"Heltec Repeater"' -D ADVERT_LAT=0.0 @@ -586,6 +604,7 @@ build_flags = build_src_filter = ${heltec_v4_tft.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${heltec_v4_tft.lib_deps} ${esp32_ota.lib_deps} @@ -596,6 +615,7 @@ lib_deps = extends = heltec_v4_tft build_flags = ${heltec_v4_tft.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=ST7789LCDDisplay -D ADVERT_NAME='"ESPNow Bridge"' -D ADVERT_LAT=0.0 @@ -610,6 +630,7 @@ build_src_filter = ${heltec_v4_tft.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${heltec_v4_tft.lib_deps} ${esp32_ota.lib_deps} @@ -618,6 +639,7 @@ lib_deps = extends = heltec_v4_tft build_flags = ${heltec_v4_tft.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=ST7789LCDDisplay -D ADVERT_NAME='"Heltec Room"' -D ADVERT_LAT=0.0 @@ -629,6 +651,7 @@ build_flags = build_src_filter = ${heltec_v4_tft.build_src_filter} + +<../examples/simple_room_server> + + lib_deps = ${heltec_v4_tft.lib_deps} ${esp32_ota.lib_deps} @@ -651,7 +674,7 @@ lib_deps = extends = heltec_v4_tft build_flags = ${heltec_v4_tft.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=ST7789LCDDisplay @@ -662,7 +685,7 @@ build_src_filter = ${heltec_v4_tft.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${heltec_v4_tft.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -671,7 +694,7 @@ lib_deps = extends = heltec_v4_tft build_flags = ${heltec_v4_tft.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D DISPLAY_CLASS=ST7789LCDDisplay -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 @@ -688,7 +711,7 @@ build_src_filter = ${heltec_v4_tft.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${heltec_v4_tft.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -697,7 +720,7 @@ lib_deps = extends = heltec_v4_tft build_flags = ${heltec_v4_tft.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 @@ -714,7 +737,7 @@ build_src_filter = ${heltec_v4_tft.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${heltec_v4_tft.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -730,7 +753,7 @@ build_flags = -D ADMIN_PASSWORD='"password"' -D ENV_PIN_SDA=3 -D ENV_PIN_SCL=4 - -D DISPLAY_CLASS=ST7789LCDDisplay + ; -D DISPLAY_CLASS=ST7789LCDDisplay ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 build_src_filter = ${heltec_v4_tft.build_src_filter} diff --git a/variants/heltec_v4/target.cpp b/variants/heltec_v4/target.cpp index 0f87c6b3b36..b562b7387a4 100644 --- a/variants/heltec_v4/target.cpp +++ b/variants/heltec_v4/target.cpp @@ -27,6 +27,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock); #ifdef DISPLAY_CLASS DISPLAY_CLASS display(NULL); MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/heltec_v4/target.h b/variants/heltec_v4/target.h index 847f4fad177..3b1c0d12103 100644 --- a/variants/heltec_v4/target.h +++ b/variants/heltec_v4/target.h @@ -20,6 +20,7 @@ #include #endif #include + #include #endif extern HeltecV4Board board; @@ -30,6 +31,7 @@ extern EnvironmentSensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/heltec_v4_r8/platformio.ini b/variants/heltec_v4_r8/platformio.ini index b5b28836aee..bea3f20acaf 100644 --- a/variants/heltec_v4_r8/platformio.ini +++ b/variants/heltec_v4_r8/platformio.ini @@ -41,6 +41,7 @@ build_flags = build_src_filter = ${esp32_base.build_src_filter} +<../variants/heltec_v4_r8> + + + lib_deps = ${esp32_base.lib_deps} ${sensor_base.lib_deps} @@ -86,6 +87,7 @@ lib_deps = extends = heltec_v4_r8_oled build_flags = ${heltec_v4_r8_oled.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"Heltec R8 Repeater"' -D ADVERT_LAT=0.0 @@ -95,6 +97,7 @@ build_flags = build_src_filter = ${heltec_v4_r8_oled.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${heltec_v4_r8_oled.lib_deps} ${esp32_ota.lib_deps} @@ -125,6 +128,7 @@ build_flags = -D ESP32_CPU_FREQ=160 -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${heltec_v4_r8_oled.build_src_filter} + + @@ -132,6 +136,7 @@ build_src_filter = ${heltec_v4_r8_oled.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${heltec_v4_r8_oled.lib_deps} ${esp32_ota.lib_deps} @@ -146,6 +151,7 @@ lib_deps = extends = heltec_v4_r8_oled build_flags = ${heltec_v4_r8_oled.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"Heltec R8 Room"' -D ADVERT_LAT=0.0 @@ -155,6 +161,7 @@ build_flags = build_src_filter = ${heltec_v4_r8_oled.build_src_filter} + +<../examples/simple_room_server> + + lib_deps = ${heltec_v4_r8_oled.lib_deps} ${esp32_ota.lib_deps} @@ -184,6 +191,7 @@ build_flags = -D ESP32_CPU_FREQ=160 -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${heltec_v4_r8_oled.build_src_filter} + + @@ -191,6 +199,7 @@ build_src_filter = ${heltec_v4_r8_oled.build_src_filter} + + +<../examples/simple_room_server> + + lib_deps = ${heltec_v4_r8_oled.lib_deps} ${esp32_ota.lib_deps} @@ -217,7 +226,7 @@ lib_deps = extends = heltec_v4_r8_oled build_flags = ${heltec_v4_r8_oled.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 @@ -226,7 +235,7 @@ build_src_filter = ${heltec_v4_r8_oled.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${heltec_v4_r8_oled.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -235,7 +244,7 @@ lib_deps = extends = heltec_v4_r8_oled build_flags = ${heltec_v4_r8_oled.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 @@ -250,7 +259,7 @@ build_src_filter = ${heltec_v4_r8_oled.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${heltec_v4_r8_oled.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -260,7 +269,7 @@ lib_deps = extends = heltec_v4_r8_oled build_flags = ${heltec_v4_r8_oled.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 @@ -275,7 +284,7 @@ build_src_filter = ${heltec_v4_r8_oled.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${heltec_v4_r8_oled.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -289,7 +298,7 @@ build_flags = -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 -D ADMIN_PASSWORD='"password"' - -D DISPLAY_CLASS=SSD1306Display + ; -D DISPLAY_CLASS=SSD1306Display build_src_filter = ${heltec_v4_r8_oled.build_src_filter} + +<../examples/simple_sensor> @@ -301,6 +310,7 @@ lib_deps = extends = heltec_v4_r8_tft build_flags = ${heltec_v4_r8_tft.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=ST7789LCDDisplay -D ADVERT_NAME='"Heltec R8 Repeater"' -D ADVERT_LAT=0.0 @@ -310,6 +320,7 @@ build_flags = build_src_filter = ${heltec_v4_r8_tft.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${heltec_v4_r8_tft.lib_deps} ${esp32_ota.lib_deps} @@ -353,6 +364,7 @@ build_flags = ; and PIN_TOUCH_INT once touch is confirmed working. -D DISPLAY_TOUCH_DEBUG=1 -D PIN_TOUCH_INT=43 + -I src/helpers/ui/server build_src_filter = ${heltec_v4_r8_tft.build_src_filter} + + @@ -360,6 +372,7 @@ build_src_filter = ${heltec_v4_r8_tft.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${heltec_v4_r8_tft.lib_deps} ${esp32_ota.lib_deps} @@ -383,6 +396,7 @@ build_flags = extends = heltec_v4_r8_tft build_flags = ${heltec_v4_r8_tft.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=ST7789LCDDisplay -D ADVERT_NAME='"Heltec R8 Room"' -D ADVERT_LAT=0.0 @@ -392,6 +406,7 @@ build_flags = build_src_filter = ${heltec_v4_r8_tft.build_src_filter} + +<../examples/simple_room_server> + + lib_deps = ${heltec_v4_r8_tft.lib_deps} ${esp32_ota.lib_deps} @@ -434,6 +449,7 @@ build_flags = ; and PIN_TOUCH_INT once touch is confirmed working. -D DISPLAY_TOUCH_DEBUG=1 -D PIN_TOUCH_INT=43 + -I src/helpers/ui/server build_src_filter = ${heltec_v4_r8_tft.build_src_filter} + + @@ -441,6 +457,7 @@ build_src_filter = ${heltec_v4_r8_tft.build_src_filter} + + +<../examples/simple_room_server> + + lib_deps = ${heltec_v4_r8_tft.lib_deps} ${esp32_ota.lib_deps} @@ -476,7 +493,7 @@ lib_deps = extends = heltec_v4_r8_tft build_flags = ${heltec_v4_r8_tft.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=ST7789LCDDisplay @@ -485,7 +502,7 @@ build_src_filter = ${heltec_v4_r8_tft.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${heltec_v4_r8_tft.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -494,7 +511,7 @@ lib_deps = extends = heltec_v4_r8_tft build_flags = ${heltec_v4_r8_tft.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D DISPLAY_CLASS=ST7789LCDDisplay -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 @@ -507,7 +524,7 @@ build_src_filter = ${heltec_v4_r8_tft.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${heltec_v4_r8_tft.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -516,7 +533,7 @@ lib_deps = extends = heltec_v4_r8_tft build_flags = ${heltec_v4_r8_tft.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 @@ -531,7 +548,7 @@ build_src_filter = ${heltec_v4_r8_tft.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${heltec_v4_r8_tft.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -545,7 +562,7 @@ build_flags = -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 -D ADMIN_PASSWORD='"password"' - -D DISPLAY_CLASS=ST7789LCDDisplay + ;-D DISPLAY_CLASS=ST7789LCDDisplay build_src_filter = ${heltec_v4_r8_tft.build_src_filter} + +<../examples/simple_sensor> diff --git a/variants/heltec_v4_r8/target.cpp b/variants/heltec_v4_r8/target.cpp index 04f5a17f7dd..4132d231af4 100644 --- a/variants/heltec_v4_r8/target.cpp +++ b/variants/heltec_v4_r8/target.cpp @@ -40,6 +40,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock); #endif MomentaryButton user_btn(PIN_USER_BTN, USER_BTN_LONG_PRESS_MILLIS, true, false, USER_BTN_MULTICLICK); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/heltec_v4_r8/target.h b/variants/heltec_v4_r8/target.h index 2d1d7a5bb45..d7555d9328f 100644 --- a/variants/heltec_v4_r8/target.h +++ b/variants/heltec_v4_r8/target.h @@ -15,6 +15,7 @@ #include #endif #include + #include #endif extern HeltecV4R8Board board; @@ -25,6 +26,7 @@ extern EnvironmentSensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/heltec_wireless_paper/platformio.ini b/variants/heltec_wireless_paper/platformio.ini index 21d9a69d324..2a74ff864b0 100644 --- a/variants/heltec_wireless_paper/platformio.ini +++ b/variants/heltec_wireless_paper/platformio.ini @@ -39,6 +39,7 @@ build_flags = -D WIRELESS_PAPER build_src_filter = ${esp32_base.build_src_filter} +<../variants/heltec_wireless_paper> + + lib_deps = ${esp32_base.lib_deps} https://github.com/todd-herbert/heltec-eink-modules/archive/9207eb6ab2b96f66298e0488740218c17b006af7.zip @@ -47,7 +48,7 @@ lib_deps = extends = Heltec_Wireless_Paper_base build_flags = ${Heltec_Wireless_Paper_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 @@ -60,7 +61,7 @@ build_src_filter = ${Heltec_Wireless_Paper_base.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Heltec_Wireless_Paper_base.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -71,7 +72,7 @@ lib_deps = extends = Heltec_Wireless_Paper_base build_flags = ${Heltec_Wireless_Paper_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 @@ -81,7 +82,7 @@ build_src_filter = ${Heltec_Wireless_Paper_base.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Heltec_Wireless_Paper_base.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -91,6 +92,7 @@ lib_deps = extends = Heltec_Wireless_Paper_base build_flags = ${Heltec_Wireless_Paper_base.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=E213Display -D ADVERT_NAME='"Heltec WP Repeater"' -D ADVERT_LAT=0.0 @@ -100,6 +102,7 @@ build_flags = build_src_filter = ${Heltec_Wireless_Paper_base.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${Heltec_Wireless_Paper_base.lib_deps} ${esp32_ota.lib_deps} @@ -133,6 +136,7 @@ lib_deps = extends = Heltec_Wireless_Paper_base build_flags = ${Heltec_Wireless_Paper_base.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=E213Display -D ADVERT_NAME='"ESPNow Bridge"' -D ADVERT_LAT=0.0 @@ -147,6 +151,7 @@ build_src_filter = ${Heltec_Wireless_Paper_base.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${Heltec_Wireless_Paper_base.lib_deps} ${esp32_ota.lib_deps} @@ -156,6 +161,7 @@ lib_deps = extends = Heltec_Wireless_Paper_base build_flags = ${Heltec_Wireless_Paper_base.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=E213Display -D ADVERT_NAME='"Heltec WP Room"' -D ADVERT_LAT=0.0 @@ -165,6 +171,7 @@ build_flags = build_src_filter = ${Heltec_Wireless_Paper_base.build_src_filter} + +<../examples/simple_room_server> + + lib_deps = ${Heltec_Wireless_Paper_base.lib_deps} ${esp32_ota.lib_deps} @@ -201,6 +208,7 @@ build_flags = -D ESP32_CPU_FREQ=160 -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${Heltec_Wireless_Paper_base.build_src_filter} + + @@ -208,6 +216,7 @@ build_src_filter = ${Heltec_Wireless_Paper_base.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${Heltec_Wireless_Paper_base.lib_deps} ${esp32_ota.lib_deps} @@ -246,6 +255,7 @@ build_flags = -D ESP32_CPU_FREQ=160 -D MQTT_WIFI_TX_POWER=WIFI_POWER_11dBm -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${Heltec_Wireless_Paper_base.build_src_filter} + + @@ -253,6 +263,7 @@ build_src_filter = ${Heltec_Wireless_Paper_base.build_src_filter} + + +<../examples/simple_room_server> + + lib_deps = ${Heltec_Wireless_Paper_base.lib_deps} ${esp32_ota.lib_deps} diff --git a/variants/heltec_wireless_paper/target.cpp b/variants/heltec_wireless_paper/target.cpp index be21695ec4e..41e353efcd5 100644 --- a/variants/heltec_wireless_paper/target.cpp +++ b/variants/heltec_wireless_paper/target.cpp @@ -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() { diff --git a/variants/heltec_wireless_paper/target.h b/variants/heltec_wireless_paper/target.h index 7206678181b..c272a2f0895 100644 --- a/variants/heltec_wireless_paper/target.h +++ b/variants/heltec_wireless_paper/target.h @@ -16,6 +16,7 @@ class HeltecWirelessPaperBoard : public HeltecV3Board { #ifdef DISPLAY_CLASS #include #include +#include #endif extern HeltecWirelessPaperBoard board; @@ -26,6 +27,7 @@ extern SensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; extern MomentaryButton user_btn; +extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/ikoka_handheld_nrf/platformio.ini b/variants/ikoka_handheld_nrf/platformio.ini index 1c6f17c24c2..c06193f257b 100644 --- a/variants/ikoka_handheld_nrf/platformio.ini +++ b/variants/ikoka_handheld_nrf/platformio.ini @@ -35,6 +35,7 @@ lib_deps = ${nrf52_base.lib_deps} lib_deps = ${ikoka_handheld_nrf.lib_deps} adafruit/Adafruit SSD1306 @ ^2.5.13 build_flags = ${ikoka_handheld_nrf.build_flags} + -I src/helpers/ui/companion-new -D DISPLAY_CLASS=SSD1306Display -D DISPLAY_ROTATION=0 -D PIN_WIRE_SCL=D6 @@ -44,10 +45,10 @@ build_flags = ${ikoka_handheld_nrf.build_flags} -D MAX_GROUP_CHANNELS=40 -D OFFLINE_QUEUE_SIZE=256 -D QSPIFLASH=1 - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new build_src_filter = ${ikoka_handheld_nrf.build_src_filter} + - +<../examples/companion_radio/ui-new/UITask.cpp> + + +<../examples/companion_radio/*.cpp> [env:ikoka_handheld_nrf_e22_30dbm_096_companion_radio_ble] diff --git a/variants/ikoka_handheld_nrf/target.cpp b/variants/ikoka_handheld_nrf/target.cpp index 6c53c5e324a..561e19bd7b7 100644 --- a/variants/ikoka_handheld_nrf/target.cpp +++ b/variants/ikoka_handheld_nrf/target.cpp @@ -16,6 +16,7 @@ EnvironmentSensorManager sensors; #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true, true); + UITask ui_task(&board, &display); #endif diff --git a/variants/ikoka_handheld_nrf/target.h b/variants/ikoka_handheld_nrf/target.h index 18f7c9c5ee0..d071259c731 100644 --- a/variants/ikoka_handheld_nrf/target.h +++ b/variants/ikoka_handheld_nrf/target.h @@ -12,8 +12,11 @@ #ifdef DISPLAY_CLASS #include #include + #include + extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif diff --git a/variants/ikoka_nano_nrf/platformio.ini b/variants/ikoka_nano_nrf/platformio.ini index 87c6240eec6..bff7c62ff0f 100644 --- a/variants/ikoka_nano_nrf/platformio.ini +++ b/variants/ikoka_nano_nrf/platformio.ini @@ -10,7 +10,6 @@ build_flags = ${nrf52_base.build_flags} -I variants/ikoka_nano_nrf -I src/helpers/nrf52 -D P_LORA_TX_LED=11 - -D DISPLAY_CLASS=NullDisplayDriver -D USE_SX1262 -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper @@ -82,15 +81,16 @@ build_flags = -D MAX_GROUP_CHANNELS=40 -D BLE_PIN_CODE=123456 -D OFFLINE_QUEUE_SIZE=256 - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D QSPIFLASH=1 + -D DISPLAY_CLASS=NullDisplayDriver ; -D BLE_DEBUG_LOGGING=1 ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 build_src_filter = ${ikoka_nano_nrf.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${ikoka_nano_nrf.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -103,15 +103,16 @@ build_flags = ${ikoka_nano_nrf.build_flags} -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D QSPIFLASH=1 -D ENABLE_USB_INTERFACE + -D DISPLAY_CLASS=NullDisplayDriver ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 build_src_filter = ${ikoka_nano_nrf.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${ikoka_nano_nrf.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/ikoka_nano_nrf/target.cpp b/variants/ikoka_nano_nrf/target.cpp index baf02c3d122..9058cf8617d 100644 --- a/variants/ikoka_nano_nrf/target.cpp +++ b/variants/ikoka_nano_nrf/target.cpp @@ -7,6 +7,7 @@ IkokaNanoNRFBoard board; #ifdef DISPLAY_CLASS DISPLAY_CLASS display; // MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI); diff --git a/variants/ikoka_nano_nrf/target.h b/variants/ikoka_nano_nrf/target.h index 30ee5cb69ee..006bd738dd1 100644 --- a/variants/ikoka_nano_nrf/target.h +++ b/variants/ikoka_nano_nrf/target.h @@ -12,8 +12,11 @@ #ifdef DISPLAY_CLASS #include #include + #include + extern DISPLAY_CLASS display; // extern MomentaryButton user_btn; + extern UITask ui_task; #endif extern IkokaNanoNRFBoard board; diff --git a/variants/ikoka_stick_nrf/platformio.ini b/variants/ikoka_stick_nrf/platformio.ini index c8184fc4052..529ca2d0065 100644 --- a/variants/ikoka_stick_nrf/platformio.ini +++ b/variants/ikoka_stick_nrf/platformio.ini @@ -45,6 +45,7 @@ build_src_filter = ${ikoka_stick_nrf.build_src_filter} + + +<../variants/ikoka_stick_nrf> + + [ikoka_stick_nrf_e22_30dbm] extends = ikoka_stick_nrf @@ -60,6 +61,7 @@ build_src_filter = ${ikoka_stick_nrf.build_src_filter} + + +<../variants/ikoka_stick_nrf> + + [ikoka_stick_nrf_e22_33dbm] extends = ikoka_stick_nrf @@ -75,6 +77,7 @@ build_src_filter = ${ikoka_stick_nrf.build_src_filter} + + +<../variants/ikoka_stick_nrf> + + ;;; abstracted firmware roles @@ -88,7 +91,7 @@ build_flags = -D MAX_GROUP_CHANNELS=40 -D BLE_PIN_CODE=123456 -D OFFLINE_QUEUE_SIZE=256 - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D QSPIFLASH=1 ; -D BLE_DEBUG_LOGGING=1 ; -D MESH_PACKET_LOGGING=1 @@ -96,7 +99,7 @@ build_flags = build_src_filter = ${ikoka_stick_nrf.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${ikoka_stick_nrf.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -109,7 +112,7 @@ build_flags = ${ikoka_stick_nrf.build_flags} -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D QSPIFLASH=1 -D ENABLE_USB_INTERFACE ; -D MESH_PACKET_LOGGING=1 @@ -117,7 +120,7 @@ build_flags = build_src_filter = ${ikoka_stick_nrf.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${ikoka_stick_nrf.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -126,6 +129,7 @@ lib_deps = extends = ikoka_stick_nrf build_flags = ${ikoka_stick_nrf.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"Ikoka Stick Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -136,11 +140,13 @@ build_flags = build_src_filter = ${ikoka_stick_nrf.build_src_filter} + +<../examples/simple_repeater/*.cpp> + + [ikoka_stick_nrf_room_server] extends = ikoka_stick_nrf build_flags = ${ikoka_stick_nrf.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"Ikoka Stick Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -149,6 +155,7 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${ikoka_stick_nrf.build_src_filter} +<../examples/simple_room_server/*.cpp> + + ;;; hardware + firmware variants @@ -294,15 +301,24 @@ build_src_filter = [env:ikoka_stick_nrf_22dbm_kiss_modem] extends = ikoka_stick_nrf_e22_22dbm +build_flags = + ${ikoka_stick_nrf_e22_22dbm.build_flags} + -U DISPLAY_CLASS build_src_filter = ${ikoka_stick_nrf_e22_22dbm.build_src_filter} +<../examples/kiss_modem/> [env:ikoka_stick_nrf_30dbm_kiss_modem] extends = ikoka_stick_nrf_e22_30dbm +build_flags = + ${ikoka_stick_nrf_e22_30dbm.build_flags} + -U DISPLAY_CLASS build_src_filter = ${ikoka_stick_nrf_e22_30dbm.build_src_filter} +<../examples/kiss_modem/> [env:ikoka_stick_nrf_33dbm_kiss_modem] extends = ikoka_stick_nrf_e22_33dbm +build_flags = + ${ikoka_stick_nrf_e22_33dbm.build_flags} + -U DISPLAY_CLASS build_src_filter = ${ikoka_stick_nrf_e22_33dbm.build_src_filter} +<../examples/kiss_modem/> diff --git a/variants/ikoka_stick_nrf/target.cpp b/variants/ikoka_stick_nrf/target.cpp index bb140505a86..9b3d47183c2 100644 --- a/variants/ikoka_stick_nrf/target.cpp +++ b/variants/ikoka_stick_nrf/target.cpp @@ -7,6 +7,7 @@ IkokaStickNRFBoard board; #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI); diff --git a/variants/ikoka_stick_nrf/target.h b/variants/ikoka_stick_nrf/target.h index 46b05e8b2e0..792f3e3e9c5 100644 --- a/variants/ikoka_stick_nrf/target.h +++ b/variants/ikoka_stick_nrf/target.h @@ -12,8 +12,11 @@ #ifdef DISPLAY_CLASS #include #include + #include + extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif extern IkokaStickNRFBoard board; diff --git a/variants/keepteen_lt1/platformio.ini b/variants/keepteen_lt1/platformio.ini index 11dc214b09f..305a8807220 100644 --- a/variants/keepteen_lt1/platformio.ini +++ b/variants/keepteen_lt1/platformio.ini @@ -16,6 +16,7 @@ build_flags = ${nrf52_base.build_flags} build_src_filter = ${nrf52_base.build_src_filter} + +<../variants/keepteen_lt1> + + lib_deps= ${nrf52_base.lib_deps} adafruit/Adafruit SSD1306 @ ^2.5.13 stevemarple/MicroNMEA @ ^2.0.6 @@ -26,8 +27,10 @@ build_src_filter = ${KeepteenLT1.build_src_filter} +<../examples/simple_repeater> + + + + build_flags = ${KeepteenLT1.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"KeepteenLT1 Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -45,7 +48,9 @@ build_src_filter = ${KeepteenLT1.build_src_filter} +<../examples/simple_room_server> + + + + build_flags = ${KeepteenLT1.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"KeepteenLT1 Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -62,7 +67,7 @@ extends = KeepteenLT1 board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 712704 build_flags = ${KeepteenLT1.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 @@ -73,7 +78,7 @@ build_src_filter = ${KeepteenLT1.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${KeepteenLT1.lib_deps} adafruit/RTClib @ ^2.1.3 densaugeo/base64 @ ~1.4.0 @@ -83,7 +88,7 @@ extends = KeepteenLT1 board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 712704 build_flags = ${KeepteenLT1.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 @@ -97,7 +102,7 @@ build_src_filter = ${KeepteenLT1.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${KeepteenLT1.lib_deps} adafruit/RTClib @ ^2.1.3 densaugeo/base64 @ ~1.4.0 diff --git a/variants/keepteen_lt1/target.cpp b/variants/keepteen_lt1/target.cpp index dd7c6741b5e..0436f7e2b6d 100644 --- a/variants/keepteen_lt1/target.cpp +++ b/variants/keepteen_lt1/target.cpp @@ -22,6 +22,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/keepteen_lt1/target.h b/variants/keepteen_lt1/target.h index 5b73bb66847..e8f67ebd750 100644 --- a/variants/keepteen_lt1/target.h +++ b/variants/keepteen_lt1/target.h @@ -9,6 +9,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif #include @@ -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(); diff --git a/variants/lilygo_t3_stm32/platformio.ini b/variants/lilygo_t3_stm32/platformio.ini index 39e059b701f..e17fb96d702 100644 --- a/variants/lilygo_t3_stm32/platformio.ini +++ b/variants/lilygo_t3_stm32/platformio.ini @@ -26,28 +26,31 @@ build_flags = ${stm32_base.build_flags} build_src_filter = ${stm32_base.build_src_filter} +<../variants/lilygo_t3_stm32> + + + lib_deps = ${stm32_base.lib_deps} adafruit/Adafruit SSD1306 @ ^2.5.13 [env:LilyGo_T3_STM32_repeater] extends = lilygo_t3_stm32 build_flags = ${lilygo_t3_stm32.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"T3 STM32 Repeater"' -D ADMIN_PASSWORD='"password"' -D MAX_NEIGHBOURS=50 build_src_filter = ${lilygo_t3_stm32.build_src_filter} +<../examples/simple_repeater/*.cpp> + + [env:LilyGo_T3_STM32_companion_radio_usb] extends = lilygo_t3_stm32 build_flags = ${lilygo_t3_stm32.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D MAX_CONTACTS=100 -D MAX_GROUP_CHANNELS=8 -D ENABLE_USB_INTERFACE build_src_filter = ${lilygo_t3_stm32.build_src_filter} +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${lilygo_t3_stm32.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/lilygo_t3_stm32/target.cpp b/variants/lilygo_t3_stm32/target.cpp index b7a14c482fd..5b6b822a922 100644 --- a/variants/lilygo_t3_stm32/target.cpp +++ b/variants/lilygo_t3_stm32/target.cpp @@ -17,6 +17,7 @@ SensorManager sensors; DISPLAY_CLASS display; // PH3 is also BOOT0: the board's button is active high with an external pull-down. MomentaryButton user_btn(PIN_USER_BTN, 1000, false); +UITask ui_task(&board, &display); static const uint32_t rfswitch_pins[] = { PB2, PB6, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC diff --git a/variants/lilygo_t3_stm32/target.h b/variants/lilygo_t3_stm32/target.h index 2db3173bbb3..597ea800b3a 100644 --- a/variants/lilygo_t3_stm32/target.h +++ b/variants/lilygo_t3_stm32/target.h @@ -11,6 +11,7 @@ #endif #include #include +#include class LilyGoT3STM32Board : public STM32Board { public: @@ -31,6 +32,7 @@ extern SensorManager sensors; #endif extern DISPLAY_CLASS display; extern MomentaryButton user_btn; +extern UITask ui_task; bool radio_init(); mesh::LocalIdentity radio_new_identity(); diff --git a/variants/lilygo_t3s3/platformio.ini b/variants/lilygo_t3s3/platformio.ini index 2ba573c6452..186816e31cf 100644 --- a/variants/lilygo_t3s3/platformio.ini +++ b/variants/lilygo_t3s3/platformio.ini @@ -29,6 +29,7 @@ build_flags = -D SX126X_RX_BOOSTED_GAIN=1 build_src_filter = ${esp32_base.build_src_filter} +<../variants/lilygo_t3s3> + + lib_deps = ${esp32_base.lib_deps} adafruit/Adafruit SSD1306 @ ^2.5.13 @@ -38,6 +39,7 @@ lib_deps = extends = LilyGo_T3S3_sx1262 build_flags = ${LilyGo_T3S3_sx1262.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"T3S3-1262 Repeater"' -D ADVERT_LAT=0.0 @@ -49,6 +51,7 @@ build_flags = build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${LilyGo_T3S3_sx1262.lib_deps} ${esp32_ota.lib_deps} @@ -81,6 +84,7 @@ lib_deps = extends = LilyGo_T3S3_sx1262 build_flags = ${LilyGo_T3S3_sx1262.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"ESPNow Bridge"' -D ADVERT_LAT=0.0 @@ -95,6 +99,7 @@ build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${LilyGo_T3S3_sx1262.lib_deps} ${esp32_ota.lib_deps} @@ -122,6 +127,7 @@ build_flags = ; -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D ESP32_CPU_FREQ=160 + -I src/helpers/ui/server # -D WIFI_SSID='"ssid"' # -D WIFI_PWD='"password"' # -D MQTT_SERVER='"your-mqtt-broker.com"' @@ -134,6 +140,7 @@ build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${LilyGo_T3S3_sx1262.lib_deps} ${esp32_ota.lib_deps} @@ -167,12 +174,14 @@ build_flags = ; -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D ESP32_CPU_FREQ=160 + -I src/helpers/ui/server build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter} + + + + +<../examples/simple_room_server> + + lib_deps = ${LilyGo_T3S3_sx1262.lib_deps} ${esp32_ota.lib_deps} @@ -200,6 +209,7 @@ lib_deps = extends = LilyGo_T3S3_sx1262 build_flags = ${LilyGo_T3S3_sx1262.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"T3S3-1262 Room"' -D ADVERT_LAT=0.0 @@ -211,6 +221,7 @@ build_flags = build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter} + +<../examples/simple_room_server> + + lib_deps = ${LilyGo_T3S3_sx1262.lib_deps} ${esp32_ota.lib_deps} @@ -219,7 +230,7 @@ lib_deps = extends = LilyGo_T3S3_sx1262 build_flags = ${LilyGo_T3S3_sx1262.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 @@ -230,7 +241,7 @@ build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_T3S3_sx1262.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -239,7 +250,7 @@ lib_deps = extends = LilyGo_T3S3_sx1262 build_flags = ${LilyGo_T3S3_sx1262.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 @@ -253,7 +264,7 @@ build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_T3S3_sx1262.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/lilygo_t3s3/target.cpp b/variants/lilygo_t3s3/target.cpp index 34df31c3b17..8c02015e52c 100644 --- a/variants/lilygo_t3s3/target.cpp +++ b/variants/lilygo_t3s3/target.cpp @@ -14,6 +14,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 diff --git a/variants/lilygo_t3s3/target.h b/variants/lilygo_t3s3/target.h index 965cdd1a2e5..224acd84a98 100644 --- a/variants/lilygo_t3s3/target.h +++ b/variants/lilygo_t3s3/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #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(); diff --git a/variants/lilygo_t3s3_sx1276/platformio.ini b/variants/lilygo_t3s3_sx1276/platformio.ini index 5e5513f7c3b..fc771547515 100644 --- a/variants/lilygo_t3s3_sx1276/platformio.ini +++ b/variants/lilygo_t3s3_sx1276/platformio.ini @@ -26,6 +26,7 @@ build_flags = -D LORA_TX_POWER=20 build_src_filter = ${esp32_base.build_src_filter} +<../variants/lilygo_t3s3_sx1276> + + lib_deps = ${esp32_base.lib_deps} adafruit/Adafruit SSD1306 @ ^2.5.13 @@ -35,6 +36,7 @@ lib_deps = extends = LilyGo_T3S3_sx1276 build_flags = ${LilyGo_T3S3_sx1276.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"T3S3-1276 Repeater"' -D ADVERT_LAT=0.0 @@ -46,6 +48,7 @@ build_flags = build_src_filter = ${LilyGo_T3S3_sx1276.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${LilyGo_T3S3_sx1276.lib_deps} ${esp32_ota.lib_deps} @@ -78,6 +81,7 @@ lib_deps = extends = LilyGo_T3S3_sx1276 build_flags = ${LilyGo_T3S3_sx1276.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"ESPNow Bridge"' -D ADVERT_LAT=0.0 @@ -92,6 +96,7 @@ build_src_filter = ${LilyGo_T3S3_sx1276.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${LilyGo_T3S3_sx1276.lib_deps} ${esp32_ota.lib_deps} @@ -114,6 +119,7 @@ lib_deps = extends = LilyGo_T3S3_sx1276 build_flags = ${LilyGo_T3S3_sx1276.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"T3S3-1276 Room"' -D ADVERT_LAT=0.0 @@ -125,6 +131,7 @@ build_flags = build_src_filter = ${LilyGo_T3S3_sx1276.build_src_filter} + +<../examples/simple_room_server> + + lib_deps = ${LilyGo_T3S3_sx1276.lib_deps} ${esp32_ota.lib_deps} @@ -134,7 +141,7 @@ extends = LilyGo_T3S3_sx1276 upload_speed = 115200 build_flags = ${LilyGo_T3S3_sx1276.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 @@ -143,7 +150,7 @@ build_src_filter = ${LilyGo_T3S3_sx1276.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_T3S3_sx1276.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -152,7 +159,7 @@ lib_deps = extends = LilyGo_T3S3_sx1276 build_flags = ${LilyGo_T3S3_sx1276.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 @@ -166,7 +173,7 @@ build_src_filter = ${LilyGo_T3S3_sx1276.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_T3S3_sx1276.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -199,12 +206,14 @@ build_flags = ; -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D ESP32_CPU_FREQ=160 + -I src/helpers/ui/server build_src_filter = ${LilyGo_T3S3_sx1276.build_src_filter} + + + + +<../examples/simple_repeater> + + lib_deps = ${LilyGo_T3S3_sx1276.lib_deps} ${esp32_ota.lib_deps} @@ -238,12 +247,14 @@ build_flags = ; -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D ESP32_CPU_FREQ=160 + -I src/helpers/ui/server build_src_filter = ${LilyGo_T3S3_sx1276.build_src_filter} + + + + +<../examples/simple_room_server> + + lib_deps = ${LilyGo_T3S3_sx1276.lib_deps} ${esp32_ota.lib_deps} diff --git a/variants/lilygo_t3s3_sx1276/target.cpp b/variants/lilygo_t3s3_sx1276/target.cpp index 770db4a7746..7a4d3e8fd29 100644 --- a/variants/lilygo_t3s3_sx1276/target.cpp +++ b/variants/lilygo_t3s3_sx1276/target.cpp @@ -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() { diff --git a/variants/lilygo_t3s3_sx1276/target.h b/variants/lilygo_t3s3_sx1276/target.h index c5fbff6289d..e1c400dbfd3 100644 --- a/variants/lilygo_t3s3_sx1276/target.h +++ b/variants/lilygo_t3s3_sx1276/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif extern LilygoT3S3SX1276Board 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(); diff --git a/variants/lilygo_t_impulse_plus/platformio.ini b/variants/lilygo_t_impulse_plus/platformio.ini index 0ed5b9a42fb..8fd01b1f27a 100644 --- a/variants/lilygo_t_impulse_plus/platformio.ini +++ b/variants/lilygo_t_impulse_plus/platformio.ini @@ -49,7 +49,7 @@ extends = LilyGo_T_Impulse_Plus build_flags = ${LilyGo_T_Impulse_Plus.build_flags} -I src/helpers/ui - -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 @@ -62,7 +62,7 @@ build_flags = build_src_filter = ${LilyGo_T_Impulse_Plus.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_T_Impulse_Plus.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/lilygo_t_impulse_plus/target.cpp b/variants/lilygo_t_impulse_plus/target.cpp index b6b0c82cf92..53474976e7d 100644 --- a/variants/lilygo_t_impulse_plus/target.cpp +++ b/variants/lilygo_t_impulse_plus/target.cpp @@ -23,6 +23,7 @@ EnvironmentSensorManager sensors = EnvironmentSensorManager(); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/lilygo_t_impulse_plus/target.h b/variants/lilygo_t_impulse_plus/target.h index ff168fbedf4..89bb7efe8e4 100644 --- a/variants/lilygo_t_impulse_plus/target.h +++ b/variants/lilygo_t_impulse_plus/target.h @@ -11,6 +11,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif extern TImpulsePlusBoard board; @@ -20,6 +21,7 @@ extern EnvironmentSensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/lilygo_tbeam_1w/platformio.ini b/variants/lilygo_tbeam_1w/platformio.ini index 73f1efce572..9a422d628e1 100644 --- a/variants/lilygo_tbeam_1w/platformio.ini +++ b/variants/lilygo_tbeam_1w/platformio.ini @@ -58,6 +58,7 @@ build_src_filter = ${esp32_base.build_src_filter} + + + + + lib_deps = ${esp32_base.lib_deps} @@ -69,6 +70,7 @@ lib_deps = extends = LilyGo_TBeam_1W build_flags = ${LilyGo_TBeam_1W.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"T-Beam 1W Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -80,6 +82,7 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${LilyGo_TBeam_1W.build_src_filter} +<../examples/simple_repeater> + + lib_deps = ${LilyGo_TBeam_1W.lib_deps} ${esp32_ota.lib_deps} @@ -89,6 +92,7 @@ lib_deps = extends = LilyGo_TBeam_1W build_flags = ${LilyGo_TBeam_1W.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"T-Beam 1W Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -100,6 +104,7 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${LilyGo_TBeam_1W.build_src_filter} +<../examples/simple_room_server> + + lib_deps = ${LilyGo_TBeam_1W.lib_deps} ${esp32_ota.lib_deps} @@ -109,7 +114,7 @@ lib_deps = extends = LilyGo_TBeam_1W build_flags = ${LilyGo_TBeam_1W.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D PERSISTANT_GPS=1 @@ -119,7 +124,7 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${LilyGo_TBeam_1W.build_src_filter} +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_TBeam_1W.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -129,7 +134,7 @@ lib_deps = extends = LilyGo_TBeam_1W build_flags = ${LilyGo_TBeam_1W.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 @@ -142,7 +147,7 @@ build_flags = build_src_filter = ${LilyGo_TBeam_1W.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_TBeam_1W.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -154,7 +159,7 @@ extends = LilyGo_TBeam_1W board_build.partitions = default_16MB.csv build_flags = ${LilyGo_TBeam_1W.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 @@ -170,7 +175,7 @@ build_src_filter = ${LilyGo_TBeam_1W.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_TBeam_1W.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -181,6 +186,7 @@ lib_deps = extends = LilyGo_TBeam_1W build_flags = ${LilyGo_TBeam_1W.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"T-Beam 1W ESPNow Bridge"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -195,6 +201,7 @@ build_flags = build_src_filter = ${LilyGo_TBeam_1W.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${LilyGo_TBeam_1W.lib_deps} ${esp32_ota.lib_deps} @@ -223,6 +230,7 @@ build_flags = ; -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D ESP32_CPU_FREQ=160 + -I src/helpers/ui/server # -D WIFI_SSID='"ssid"' # -D WIFI_PWD='"password"' # -D MQTT_SERVER='"your-mqtt-broker.com"' @@ -235,6 +243,7 @@ build_src_filter = ${LilyGo_TBeam_1W.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${LilyGo_TBeam_1W.lib_deps} ${esp32_ota.lib_deps} @@ -269,12 +278,14 @@ build_flags = ; -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D ESP32_CPU_FREQ=160 + -I src/helpers/ui/server build_src_filter = ${LilyGo_TBeam_1W.build_src_filter} + + + + +<../examples/simple_room_server> + + lib_deps = ${LilyGo_TBeam_1W.lib_deps} ${esp32_ota.lib_deps} @@ -286,5 +297,8 @@ lib_deps = [env:LilyGo_TBeam_1W_kiss_modem] extends = LilyGo_TBeam_1W +build_flags = + ${LilyGo_TBeam_1W.build_flags} + -U DISPLAY_CLASS build_src_filter = ${LilyGo_TBeam_1W.build_src_filter} +<../examples/kiss_modem/> diff --git a/variants/lilygo_tbeam_1w/target.cpp b/variants/lilygo_tbeam_1w/target.cpp index db11747f8b8..89f566100be 100644 --- a/variants/lilygo_tbeam_1w/target.cpp +++ b/variants/lilygo_tbeam_1w/target.cpp @@ -6,6 +6,7 @@ TBeam1WBoard board; #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif static SPIClass spi; diff --git a/variants/lilygo_tbeam_1w/target.h b/variants/lilygo_tbeam_1w/target.h index d6cd61b4ccd..edf8bca0e52 100644 --- a/variants/lilygo_tbeam_1w/target.h +++ b/variants/lilygo_tbeam_1w/target.h @@ -11,8 +11,11 @@ #ifdef DISPLAY_CLASS #include #include + #include + extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif extern TBeam1WBoard board; diff --git a/variants/lilygo_tbeam_SX1262/platformio.ini b/variants/lilygo_tbeam_SX1262/platformio.ini index 7728af30ce1..e171faa12cf 100644 --- a/variants/lilygo_tbeam_SX1262/platformio.ini +++ b/variants/lilygo_tbeam_SX1262/platformio.ini @@ -33,6 +33,7 @@ build_src_filter = ${esp32_base.build_src_filter} + + + + + board_build.partitions = min_spiffs.csv ; get around 4mb flash limit lib_deps = ${esp32_base.lib_deps} @@ -45,7 +46,7 @@ extends = LilyGo_TBeam_SX1262 board_build.upload.maximum_ram_size=2000000 build_flags = ${LilyGo_TBeam_SX1262.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D MAX_CONTACTS=160 -D MAX_GROUP_CHANNELS=8 -D BLE_PIN_CODE=123456 @@ -60,7 +61,7 @@ build_src_filter = ${LilyGo_TBeam_SX1262.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_TBeam_SX1262.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -69,6 +70,7 @@ lib_deps = extends = LilyGo_TBeam_SX1262 build_flags = ${LilyGo_TBeam_SX1262.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"Tbeam SX1262 Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -78,6 +80,7 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${LilyGo_TBeam_SX1262.build_src_filter} +<../examples/simple_repeater> + + lib_deps = ${LilyGo_TBeam_SX1262.lib_deps} ${esp32_ota.lib_deps} @@ -108,6 +111,7 @@ lib_deps = extends = LilyGo_TBeam_SX1262 build_flags = ${LilyGo_TBeam_SX1262.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"ESPNow Bridge"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -120,6 +124,7 @@ build_flags = build_src_filter = ${LilyGo_TBeam_SX1262.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${LilyGo_TBeam_SX1262.lib_deps} ${esp32_ota.lib_deps} @@ -128,6 +133,7 @@ lib_deps = extends = LilyGo_TBeam_SX1262 build_flags = ${LilyGo_TBeam_SX1262.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"Tbeam SX1262 Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -137,12 +143,16 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${LilyGo_TBeam_SX1262.build_src_filter} +<../examples/simple_room_server> + + lib_deps = ${LilyGo_TBeam_SX1262.lib_deps} ${esp32_ota.lib_deps} [env:Tbeam_SX1262_kiss_modem] extends = LilyGo_TBeam_SX1262 +build_flags = + ${LilyGo_TBeam_SX1262.build_flags} + -U DISPLAY_CLASS build_src_filter = ${LilyGo_TBeam_SX1262.build_src_filter} +<../examples/kiss_modem/> @@ -166,6 +176,7 @@ build_flags = ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y + -I src/helpers/ui/server # -D WIFI_SSID='"ssid"' # -D WIFI_PWD='"password"' # -D MQTT_SERVER='"your-mqtt-broker.com"' @@ -178,6 +189,7 @@ build_src_filter = ${LilyGo_TBeam_SX1262.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${LilyGo_TBeam_SX1262.lib_deps} ${esp32_ota.lib_deps} @@ -208,12 +220,14 @@ build_flags = ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y + -I src/helpers/ui/server build_src_filter = ${LilyGo_TBeam_SX1262.build_src_filter} + + + + +<../examples/simple_room_server> + + lib_deps = ${LilyGo_TBeam_SX1262.lib_deps} ${esp32_ota.lib_deps} diff --git a/variants/lilygo_tbeam_SX1262/target.cpp b/variants/lilygo_tbeam_SX1262/target.cpp index b97dda41e85..ec9b0e93357 100644 --- a/variants/lilygo_tbeam_SX1262/target.cpp +++ b/variants/lilygo_tbeam_SX1262/target.cpp @@ -27,6 +27,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/lilygo_tbeam_SX1262/target.h b/variants/lilygo_tbeam_SX1262/target.h index c532a73af9a..109a57bbb0f 100644 --- a/variants/lilygo_tbeam_SX1262/target.h +++ b/variants/lilygo_tbeam_SX1262/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif extern TBeamBoard board; @@ -20,6 +21,7 @@ extern EnvironmentSensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/lilygo_tbeam_SX1276/platformio.ini b/variants/lilygo_tbeam_SX1276/platformio.ini index a17e86ff372..f99b3655da2 100644 --- a/variants/lilygo_tbeam_SX1276/platformio.ini +++ b/variants/lilygo_tbeam_SX1276/platformio.ini @@ -30,6 +30,7 @@ build_src_filter = ${esp32_base.build_src_filter} + + + + + board_build.partitions = min_spiffs.csv ; get around 4mb flash limit lib_deps = ${esp32_base.lib_deps} @@ -43,7 +44,7 @@ extends = LilyGo_TBeam_SX1276 board_build.upload.maximum_ram_size=2000000 build_flags = ${LilyGo_TBeam_SX1276.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D MAX_CONTACTS=160 -D MAX_GROUP_CHANNELS=40 -D BLE_PIN_CODE=123456 @@ -56,7 +57,7 @@ build_src_filter = ${LilyGo_TBeam_SX1276.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_TBeam_SX1276.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -65,6 +66,7 @@ lib_deps = extends = LilyGo_TBeam_SX1276 build_flags = ${LilyGo_TBeam_SX1276.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"Tbeam Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -75,6 +77,7 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${LilyGo_TBeam_SX1276.build_src_filter} +<../examples/simple_repeater> + + lib_deps = ${LilyGo_TBeam_SX1276.lib_deps} ${esp32_ota.lib_deps} @@ -106,6 +109,7 @@ lib_deps = extends = LilyGo_TBeam_SX1276 build_flags = ${LilyGo_TBeam_SX1276.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"ESPNow Bridge"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -119,6 +123,7 @@ build_flags = build_src_filter = ${LilyGo_TBeam_SX1276.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${LilyGo_TBeam_SX1276.lib_deps} ${esp32_ota.lib_deps} @@ -127,6 +132,7 @@ lib_deps = extends = LilyGo_TBeam_SX1276 build_flags = ${LilyGo_TBeam_SX1276.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"Tbeam Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -135,12 +141,16 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${LilyGo_TBeam_SX1276.build_src_filter} +<../examples/simple_room_server> + + lib_deps = ${LilyGo_TBeam_SX1276.lib_deps} ${esp32_ota.lib_deps} [env:Tbeam_SX1276_kiss_modem] extends = LilyGo_TBeam_SX1276 +build_flags = + ${LilyGo_TBeam_SX1276.build_flags} + -U DISPLAY_CLASS build_src_filter = ${LilyGo_TBeam_SX1276.build_src_filter} +<../examples/kiss_modem/> @@ -165,6 +175,7 @@ build_flags = ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y + -I src/helpers/ui/server # -D WIFI_SSID='"ssid"' # -D WIFI_PWD='"password"' # -D MQTT_SERVER='"your-mqtt-broker.com"' @@ -177,6 +188,7 @@ build_src_filter = ${LilyGo_TBeam_SX1276.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${LilyGo_TBeam_SX1276.lib_deps} ${esp32_ota.lib_deps} @@ -207,12 +219,14 @@ build_flags = ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y + -I src/helpers/ui/server build_src_filter = ${LilyGo_TBeam_SX1276.build_src_filter} + + + + +<../examples/simple_room_server> + + lib_deps = ${LilyGo_TBeam_SX1276.lib_deps} ${esp32_ota.lib_deps} diff --git a/variants/lilygo_tbeam_SX1276/target.cpp b/variants/lilygo_tbeam_SX1276/target.cpp index be7c8287f8a..061a9260f38 100644 --- a/variants/lilygo_tbeam_SX1276/target.cpp +++ b/variants/lilygo_tbeam_SX1276/target.cpp @@ -27,6 +27,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/lilygo_tbeam_SX1276/target.h b/variants/lilygo_tbeam_SX1276/target.h index 0d56f88f8b9..aa60996640a 100644 --- a/variants/lilygo_tbeam_SX1276/target.h +++ b/variants/lilygo_tbeam_SX1276/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif extern LilygoTBeamSX1276Board board; @@ -20,6 +21,7 @@ extern EnvironmentSensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/lilygo_tbeam_supreme_SX1262/platformio.ini b/variants/lilygo_tbeam_supreme_SX1262/platformio.ini index eab728756e9..aba17fbd834 100644 --- a/variants/lilygo_tbeam_supreme_SX1262/platformio.ini +++ b/variants/lilygo_tbeam_supreme_SX1262/platformio.ini @@ -37,6 +37,7 @@ build_src_filter = ${esp32_base.build_src_filter} + + + + + board_build.partitions = default_8MB.csv board_upload.flash_size = 8MB board_upload.maximum_size = 8388608 @@ -52,6 +53,7 @@ lib_deps = extends = T_Beam_S3_Supreme_SX1262 build_flags = ${T_Beam_S3_Supreme_SX1262.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"T-Beam S3 Supreme SX1262 Repeater"' -D ADVERT_LAT=0 -D ADVERT_LON=0 @@ -61,6 +63,7 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${T_Beam_S3_Supreme_SX1262.build_src_filter} +<../examples/simple_repeater> + + lib_deps = ${T_Beam_S3_Supreme_SX1262.lib_deps} ${esp32_ota.lib_deps} @@ -91,6 +94,7 @@ lib_deps = extends = T_Beam_S3_Supreme_SX1262 build_flags = ${T_Beam_S3_Supreme_SX1262.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"ESPNow Bridge"' -D ADVERT_LAT=0 -D ADVERT_LON=0 @@ -103,6 +107,7 @@ build_flags = build_src_filter = ${T_Beam_S3_Supreme_SX1262.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${T_Beam_S3_Supreme_SX1262.lib_deps} ${esp32_ota.lib_deps} @@ -128,6 +133,7 @@ build_flags = -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D ESP32_CPU_FREQ=160 + -I src/helpers/ui/server # -D WIFI_SSID='"ssid"' # -D WIFI_PWD='"password"' # -D MQTT_SERVER='"your-mqtt-broker.com"' @@ -139,6 +145,7 @@ build_src_filter = ${T_Beam_S3_Supreme_SX1262.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${T_Beam_S3_Supreme_SX1262.lib_deps} ${esp32_ota.lib_deps} @@ -170,11 +177,13 @@ build_flags = ; -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D ESP32_CPU_FREQ=160 + -I src/helpers/ui/server build_src_filter = ${T_Beam_S3_Supreme_SX1262.build_src_filter} + + + +<../examples/simple_room_server> + + lib_deps = ${T_Beam_S3_Supreme_SX1262.lib_deps} ${esp32_ota.lib_deps} @@ -188,6 +197,7 @@ lib_deps = extends = T_Beam_S3_Supreme_SX1262 build_flags = ${T_Beam_S3_Supreme_SX1262.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"T_Beam_S3_Supreme_SX1262 Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -197,6 +207,7 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${T_Beam_S3_Supreme_SX1262.build_src_filter} +<../examples/simple_room_server> + + lib_deps = ${T_Beam_S3_Supreme_SX1262.lib_deps} ${esp32_ota.lib_deps} @@ -205,7 +216,7 @@ lib_deps = extends = T_Beam_S3_Supreme_SX1262 build_flags = ${T_Beam_S3_Supreme_SX1262.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 @@ -219,7 +230,7 @@ build_src_filter = ${T_Beam_S3_Supreme_SX1262.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${T_Beam_S3_Supreme_SX1262.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -228,7 +239,7 @@ lib_deps = extends = T_Beam_S3_Supreme_SX1262 build_flags = ${T_Beam_S3_Supreme_SX1262.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 @@ -245,7 +256,7 @@ build_src_filter = ${T_Beam_S3_Supreme_SX1262.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${T_Beam_S3_Supreme_SX1262.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -253,5 +264,8 @@ lib_deps = [env:T_Beam_S3_Supreme_SX1262_kiss_modem] extends = T_Beam_S3_Supreme_SX1262 +build_flags = + ${T_Beam_S3_Supreme_SX1262.build_flags} + -U DISPLAY_CLASS build_src_filter = ${T_Beam_S3_Supreme_SX1262.build_src_filter} +<../examples/kiss_modem/> diff --git a/variants/lilygo_tbeam_supreme_SX1262/target.cpp b/variants/lilygo_tbeam_supreme_SX1262/target.cpp index 86b9116c3a3..02b39b46afd 100644 --- a/variants/lilygo_tbeam_supreme_SX1262/target.cpp +++ b/variants/lilygo_tbeam_supreme_SX1262/target.cpp @@ -6,6 +6,7 @@ TBeamBoard board; #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif static SPIClass spi; diff --git a/variants/lilygo_tbeam_supreme_SX1262/target.h b/variants/lilygo_tbeam_supreme_SX1262/target.h index 25caa711698..b2c8b9362e3 100644 --- a/variants/lilygo_tbeam_supreme_SX1262/target.h +++ b/variants/lilygo_tbeam_supreme_SX1262/target.h @@ -13,6 +13,8 @@ extern DISPLAY_CLASS display; #include extern MomentaryButton user_btn; + #include + extern UITask ui_task; #endif extern TBeamBoard board; diff --git a/variants/lilygo_tdeck/platformio.ini b/variants/lilygo_tdeck/platformio.ini index 00571db93bc..48ffb3b1cff 100644 --- a/variants/lilygo_tdeck/platformio.ini +++ b/variants/lilygo_tdeck/platformio.ini @@ -41,7 +41,6 @@ build_flags = -D P_LORA_SCLK=40 ; LORA SCLK pin -D P_LORA_MISO=38 ; LORA MISO pin -D P_LORA_MOSI=41 ; LORA MOSI pin - -D DISPLAY_CLASS=ST7789LCDDisplay -D DISPLAY_SCALE_X=2.5 -D DISPLAY_SCALE_Y=3.75 -D PIN_TFT_RST=-1 @@ -67,7 +66,8 @@ lib_deps = extends = LilyGo_TDeck build_flags = ${LilyGo_TDeck.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new + -D DISPLAY_CLASS=ST7789LCDDisplay -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D OFFLINE_QUEUE_SIZE=256 @@ -76,7 +76,7 @@ build_src_filter = ${LilyGo_TDeck.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_TDeck.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -85,7 +85,8 @@ lib_deps = extends = LilyGo_TDeck build_flags = ${LilyGo_TDeck.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new + -D DISPLAY_CLASS=ST7789LCDDisplay -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D BLE_PIN_CODE=123456 @@ -94,7 +95,7 @@ build_src_filter = ${LilyGo_TDeck.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_TDeck.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/lilygo_tdeck/target.cpp b/variants/lilygo_tdeck/target.cpp index 4084a73bc06..74026a260b2 100644 --- a/variants/lilygo_tdeck/target.cpp +++ b/variants/lilygo_tdeck/target.cpp @@ -21,6 +21,7 @@ EnvironmentSensorManager sensors(gps); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/lilygo_tdeck/target.h b/variants/lilygo_tdeck/target.h index 9d35af9b13a..5e52afdf1ef 100644 --- a/variants/lilygo_tdeck/target.h +++ b/variants/lilygo_tdeck/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif #include "helpers/sensors/EnvironmentSensorManager.h" #include "helpers/sensors/MicroNMEALocationProvider.h" @@ -22,6 +23,7 @@ extern EnvironmentSensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/lilygo_techo/platformio.ini b/variants/lilygo_techo/platformio.ini index 2c2a3e4304a..15d96b0f22c 100644 --- a/variants/lilygo_techo/platformio.ini +++ b/variants/lilygo_techo/platformio.ini @@ -49,6 +49,7 @@ build_src_filter = ${nrf52_base.build_src_filter} + + +<../variants/lilygo_techo> + + lib_deps = ${nrf52_base.lib_deps} stevemarple/MicroNMEA @ ^2.0.6 @@ -62,8 +63,10 @@ upload_protocol = nrfutil extends = LilyGo_T-Echo build_src_filter = ${LilyGo_T-Echo.build_src_filter} +<../examples/simple_repeater> + + build_flags = ${LilyGo_T-Echo.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"T-Echo Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -76,8 +79,10 @@ build_flags = extends = LilyGo_T-Echo build_src_filter = ${LilyGo_T-Echo.build_src_filter} +<../examples/simple_room_server> + + build_flags = ${LilyGo_T-Echo.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"T-Echo Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -92,7 +97,7 @@ board_upload.maximum_size = 712704 build_flags = ${LilyGo_T-Echo.build_flags} -I src/helpers/ui - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D EINK_REFRESH_LOOP -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 @@ -108,7 +113,7 @@ build_flags = build_src_filter = ${LilyGo_T-Echo.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_T-Echo.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -120,7 +125,7 @@ board_upload.maximum_size = 712704 build_flags = ${LilyGo_T-Echo.build_flags} -I src/helpers/ui - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D EINK_REFRESH_LOOP -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 @@ -131,12 +136,15 @@ build_flags = -D ENABLE_USB_INTERFACE build_src_filter = ${LilyGo_T-Echo.build_src_filter} +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_T-Echo.lib_deps} densaugeo/base64 @ ~1.4.0 [env:LilyGo_T-Echo_kiss_modem] extends = LilyGo_T-Echo +build_flags = + ${LilyGo_T-Echo.build_flags} + -U DISPLAY_CLASS build_src_filter = ${LilyGo_T-Echo.build_src_filter} +<../examples/kiss_modem/> diff --git a/variants/lilygo_techo/target.cpp b/variants/lilygo_techo/target.cpp index 394d79c5c43..6cb6a69f2d1 100644 --- a/variants/lilygo_techo/target.cpp +++ b/variants/lilygo_techo/target.cpp @@ -25,6 +25,7 @@ EnvironmentSensorManager sensors = EnvironmentSensorManager(); DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); MomentaryButton backlight_btn(BACKLIGHT_BTN, 1000, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/lilygo_techo/target.h b/variants/lilygo_techo/target.h index a1668f03187..dea948fe676 100644 --- a/variants/lilygo_techo/target.h +++ b/variants/lilygo_techo/target.h @@ -12,6 +12,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif extern TechoBoard board; @@ -23,6 +24,7 @@ extern EnvironmentSensorManager sensors; extern DISPLAY_CLASS display; extern MomentaryButton user_btn; extern MomentaryButton backlight_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/lilygo_techo_card/platformio.ini b/variants/lilygo_techo_card/platformio.ini index 17ba8d1b2b6..b76eed9a049 100644 --- a/variants/lilygo_techo_card/platformio.ini +++ b/variants/lilygo_techo_card/platformio.ini @@ -21,11 +21,13 @@ build_flags = ${nrf52_base.build_flags} -D PIN_OLED_RESET=-1 build_src_filter = ${nrf52_base.build_src_filter} + - + + +<../variants/lilygo_techo_card/TechoCardBoard.cpp> + + + - +<../variants/lilygo_techo_card> + +<../variants/lilygo_techo_card/target.cpp> + +<../variants/lilygo_techo_card/variant.cpp> + + lib_deps = ${nrf52_base.lib_deps} stevemarple/MicroNMEA @ ^2.0.6 @@ -38,9 +40,12 @@ upload_protocol = nrfutil [env:LilyGo_T-Echo_Card_repeater] extends = LilyGo_T-Echo_Card build_src_filter = ${LilyGo_T-Echo_Card.build_src_filter} + + +<../examples/simple_repeater> + +<../variants/lilygo_techo_card/target-other.cpp> build_flags = ${LilyGo_T-Echo_Card.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"T-Echo Card Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -52,9 +57,12 @@ build_flags = [env:LilyGo_T-Echo_Card_room_server] extends = LilyGo_T-Echo_Card build_src_filter = ${LilyGo_T-Echo_Card.build_src_filter} + + +<../examples/simple_room_server> + +<../variants/lilygo_techo_card/target-other.cpp> build_flags = ${LilyGo_T-Echo_Card.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"T-Echo Card Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -69,7 +77,7 @@ board_upload.maximum_size = 712704 build_flags = ${LilyGo_T-Echo_Card.build_flags} -I src/helpers/ui - -I examples/companion_radio/ui-tiny + -I src/helpers/ui/companion-tiny -D PIN_BUZZER=38 -D QSPIFLASH=1 -D MAX_CONTACTS=350 @@ -84,8 +92,9 @@ build_flags = -D AUTO_SHUTDOWN_MILLIVOLTS=3300 build_src_filter = ${LilyGo_T-Echo_Card.build_src_filter} + + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-tiny/*.cpp> + +<../variants/lilygo_techo_card/target-companion.cpp> + lib_deps = ${LilyGo_T-Echo_Card.lib_deps} @@ -99,7 +108,7 @@ board_upload.maximum_size = 712704 build_flags = ${LilyGo_T-Echo_Card.build_flags} -I src/helpers/ui - -I examples/companion_radio/ui-tiny + -I src/helpers/ui/companion-tiny -D PIN_BUZZER=38 -D QSPIFLASH=1 -D MAX_CONTACTS=350 @@ -112,8 +121,9 @@ build_flags = -D AUTO_SHUTDOWN_MILLIVOLTS=3300 -D ENABLE_USB_INTERFACE build_src_filter = ${LilyGo_T-Echo_Card.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-tiny/*.cpp> + +<../variants/lilygo_techo_card/target-companion.cpp> + lib_deps = ${LilyGo_T-Echo_Card.lib_deps} @@ -124,3 +134,6 @@ lib_deps = extends = LilyGo_T-Echo_Card build_src_filter = ${LilyGo_T-Echo_Card.build_src_filter} +<../examples/kiss_modem/> +build_flags = + ${LilyGo_T-Echo_Card.build_flags} + -U DISPLAY_CLASS diff --git a/variants/lilygo_techo_card/target.cpp b/variants/lilygo_techo_card/target.cpp index ea74bd0ca24..b3375dbbe14 100644 --- a/variants/lilygo_techo_card/target.cpp +++ b/variants/lilygo_techo_card/target.cpp @@ -20,11 +20,12 @@ EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea); EnvironmentSensorManager sensors = EnvironmentSensorManager(); #endif - #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); MomentaryButton back_btn(PIN_BUTTON2, 1000, true); + + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/lilygo_techo_card/target.h b/variants/lilygo_techo_card/target.h index f394f7dafb0..bd76e0b7ffd 100644 --- a/variants/lilygo_techo_card/target.h +++ b/variants/lilygo_techo_card/target.h @@ -12,6 +12,7 @@ #ifdef DISPLAY_CLASS #include #include + #include // needs -I(nclude) path setting #endif extern TechoCardBoard board; @@ -23,6 +24,7 @@ extern EnvironmentSensorManager sensors; extern DISPLAY_CLASS display; extern MomentaryButton user_btn; extern MomentaryButton back_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/lilygo_techo_lite/platformio.ini b/variants/lilygo_techo_lite/platformio.ini index 2a92eb9be2d..f1cad6ef692 100644 --- a/variants/lilygo_techo_lite/platformio.ini +++ b/variants/lilygo_techo_lite/platformio.ini @@ -35,6 +35,7 @@ build_src_filter = ${nrf52_base.build_src_filter} + + +<../variants/lilygo_techo_lite> + + lib_deps = ${nrf52_base.lib_deps} stevemarple/MicroNMEA @ ^2.0.6 @@ -48,8 +49,10 @@ upload_protocol = nrfutil extends = LilyGo_T-Echo-Lite build_src_filter = ${LilyGo_T-Echo-Lite.build_src_filter} +<../examples/simple_repeater> + + build_flags = ${LilyGo_T-Echo-Lite.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"T-Echo-Lite Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -62,8 +65,10 @@ build_flags = extends = LilyGo_T-Echo-Lite build_src_filter = ${LilyGo_T-Echo-Lite.build_src_filter} +<../examples/simple_room_server> + + build_flags = ${LilyGo_T-Echo-Lite.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"T-Echo-Lite Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -78,7 +83,7 @@ board_upload.maximum_size = 712704 build_flags = ${LilyGo_T-Echo-Lite.build_flags} -I src/helpers/ui - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 ; -D QSPIFLASH=1 @@ -93,15 +98,19 @@ build_flags = build_src_filter = ${LilyGo_T-Echo-Lite.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_T-Echo-Lite.lib_deps} densaugeo/base64 @ ~1.4.0 [env:LilyGo_T-Echo-Lite_kiss_modem] extends = LilyGo_T-Echo-Lite +build_flags = + ${LilyGo_T-Echo-Lite.build_flags} + -U DISPLAY_CLASS build_src_filter = ${LilyGo_T-Echo-Lite.build_src_filter} +<../examples/kiss_modem/> + [env:LilyGo_T-Echo-Lite_companion_radio_usb] extends = LilyGo_T-Echo-Lite board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld @@ -109,7 +118,7 @@ board_upload.maximum_size = 712704 build_flags = ${LilyGo_T-Echo-Lite.build_flags} -I src/helpers/ui - -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 @@ -119,7 +128,7 @@ build_flags = ; -D QSPIFLASH=1 build_src_filter = ${LilyGo_T-Echo-Lite.build_src_filter} +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_T-Echo-Lite.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -136,7 +145,7 @@ build_flags = -I lib/nrf52/s140_nrf52_6.1.1_API/include -I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52 -I src/helpers/ui - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D LILYGO_TECHO -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper @@ -181,7 +190,7 @@ build_flags = -I lib/nrf52/s140_nrf52_6.1.1_API/include -I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52 -I src/helpers/ui - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D LILYGO_TECHO -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper diff --git a/variants/lilygo_techo_lite/target.cpp b/variants/lilygo_techo_lite/target.cpp index 6d199fff834..1fd0b622355 100644 --- a/variants/lilygo_techo_lite/target.cpp +++ b/variants/lilygo_techo_lite/target.cpp @@ -23,6 +23,7 @@ EnvironmentSensorManager sensors = EnvironmentSensorManager(); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/lilygo_techo_lite/target.h b/variants/lilygo_techo_lite/target.h index 2b8a1783f06..b0cdcf4eb6b 100644 --- a/variants/lilygo_techo_lite/target.h +++ b/variants/lilygo_techo_lite/target.h @@ -12,6 +12,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif extern TechoBoard board; @@ -22,6 +23,7 @@ extern EnvironmentSensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/lilygo_tlora_v2_1/platformio.ini b/variants/lilygo_tlora_v2_1/platformio.ini index da21420f8e8..9189386c65d 100644 --- a/variants/lilygo_tlora_v2_1/platformio.ini +++ b/variants/lilygo_tlora_v2_1/platformio.ini @@ -32,6 +32,7 @@ build_src_filter = ${esp32_base.build_src_filter} + +<../variants/lilygo_tlora_v2_1> + + + lib_deps = ${esp32_base.lib_deps} adafruit/Adafruit SSD1306 @ ^2.5.13 @@ -54,8 +55,10 @@ lib_deps = extends = LilyGo_TLora_V2_1_1_6 build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} +<../examples/simple_repeater> + + build_flags = ${LilyGo_TLora_V2_1_1_6.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"TLora-V2.1-1.6 Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -86,7 +89,7 @@ lib_deps = extends = LilyGo_TLora_V2_1_1_6 build_flags = ${LilyGo_TLora_V2_1_1_6.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D MAX_CONTACTS=160 -D MAX_GROUP_CHANNELS=8 -D ENABLE_USB_INTERFACE @@ -95,7 +98,7 @@ build_flags = build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_TLora_V2_1_1_6.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -104,7 +107,7 @@ lib_deps = extends = LilyGo_TLora_V2_1_1_6 build_flags = ${LilyGo_TLora_V2_1_1_6.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D MAX_CONTACTS=160 -D MAX_GROUP_CHANNELS=8 -D BLE_PIN_CODE=123456 @@ -116,7 +119,7 @@ build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_TLora_V2_1_1_6.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -126,8 +129,10 @@ extends = LilyGo_TLora_V2_1_1_6 build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} + +<../examples/simple_room_server> + + build_flags = ${LilyGo_TLora_V2_1_1_6.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"TLora-V2.1-1.6 Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -172,6 +177,7 @@ build_flags = ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y + -I src/helpers/ui/server # -D WIFI_SSID='"ssid"' # -D WIFI_PWD='"password"' # -D MQTT_SERVER='"your-mqtt-broker.com"' @@ -184,6 +190,7 @@ build_src_filter = ${LilyGo_TLora_V2_1_1_6_core.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${LilyGo_TLora_V2_1_1_6_core.lib_deps} ${esp32_ota.lib_deps} @@ -217,12 +224,14 @@ build_flags = ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y + -I src/helpers/ui/server build_src_filter = ${LilyGo_TLora_V2_1_1_6_core.build_src_filter} + + + + +<../examples/simple_room_server> + + lib_deps = ${LilyGo_TLora_V2_1_1_6_core.lib_deps} ${esp32_ota.lib_deps} @@ -238,7 +247,7 @@ build_flags = ${LilyGo_TLora_V2_1_1_6.build_flags} ; 4 MB flash: no room for the TLS stack that OTA needs -D DMC_COMPANION_NO_OTA - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D ENABLE_WIFI_INTERFACE -D MAX_CONTACTS=160 -D MAX_GROUP_CHANNELS=8 @@ -251,7 +260,7 @@ build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${LilyGo_TLora_V2_1_1_6.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -265,8 +274,10 @@ extends = LilyGo_TLora_V2_1_1_6 build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} + +<../examples/simple_repeater> + + build_flags = ${LilyGo_TLora_V2_1_1_6.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"RS232 Bridge"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -288,8 +299,10 @@ extends = LilyGo_TLora_V2_1_1_6 build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} + +<../examples/simple_repeater> + + build_flags = ${LilyGo_TLora_V2_1_1_6.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"ESPNow Bridge"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -306,5 +319,8 @@ lib_deps = [env:LilyGo_TLora_V2_1_1_6_kiss_modem] extends = LilyGo_TLora_V2_1_1_6 +build_flags = + ${LilyGo_TLora_V2_1_1_6.build_flags} + -U DISPLAY_CLASS build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} +<../examples/kiss_modem/> diff --git a/variants/lilygo_tlora_v2_1/target.cpp b/variants/lilygo_tlora_v2_1/target.cpp index 8c120161505..9b02845a3c3 100644 --- a/variants/lilygo_tlora_v2_1/target.cpp +++ b/variants/lilygo_tlora_v2_1/target.cpp @@ -15,6 +15,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() { diff --git a/variants/lilygo_tlora_v2_1/target.h b/variants/lilygo_tlora_v2_1/target.h index fa954b329b1..7d109c456c0 100644 --- a/variants/lilygo_tlora_v2_1/target.h +++ b/variants/lilygo_tlora_v2_1/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif extern LilyGoTLoraBoard board; @@ -20,6 +21,7 @@ extern EnvironmentSensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/mesh_pocket/platformio.ini b/variants/mesh_pocket/platformio.ini index a6f823dbf71..78edbab5625 100644 --- a/variants/mesh_pocket/platformio.ini +++ b/variants/mesh_pocket/platformio.ini @@ -24,6 +24,7 @@ build_src_filter = ${nrf52_base.build_src_filter} + +<../variants/mesh_pocket> + + + lib_deps = ${nrf52_base.lib_deps} adafruit/Adafruit EPD @ 4.6.1 @@ -38,8 +39,10 @@ upload_protocol = nrfutil extends = Mesh_pocket build_src_filter = ${Mesh_pocket.build_src_filter} +<../examples/simple_repeater> + + build_flags = ${Mesh_pocket.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"Heltec_Mesh_Pocket Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -52,8 +55,10 @@ build_flags = extends = Mesh_pocket build_src_filter = ${Mesh_pocket.build_src_filter} +<../examples/simple_room_server> + + build_flags = ${Mesh_pocket.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"Heltec_Mesh_Pocket Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -68,7 +73,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 712704 build_flags = ${Mesh_pocket.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 @@ -77,11 +82,10 @@ build_flags = ; -D BLE_DEBUG_LOGGING=1 ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 - build_src_filter = ${Mesh_pocket.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Mesh_pocket.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -92,7 +96,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 712704 build_flags = ${Mesh_pocket.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D AUTO_OFF_MILLIS=0 @@ -104,12 +108,15 @@ build_flags = build_src_filter = ${Mesh_pocket.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Mesh_pocket.lib_deps} densaugeo/base64 @ ~1.4.0 [env:Mesh_pocket_kiss_modem] extends = Mesh_pocket +build_flags = + ${Mesh_pocket.build_flags} + -U DISPLAY_CLASS build_src_filter = ${Mesh_pocket.build_src_filter} +<../examples/kiss_modem/> diff --git a/variants/mesh_pocket/target.cpp b/variants/mesh_pocket/target.cpp index ee8f944de41..47ad2de3b1b 100644 --- a/variants/mesh_pocket/target.cpp +++ b/variants/mesh_pocket/target.cpp @@ -17,6 +17,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/mesh_pocket/target.h b/variants/mesh_pocket/target.h index 244fe7d2d5b..466d9a7005d 100644 --- a/variants/mesh_pocket/target.h +++ b/variants/mesh_pocket/target.h @@ -12,6 +12,7 @@ #ifdef DISPLAY_CLASS #include #include +#include #endif extern HeltecMeshPocket board; @@ -21,6 +22,7 @@ extern AutoDiscoverRTCClock rtc_clock; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/meshadventurer/platformio.ini b/variants/meshadventurer/platformio.ini index 5e35251cc6c..b4ec065ad00 100644 --- a/variants/meshadventurer/platformio.ini +++ b/variants/meshadventurer/platformio.ini @@ -30,6 +30,7 @@ build_src_filter = ${esp32_base.build_src_filter} +<../variants/meshadventurer> + + + + lib_deps = ${esp32_base.lib_deps} stevemarple/MicroNMEA @ ^2.0.6 @@ -39,8 +40,10 @@ lib_deps = extends = Meshadventurer build_src_filter = ${Meshadventurer.build_src_filter} +<../examples/simple_repeater> + + build_flags = ${Meshadventurer.build_flags} + -I src/helpers/ui/server -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper -D LORA_TX_POWER=22 @@ -85,8 +88,10 @@ extends = Meshadventurer build_src_filter = ${Meshadventurer.build_src_filter} + +<../examples/simple_repeater> + + build_flags = ${Meshadventurer.build_flags} + -I src/helpers/ui/server -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper -D LORA_TX_POWER=22 @@ -107,8 +112,10 @@ lib_deps = extends = Meshadventurer build_src_filter = ${Meshadventurer.build_src_filter} +<../examples/simple_repeater> + + build_flags = ${Meshadventurer.build_flags} + -I src/helpers/ui/server -D RADIO_CLASS=CustomSX1268 -D WRAPPER_CLASS=CustomSX1268Wrapper -D LORA_TX_POWER=22 @@ -154,8 +161,10 @@ extends = Meshadventurer build_src_filter = ${Meshadventurer.build_src_filter} + +<../examples/simple_repeater> + + build_flags = ${Meshadventurer.build_flags} + -I src/helpers/ui/server -D RADIO_CLASS=CustomSX1268 -D WRAPPER_CLASS=CustomSX1268Wrapper -D LORA_TX_POWER=22 @@ -176,10 +185,10 @@ lib_deps = extends = Meshadventurer build_src_filter = ${Meshadventurer.build_src_filter} +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + build_flags = ${Meshadventurer.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper -D LORA_TX_POWER=22 @@ -198,10 +207,10 @@ extends = Meshadventurer build_src_filter = ${Meshadventurer.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + build_flags = ${Meshadventurer.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper -D LORA_TX_POWER=22 @@ -237,6 +246,7 @@ lib_deps = extends = Meshadventurer build_flags = ${Meshadventurer.build_flags} + -I src/helpers/ui/server -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper -D LORA_TX_POWER=22 @@ -249,6 +259,7 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${Meshadventurer.build_src_filter} +<../examples/simple_room_server> + + lib_deps = ${Meshadventurer.lib_deps} ${esp32_ota.lib_deps} @@ -257,10 +268,10 @@ lib_deps = extends = Meshadventurer build_src_filter = ${Meshadventurer.build_src_filter} +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + build_flags = ${Meshadventurer.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D RADIO_CLASS=CustomSX1268 -D WRAPPER_CLASS=CustomSX1268Wrapper -D LORA_TX_POWER=22 @@ -279,10 +290,10 @@ extends = Meshadventurer build_src_filter = ${Meshadventurer.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + build_flags = ${Meshadventurer.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D RADIO_CLASS=CustomSX1268 -D WRAPPER_CLASS=CustomSX1268Wrapper -D LORA_TX_POWER=22 @@ -318,6 +329,7 @@ lib_deps = extends = Meshadventurer build_flags = ${Meshadventurer.build_flags} + -I src/helpers/ui/server -D RADIO_CLASS=CustomSX1268 -D WRAPPER_CLASS=CustomSX1268Wrapper -D LORA_TX_POWER=22 @@ -330,6 +342,7 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${Meshadventurer.build_src_filter} +<../examples/simple_room_server> + + lib_deps = ${Meshadventurer.lib_deps} ${esp32_ota.lib_deps} @@ -342,6 +355,7 @@ build_flags = ${Meshadventurer.build_flags} -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper -D LORA_TX_POWER=22 + -U DISPLAY_CLASS [env:Meshadventurer_sx1268_kiss_modem] extends = Meshadventurer @@ -351,3 +365,4 @@ build_flags = ${Meshadventurer.build_flags} -D RADIO_CLASS=CustomSX1268 -D WRAPPER_CLASS=CustomSX1268Wrapper -D LORA_TX_POWER=22 + -U DISPLAY_CLASS diff --git a/variants/meshadventurer/target.cpp b/variants/meshadventurer/target.cpp index 1ccfe151017..24a4b6f1205 100644 --- a/variants/meshadventurer/target.cpp +++ b/variants/meshadventurer/target.cpp @@ -18,6 +18,7 @@ MASensorManager sensors = MASensorManager(nmea); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/meshadventurer/target.h b/variants/meshadventurer/target.h index 9581d422cef..1f7ab872152 100644 --- a/variants/meshadventurer/target.h +++ b/variants/meshadventurer/target.h @@ -12,6 +12,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif class MASensorManager : public SensorManager { @@ -38,6 +39,7 @@ extern MASensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif diff --git a/variants/meshnology_w12/platformio.ini b/variants/meshnology_w12/platformio.ini index 27add3fbc17..f4b9c2ab2c6 100644 --- a/variants/meshnology_w12/platformio.ini +++ b/variants/meshnology_w12/platformio.ini @@ -44,6 +44,7 @@ build_flags = build_src_filter = ${esp32_base.build_src_filter} +<../variants/meshnology_w12> + + + lib_deps = ${esp32_base.lib_deps} ${sensor_base.lib_deps} @@ -52,6 +53,7 @@ lib_deps = extends = meshnology_w12 build_flags = ${meshnology_w12.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"Meshnology W12 Repeater"' -D ADVERT_LAT=0.0 @@ -63,6 +65,7 @@ build_flags = build_src_filter = ${meshnology_w12.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${meshnology_w12.lib_deps} ${esp32_ota.lib_deps} @@ -72,6 +75,7 @@ lib_deps = extends = meshnology_w12 build_flags = ${meshnology_w12.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"ESPNow Bridge"' -D ADVERT_LAT=0.0 @@ -86,6 +90,7 @@ build_src_filter = ${meshnology_w12.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${meshnology_w12.lib_deps} ${esp32_ota.lib_deps} @@ -94,6 +99,7 @@ lib_deps = extends = meshnology_w12 build_flags = ${meshnology_w12.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"Meshnology W12 Room"' -D ADVERT_LAT=0.0 @@ -105,6 +111,7 @@ build_flags = build_src_filter = ${meshnology_w12.build_src_filter} + +<../examples/simple_room_server> + + lib_deps = ${meshnology_w12.lib_deps} ${esp32_ota.lib_deps} @@ -127,7 +134,7 @@ lib_deps = extends = meshnology_w12 build_flags = ${meshnology_w12.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 @@ -137,7 +144,7 @@ build_src_filter = ${meshnology_w12.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${meshnology_w12.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -146,7 +153,7 @@ lib_deps = extends = meshnology_w12 build_flags = ${meshnology_w12.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 @@ -161,7 +168,7 @@ build_src_filter = ${meshnology_w12.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${meshnology_w12.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -170,7 +177,7 @@ lib_deps = extends = meshnology_w12 build_flags = ${meshnology_w12.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 @@ -187,7 +194,7 @@ build_src_filter = ${meshnology_w12.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${meshnology_w12.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -203,7 +210,7 @@ build_flags = -D ADMIN_PASSWORD='"password"' -D ENV_PIN_SDA=3 -D ENV_PIN_SCL=4 - -D DISPLAY_CLASS=SSD1306Display + ; -D DISPLAY_CLASS=SSD1306Display ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 build_src_filter = ${meshnology_w12.build_src_filter} @@ -241,6 +248,7 @@ build_flags = -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D ESP32_CPU_FREQ=160 -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${meshnology_w12.build_src_filter} + + @@ -248,6 +256,7 @@ build_src_filter = ${meshnology_w12.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${meshnology_w12.lib_deps} ${esp32_ota.lib_deps} @@ -283,6 +292,7 @@ build_flags = -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D ESP32_CPU_FREQ=160 -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${meshnology_w12.build_src_filter} + + @@ -290,6 +300,7 @@ build_src_filter = ${meshnology_w12.build_src_filter} + + +<../examples/simple_room_server> + + lib_deps = ${meshnology_w12.lib_deps} ${esp32_ota.lib_deps} diff --git a/variants/meshnology_w12/target.cpp b/variants/meshnology_w12/target.cpp index a3d6089ffde..969c1fc2062 100644 --- a/variants/meshnology_w12/target.cpp +++ b/variants/meshnology_w12/target.cpp @@ -27,6 +27,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock); #ifdef DISPLAY_CLASS DISPLAY_CLASS display(NULL); MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif const uint32_t rfswitch_dios[] = { diff --git a/variants/meshnology_w12/target.h b/variants/meshnology_w12/target.h index 1bf8876b282..9cfce3d2d9a 100644 --- a/variants/meshnology_w12/target.h +++ b/variants/meshnology_w12/target.h @@ -11,6 +11,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif extern MeshnologyW12Board 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(); diff --git a/variants/meshtiny/platformio.ini b/variants/meshtiny/platformio.ini index c0a3c5f94e8..a4741de797d 100644 --- a/variants/meshtiny/platformio.ini +++ b/variants/meshtiny/platformio.ini @@ -29,7 +29,7 @@ lib_deps = extends = Meshtiny build_flags = ${Meshtiny.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D MESHTINY -D PIN_BUZZER=30 -D DISPLAY_CLASS=SSD1306Display @@ -41,7 +41,7 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${Meshtiny.build_src_filter} +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Meshtiny.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -50,7 +50,7 @@ lib_deps = extends = Meshtiny build_flags = ${Meshtiny.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D MESHTINY -D PIN_BUZZER=30 -D DISPLAY_CLASS=SSD1306Display @@ -64,7 +64,7 @@ build_flags = build_src_filter = ${Meshtiny.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Meshtiny.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/meshtiny/target.cpp b/variants/meshtiny/target.cpp index 50d678266e8..25eded16019 100644 --- a/variants/meshtiny/target.cpp +++ b/variants/meshtiny/target.cpp @@ -14,11 +14,12 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock); EnvironmentSensorManager sensors = EnvironmentSensorManager(); #ifdef DISPLAY_CLASS -DISPLAY_CLASS display; + DISPLAY_CLASS display; MomentaryButton user_btn(ENCODER_PRESS, 1000, true, true); MomentaryButton joystick_left(ENCODER_LEFT, 1000, true, true); MomentaryButton joystick_right(ENCODER_RIGHT, 1000, true, true); MomentaryButton back_btn(PIN_SIDE_BUTTON, 1000, true, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/meshtiny/target.h b/variants/meshtiny/target.h index 3987e18c29b..066eae9217c 100644 --- a/variants/meshtiny/target.h +++ b/variants/meshtiny/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include #include +#include #endif #include @@ -24,6 +25,7 @@ extern MomentaryButton user_btn; extern MomentaryButton joystick_left; extern MomentaryButton joystick_right; extern MomentaryButton back_btn; +extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/meshtracker_x1/platformio.ini b/variants/meshtracker_x1/platformio.ini index 80286460bb6..fa8cc4babc8 100644 --- a/variants/meshtracker_x1/platformio.ini +++ b/variants/meshtracker_x1/platformio.ini @@ -31,7 +31,7 @@ build_flags = ${nrf52_base.build_flags} -D ENV_INCLUDE_GPS=1 build_src_filter = ${nrf52_base.build_src_filter} + - +<../variants/meshtracker_x1> + +<../variants/meshtracker_x1/*.cpp> lib_deps = ${nrf52_base.lib_deps} https://github.com/adafruit/Adafruit_SPA06_003/archive/refs/tags/1.0.2.zip stevemarple/MicroNMEA @ ^2.0.6 @@ -41,7 +41,6 @@ upload_protocol = nrfutil [env:MeshTracker_X1_repeater] extends = MeshTracker_X1 build_flags = ${MeshTracker_X1.build_flags} - -I examples/companion_radio/ui-orig -D ADVERT_NAME='"MeshTracker X1 Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -56,7 +55,6 @@ lib_deps = ${MeshTracker_X1.lib_deps} [env:MeshTracker_X1_room_server] extends = MeshTracker_X1 build_flags = ${MeshTracker_X1.build_flags} - -I examples/companion_radio/ui-orig -D ADVERT_NAME='"MeshTracker X1 Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -73,7 +71,7 @@ extends = MeshTracker_X1 board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${MeshTracker_X1.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D QSPIFLASH=1 -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 @@ -89,8 +87,8 @@ build_src_filter = ${MeshTracker_X1.build_src_filter} + + + + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> lib_deps = ${MeshTracker_X1.lib_deps} densaugeo/base64 @ ~1.4.0 end2endzone/NonBlockingRTTTL@^1.3.0 @@ -101,7 +99,7 @@ extends = MeshTracker_X1 board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${MeshTracker_X1.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D QSPIFLASH=1 -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 @@ -121,8 +119,8 @@ build_src_filter = ${MeshTracker_X1.build_src_filter} + + + + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> lib_deps = ${MeshTracker_X1.lib_deps} densaugeo/base64 @ ~1.4.0 end2endzone/NonBlockingRTTTL@^1.3.0 diff --git a/variants/meshtracker_x1/target.cpp b/variants/meshtracker_x1/target.cpp index 84e0870e2ba..daba06196bd 100644 --- a/variants/meshtracker_x1/target.cpp +++ b/variants/meshtracker_x1/target.cpp @@ -16,6 +16,7 @@ MeshTrackerX1SensorManager sensors = MeshTrackerX1SensorManager(nmea); #ifdef DISPLAY_CLASS NullDisplayDriver display; + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/meshtracker_x1/target.h b/variants/meshtracker_x1/target.h index e678e29ca68..27110343f0b 100644 --- a/variants/meshtracker_x1/target.h +++ b/variants/meshtracker_x1/target.h @@ -11,6 +11,7 @@ #include #ifdef DISPLAY_CLASS #include "NullDisplayDriver.h" + #include // needs -I(nclude) path setting #endif class MeshTrackerX1SensorManager: public SensorManager { @@ -34,6 +35,7 @@ class MeshTrackerX1SensorManager: public SensorManager { #ifdef DISPLAY_CLASS extern NullDisplayDriver display; + extern UITask ui_task; #endif extern MeshTrackerX1Board board; diff --git a/variants/minewsemi_me25ls01/platformio.ini b/variants/minewsemi_me25ls01/platformio.ini index 12858b5802a..70cf195ef21 100644 --- a/variants/minewsemi_me25ls01/platformio.ini +++ b/variants/minewsemi_me25ls01/platformio.ini @@ -43,7 +43,7 @@ extends = me25ls01 board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${me25ls01.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D BLE_PIN_CODE=123456 @@ -59,7 +59,7 @@ build_flags = ${me25ls01.build_flags} build_src_filter = ${me25ls01.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + [env:Minewsemi_me25ls01_repeater] extends = me25ls01 @@ -74,10 +74,8 @@ build_flags = ${me25ls01.build_flags} -D ADVERT_LON=0.0 -D ADMIN_PASSWORD='"password"' -D MAX_NEIGHBOURS=50 - -D DISPLAY_CLASS=NullDisplayDriver build_src_filter = ${me25ls01.build_src_filter} +<../examples/simple_repeater> - + [env:Minewsemi_me25ls01_room_server] extends = me25ls01 @@ -93,7 +91,6 @@ build_flags = ${me25ls01.build_flags} -D ADMIN_PASSWORD='"password"' -D ROOM_PASSWORD='"hello"' -D MAX_NEIGHBOURS=50 - -D DISPLAY_CLASS=NullDisplayDriver build_src_filter = ${me25ls01.build_src_filter} +<../examples/simple_room_server> @@ -111,7 +108,7 @@ build_flags = ${me25ls01.build_flags} -D ADMIN_PASSWORD='"password"' -D ROOM_PASSWORD='"hello"' -D MAX_NEIGHBOURS=50 - -D DISPLAY_CLASS=NullDisplayDriver +; -D DISPLAY_CLASS=NullDisplayDriver build_src_filter = ${me25ls01.build_src_filter} +<../examples/simple_secure_chat/main.cpp> @@ -120,7 +117,7 @@ extends = me25ls01 board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${me25ls01.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 ;-D BLE_PIN_CODE=123456 @@ -134,7 +131,7 @@ build_flags = ${me25ls01.build_flags} build_src_filter = ${me25ls01.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + [env:Minewsemi_me25ls01_kiss_modem] extends = me25ls01 diff --git a/variants/minewsemi_me25ls01/target.cpp b/variants/minewsemi_me25ls01/target.cpp index 8d9a6e0721f..38d78a9d5b2 100644 --- a/variants/minewsemi_me25ls01/target.cpp +++ b/variants/minewsemi_me25ls01/target.cpp @@ -20,6 +20,7 @@ extern EnvironmentSensorManager sensors; #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif #ifndef LORA_CR diff --git a/variants/minewsemi_me25ls01/target.h b/variants/minewsemi_me25ls01/target.h index db44058c81c..a82565e0196 100644 --- a/variants/minewsemi_me25ls01/target.h +++ b/variants/minewsemi_me25ls01/target.h @@ -12,6 +12,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif extern MinewsemiME25LS01Board 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(); diff --git a/variants/muzi_base/platformio.ini b/variants/muzi_base/platformio.ini index 72a3ecac239..5fea7797862 100644 --- a/variants/muzi_base/platformio.ini +++ b/variants/muzi_base/platformio.ini @@ -35,6 +35,7 @@ build_src_filter = ${nrf52_base.build_src_filter} + + +<../variants/muzi_base> + + debug_tool = jlink upload_protocol = nrfutil lib_deps = @@ -73,7 +74,7 @@ build_flags = ${muzi_base_common.build_flags} [env:muzi_base_duo_repeater] extends = muzi_base_duo build_flags = ${muzi_base_duo.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/server -D ADVERT_NAME='"Muzi Base Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -83,12 +84,13 @@ build_flags = ${muzi_base_duo.build_flags} ; -D MESH_DEBUG=1 build_src_filter = ${muzi_base_duo.build_src_filter} +<../examples/simple_repeater> + + lib_deps = ${muzi_base_duo.lib_deps} [env:muzi_base_duo_room_server] extends = muzi_base_duo build_flags = ${muzi_base_duo.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/server -D ADVERT_NAME='"Muzi Base Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -98,6 +100,7 @@ build_flags = ${muzi_base_duo.build_flags} ; -D MESH_DEBUG=1 build_src_filter = ${muzi_base_duo.build_src_filter} +<../examples/simple_room_server> + + lib_deps = ${muzi_base_duo.lib_deps} [env:muzi_base_duo_companion_radio_usb] @@ -105,7 +108,7 @@ extends = muzi_base_duo board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${muzi_base_duo.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 ; -D MESH_PACKET_LOGGING=1 @@ -115,7 +118,7 @@ build_flags = ${muzi_base_duo.build_flags} build_src_filter = ${muzi_base_duo.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${muzi_base_duo.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -124,7 +127,7 @@ extends = muzi_base_duo board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${muzi_base_duo.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 @@ -140,7 +143,7 @@ build_src_filter = ${muzi_base_duo.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${muzi_base_duo.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -180,7 +183,7 @@ board_upload.maximum_size = 708608 build_flags = ${muzi_base_duo_superIO.build_flags} -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D BLE_PIN_CODE=123456 -D QSPIFLASH=1 ; -D BLE_DEBUG_LOGGING=1 @@ -190,7 +193,7 @@ build_flags = ${muzi_base_duo_superIO.build_flags} build_src_filter = ${muzi_base_duo_superIO.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${muzi_base_duo_superIO.lib_deps} @@ -200,7 +203,7 @@ lib_deps = [env:muzi_base_uno_repeater] extends = muzi_base_uno build_flags = ${muzi_base_uno.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/server -D ADVERT_NAME='"Muzi Base Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -210,12 +213,13 @@ build_flags = ${muzi_base_uno.build_flags} ; -D MESH_DEBUG=1 build_src_filter = ${muzi_base_uno.build_src_filter} +<../examples/simple_repeater> + + lib_deps = ${muzi_base_uno.lib_deps} [env:muzi_base_uno_room_server] extends = muzi_base_uno build_flags = ${muzi_base_uno.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/server -D ADVERT_NAME='"Muzi Base Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -225,6 +229,7 @@ build_flags = ${muzi_base_uno.build_flags} ; -D MESH_DEBUG=1 build_src_filter = ${muzi_base_uno.build_src_filter} +<../examples/simple_room_server> + + lib_deps = ${muzi_base_uno.lib_deps} [env:muzi_base_uno_companion_radio_usb] @@ -232,7 +237,7 @@ extends = muzi_base_uno board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${muzi_base_uno.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 ; -D MESH_PACKET_LOGGING=1 @@ -242,7 +247,7 @@ build_flags = ${muzi_base_uno.build_flags} build_src_filter = ${muzi_base_uno.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${muzi_base_uno.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -251,7 +256,7 @@ extends = muzi_base_uno board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${muzi_base_uno.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 @@ -267,7 +272,7 @@ build_src_filter = ${muzi_base_uno.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${muzi_base_uno.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -307,7 +312,7 @@ board_upload.maximum_size = 708608 build_flags = ${muzi_base_uno_superIO.build_flags} -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D BLE_PIN_CODE=123456 -D QSPIFLASH=1 ; -D BLE_DEBUG_LOGGING=1 @@ -317,6 +322,6 @@ build_flags = ${muzi_base_uno_superIO.build_flags} build_src_filter = ${muzi_base_uno_superIO.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${muzi_base_uno_superIO.lib_deps} diff --git a/variants/muzi_base/target.cpp b/variants/muzi_base/target.cpp index 6653ada1912..6f9fcdad437 100644 --- a/variants/muzi_base/target.cpp +++ b/variants/muzi_base/target.cpp @@ -71,6 +71,7 @@ void MuziBaseSensorManager::loop() { 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 #if defined(USE_LR1121) diff --git a/variants/muzi_base/target.h b/variants/muzi_base/target.h index 0c143e1bcbc..ca644ae6f9c 100644 --- a/variants/muzi_base/target.h +++ b/variants/muzi_base/target.h @@ -26,10 +26,14 @@ extern MomentaryButton joystick_left; extern MomentaryButton joystick_right; extern MomentaryButton back_btn; + #include + extern UITask ui_task; #elif defined(DISPLAY_CLASS) #include "helpers/ui/NullDisplayDriver.h" extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + #include + extern UITask ui_task; #endif extern MuziBaseBoard board; diff --git a/variants/muziworks_r1_neo/R1NeoBoard.h b/variants/muziworks_r1_neo/R1NeoBoard.h index c56f1f5c2e9..3dffa301560 100644 --- a/variants/muziworks_r1_neo/R1NeoBoard.h +++ b/variants/muziworks_r1_neo/R1NeoBoard.h @@ -6,8 +6,6 @@ #include "NullDisplayDriver.h" #include "MomentaryButton.h" -#define DISPLAY_CLASS NullDisplayDriver - class R1NeoBoard : public NRF52BoardDCDC { protected: #ifdef NRF52_POWER_MANAGEMENT diff --git a/variants/muziworks_r1_neo/platformio.ini b/variants/muziworks_r1_neo/platformio.ini index fb51c04d94c..834fd5e9763 100644 --- a/variants/muziworks_r1_neo/platformio.ini +++ b/variants/muziworks_r1_neo/platformio.ini @@ -9,7 +9,6 @@ build_flags = ${nrf52_base.build_flags} -D R1Neo -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper - -D DISPLAY_CLASS=NullDisplayDriver -D LORA_TX_POWER=22 -D SX126X_CURRENT_LIMIT=140 -D SX126X_RX_BOOSTED_GAIN=1 @@ -63,16 +62,17 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 712704 build_flags = ${R1Neo.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D ENABLE_USB_INTERFACE + -D DISPLAY_CLASS=NullDisplayDriver ; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1 ; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 build_src_filter = ${R1Neo.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${R1Neo.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -84,20 +84,21 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 712704 build_flags = ${R1Neo.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D ENV_INCLUDE_GPS=1 -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D BLE_PIN_CODE=123456 -D BLE_DEBUG_LOGGING=1 -D OFFLINE_QUEUE_SIZE=256 + -D DISPLAY_CLASS=NullDisplayDriver ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 build_src_filter = ${R1Neo.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${R1Neo.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -121,7 +122,7 @@ lib_deps = extends = R1Neo build_flags = ${R1Neo.build_flags} - -D DISPLAY_CLASS=SSD1306Display +; -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"R1 Neo Sensor"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 diff --git a/variants/muziworks_r1_neo/target.cpp b/variants/muziworks_r1_neo/target.cpp index 3081de2c19b..57f21accac8 100644 --- a/variants/muziworks_r1_neo/target.cpp +++ b/variants/muziworks_r1_neo/target.cpp @@ -9,6 +9,7 @@ WRAPPER_CLASS radio_driver(radio, board); #ifdef DISPLAY_CLASS NullDisplayDriver display; + UITask ui_task(&board, &display); #endif #ifdef PIN_USER_BTN diff --git a/variants/muziworks_r1_neo/target.h b/variants/muziworks_r1_neo/target.h index 5bf3f268503..a16122d53ce 100644 --- a/variants/muziworks_r1_neo/target.h +++ b/variants/muziworks_r1_neo/target.h @@ -12,8 +12,14 @@ extern R1NeoBoard board; extern WRAPPER_CLASS radio_driver; extern AutoDiscoverRTCClock rtc_clock; extern EnvironmentSensorManager sensors; + +#ifdef DISPLAY_CLASS +#include + extern DISPLAY_CLASS display; extern MomentaryButton user_btn; +extern UITask ui_task; +#endif bool radio_init(); mesh::LocalIdentity radio_new_identity(); diff --git a/variants/nano_g2_ultra/platformio.ini b/variants/nano_g2_ultra/platformio.ini index b817b3e9918..fbc12ea041f 100644 --- a/variants/nano_g2_ultra/platformio.ini +++ b/variants/nano_g2_ultra/platformio.ini @@ -17,6 +17,7 @@ build_flags = ${nrf52_base.build_flags} build_src_filter = ${nrf52_base.build_src_filter} + +<../variants/nano_g2_ultra> + + debug_tool = jlink upload_protocol = nrfutil lib_deps = ${nrf52_base.lib_deps} @@ -28,6 +29,7 @@ lib_deps = ${nrf52_base.lib_deps} extends = Nano_G2_Ultra build_flags = ${Nano_G2_Ultra.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SH1106Display -D ADVERT_NAME='"Nano G2 Repeater"' -D ADVERT_LAT=0.0 @@ -39,11 +41,13 @@ build_flags = build_src_filter = ${Nano_G2_Ultra.build_src_filter} + +<../examples/simple_repeater> + + [env:Nano_G2_Ultra_room_server] extends = Nano_G2_Ultra build_flags = ${Nano_G2_Ultra.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SH1106Display -D ADVERT_NAME='"Nano G2 Room"' -D ADVERT_LAT=0.0 @@ -55,6 +59,7 @@ build_flags = build_src_filter = ${Nano_G2_Ultra.build_src_filter} + +<../examples/simple_room_server> + + [env:Nano_G2_Ultra_companion_radio_ble] extends = Nano_G2_Ultra @@ -63,7 +68,7 @@ board_upload.maximum_size = 712704 build_flags = ${Nano_G2_Ultra.build_flags} -I src/helpers/ui - -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 @@ -80,7 +85,7 @@ build_src_filter = ${Nano_G2_Ultra.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Nano_G2_Ultra.lib_deps} densaugeo/base64 @ ~1.4.0 end2endzone/NonBlockingRTTTL@^1.3.0 @@ -92,7 +97,7 @@ board_upload.maximum_size = 712704 build_flags = ${Nano_G2_Ultra.build_flags} -I src/helpers/ui - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D QSPIFLASH=1 @@ -107,7 +112,7 @@ build_src_filter = ${Nano_G2_Ultra.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Nano_G2_Ultra.lib_deps} densaugeo/base64 @ ~1.4.0 end2endzone/NonBlockingRTTTL@^1.3.0 diff --git a/variants/nano_g2_ultra/target.cpp b/variants/nano_g2_ultra/target.cpp index fedc48e7fa3..68230fa2a6e 100644 --- a/variants/nano_g2_ultra/target.cpp +++ b/variants/nano_g2_ultra/target.cpp @@ -21,6 +21,7 @@ NanoG2UltraSensorManager sensors = NanoG2UltraSensorManager(nmea, gps_driver); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); +UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/nano_g2_ultra/target.h b/variants/nano_g2_ultra/target.h index d540b9ecc6f..78c511f3bf2 100644 --- a/variants/nano_g2_ultra/target.h +++ b/variants/nano_g2_ultra/target.h @@ -11,6 +11,7 @@ #ifdef DISPLAY_CLASS #include #include +#include #endif #include @@ -43,6 +44,7 @@ extern NanoG2UltraSensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; extern MomentaryButton user_btn; +extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/nibble_screen_connect/platformio.ini b/variants/nibble_screen_connect/platformio.ini index 0f8d31de84e..52e7f78fc05 100644 --- a/variants/nibble_screen_connect/platformio.ini +++ b/variants/nibble_screen_connect/platformio.ini @@ -29,6 +29,7 @@ build_flags = -D SX126X_RX_BOOSTED_GAIN=1 build_src_filter = ${esp32_base.build_src_filter} +<../variants/nibble_screen_connect> + + lib_deps = ${esp32_base.lib_deps} adafruit/Adafruit SSD1306 @ ^2.5.13 @@ -38,6 +39,7 @@ lib_deps = extends = nibble_screen_connect_base build_flags = ${nibble_screen_connect_base.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"Nibble Repeater"' -D ADVERT_LAT=0.0 @@ -47,6 +49,7 @@ build_flags = build_src_filter = ${nibble_screen_connect_base.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${nibble_screen_connect_base.lib_deps} ${esp32_ota.lib_deps} @@ -55,6 +58,7 @@ lib_deps = extends = nibble_screen_connect_base build_flags = ${nibble_screen_connect_base.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"ESPNow Bridge"' -D ADVERT_LAT=0.0 @@ -66,6 +70,7 @@ build_src_filter = ${nibble_screen_connect_base.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${nibble_screen_connect_base.lib_deps} ${esp32_ota.lib_deps} @@ -86,6 +91,7 @@ lib_deps = extends = nibble_screen_connect_base build_flags = ${nibble_screen_connect_base.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"Nibble Room"' -D ADVERT_LAT=0.0 @@ -95,6 +101,7 @@ build_flags = build_src_filter = ${nibble_screen_connect_base.build_src_filter} + +<../examples/simple_room_server> + + lib_deps = ${nibble_screen_connect_base.lib_deps} ${esp32_ota.lib_deps} @@ -103,7 +110,7 @@ lib_deps = extends = nibble_screen_connect_base build_flags = ${nibble_screen_connect_base.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D DISPLAY_CLASS=SSD1306Display -D MAX_CONTACTS=300 -D MAX_GROUP_CHANNELS=8 @@ -112,7 +119,7 @@ build_src_filter = ${nibble_screen_connect_base.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${nibble_screen_connect_base.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -121,7 +128,7 @@ lib_deps = extends = nibble_screen_connect_base build_flags = ${nibble_screen_connect_base.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D DISPLAY_CLASS=SSD1306Display -D MAX_CONTACTS=300 -D MAX_GROUP_CHANNELS=8 @@ -133,7 +140,7 @@ build_src_filter = ${nibble_screen_connect_base.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${nibble_screen_connect_base.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -142,7 +149,7 @@ lib_deps = extends = nibble_screen_connect_base build_flags = ${nibble_screen_connect_base.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=300 @@ -157,7 +164,7 @@ build_src_filter = ${nibble_screen_connect_base.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${nibble_screen_connect_base.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/nibble_screen_connect/target.cpp b/variants/nibble_screen_connect/target.cpp index ceb9fe49cf0..79ea6348665 100644 --- a/variants/nibble_screen_connect/target.cpp +++ b/variants/nibble_screen_connect/target.cpp @@ -14,6 +14,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 diff --git a/variants/nibble_screen_connect/target.h b/variants/nibble_screen_connect/target.h index dcbcf8e1dff..c91cfc73cf2 100644 --- a/variants/nibble_screen_connect/target.h +++ b/variants/nibble_screen_connect/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #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(); diff --git a/variants/nibble_zero_connect/platformio.ini b/variants/nibble_zero_connect/platformio.ini index c7e7b07659f..4fe43d0e1bb 100644 --- a/variants/nibble_zero_connect/platformio.ini +++ b/variants/nibble_zero_connect/platformio.ini @@ -27,6 +27,7 @@ build_flags = -D SX126X_RX_BOOSTED_GAIN=1 build_src_filter = ${esp32_base.build_src_filter} +<../variants/nibble_zero_connect> + + lib_deps = ${esp32_base.lib_deps} adafruit/Adafruit SSD1306 @ ^2.5.13 @@ -35,6 +36,7 @@ lib_deps = extends = nibble_zero_connect_base build_flags = ${nibble_zero_connect_base.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"Nibble Repeater"' -D ADVERT_LAT=0.0 @@ -44,6 +46,7 @@ build_flags = build_src_filter = ${nibble_zero_connect_base.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${nibble_zero_connect_base.lib_deps} ${esp32_ota.lib_deps} @@ -52,6 +55,7 @@ lib_deps = extends = nibble_zero_connect_base build_flags = ${nibble_zero_connect_base.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"ESPNow Bridge"' -D ADVERT_LAT=0.0 @@ -63,6 +67,7 @@ build_src_filter = ${nibble_zero_connect_base.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${nibble_zero_connect_base.lib_deps} ${esp32_ota.lib_deps} @@ -83,6 +88,7 @@ lib_deps = extends = nibble_zero_connect_base build_flags = ${nibble_zero_connect_base.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"Nibble Room"' -D ADVERT_LAT=0.0 @@ -92,6 +98,7 @@ build_flags = build_src_filter = ${nibble_zero_connect_base.build_src_filter} + +<../examples/simple_room_server> + + lib_deps = ${nibble_zero_connect_base.lib_deps} ${esp32_ota.lib_deps} @@ -100,7 +107,7 @@ lib_deps = extends = nibble_zero_connect_base build_flags = ${nibble_zero_connect_base.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D DISPLAY_CLASS=SSD1306Display -D MAX_CONTACTS=300 -D MAX_GROUP_CHANNELS=8 @@ -109,7 +116,7 @@ build_src_filter = ${nibble_zero_connect_base.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${nibble_zero_connect_base.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -118,7 +125,7 @@ lib_deps = extends = nibble_zero_connect_base build_flags = ${nibble_zero_connect_base.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D DISPLAY_CLASS=SSD1306Display -D MAX_CONTACTS=300 -D MAX_GROUP_CHANNELS=8 @@ -130,7 +137,7 @@ build_src_filter = ${nibble_zero_connect_base.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${nibble_zero_connect_base.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -139,7 +146,7 @@ lib_deps = extends = nibble_zero_connect_base build_flags = ${nibble_zero_connect_base.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=300 @@ -153,7 +160,7 @@ build_src_filter = ${nibble_zero_connect_base.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${nibble_zero_connect_base.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/nibble_zero_connect/target.cpp b/variants/nibble_zero_connect/target.cpp index d53b6a1c3d8..5200ca39f25 100644 --- a/variants/nibble_zero_connect/target.cpp +++ b/variants/nibble_zero_connect/target.cpp @@ -14,6 +14,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 diff --git a/variants/nibble_zero_connect/target.h b/variants/nibble_zero_connect/target.h index 87c55f0f2e1..2d45bff2054 100644 --- a/variants/nibble_zero_connect/target.h +++ b/variants/nibble_zero_connect/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #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(); diff --git a/variants/promicro/platformio.ini b/variants/promicro/platformio.ini index da27c2fab20..41cd725b732 100644 --- a/variants/promicro/platformio.ini +++ b/variants/promicro/platformio.ini @@ -27,6 +27,7 @@ build_flags = ${nrf52_base.build_flags} build_src_filter = ${nrf52_base.build_src_filter} + +<../variants/promicro> + + lib_deps= ${nrf52_base.lib_deps} adafruit/Adafruit SSD1306 @ ^2.5.13 adafruit/Adafruit INA3221 Library @ ^1.0.1 @@ -43,8 +44,10 @@ build_src_filter = ${Promicro.build_src_filter} +<../examples/simple_repeater> + + + + build_flags = ${Promicro.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"ProMicro Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -63,8 +66,10 @@ build_src_filter = ${Promicro.build_src_filter} + + + + + build_flags = ${Promicro.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"RS232 Bridge"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -87,7 +92,9 @@ build_src_filter = ${Promicro.build_src_filter} +<../examples/simple_room_server> + + + + build_flags = ${Promicro.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"ProMicro Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -117,7 +124,7 @@ extends = Promicro board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 712704 build_flags = ${Promicro.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 @@ -128,7 +135,7 @@ build_src_filter = ${Promicro.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Promicro.lib_deps} adafruit/RTClib @ ^2.1.3 densaugeo/base64 @ ~1.4.0 @@ -138,7 +145,7 @@ extends = Promicro board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 712704 build_flags = ${Promicro.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 @@ -152,7 +159,7 @@ build_src_filter = ${Promicro.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Promicro.lib_deps} adafruit/RTClib @ ^2.1.3 densaugeo/base64 @ ~1.4.0 @@ -165,7 +172,7 @@ build_flags = -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 -D ADMIN_PASSWORD='"password"' - -D DISPLAY_CLASS=SSD1306Display +; -D DISPLAY_CLASS=SSD1306Display ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 build_src_filter = ${Promicro.build_src_filter} diff --git a/variants/promicro/target.cpp b/variants/promicro/target.cpp index 5758d9cda7e..cebfc22b8d4 100644 --- a/variants/promicro/target.cpp +++ b/variants/promicro/target.cpp @@ -22,6 +22,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/promicro/target.h b/variants/promicro/target.h index e577ab4e979..8a953a919a8 100644 --- a/variants/promicro/target.h +++ b/variants/promicro/target.h @@ -9,6 +9,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif #include @@ -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(); diff --git a/variants/rak3112/platformio.ini b/variants/rak3112/platformio.ini index 0eae5f909be..3b4132e8b75 100644 --- a/variants/rak3112/platformio.ini +++ b/variants/rak3112/platformio.ini @@ -221,7 +221,7 @@ lib_deps = extends = rak3112 build_flags = ${rak3112.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D ENABLE_USB_INTERFACE @@ -229,7 +229,7 @@ build_flags = ; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 build_src_filter = ${rak3112.build_src_filter} +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${rak3112.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -238,7 +238,7 @@ lib_deps = extends = rak3112 build_flags = ${rak3112.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D BLE_PIN_CODE=123456 ; dynamic, random PIN @@ -252,7 +252,7 @@ build_src_filter = ${rak3112.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${rak3112.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -262,7 +262,7 @@ lib_deps = extends = rak3112 build_flags = ${rak3112.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D ENABLE_WIFI_INTERFACE -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 @@ -276,7 +276,7 @@ build_src_filter = ${rak3112.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${rak3112.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/rak3112/target.cpp b/variants/rak3112/target.cpp index 9b1d11a0198..34e9be5881f 100644 --- a/variants/rak3112/target.cpp +++ b/variants/rak3112/target.cpp @@ -27,6 +27,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/rak3112/target.h b/variants/rak3112/target.h index f93cd53996b..0ce8e4fb367 100644 --- a/variants/rak3112/target.h +++ b/variants/rak3112/target.h @@ -11,6 +11,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif extern RAK3112Board 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(); diff --git a/variants/rak3401/platformio.ini b/variants/rak3401/platformio.ini index d157e4b1d3f..97f1e6da955 100644 --- a/variants/rak3401/platformio.ini +++ b/variants/rak3401/platformio.ini @@ -18,6 +18,7 @@ build_src_filter = ${nrf52_base.build_src_filter} + + + + + lib_deps = ${nrf52_base.lib_deps} ${sensor_base.lib_deps} @@ -28,6 +29,7 @@ lib_deps = extends = rak3401 build_flags = ${rak3401.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"RAK3401 1W Repeater"' -D ADVERT_LAT=0.0 @@ -39,11 +41,13 @@ build_flags = build_src_filter = ${rak3401.build_src_filter} + +<../examples/simple_repeater> + + [env:RAK_3401_room_server] extends = rak3401 build_flags = ${rak3401.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"Test Room"' -D ADVERT_LAT=0.0 @@ -55,6 +59,7 @@ build_flags = build_src_filter = ${rak3401.build_src_filter} + +<../examples/simple_room_server> + + [env:RAK_3401_companion_radio_usb] extends = rak3401 @@ -62,7 +67,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 712704 build_flags = ${rak3401.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D PIN_USER_BTN_ANA=31 -D DISPLAY_CLASS=SSD1306Display -D MAX_CONTACTS=350 @@ -72,7 +77,7 @@ build_flags = ; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 build_src_filter = ${rak3401.build_src_filter} +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${rak3401.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -83,7 +88,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 712704 build_flags = ${rak3401.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D PIN_USER_BTN_ANA=31 -D DISPLAY_CLASS=SSD1306Display -D MAX_CONTACTS=350 @@ -96,7 +101,7 @@ build_flags = build_src_filter = ${rak3401.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${rak3401.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/rak3401/target.cpp b/variants/rak3401/target.cpp index a9316558dad..cc71cbcfa40 100644 --- a/variants/rak3401/target.cpp +++ b/variants/rak3401/target.cpp @@ -17,6 +17,7 @@ RAK3401Board board; #if defined(PIN_USER_BTN_ANA) MomentaryButton analog_btn(PIN_USER_BTN_ANA, 1000, 20); #endif + UITask ui_task(&board, &display); #endif RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI); diff --git a/variants/rak3401/target.h b/variants/rak3401/target.h index 00653e90e5e..e235eca0484 100644 --- a/variants/rak3401/target.h +++ b/variants/rak3401/target.h @@ -16,6 +16,8 @@ #if defined(PIN_USER_BTN_ANA) extern MomentaryButton analog_btn; #endif + #include + extern UITask ui_task; #endif extern RAK3401Board board; diff --git a/variants/rak4631/platformio.ini b/variants/rak4631/platformio.ini index c5d94d51f52..eaf73c7b02b 100644 --- a/variants/rak4631/platformio.ini +++ b/variants/rak4631/platformio.ini @@ -31,6 +31,7 @@ build_src_filter = ${nrf52_base.build_src_filter} + + + + + lib_deps = ${nrf52_base.lib_deps} ${sensor_base.lib_deps} @@ -43,6 +44,7 @@ lib_deps = extends = rak4631 build_flags = ${rak4631.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=AutoDetectDisplay -D ADVERT_NAME='"RAK4631 Repeater"' -D ADVERT_LAT=0.0 @@ -54,6 +56,7 @@ build_flags = build_src_filter = ${rak4631.build_src_filter} + +<../examples/simple_repeater> + + ; Lets `gps off`, periodic mode and shutdown cut the power to a serial GPS (RAK12501). ; WB_IO2 switches the shared 3V3_S slot rail, so this also powers down any other slot module. @@ -67,6 +70,7 @@ build_flags = extends = rak4631 build_flags = ${rak4631.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=AutoDetectDisplay -D ADVERT_NAME='"RAK4631 Repeater"' -D ADVERT_LAT=0.0 @@ -78,6 +82,7 @@ build_flags = build_src_filter = ${rak4631.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${rak4631.lib_deps} https://github.com/RAKWireless/RAK13800-W5100S/archive/1.0.2.zip @@ -86,6 +91,7 @@ lib_deps = extends = rak4631 build_flags = ${rak4631.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=AutoDetectDisplay -D ADVERT_NAME='"RS232 Bridge"' -D ADVERT_LAT=0.0 @@ -104,11 +110,13 @@ build_src_filter = ${rak4631.build_src_filter} + + +<../examples/simple_repeater> + + [env:RAK_4631_repeater_bridge_rs232_serial2] extends = rak4631 build_flags = ${rak4631.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=AutoDetectDisplay -D ADVERT_NAME='"RS232 Bridge"' -D ADVERT_LAT=0.0 @@ -127,11 +135,13 @@ build_src_filter = ${rak4631.build_src_filter} + + +<../examples/simple_repeater> + + [env:RAK_4631_room_server] extends = rak4631 build_flags = ${rak4631.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=AutoDetectDisplay -D ADVERT_NAME='"Test Room"' -D ADVERT_LAT=0.0 @@ -143,11 +153,13 @@ build_flags = build_src_filter = ${rak4631.build_src_filter} + +<../examples/simple_room_server> + + [env:RAK_4631_room_server_ethernet] extends = rak4631 build_flags = ${rak4631.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=AutoDetectDisplay -D ADVERT_NAME='"RAK4631 Room Server"' -D ADVERT_LAT=0.0 @@ -159,6 +171,7 @@ build_flags = build_src_filter = ${rak4631.build_src_filter} + +<../examples/simple_room_server> + + lib_deps = ${rak4631.lib_deps} https://github.com/RAKWireless/RAK13800-W5100S/archive/1.0.2.zip @@ -169,7 +182,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 712704 build_flags = ${rak4631.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D PIN_USER_BTN=9 -D PIN_USER_BTN_ANA=31 -D DISPLAY_CLASS=AutoDetectDisplay @@ -180,7 +193,7 @@ build_flags = ; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 build_src_filter = ${rak4631.build_src_filter} +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${rak4631.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -194,7 +207,7 @@ build_unflags = -D EXTRAFS=1 build_flags = ${rak4631.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D PIN_USER_BTN=9 -D PIN_USER_BTN_ANA=31 -D DISPLAY_CLASS=AutoDetectDisplay @@ -208,7 +221,7 @@ build_flags = ; -D ETHERNET_DEBUG_LOGGING=1 build_src_filter = ${rak4631.build_src_filter} +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + + + lib_deps = @@ -223,7 +236,7 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 712704 build_flags = ${rak4631.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D PIN_USER_BTN=9 -D PIN_USER_BTN_ANA=31 -D DISPLAY_CLASS=AutoDetectDisplay @@ -237,7 +250,7 @@ build_flags = build_src_filter = ${rak4631.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${rak4631.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/rak4631/target.cpp b/variants/rak4631/target.cpp index 813cb807ffb..385dcec22f2 100644 --- a/variants/rak4631/target.cpp +++ b/variants/rak4631/target.cpp @@ -15,6 +15,7 @@ RAK4631Board board; #if defined(PIN_USER_BTN_ANA) MomentaryButton analog_btn(PIN_USER_BTN_ANA, 1000, 20); #endif + UITask ui_task(&board, &display); #endif RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI); diff --git a/variants/rak4631/target.h b/variants/rak4631/target.h index c04cd4e4822..1cc6f30a328 100644 --- a/variants/rak4631/target.h +++ b/variants/rak4631/target.h @@ -16,6 +16,8 @@ #if defined(PIN_USER_BTN_ANA) extern MomentaryButton analog_btn; #endif + #include + extern UITask ui_task; #endif extern RAK4631Board board; diff --git a/variants/rak_wismesh_tag/platformio.ini b/variants/rak_wismesh_tag/platformio.ini index d6140187170..56395cb0477 100644 --- a/variants/rak_wismesh_tag/platformio.ini +++ b/variants/rak_wismesh_tag/platformio.ini @@ -18,7 +18,6 @@ build_flags = ${nrf52_base.build_flags} -D P_LORA_MOSI=PIN_SPI_MOSI -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper - -D DISPLAY_CLASS=NullDisplayDriver -D LORA_TX_POWER=22 -D SX126X_CURRENT_LIMIT=140 -D SX126X_RX_BOOSTED_GAIN=1 @@ -68,7 +67,8 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 712704 build_flags = ${rak_wismesh_tag.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig + -D DISPLAY_CLASS=NullDisplayDriver -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D ENABLE_USB_INTERFACE @@ -77,7 +77,7 @@ build_flags = build_src_filter = ${rak_wismesh_tag.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${rak_wismesh_tag.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -89,7 +89,8 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 712704 build_flags = ${rak_wismesh_tag.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig + -D DISPLAY_CLASS=NullDisplayDriver -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D BLE_PIN_CODE=123456 @@ -102,7 +103,7 @@ build_src_filter = ${rak_wismesh_tag.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${rak_wismesh_tag.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/rak_wismesh_tag/target.cpp b/variants/rak_wismesh_tag/target.cpp index 3e80ae639be..364e33c35bc 100644 --- a/variants/rak_wismesh_tag/target.cpp +++ b/variants/rak_wismesh_tag/target.cpp @@ -11,6 +11,7 @@ RAKWismeshTagBoard board; #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true, true); + UITask ui_task(&board, &display); #endif RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI); diff --git a/variants/rak_wismesh_tag/target.h b/variants/rak_wismesh_tag/target.h index fbe18d2d11a..3d2f9fc1125 100644 --- a/variants/rak_wismesh_tag/target.h +++ b/variants/rak_wismesh_tag/target.h @@ -13,6 +13,8 @@ extern DISPLAY_CLASS display; #include extern MomentaryButton user_btn; + #include + extern UITask ui_task; #endif extern RAKWismeshTagBoard board; diff --git a/variants/sensecap_indicator-espnow/platformio.ini b/variants/sensecap_indicator-espnow/platformio.ini index a5952d6e32a..280e3a53476 100644 --- a/variants/sensecap_indicator-espnow/platformio.ini +++ b/variants/sensecap_indicator-espnow/platformio.ini @@ -36,14 +36,14 @@ lib_deps=${esp32_base.lib_deps} extends = SenseCapIndicator-ESPNow build_flags = ${SenseCapIndicator-ESPNow.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 ; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1 ; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 ; NOTE: DO NOT ENABLE --> -D ESPNOW_DEBUG_LOGGING=1 build_src_filter = ${SenseCapIndicator-ESPNow.build_src_filter} - +<../examples/companion_radio/ui-new/*.cpp> + + +<../examples/companion_radio/*.cpp> lib_deps = ${SenseCapIndicator-ESPNow.lib_deps} diff --git a/variants/sensecap_indicator-espnow/target.cpp b/variants/sensecap_indicator-espnow/target.cpp index 4895447c043..1bd46dd666d 100644 --- a/variants/sensecap_indicator-espnow/target.cpp +++ b/variants/sensecap_indicator-espnow/target.cpp @@ -20,6 +20,7 @@ EnvironmentSensorManager sensors = EnvironmentSensorManager(); #ifdef PIN_USER_BTN MomentaryButton user_btn(PIN_USER_BTN, 1000, true, true); #endif + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/sensecap_indicator-espnow/target.h b/variants/sensecap_indicator-espnow/target.h index dab4575e5c7..206d0e688d9 100644 --- a/variants/sensecap_indicator-espnow/target.h +++ b/variants/sensecap_indicator-espnow/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include "SCIndicatorDisplay.h" #include + #include #endif extern ESP32Board board; @@ -20,6 +21,7 @@ extern EnvironmentSensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/station_g2/platformio.ini b/variants/station_g2/platformio.ini index 955d432015f..e72bebac321 100644 --- a/variants/station_g2/platformio.ini +++ b/variants/station_g2/platformio.ini @@ -37,6 +37,7 @@ build_src_filter = ${esp32_base.build_src_filter} + + + + + lib_deps = ${esp32_base.lib_deps} ${sensor_base.lib_deps} @@ -48,6 +49,7 @@ extends = Station_G2 board_build.partitions = default_16MB.csv ; standard 16MB partition table (compatible with MQTT bridge) build_flags = ${Station_G2.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"Station G2 Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -60,6 +62,7 @@ build_src_filter = ${Station_G2.build_src_filter} - - - + + lib_deps = ${Station_G2.lib_deps} ${esp32_ota.lib_deps} @@ -90,6 +93,7 @@ lib_deps = extends = Station_G2 build_flags = ${Station_G2.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"ESPNow Bridge"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -102,6 +106,7 @@ build_flags = build_src_filter = ${Station_G2.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${Station_G2.lib_deps} ${esp32_ota.lib_deps} @@ -110,6 +115,7 @@ lib_deps = extends = Station_G2 build_flags = ${Station_G2.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"Station G2 Logging Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -124,6 +130,7 @@ build_src_filter = ${Station_G2.build_src_filter} - - - + + lib_deps = ${Station_G2.lib_deps} ${esp32_ota.lib_deps} @@ -155,6 +162,7 @@ lib_deps = extends = Station_G2 build_flags = ${Station_G2.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"ESPNow Bridge"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -168,6 +176,7 @@ build_flags = build_src_filter = ${Station_G2.build_src_filter} + +<../examples/simple_repeater> + + lib_deps = ${Station_G2.lib_deps} ${esp32_ota.lib_deps} @@ -196,6 +205,7 @@ build_flags = -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D ESP32_CPU_FREQ=160 -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${Station_G2.build_src_filter} + + @@ -203,6 +213,7 @@ build_src_filter = ${Station_G2.build_src_filter} + + +<../examples/simple_room_server> + + lib_deps = ${Station_G2.lib_deps} ${esp32_ota.lib_deps} @@ -217,8 +228,10 @@ lib_deps = extends = Station_G2 build_src_filter = ${Station_G2.build_src_filter} +<../examples/simple_room_server> + + build_flags = ${Station_G2.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"Station G2 Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -234,7 +247,7 @@ lib_deps = extends = Station_G2 build_flags = ${Station_G2.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 @@ -243,7 +256,7 @@ build_flags = build_src_filter = ${Station_G2.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Station_G2.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -254,7 +267,7 @@ extends = Station_G2 board_build.partitions = default_16MB.csv build_flags = ${Station_G2.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 @@ -265,7 +278,7 @@ build_flags = build_src_filter = ${Station_G2.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Station_G2.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -276,7 +289,7 @@ extends = Station_G2 board_build.partitions = default_16MB.csv build_flags = ${Station_G2.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 @@ -290,7 +303,7 @@ build_src_filter = ${Station_G2.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Station_G2.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -300,6 +313,7 @@ lib_deps = extends = Station_G2 build_flags = ${Station_G2.build_flags} + -U DISPLAY_CLASS -D ARDUINO_USB_MODE=1 build_src_filter = ${Station_G2.build_src_filter} +<../examples/kiss_modem/> @@ -322,6 +336,7 @@ build_flags = -D WITH_MQTT_BRIDGE=1 -D MQTT_MAX_PACKET_SIZE=1024 -D MQTT_DEBUG=1 + -I src/helpers/ui/server # -D MESH_PACKET_LOGGING=1 # -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y @@ -340,6 +355,7 @@ build_src_filter = ${Station_G2.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${Station_G2.lib_deps} ${esp32_ota.lib_deps} diff --git a/variants/station_g2/target.cpp b/variants/station_g2/target.cpp index f5365eb58c8..2cdee0ff633 100644 --- a/variants/station_g2/target.cpp +++ b/variants/station_g2/target.cpp @@ -27,6 +27,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/station_g2/target.h b/variants/station_g2/target.h index b4eadbba319..963f4619d4a 100644 --- a/variants/station_g2/target.h +++ b/variants/station_g2/target.h @@ -11,6 +11,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif extern StationG2Board 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(); diff --git a/variants/station_g3_esp32/platformio.ini b/variants/station_g3_esp32/platformio.ini index 677cbe673e2..0be5a6552bd 100644 --- a/variants/station_g3_esp32/platformio.ini +++ b/variants/station_g3_esp32/platformio.ini @@ -34,6 +34,7 @@ build_src_filter = ${esp32_base.build_src_filter} + + + + + lib_deps = ${esp32_base.lib_deps} ${sensor_base.lib_deps} @@ -86,6 +87,7 @@ lib_deps = ${Station_G3_ESP32_common.lib_deps} extends = Station_G3_ESP32 build_flags = ${Station_G3_ESP32.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"Station G3 ESP32 Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -95,6 +97,7 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${Station_G3_ESP32.build_src_filter} +<../examples/simple_repeater> + + lib_deps = ${Station_G3_ESP32.lib_deps} ${esp32_ota.lib_deps} @@ -103,6 +106,7 @@ lib_deps = extends = Station_G3_ESP32 build_flags = ${Station_G3_ESP32.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"Station G3 ESP32 Logging Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -112,6 +116,7 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${Station_G3_ESP32.build_src_filter} +<../examples/simple_repeater> + + lib_deps = ${Station_G3_ESP32.lib_deps} ${esp32_ota.lib_deps} @@ -120,8 +125,10 @@ lib_deps = extends = Station_G3_ESP32 build_src_filter = ${Station_G3_ESP32.build_src_filter} +<../examples/simple_room_server> + + build_flags = ${Station_G3_ESP32.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"Station G3 ESP32 Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -137,7 +144,7 @@ lib_deps = extends = Station_G3_ESP32 build_flags = ${Station_G3_ESP32.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 @@ -146,7 +153,7 @@ build_flags = build_src_filter = ${Station_G3_ESP32.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Station_G3_ESP32.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -157,7 +164,7 @@ extends = Station_G3_ESP32 board_build.partitions = default_16MB.csv build_flags = ${Station_G3_ESP32.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 @@ -168,7 +175,7 @@ build_flags = build_src_filter = ${Station_G3_ESP32.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Station_G3_ESP32.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -179,7 +186,7 @@ extends = Station_G3_ESP32 board_build.partitions = default_16MB.csv build_flags = ${Station_G3_ESP32.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 @@ -193,7 +200,7 @@ build_src_filter = ${Station_G3_ESP32.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Station_G3_ESP32.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -201,6 +208,9 @@ lib_deps = [env:Station_G3_ESP32_kiss_modem] extends = Station_G3_ESP32 +build_flags = + ${Station_G3_ESP32.build_flags} + -U DISPLAY_CLASS build_src_filter = ${Station_G3_ESP32.build_src_filter} +<../examples/kiss_modem/> @@ -222,6 +232,7 @@ build_flags = -D WITH_MQTT_BRIDGE=1 -D MQTT_MAX_PACKET_SIZE=1024 -D MQTT_DEBUG=1 + -I src/helpers/ui/server # -D MESH_PACKET_LOGGING=1 # -D MESH_DEBUG=1 -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y @@ -240,6 +251,7 @@ build_src_filter = ${Station_G3_ESP32.build_src_filter} + + +<../examples/simple_repeater> + + lib_deps = ${Station_G3_ESP32.lib_deps} ${esp32_ota.lib_deps} @@ -274,6 +286,7 @@ build_flags = -D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y -D ESP32_CPU_FREQ=160 -D WITH_SNMP=1 + -I src/helpers/ui/server build_src_filter = ${Station_G3_ESP32.build_src_filter} + + @@ -281,6 +294,7 @@ build_src_filter = ${Station_G3_ESP32.build_src_filter} + + +<../examples/simple_room_server> + + lib_deps = ${Station_G3_ESP32.lib_deps} ${esp32_ota.lib_deps} diff --git a/variants/station_g3_esp32/target.cpp b/variants/station_g3_esp32/target.cpp index 189169d216e..da65236865c 100644 --- a/variants/station_g3_esp32/target.cpp +++ b/variants/station_g3_esp32/target.cpp @@ -27,6 +27,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/station_g3_esp32/target.h b/variants/station_g3_esp32/target.h index b67349dcb9a..4bc3fc1ca44 100644 --- a/variants/station_g3_esp32/target.h +++ b/variants/station_g3_esp32/target.h @@ -11,6 +11,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif extern StationG3Board 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(); diff --git a/variants/t1000-e/platformio.ini b/variants/t1000-e/platformio.ini index ab8b0de0b85..766229d4633 100644 --- a/variants/t1000-e/platformio.ini +++ b/variants/t1000-e/platformio.ini @@ -38,7 +38,7 @@ upload_protocol = nrfutil [env:t1000e_repeater] extends = t1000-e build_flags = ${t1000-e.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D ADVERT_NAME='"t1000-e Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -54,7 +54,7 @@ lib_deps = ${t1000-e.lib_deps} [env:t1000e_room_server] extends = t1000-e build_flags = ${t1000-e.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D ADVERT_NAME='"t1000-e Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -73,7 +73,7 @@ extends = t1000-e board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${t1000-e.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 ; -D MESH_PACKET_LOGGING=1 @@ -87,7 +87,7 @@ build_src_filter = ${t1000-e.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${t1000-e.lib_deps} densaugeo/base64 @ ~1.4.0 stevemarple/MicroNMEA @ ^2.0.6 @@ -98,7 +98,7 @@ extends = t1000-e board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${t1000-e.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D BLE_PIN_CODE=123456 @@ -117,7 +117,7 @@ build_src_filter = ${t1000-e.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${t1000-e.lib_deps} densaugeo/base64 @ ~1.4.0 stevemarple/MicroNMEA @ ^2.0.6 diff --git a/variants/t1000-e/target.cpp b/variants/t1000-e/target.cpp index 609c32bc7f2..a9db46ade15 100644 --- a/variants/t1000-e/target.cpp +++ b/variants/t1000-e/target.cpp @@ -17,6 +17,7 @@ T1000SensorManager sensors(nmea, gps_driver); #ifdef DISPLAY_CLASS NullDisplayDriver display; + UITask ui_task(&board, &display); #endif #ifndef LORA_CR diff --git a/variants/t1000-e/target.h b/variants/t1000-e/target.h index 68508bcb5ad..e6eea918064 100644 --- a/variants/t1000-e/target.h +++ b/variants/t1000-e/target.h @@ -10,6 +10,7 @@ #include #ifdef DISPLAY_CLASS #include "NullDisplayDriver.h" + #include #endif class AirohaGpsDriver; @@ -36,6 +37,7 @@ class T1000SensorManager: public SensorManager { #ifdef DISPLAY_CLASS extern NullDisplayDriver display; + extern UITask ui_task; #endif extern T1000eBoard board; diff --git a/variants/thinknode_m1/platformio.ini b/variants/thinknode_m1/platformio.ini index ae00d28eac4..8be7e19c5cf 100644 --- a/variants/thinknode_m1/platformio.ini +++ b/variants/thinknode_m1/platformio.ini @@ -85,7 +85,7 @@ board_upload.maximum_size = 712704 build_flags = ${ThinkNode_M1.build_flags} -I src/helpers/ui - -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 @@ -105,7 +105,7 @@ build_src_filter = ${ThinkNode_M1.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${ThinkNode_M1.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -120,7 +120,7 @@ board_upload.maximum_size = 712704 build_flags = ${ThinkNode_M1.build_flags} -I src/helpers/ui - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D DISPLAY_ROTATION=4 @@ -135,7 +135,7 @@ build_src_filter = ${ThinkNode_M1.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${ThinkNode_M1.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/thinknode_m1/target.cpp b/variants/thinknode_m1/target.cpp index 4183c514fb4..d29d13b4caf 100644 --- a/variants/thinknode_m1/target.cpp +++ b/variants/thinknode_m1/target.cpp @@ -20,6 +20,7 @@ ThinkNodeM1SensorManager sensors = ThinkNodeM1SensorManager(nmea); DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); MomentaryButton backlight_btn(BACKLIGHT_BTN, 1000, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/thinknode_m1/target.h b/variants/thinknode_m1/target.h index 9c8a6e80f4a..08cb9a569c7 100644 --- a/variants/thinknode_m1/target.h +++ b/variants/thinknode_m1/target.h @@ -11,6 +11,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif class ThinkNodeM1SensorManager : public SensorManager { @@ -39,6 +40,7 @@ extern ThinkNodeM1SensorManager sensors; extern DISPLAY_CLASS display; extern MomentaryButton user_btn; extern MomentaryButton backlight_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/thinknode_m2/platformio.ini b/variants/thinknode_m2/platformio.ini index 6c0f34d9040..f74241a77ee 100644 --- a/variants/thinknode_m2/platformio.ini +++ b/variants/thinknode_m2/platformio.ini @@ -24,7 +24,6 @@ build_flags = ${esp32_base.build_flags} -D SX126X_DIO2_AS_RF_SWITCH=true -D SX126X_DIO3_TCXO_VOLTAGE=3.3 -D SX126X_CURRENT_LIMIT=140 - -D DISPLAY_CLASS=SH1106Display -D USE_SX1262 -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper @@ -132,7 +131,8 @@ lib_deps = extends = ThinkNode_M2 build_flags = ${ThinkNode_M2.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new + -D DISPLAY_CLASS=SH1106Display -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D BLE_PIN_CODE=123456 @@ -145,7 +145,7 @@ build_src_filter = ${ThinkNode_M2.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${ThinkNode_M2.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -155,7 +155,8 @@ lib_deps = extends = ThinkNode_M2 build_flags = ${ThinkNode_M2.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new + -D DISPLAY_CLASS=SH1106Display -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D OFFLINE_QUEUE_SIZE=256 @@ -165,7 +166,7 @@ build_src_filter = ${ThinkNode_M2.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${ThinkNode_M2.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -177,8 +178,9 @@ build_flags = ${ThinkNode_M2.build_flags} ; 4 MB flash: no room for the TLS stack that OTA needs -D DMC_COMPANION_NO_OTA - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D ENABLE_WIFI_INTERFACE + -D DISPLAY_CLASS=SH1106Display -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D OFFLINE_QUEUE_SIZE=256 @@ -191,7 +193,7 @@ build_src_filter = ${ThinkNode_M2.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${ThinkNode_M2.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -202,7 +204,8 @@ lib_deps = extends = ThinkNode_M2 build_flags = ${ThinkNode_M2.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new + -D DISPLAY_CLASS=SH1106Display -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D SERIAL_TX=43 @@ -214,7 +217,7 @@ build_src_filter = ${ThinkNode_M2.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${ThinkNode_M2.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/thinknode_m2/target.cpp b/variants/thinknode_m2/target.cpp index ff0dd6cf4db..9ea042ba743 100644 --- a/variants/thinknode_m2/target.cpp +++ b/variants/thinknode_m2/target.cpp @@ -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() { diff --git a/variants/thinknode_m2/target.h b/variants/thinknode_m2/target.h index 37ede89e555..6928036d13d 100644 --- a/variants/thinknode_m2/target.h +++ b/variants/thinknode_m2/target.h @@ -11,6 +11,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif extern ThinknodeM2Board board; @@ -21,6 +22,7 @@ extern SensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/thinknode_m3/platformio.ini b/variants/thinknode_m3/platformio.ini index ce1e7e59e48..791f4573502 100644 --- a/variants/thinknode_m3/platformio.ini +++ b/variants/thinknode_m3/platformio.ini @@ -39,7 +39,7 @@ lib_deps= ${nrf52_base.lib_deps} [env:ThinkNode_M3_repeater] extends = ThinkNode_M3 build_flags = ${ThinkNode_M3.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D ADVERT_NAME='"ThinkNode_M3 Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -55,7 +55,7 @@ lib_deps = ${ThinkNode_M3.lib_deps} [env:ThinkNode_M3_room_server] extends = ThinkNode_M3 build_flags = ${ThinkNode_M3.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D ADVERT_NAME='"ThinkNode_M3 Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -74,7 +74,7 @@ extends = ThinkNode_M3 board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${ThinkNode_M3.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 ; -D MESH_PACKET_LOGGING=1 @@ -88,7 +88,7 @@ build_src_filter = ${ThinkNode_M3.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${ThinkNode_M3.lib_deps} densaugeo/base64 @ ~1.4.0 stevemarple/MicroNMEA @ ^2.0.6 @@ -99,7 +99,7 @@ extends = ThinkNode_M3 board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${ThinkNode_M3.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D BLE_PIN_CODE=123456 @@ -115,7 +115,7 @@ build_src_filter = ${ThinkNode_M3.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${ThinkNode_M3.lib_deps} densaugeo/base64 @ ~1.4.0 stevemarple/MicroNMEA @ ^2.0.6 diff --git a/variants/thinknode_m3/target.cpp b/variants/thinknode_m3/target.cpp index bb5746cac02..f9f5ed71d97 100644 --- a/variants/thinknode_m3/target.cpp +++ b/variants/thinknode_m3/target.cpp @@ -20,6 +20,7 @@ EnvironmentSensorManager sensors = EnvironmentSensorManager(); #ifdef DISPLAY_CLASS NullDisplayDriver display; + UITask ui_task(&board, &display); #endif #ifndef LORA_CR diff --git a/variants/thinknode_m3/target.h b/variants/thinknode_m3/target.h index f2d34328dad..8026f53b450 100644 --- a/variants/thinknode_m3/target.h +++ b/variants/thinknode_m3/target.h @@ -11,10 +11,12 @@ #include #ifdef DISPLAY_CLASS #include "NullDisplayDriver.h" + #include #endif #ifdef DISPLAY_CLASS extern NullDisplayDriver display; + extern UITask ui_task; #endif extern ThinkNodeM3Board board; diff --git a/variants/thinknode_m4/platformio.ini b/variants/thinknode_m4/platformio.ini index 06762f88d82..a69d9303e7d 100644 --- a/variants/thinknode_m4/platformio.ini +++ b/variants/thinknode_m4/platformio.ini @@ -40,7 +40,6 @@ lib_deps= ${nrf52_base.lib_deps} [env:ThinkNode_M4_repeater] extends = ThinkNode_M4 build_flags = ${ThinkNode_M4.build_flags} - -I examples/companion_radio/ui-orig -D ADVERT_NAME='"ThinkNode_M4 Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -56,7 +55,6 @@ lib_deps = ${ThinkNode_M4.lib_deps} [env:ThinkNode_M4_room_server] extends = ThinkNode_M4 build_flags = ${ThinkNode_M4.build_flags} - -I examples/companion_radio/ui-orig -D ADVERT_NAME='"ThinkNode_M4 Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -75,7 +73,7 @@ extends = ThinkNode_M4 board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${ThinkNode_M4.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 ; -D MESH_PACKET_LOGGING=1 @@ -89,7 +87,7 @@ build_src_filter = ${ThinkNode_M4.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${ThinkNode_M4.lib_deps} densaugeo/base64 @ ~1.4.0 stevemarple/MicroNMEA @ ^2.0.6 @@ -100,7 +98,7 @@ extends = ThinkNode_M4 board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${ThinkNode_M4.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D BLE_PIN_CODE=123456 @@ -116,7 +114,7 @@ build_src_filter = ${ThinkNode_M4.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${ThinkNode_M4.lib_deps} densaugeo/base64 @ ~1.4.0 stevemarple/MicroNMEA @ ^2.0.6 diff --git a/variants/thinknode_m4/target.cpp b/variants/thinknode_m4/target.cpp index 59a898f5499..fc3431695c2 100644 --- a/variants/thinknode_m4/target.cpp +++ b/variants/thinknode_m4/target.cpp @@ -20,6 +20,7 @@ EnvironmentSensorManager sensors = EnvironmentSensorManager(); #ifdef DISPLAY_CLASS NullDisplayDriver display; + UITask ui_task(&board, &display); #endif #ifndef LORA_CR diff --git a/variants/thinknode_m4/target.h b/variants/thinknode_m4/target.h index 1135f5e8900..922cc18e19c 100644 --- a/variants/thinknode_m4/target.h +++ b/variants/thinknode_m4/target.h @@ -11,10 +11,12 @@ #include #ifdef DISPLAY_CLASS #include "NullDisplayDriver.h" + #include #endif #ifdef DISPLAY_CLASS extern NullDisplayDriver display; + extern UITask ui_task; #endif extern ThinkNodeM4Board board; diff --git a/variants/thinknode_m5/platformio.ini b/variants/thinknode_m5/platformio.ini index 46ce9508ba5..782e891e81a 100644 --- a/variants/thinknode_m5/platformio.ini +++ b/variants/thinknode_m5/platformio.ini @@ -20,7 +20,6 @@ build_flags = ${esp32_base.build_flags} -D PIN_BUTTON2=14 -D EXP_PIN_LED=1 ; led is on bus expander -D DISPLAY_ROTATION=4 - -D DISPLAY_CLASS=GxEPDDisplay -D EINK_DISPLAY_MODEL=GxEPD2_154_D67 -D EINK_SCALE_X=1.5625f -D EINK_SCALE_Y=1.5625f @@ -49,7 +48,8 @@ build_src_filter = ${esp32_base.build_src_filter} + + + - +<../variants/thinknode_m5> + + + +<../variants/thinknode_m5/*.cpp> lib_deps = ${esp32_base.lib_deps} zinggjm/GxEPD2 @ 1.6.2 bakercp/CRC32 @ ^2.0.0 @@ -60,13 +60,16 @@ lib_deps = ${esp32_base.lib_deps} extends = ThinkNode_M5 build_src_filter = ${ThinkNode_M5.build_src_filter} +<../examples/simple_repeater/*.cpp> + + build_flags = ${ThinkNode_M5.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"Thinknode M5 Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 -D ADMIN_PASSWORD='"password"' -D MAX_NEIGHBOURS=8 + -D DISPLAY_CLASS=GxEPDDisplay ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 lib_deps = @@ -99,8 +102,10 @@ extends = ThinkNode_M5 build_src_filter = ${ThinkNode_M5.build_src_filter} + +<../examples/simple_repeater/*.cpp> + + build_flags = ${ThinkNode_M5.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"ESPNow Bridge"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -108,6 +113,7 @@ build_flags = -D MAX_NEIGHBOURS=8 -D WITH_ESPNOW_BRIDGE=1 -D WITH_ESPNOW_BRIDGE_SECRET='"shared-secret"' + -D DISPLAY_CLASS=GxEPDDisplay ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 lib_deps = @@ -118,13 +124,16 @@ lib_deps = extends = ThinkNode_M5 build_src_filter = ${ThinkNode_M5.build_src_filter} +<../examples/simple_room_server> + + build_flags = ${ThinkNode_M5.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"Thinknode M5 Room Server"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 -D ADMIN_PASSWORD='"password"' -D ROOM_PASSWORD='"hello"' + -D DISPLAY_CLASS=GxEPDDisplay ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 lib_deps = @@ -149,19 +158,20 @@ lib_deps = extends = ThinkNode_M5 build_flags = ${ThinkNode_M5.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 -D OFFLINE_QUEUE_SIZE=256 + -D DISPLAY_CLASS=GxEPDDisplay ; -D BLE_DEBUG_LOGGING=1 ; -D MESH_PACKET_LOGGING=1 ; -D GPS_NMEA_DEBUG build_src_filter = ${ThinkNode_M5.build_src_filter} + +<../examples/companion_radio/*.cpp> + + + + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + lib_deps = ${ThinkNode_M5.lib_deps} @@ -172,17 +182,19 @@ lib_deps = extends = ThinkNode_M5 build_flags = ${ThinkNode_M5.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 -D ENABLE_USB_INTERFACE -D ENABLE_WIFI_INTERFACE + -D DISPLAY_CLASS=GxEPDDisplay + -I src/helpers/ui/companion-new build_src_filter = ${ThinkNode_M5.build_src_filter} + +<../examples/companion_radio/*.cpp> + + + + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = @@ -196,7 +208,7 @@ build_flags = ${ThinkNode_M5.build_flags} ; 4 MB flash: no room for the TLS stack that OTA needs -D DMC_COMPANION_NO_OTA - -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 @@ -204,12 +216,14 @@ build_flags = -D WIFI_DEBUG_LOGGING=1 -D WIFI_SSID='"myssid"' -D WIFI_PWD='"mypwd"' + -D DISPLAY_CLASS=GxEPDDisplay + -I src/helpers/ui/companion-new build_src_filter = ${ThinkNode_M5.build_src_filter} + +<../examples/companion_radio/*.cpp> + + + + + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + lib_deps = ${ThinkNode_M5.lib_deps} @@ -221,18 +235,21 @@ lib_deps = extends = ThinkNode_M5 build_flags = ${ThinkNode_M5.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D SERIAL_TX=D6 -D SERIAL_RX=D7 + -D DISPLAY_CLASS=GxEPDDisplay ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 + -I src/helpers/ui/companion-new build_src_filter = ${ThinkNode_M5.build_src_filter} + +<../examples/companion_radio/*.cpp> + +<../variants/thinknode_m5/target-companion.cpp> + + + + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + lib_deps = ${ThinkNode_M5.lib_deps} diff --git a/variants/thinknode_m5/target.cpp b/variants/thinknode_m5/target.cpp index 0ed9a0d0c5a..493ce84458b 100644 --- a/variants/thinknode_m5/target.cpp +++ b/variants/thinknode_m5/target.cpp @@ -28,6 +28,8 @@ EnvironmentSensorManager sensors = EnvironmentSensorManager(); DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); MomentaryButton backlight_btn(BACKLIGHT_BTN, 1000, true); + + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/thinknode_m5/target.h b/variants/thinknode_m5/target.h index 7cce1edbf88..d5b8d61db30 100644 --- a/variants/thinknode_m5/target.h +++ b/variants/thinknode_m5/target.h @@ -13,6 +13,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif extern ThinknodeM5Board board; @@ -25,6 +26,7 @@ extern PCA9557 expander; extern DISPLAY_CLASS display; extern MomentaryButton user_btn; extern MomentaryButton backlight_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/thinknode_m6/platformio.ini b/variants/thinknode_m6/platformio.ini index ad7e6902cf0..f689a8e0e42 100644 --- a/variants/thinknode_m6/platformio.ini +++ b/variants/thinknode_m6/platformio.ini @@ -78,7 +78,7 @@ board_upload.maximum_size = 712704 build_flags = ${ThinkNode_M6.build_flags} -I src/helpers/ui - -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 @@ -103,7 +103,7 @@ board_upload.maximum_size = 712704 build_flags = ${ThinkNode_M6.build_flags} -I src/helpers/ui - -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 diff --git a/variants/thinknode_m6/target.cpp b/variants/thinknode_m6/target.cpp index 061f7ad4ca0..2d936d07c2e 100644 --- a/variants/thinknode_m6/target.cpp +++ b/variants/thinknode_m6/target.cpp @@ -22,6 +22,7 @@ EnvironmentSensorManager sensors = EnvironmentSensorManager(); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/thinknode_m6/target.h b/variants/thinknode_m6/target.h index 76188e584e0..6b9a751ccac 100644 --- a/variants/thinknode_m6/target.h +++ b/variants/thinknode_m6/target.h @@ -12,6 +12,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif extern ThinkNodeM6Board board; @@ -22,6 +23,7 @@ extern EnvironmentSensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/thinknode_m7/platformio.ini b/variants/thinknode_m7/platformio.ini index c10523588a4..d0b3f4cb2c5 100644 --- a/variants/thinknode_m7/platformio.ini +++ b/variants/thinknode_m7/platformio.ini @@ -102,7 +102,7 @@ extends = ThinkNode_M7 build_flags = ${ThinkNode_M7.build_flags} ${ThinkNode_M7_ethernet.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D DISPLAY_CLASS=NullDisplayDriver -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 @@ -118,7 +118,7 @@ build_src_filter = ${ThinkNode_M7.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${ThinkNode_M7.lib_deps} ${ThinkNode_M7_ethernet.lib_deps} @@ -129,7 +129,7 @@ lib_deps = extends = ThinkNode_M7 build_flags = ${ThinkNode_M7.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D OFFLINE_QUEUE_SIZE=256 @@ -138,7 +138,7 @@ build_src_filter = ${ThinkNode_M7.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${ThinkNode_M7.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -147,7 +147,7 @@ lib_deps = extends = ThinkNode_M7 build_flags = ${ThinkNode_M7.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D ENABLE_WIFI_INTERFACE -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 @@ -163,7 +163,7 @@ build_src_filter = ${ThinkNode_M7.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${ThinkNode_M7.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -174,7 +174,7 @@ extends = ThinkNode_M7 build_flags = ${ThinkNode_M7.build_flags} ${ThinkNode_M7_ethernet.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D DISPLAY_CLASS=NullDisplayDriver @@ -185,7 +185,7 @@ build_src_filter = ${ThinkNode_M7.build_src_filter} + + ; defines UIColor::window_bkg for DISPLAY_CLASS +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${ThinkNode_M7.lib_deps} ${ThinkNode_M7_ethernet.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/thinknode_m7/target.cpp b/variants/thinknode_m7/target.cpp index 8e7e8a05a7c..80825abc166 100644 --- a/variants/thinknode_m7/target.cpp +++ b/variants/thinknode_m7/target.cpp @@ -21,6 +21,7 @@ EnvironmentSensorManager sensors = EnvironmentSensorManager(); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; + UITask ui_task(&board, &display); #endif #ifdef RF_SWITCH_TABLE diff --git a/variants/thinknode_m7/target.h b/variants/thinknode_m7/target.h index 34213f57cab..7aa95421110 100644 --- a/variants/thinknode_m7/target.h +++ b/variants/thinknode_m7/target.h @@ -11,6 +11,7 @@ #include #ifdef DISPLAY_CLASS #include "NullDisplayDriver.h" + #include #endif extern ThinkNodeM7Board board; @@ -20,6 +21,7 @@ extern EnvironmentSensorManager sensors; #ifdef DISPLAY_CLASS extern NullDisplayDriver display; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/thinknode_m8/platformio.ini b/variants/thinknode_m8/platformio.ini index 2f8fb9e557b..becd34dd7ae 100644 --- a/variants/thinknode_m8/platformio.ini +++ b/variants/thinknode_m8/platformio.ini @@ -91,7 +91,7 @@ board_upload.maximum_size = 712704 build_flags = ${ThinkNode_M8.build_flags} -I src/helpers/ui - -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 @@ -112,7 +112,7 @@ build_src_filter = ${ThinkNode_M8.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${ThinkNode_M8.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -127,7 +127,7 @@ board_upload.maximum_size = 712704 build_flags = ${ThinkNode_M8.build_flags} -I src/helpers/ui - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-new -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D DISPLAY_ROTATION=4 @@ -143,7 +143,7 @@ build_src_filter = ${ThinkNode_M8.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${ThinkNode_M8.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/thinknode_m8/target.cpp b/variants/thinknode_m8/target.cpp index 04496d3fc9d..e4497ffe8c2 100644 --- a/variants/thinknode_m8/target.cpp +++ b/variants/thinknode_m8/target.cpp @@ -25,6 +25,7 @@ EnvironmentSensorManager sensors = EnvironmentSensorManager(); MomentaryButton user_btn(PIN_USER_BTN, 1000, true); RotaryInputGPIO rotary_input(PIN_BUTTON1_A, PIN_BUTTON1_B); MomentaryButton backlight_btn(BACKLIGHT_BTN, 1000, true); + UITask ui_task(&board, &display); #endif bool radio_init() { diff --git a/variants/thinknode_m8/target.h b/variants/thinknode_m8/target.h index 39928506585..39ad6bec901 100644 --- a/variants/thinknode_m8/target.h +++ b/variants/thinknode_m8/target.h @@ -13,6 +13,7 @@ #include #include #include + #include #endif extern ThinkNodeM8Board board; @@ -25,6 +26,7 @@ extern EnvironmentSensorManager sensors; extern MomentaryButton user_btn; extern MomentaryButton backlight_btn; extern RotaryInputGPIO rotary_input; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/thinknode_m9/platformio.ini b/variants/thinknode_m9/platformio.ini index d4983491db5..c718fe94f23 100755 --- a/variants/thinknode_m9/platformio.ini +++ b/variants/thinknode_m9/platformio.ini @@ -94,7 +94,7 @@ lib_deps = extends = ThinkNode_M9 build_flags = ${ThinkNode_M9.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 @@ -106,7 +106,7 @@ build_src_filter = ${ThinkNode_M9.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${ThinkNode_M9.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -116,7 +116,7 @@ lib_deps = extends = ThinkNode_M9 build_flags = ${ThinkNode_M9.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 @@ -126,7 +126,7 @@ build_src_filter = ${ThinkNode_M9.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${ThinkNode_M9.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -136,7 +136,7 @@ lib_deps = extends = ThinkNode_M9 build_flags = ${ThinkNode_M9.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 @@ -151,7 +151,7 @@ build_src_filter = ${ThinkNode_M9.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${ThinkNode_M9.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/thinknode_m9/target.cpp b/variants/thinknode_m9/target.cpp index 990f0388a71..aa1cc5b9bfa 100644 --- a/variants/thinknode_m9/target.cpp +++ b/variants/thinknode_m9/target.cpp @@ -20,6 +20,7 @@ EnvironmentSensorManager sensors = EnvironmentSensorManager(); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; + UITask ui_task(&board, &display); #endif #ifdef RF_SWITCH_TABLE diff --git a/variants/thinknode_m9/target.h b/variants/thinknode_m9/target.h index f083a9f1b3d..d249d16bb25 100644 --- a/variants/thinknode_m9/target.h +++ b/variants/thinknode_m9/target.h @@ -12,6 +12,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif extern ThinkNodeM9Board board; @@ -22,6 +23,7 @@ extern EnvironmentSensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/wio-e5-mini/platformio.ini b/variants/wio-e5-mini/platformio.ini index 021c7db20a4..8149b8e0a1a 100644 --- a/variants/wio-e5-mini/platformio.ini +++ b/variants/wio-e5-mini/platformio.ini @@ -39,7 +39,7 @@ build_src_filter = ${lora_e5_mini.build_src_filter} [env:wio-e5-mini_companion_radio_usb] extends = lora_e5_mini build_flags = ${lora_e5_mini.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig -D LORA_TX_POWER=22 -D MAX_CONTACTS=100 -D MAX_GROUP_CHANNELS=8 @@ -48,7 +48,7 @@ build_flags = ${lora_e5_mini.build_flags} build_src_filter = ${lora_e5_mini.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${lora_e5_mini.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/wio-e5-mini/target.cpp b/variants/wio-e5-mini/target.cpp index 92775d5511f..9366cf81da9 100644 --- a/variants/wio-e5-mini/target.cpp +++ b/variants/wio-e5-mini/target.cpp @@ -22,6 +22,7 @@ WIOE5SensorManager sensors; #ifdef DISPLAY_CLASS NullDisplayDriver display; + UITask ui_task(&board, &display); #endif #ifndef LORA_CR diff --git a/variants/wio-e5-mini/target.h b/variants/wio-e5-mini/target.h index f4d6a088466..fdb0ab5425b 100644 --- a/variants/wio-e5-mini/target.h +++ b/variants/wio-e5-mini/target.h @@ -9,6 +9,7 @@ #include #ifdef DISPLAY_CLASS #include + #include #endif #include @@ -16,6 +17,7 @@ #ifdef DISPLAY_CLASS extern NullDisplayDriver display; + extern UITask ui_task; #endif class WIOE5Board : public STM32Board { diff --git a/variants/wio-tracker-l1-1w/platformio.ini b/variants/wio-tracker-l1-1w/platformio.ini index 7d3c2dc39ac..ce54fbef00a 100644 --- a/variants/wio-tracker-l1-1w/platformio.ini +++ b/variants/wio-tracker-l1-1w/platformio.ini @@ -21,6 +21,7 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/wio-tracker-l1-1w> + + + + lib_deps= ${nrf52_base.lib_deps} ${sensor_base.lib_deps} adafruit/Adafruit SH110X @ ^2.1.13 @@ -30,8 +31,10 @@ lib_deps= ${nrf52_base.lib_deps} extends = WioTrackerL1-1W build_src_filter = ${WioTrackerL1-1W.build_src_filter} +<../examples/simple_repeater> + + build_flags = ${WioTrackerL1-1W.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"WioTrackerL1 Repeater"' -D ADMIN_PASSWORD='"password"' -D MAX_NEIGHBOURS=50 @@ -45,7 +48,9 @@ lib_deps = ${WioTrackerL1-1W.lib_deps} extends = WioTrackerL1-1W build_src_filter = ${WioTrackerL1-1W.build_src_filter} +<../examples/simple_room_server> + + build_flags = ${WioTrackerL1-1W.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"WioTrackerL1 Room"' -D ADMIN_PASSWORD='"password"' -D ROOM_PASSWORD='"hello"' @@ -60,7 +65,7 @@ extends = WioTrackerL1-1W board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${WioTrackerL1-1W.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=SH1106Display @@ -76,8 +81,7 @@ build_flags = ${WioTrackerL1-1W.build_flags} build_src_filter = ${WioTrackerL1-1W.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> - + + + + lib_deps = ${WioTrackerL1-1W.lib_deps} adafruit/RTClib @ ^2.1.3 @@ -89,7 +93,7 @@ extends = WioTrackerL1-1W board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${WioTrackerL1-1W.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 @@ -111,7 +115,7 @@ build_src_filter = ${WioTrackerL1-1W.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${WioTrackerL1-1W.lib_deps} adafruit/RTClib @ ^2.1.3 densaugeo/base64 @ ~1.4.0 diff --git a/variants/wio-tracker-l1-1w/target.cpp b/variants/wio-tracker-l1-1w/target.cpp index cd4b8dac9c5..667add43e82 100644 --- a/variants/wio-tracker-l1-1w/target.cpp +++ b/variants/wio-tracker-l1-1w/target.cpp @@ -26,6 +26,7 @@ EnvironmentSensorManager sensors = EnvironmentSensorManager(); 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 bool radio_init() { diff --git a/variants/wio-tracker-l1-1w/target.h b/variants/wio-tracker-l1-1w/target.h index 05bc7ff1cae..5bc9ad43487 100644 --- a/variants/wio-tracker-l1-1w/target.h +++ b/variants/wio-tracker-l1-1w/target.h @@ -15,6 +15,7 @@ #include #endif #include + #include #endif #include @@ -28,6 +29,7 @@ extern EnvironmentSensorManager sensors; extern MomentaryButton joystick_left; extern MomentaryButton joystick_right; extern MomentaryButton back_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/wio-tracker-l1-eink/platformio.ini b/variants/wio-tracker-l1-eink/platformio.ini index 0b448a24b3f..2652bb9287e 100644 --- a/variants/wio-tracker-l1-eink/platformio.ini +++ b/variants/wio-tracker-l1-eink/platformio.ini @@ -33,6 +33,7 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/wio-tracker-l1> + + + + lib_deps= ${nrf52_base.lib_deps} ${sensor_base.lib_deps} adafruit/Adafruit GFX Library @ ^1.12.1 @@ -44,7 +45,7 @@ extends = WioTrackerL1Eink board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${WioTrackerL1Eink.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 @@ -63,7 +64,7 @@ build_src_filter = ${WioTrackerL1Eink.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${WioTrackerL1Eink.lib_deps} adafruit/RTClib @ ^2.1.3 densaugeo/base64 @ ~1.4.0 @@ -74,8 +75,10 @@ debug_tool=stlink extends = WioTrackerL1Eink build_src_filter = ${WioTrackerL1Eink.build_src_filter} +<../examples/simple_repeater> + + build_flags = ${WioTrackerL1Eink.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"WioTrackerL1 Eink Repeater"' -D ADMIN_PASSWORD='"password"' -D MAX_NEIGHBOURS=50 diff --git a/variants/wio-tracker-l1/platformio.ini b/variants/wio-tracker-l1/platformio.ini index 19139c289eb..75d02e1f85c 100644 --- a/variants/wio-tracker-l1/platformio.ini +++ b/variants/wio-tracker-l1/platformio.ini @@ -20,6 +20,7 @@ build_src_filter = ${nrf52_base.build_src_filter} + +<../variants/wio-tracker-l1> + + + + lib_deps= ${nrf52_base.lib_deps} ${sensor_base.lib_deps} @@ -30,8 +31,10 @@ lib_deps= ${nrf52_base.lib_deps} extends = WioTrackerL1 build_src_filter = ${WioTrackerL1.build_src_filter} +<../examples/simple_repeater> + + build_flags = ${WioTrackerL1.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"WioTrackerL1 Repeater"' -D ADMIN_PASSWORD='"password"' -D MAX_NEIGHBOURS=50 @@ -45,7 +48,9 @@ lib_deps = ${WioTrackerL1.lib_deps} extends = WioTrackerL1 build_src_filter = ${WioTrackerL1.build_src_filter} +<../examples/simple_room_server> + + build_flags = ${WioTrackerL1.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"WioTrackerL1 Room"' -D ADMIN_PASSWORD='"password"' -D ROOM_PASSWORD='"hello"' @@ -60,7 +65,7 @@ extends = WioTrackerL1 board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${WioTrackerL1.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=SH1106Display @@ -75,7 +80,7 @@ build_flags = ${WioTrackerL1.build_flags} build_src_filter = ${WioTrackerL1.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + + + lib_deps = ${WioTrackerL1.lib_deps} @@ -88,7 +93,7 @@ extends = WioTrackerL1 board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${WioTrackerL1.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 @@ -109,7 +114,7 @@ build_src_filter = ${WioTrackerL1.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${WioTrackerL1.lib_deps} adafruit/RTClib @ ^2.1.3 densaugeo/base64 @ ~1.4.0 diff --git a/variants/wio-tracker-l1/target.cpp b/variants/wio-tracker-l1/target.cpp index cd4b8dac9c5..667add43e82 100644 --- a/variants/wio-tracker-l1/target.cpp +++ b/variants/wio-tracker-l1/target.cpp @@ -26,6 +26,7 @@ EnvironmentSensorManager sensors = EnvironmentSensorManager(); 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 bool radio_init() { diff --git a/variants/wio-tracker-l1/target.h b/variants/wio-tracker-l1/target.h index 05bc7ff1cae..5bc9ad43487 100644 --- a/variants/wio-tracker-l1/target.h +++ b/variants/wio-tracker-l1/target.h @@ -15,6 +15,7 @@ #include #endif #include + #include #endif #include @@ -28,6 +29,7 @@ extern EnvironmentSensorManager sensors; extern MomentaryButton joystick_left; extern MomentaryButton joystick_right; extern MomentaryButton back_btn; + extern UITask ui_task; #endif bool radio_init(); diff --git a/variants/xiao_nrf52/platformio.ini b/variants/xiao_nrf52/platformio.ini index b40ebbc3600..b9bdb5083f1 100644 --- a/variants/xiao_nrf52/platformio.ini +++ b/variants/xiao_nrf52/platformio.ini @@ -28,7 +28,6 @@ build_flags = ${nrf52_base.build_flags} -D PIN_WIRE_SCL=D6 -D PIN_WIRE_SDA=D7 -D PIN_USER_BTN=PIN_BUTTON1 - -D DISPLAY_CLASS=NullDisplayDriver build_src_filter = ${nrf52_base.build_src_filter} + + @@ -45,7 +44,8 @@ board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${Xiao_nrf52.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig + -D DISPLAY_CLASS=NullDisplayDriver -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D BLE_PIN_CODE=123456 @@ -57,7 +57,7 @@ build_flags = build_src_filter = ${Xiao_nrf52.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${Xiao_nrf52.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -68,7 +68,8 @@ board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${Xiao_nrf52.build_flags} - -I examples/companion_radio/ui-orig + -I src/helpers/ui/companion-orig + -D DISPLAY_CLASS=NullDisplayDriver -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D OFFLINE_QUEUE_SIZE=256 @@ -78,7 +79,7 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${Xiao_nrf52.build_src_filter} +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + + lib_deps = ${Xiao_nrf52.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/xiao_nrf52/target.cpp b/variants/xiao_nrf52/target.cpp index def1dbbeaaa..3c9b839575b 100644 --- a/variants/xiao_nrf52/target.cpp +++ b/variants/xiao_nrf52/target.cpp @@ -5,6 +5,7 @@ #ifdef DISPLAY_CLASS DISPLAY_CLASS display; MomentaryButton user_btn(PIN_USER_BTN, 1000, true, true); + UITask ui_task(&board, &display); #endif XiaoNrf52Board board; diff --git a/variants/xiao_nrf52/target.h b/variants/xiao_nrf52/target.h index 20093904aad..f28dbc930d7 100644 --- a/variants/xiao_nrf52/target.h +++ b/variants/xiao_nrf52/target.h @@ -12,8 +12,11 @@ #ifdef DISPLAY_CLASS #include #include + #include + extern DISPLAY_CLASS display; extern MomentaryButton user_btn; + extern UITask ui_task; #endif extern XiaoNrf52Board board; diff --git a/variants/xiao_s3/platformio.ini b/variants/xiao_s3/platformio.ini index f377f89700c..fe5e5935701 100644 --- a/variants/xiao_s3/platformio.ini +++ b/variants/xiao_s3/platformio.ini @@ -94,7 +94,7 @@ lib_deps = extends = Xiao_S3 build_flags = ${Xiao_S3.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 @@ -110,7 +110,7 @@ build_src_filter = ${Xiao_S3.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Xiao_S3.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -121,7 +121,7 @@ lib_deps = extends = Xiao_S3 build_flags = ${Xiao_S3.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 @@ -135,7 +135,7 @@ build_src_filter = ${Xiao_S3.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Xiao_S3.lib_deps} densaugeo/base64 @ ~1.4.0 diff --git a/variants/xiao_s3/target.cpp b/variants/xiao_s3/target.cpp index a7ae7dd8e00..7d4bc9e8439 100644 --- a/variants/xiao_s3/target.cpp +++ b/variants/xiao_s3/target.cpp @@ -19,6 +19,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() { diff --git a/variants/xiao_s3/target.h b/variants/xiao_s3/target.h index 27eddd844e9..e351bcc157e 100644 --- a/variants/xiao_s3/target.h +++ b/variants/xiao_s3/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif #include "XiaoS3Board.h" @@ -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(); diff --git a/variants/xiao_s3_wio/platformio.ini b/variants/xiao_s3_wio/platformio.ini index 370995cc5fc..670838e0ab1 100644 --- a/variants/xiao_s3_wio/platformio.ini +++ b/variants/xiao_s3_wio/platformio.ini @@ -209,7 +209,7 @@ lib_deps = extends = Xiao_S3_WIO build_flags = ${Xiao_S3_WIO.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 @@ -222,7 +222,7 @@ build_src_filter = ${Xiao_S3_WIO.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Xiao_S3_WIO.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -232,7 +232,7 @@ lib_deps = extends = Xiao_S3_WIO build_flags = ${Xiao_S3_WIO.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 @@ -248,7 +248,7 @@ build_src_filter = ${Xiao_S3_WIO.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Xiao_S3_WIO.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -259,7 +259,7 @@ lib_deps = extends = Xiao_S3_WIO build_flags = ${Xiao_S3_WIO.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 @@ -272,7 +272,7 @@ build_src_filter = ${Xiao_S3_WIO.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> + + lib_deps = ${Xiao_S3_WIO.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -286,14 +286,16 @@ build_src_filter = ${Xiao_S3_WIO.build_src_filter} + + +<../examples/companion_radio/*.cpp> + + build_flags = ${Xiao_S3_WIO.build_flags} - -I examples/companion_radio/ui-new + -I src/helpers/ui/companion-orig -D ENABLE_WIFI_INTERFACE -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D OFFLINE_QUEUE_SIZE=256 -D WIFI_DEBUG_LOGGING=1 + -D DISPLAY_CLASS=NullDisplayDriver -D WIFI_SSID='"myssid"' -D WIFI_PWD='"password"' ; -D BLE_DEBUG_LOGGING=1 @@ -325,7 +327,7 @@ build_src_filter = ${Xiao_S3_WIO.build_src_filter} +<../examples/companion_radio/*.cpp> build_flags = ${Xiao_S3_WIO.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 diff --git a/variants/xiao_s3_wio/target.cpp b/variants/xiao_s3_wio/target.cpp index 8a975959fa4..79781dd5c0c 100644 --- a/variants/xiao_s3_wio/target.cpp +++ b/variants/xiao_s3_wio/target.cpp @@ -19,6 +19,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() { diff --git a/variants/xiao_s3_wio/target.h b/variants/xiao_s3_wio/target.h index 29c5f281447..a5839534e4b 100644 --- a/variants/xiao_s3_wio/target.h +++ b/variants/xiao_s3_wio/target.h @@ -10,6 +10,7 @@ #ifdef DISPLAY_CLASS #include #include + #include #endif #include "XiaoS3WIOBoard.h" @@ -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();