From 5806a266d38ff34a53ee5f7bf456b2f4fa344079 Mon Sep 17 00:00:00 2001 From: thebentern Date: Thu, 25 Apr 2024 20:19:54 +0000 Subject: [PATCH 01/19] [create-pull-request] automated change --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index 485f55130b..36607a9562 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 3 -build = 7 +build = 8 From dfcabba0b2bda6b142108962053c7c36263dcaf3 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Sat, 27 Apr 2024 13:43:09 +1200 Subject: [PATCH 02/19] Prevent overflow when calculating timezones (#3730) --- src/gps/RTC.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gps/RTC.cpp b/src/gps/RTC.cpp index 85931900f6..a2cdb5b30f 100644 --- a/src/gps/RTC.cpp +++ b/src/gps/RTC.cpp @@ -223,7 +223,7 @@ int32_t getTZOffset() now = time(NULL); gmt = gmtime(&now); gmt->tm_isdst = -1; - return (int16_t)difftime(now, mktime(gmt)); + return (int32_t)difftime(now, mktime(gmt)); } /** From f8c3f43ea61d4b6987b31e6e170b3ef56049ac9e Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Sat, 27 Apr 2024 19:17:17 +0800 Subject: [PATCH 03/19] Fix xiao_ble variant build error due to undefined BATTERY_SENSE_RESOLUTION_BITS (#3732) Define BATTERY_SENSE_RESOLUTION_BITS based on [amoroz's snippet on the Meshtastic forum](https://meshtastic.discourse.group/t/new-1w-diy-variant-xiao-nrf52840-ebyte-e22-900m30s/7904/10). Fixes following build error: ``` src/Power.cpp: In member function 'virtual uint16_t AnalogBatteryLevel::getBattVoltage()': src/Power.cpp:224:79: error: 'BATTERY_SENSE_RESOLUTION_BITS' was not declared in this scope scaled = operativeAdcMultiplier * ((1000 * AREF_VOLTAGE) / pow(2, BATTERY_SENSE_RESOLUTION_BITS)) * raw; ``` Signed-off-by: Andrew Yong --- variants/xiao_ble/variant.h | 1 + 1 file changed, 1 insertion(+) diff --git a/variants/xiao_ble/variant.h b/variants/xiao_ble/variant.h index e2b8eb613c..77af08278c 100644 --- a/variants/xiao_ble/variant.h +++ b/variants/xiao_ble/variant.h @@ -181,6 +181,7 @@ static const uint8_t SCL = PIN_WIRE_SCL; #define BAT_READ \ 14 // P0_14 = 14 Reads battery voltage from divider on signal board. (PIN_VBAT is reading voltage divider on XIAO and is // program pin 32 / or P0.31) +#define BATTERY_SENSE_RESOLUTION_BITS 10 #define CHARGE_LED 23 // P0_17 = 17 D23 YELLOW CHARGE LED #define HICHG 22 // P0_13 = 13 D22 Charge-select pin for Lipo for 100 mA instead of default 50mA charge From a06a01d25ea2f5cdc75e0e5266b542af5e789389 Mon Sep 17 00:00:00 2001 From: Oliver Seiler Date: Sat, 27 Apr 2024 11:35:44 +0000 Subject: [PATCH 04/19] fix #if HAS_TELEMETRY when set to 0 (#3733) --- src/Power.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Power.cpp b/src/Power.cpp index d13fd68913..2658b74a4b 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -184,7 +184,7 @@ class AnalogBatteryLevel : public HasBatteryLevel virtual uint16_t getBattVoltage() override { -#if defined(HAS_TELEMETRY) && !defined(ARCH_PORTDUINO) && !defined(HAS_PMU) +#if HAS_TELEMETRY && !defined(ARCH_PORTDUINO) && !defined(HAS_PMU) if (hasINA()) { LOG_DEBUG("Using INA on I2C addr 0x%x for device battery voltage\n", config.power.device_battery_ina_address); return getINAVoltage(); @@ -360,7 +360,7 @@ class AnalogBatteryLevel : public HasBatteryLevel float last_read_value = (OCV[NUM_OCV_POINTS - 1] * NUM_CELLS); uint32_t last_read_time_ms = 0; -#if defined(HAS_TELEMETRY) && !defined(ARCH_PORTDUINO) +#if HAS_TELEMETRY && !defined(ARCH_PORTDUINO) uint16_t getINAVoltage() { if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA219].first == config.power.device_battery_ina_address) { From e66aec8223337e6580adf86028ea4f6a5c73e2cd Mon Sep 17 00:00:00 2001 From: jcyrio <50239349+jcyrio@users.noreply.github.com> Date: Sat, 27 Apr 2024 06:54:06 -0700 Subject: [PATCH 05/19] fix typo in comment (#3726) --- src/modules/CannedMessageModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index c80ccc5e79..24e5d28d11 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -239,7 +239,7 @@ int32_t CannedMessageModule::runOnce() UIFrameEvent e = {false, true}; if ((this->runState == CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE) || (this->runState == CANNED_MESSAGE_RUN_STATE_ACK_NACK_RECEIVED)) { - // TODO: might have some feedback of sendig state + // TODO: might have some feedback of sending state this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; e.frameChanged = true; this->currentMessageIndex = -1; From e683d8f5525b1b3efd445c296b2cce2b37f7deb5 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 27 Apr 2024 08:55:04 -0500 Subject: [PATCH 06/19] Rebrand "send network ping" to more honest "try send position" with better output (#3737) --- src/ButtonThread.cpp | 7 +++++-- src/mesh/MeshService.cpp | 4 +++- src/mesh/MeshService.h | 5 +++-- src/modules/CannedMessageModule.cpp | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ButtonThread.cpp b/src/ButtonThread.cpp index 206bb72395..e9717521ad 100644 --- a/src/ButtonThread.cpp +++ b/src/ButtonThread.cpp @@ -136,9 +136,12 @@ int32_t ButtonThread::runOnce() case BUTTON_EVENT_DOUBLE_PRESSED: { LOG_BUTTON("Double press!\n"); service.refreshLocalMeshNode(); - service.sendNetworkPing(NODENUM_BROADCAST, true); + auto sentPosition = service.trySendPosition(NODENUM_BROADCAST, true); if (screen) { - screen->print("Sent ad-hoc ping\n"); + if (sentPosition) + screen->print("Sent ad-hoc position\n"); + else + screen->print("Sent ad-hoc nodeinfo\n"); screen->forceDisplay(true); // Force a new UI frame, then force an EInk update } break; diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index 2c1969e305..6b8d379758 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -267,7 +267,7 @@ void MeshService::sendToMesh(meshtastic_MeshPacket *p, RxSource src, bool ccToPh } } -void MeshService::sendNetworkPing(NodeNum dest, bool wantReplies) +bool MeshService::trySendPosition(NodeNum dest, bool wantReplies) { meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(nodeDB->getNodeNum()); @@ -278,6 +278,7 @@ void MeshService::sendNetworkPing(NodeNum dest, bool wantReplies) if (positionModule) { LOG_INFO("Sending position ping to 0x%x, wantReplies=%d, channel=%d\n", dest, wantReplies, node->channel); positionModule->sendOurPosition(dest, wantReplies, node->channel); + return true; } } else { #endif @@ -286,6 +287,7 @@ void MeshService::sendNetworkPing(NodeNum dest, bool wantReplies) nodeInfoModule->sendOurNodeInfo(dest, wantReplies, node->channel); } } + return false; } void MeshService::sendToPhone(meshtastic_MeshPacket *p) diff --git a/src/mesh/MeshService.h b/src/mesh/MeshService.h index 8d1434030d..d777b7a01a 100644 --- a/src/mesh/MeshService.h +++ b/src/mesh/MeshService.h @@ -108,8 +108,9 @@ class MeshService void reloadOwner(bool shouldSave = true); /// Called when the user wakes up our GUI, normally sends our latest location to the mesh (if we have it), otherwise at least - /// sends our owner - void sendNetworkPing(NodeNum dest, bool wantReplies = false); + /// sends our nodeinfo + /// returns true if we sent a position + bool trySendPosition(NodeNum dest, bool wantReplies = false); /// Send a packet into the mesh - note p must have been allocated from packetPool. We will return it to that pool after /// sending. This is the ONLY function you should use for sending messages into the mesh, because it also updates the nodedb diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 24e5d28d11..ea7d5029a3 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -452,7 +452,7 @@ int32_t CannedMessageModule::runOnce() break; case 0xaf: // fn+space send network ping like double press does service.refreshLocalMeshNode(); - service.sendNetworkPing(NODENUM_BROADCAST, true); + service.trySendPosition(NODENUM_BROADCAST, true); runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; break; default: From 38c4d35a7bd81e5b8ecbec479e4bf5df314e9735 Mon Sep 17 00:00:00 2001 From: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com> Date: Sat, 27 Apr 2024 12:08:25 -0400 Subject: [PATCH 07/19] Add Notification on device screen following feature toggle (#3627) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update CannedMessageModule.h * Update CannedMessageModule.cpp * Update CannedMessageModule.cpp hopefully this fixes the errors on Trunk * Update CannedMessageModule.cpp Changed "Ping Broadcasted" with "Telemetry Update Sent" * tryfix: disable tempmessage again after 2 seconds * fix 2s showtime * Put spelling fix back * Fix build --------- Co-authored-by: Thomas Göttgens Co-authored-by: Ben Meadors --- src/modules/CannedMessageModule.cpp | 36 ++++++++++++++++++++++------- src/modules/CannedMessageModule.h | 6 ++++- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index ea7d5029a3..b6267d9855 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -233,14 +233,16 @@ int32_t CannedMessageModule::runOnce() { if (((!moduleConfig.canned_message.enabled) && !CANNED_MESSAGE_MODULE_ENABLE) || (this->runState == CANNED_MESSAGE_RUN_STATE_DISABLED) || (this->runState == CANNED_MESSAGE_RUN_STATE_INACTIVE)) { + temporaryMessage = ""; return INT32_MAX; } // LOG_DEBUG("Check status\n"); UIFrameEvent e = {false, true}; if ((this->runState == CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE) || - (this->runState == CANNED_MESSAGE_RUN_STATE_ACK_NACK_RECEIVED)) { + (this->runState == CANNED_MESSAGE_RUN_STATE_ACK_NACK_RECEIVED) || (this->runState == CANNED_MESSAGE_RUN_STATE_MESSAGE)) { // TODO: might have some feedback of sending state this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + temporaryMessage = ""; e.frameChanged = true; this->currentMessageIndex = -1; this->freetext = ""; // clear freetext @@ -434,7 +436,7 @@ int32_t CannedMessageModule::runOnce() } if (screen) screen->forceDisplay(); - runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + showTemporaryMessage("GPS Toggled"); break; // mute (switch off/toggle) external notifications on fn+m @@ -442,18 +444,21 @@ int32_t CannedMessageModule::runOnce() if (moduleConfig.external_notification.enabled == true) { if (externalNotificationModule->getMute()) { externalNotificationModule->setMute(false); - runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + showTemporaryMessage("Notifications \nEnabled"); } else { externalNotificationModule->stopNow(); // this will turn off all GPIO and sounds and idle the loop externalNotificationModule->setMute(true); - runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + showTemporaryMessage("Notifications \nDisabled"); } } break; case 0xaf: // fn+space send network ping like double press does service.refreshLocalMeshNode(); - service.trySendPosition(NODENUM_BROADCAST, true); - runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + if (service.trySendPosition(NODENUM_BROADCAST, true)) { + showTemporaryMessage("Position \nUpdate Sent"); + } else { + showTemporaryMessage("Node Info \nUpdate Sent"); + } break; default: if (this->cursor == this->freetext.length()) { @@ -542,12 +547,27 @@ int CannedMessageModule::getPrevIndex() return this->currentMessageIndex - 1; } } +void CannedMessageModule::showTemporaryMessage(const String &message) +{ + temporaryMessage = message; + UIFrameEvent e = {false, true}; + e.frameChanged = true; + notifyObservers(&e); + runState = CANNED_MESSAGE_RUN_STATE_MESSAGE; + // run this loop again in 2 seconds, next iteration will clear the display + setIntervalFromNow(2000); +} void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { char buffer[50]; - if (cannedMessageModule->runState == CANNED_MESSAGE_RUN_STATE_ACK_NACK_RECEIVED) { + if (temporaryMessage.length() != 0) { + LOG_DEBUG("Drawing temporary message: %s", temporaryMessage.c_str()); + display->setTextAlignment(TEXT_ALIGN_CENTER); + display->setFont(FONT_MEDIUM); + display->drawString(display->getWidth() / 2 + x, 0 + y + 12, temporaryMessage); + } else if (cannedMessageModule->runState == CANNED_MESSAGE_RUN_STATE_ACK_NACK_RECEIVED) { display->setTextAlignment(TEXT_ALIGN_CENTER); display->setFont(FONT_MEDIUM); String displayString; @@ -766,4 +786,4 @@ String CannedMessageModule::drawWithCursor(String text, int cursor) return result; } -#endif \ No newline at end of file +#endif diff --git a/src/modules/CannedMessageModule.h b/src/modules/CannedMessageModule.h index 4802be0781..faf1d80f3b 100644 --- a/src/modules/CannedMessageModule.h +++ b/src/modules/CannedMessageModule.h @@ -10,6 +10,7 @@ enum cannedMessageModuleRunState { CANNED_MESSAGE_RUN_STATE_FREETEXT, CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE, CANNED_MESSAGE_RUN_STATE_ACK_NACK_RECEIVED, + CANNED_MESSAGE_RUN_STATE_MESSAGE, CANNED_MESSAGE_RUN_STATE_ACTION_SELECT, CANNED_MESSAGE_RUN_STATE_ACTION_UP, CANNED_MESSAGE_RUN_STATE_ACTION_DOWN, @@ -51,6 +52,8 @@ class CannedMessageModule : public SinglePortModule, public Observable Date: Sat, 27 Apr 2024 11:12:52 -0500 Subject: [PATCH 08/19] Tradunkadunk --- src/modules/CannedMessageModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index b6267d9855..a8b1b994b9 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -455,9 +455,9 @@ int32_t CannedMessageModule::runOnce() case 0xaf: // fn+space send network ping like double press does service.refreshLocalMeshNode(); if (service.trySendPosition(NODENUM_BROADCAST, true)) { - showTemporaryMessage("Position \nUpdate Sent"); + showTemporaryMessage("Position \nUpdate Sent"); } else { - showTemporaryMessage("Node Info \nUpdate Sent"); + showTemporaryMessage("Node Info \nUpdate Sent"); } break; default: From ee4c4ae6c968502888fdb3adb256d1023b397a1b Mon Sep 17 00:00:00 2001 From: Mike Date: Sun, 28 Apr 2024 02:15:54 +0300 Subject: [PATCH 09/19] Allow setting hopLimit for MQTT json sendtext and sendposition (#3735) * Fix channel name extraction * Allow setting hopLimit for mqtt sendtext and sendposition --- src/mqtt/MQTT.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 8a477d8adc..5088302035 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -54,9 +54,9 @@ void MQTT::onReceive(char *topic, byte *payload, size_t length) JSONObject json; json = json_value->AsObject(); - // parse the channel name from the topic string by looking for "json/" - const char *jsonSlash = "json/"; - char *ptr = strstr(topic, jsonSlash) + sizeof(jsonSlash) + 1; // set pointer to after "json/" + // parse the channel name from the topic string + // the topic has been checked above for having jsonTopic prefix, so just move past it + char *ptr = topic + jsonTopic.length(); ptr = strtok(ptr, "/") ? strtok(ptr, "/") : ptr; // if another "/" was added, parse string up to that character meshtastic_Channel sendChannel = channels.getByName(ptr); // We allow downlink JSON packets only on a channel named "mqtt" @@ -76,6 +76,8 @@ void MQTT::onReceive(char *topic, byte *payload, size_t length) p->channel = json["channel"]->AsNumber(); if (json.find("to") != json.end() && json["to"]->IsNumber()) p->to = json["to"]->AsNumber(); + if (json.find("hopLimit") != json.end() && json["hopLimit"]->IsNumber()) + p->hop_limit = json["hopLimit"]->AsNumber(); if (jsonPayloadStr.length() <= sizeof(p->decoded.payload.bytes)) { memcpy(p->decoded.payload.bytes, jsonPayloadStr.c_str(), jsonPayloadStr.length()); p->decoded.payload.size = jsonPayloadStr.length(); @@ -105,6 +107,8 @@ void MQTT::onReceive(char *topic, byte *payload, size_t length) p->channel = json["channel"]->AsNumber(); if (json.find("to") != json.end() && json["to"]->IsNumber()) p->to = json["to"]->AsNumber(); + if (json.find("hopLimit") != json.end() && json["hopLimit"]->IsNumber()) + p->hop_limit = json["hopLimit"]->AsNumber(); p->decoded.payload.size = pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), &meshtastic_Position_msg, &pos); // make the Data protobuf from position @@ -907,6 +911,7 @@ bool MQTT::isValidJsonEnvelope(JSONObject &json) { // if "sender" is provided, avoid processing packets we uplinked return (json.find("sender") != json.end() ? (json["sender"]->AsString().compare(owner.id) != 0) : true) && + (json.find("hopLimit") != json.end() ? json["hopLimit"]->IsNumber() : true) && // hop limit should be a number (json.find("from") != json.end()) && json["from"]->IsNumber() && (json["from"]->AsNumber() == nodeDB->getNodeNum()) && // only accept message if the "from" is us (json.find("type") != json.end()) && json["type"]->IsString() && // should specify a type From 93f77ea7d23a1612887cef09019e1c0ed5d8cd93 Mon Sep 17 00:00:00 2001 From: David Ellefsen <93522+titan098@users.noreply.github.com> Date: Sun, 28 Apr 2024 02:50:15 +0200 Subject: [PATCH 10/19] Update TinyGPSPlus version (#3727) Co-authored-by: Ben Meadors --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index a1082a84a3..e178fdb167 100644 --- a/platformio.ini +++ b/platformio.ini @@ -78,7 +78,7 @@ lib_deps = https://github.com/meshtastic/esp8266-oled-ssd1306.git#ee628ee6c9588d4c56c9e3da35f0fc9448ad54a8 ; ESP8266_SSD1306 mathertel/OneButton@^2.5.0 ; OneButton library for non-blocking button debounce https://github.com/meshtastic/arduino-fsm.git#7db3702bf0cfe97b783d6c72595e3f38e0b19159 - https://github.com/meshtastic/TinyGPSPlus.git#964f75a72cccd6b53cd74e4add1f7a42c6f7344d + https://github.com/meshtastic/TinyGPSPlus.git#71a82db35f3b973440044c476d4bcdc673b104f4 https://github.com/meshtastic/ArduinoThread.git#1ae8778c85d0a2a729f989e0b1e7d7c4dc84eef0 nanopb/Nanopb@^0.4.7 erriez/ErriezCRC32@^1.0.1 From 18e69a0906e173cffa1049ca0954728e1b66b367 Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Sun, 28 Apr 2024 19:49:26 +0800 Subject: [PATCH 11/19] Update Heltec HT-C62 variant based on HT-DEV-ESP board (#3731) * I2C is not defined in the reference schematic nor HT-DEV-ESP board, remove definition accordingly * There is no screen in the the reference schematic nor HT-DEV-ESP board, change definition accordingly * BUTTON_PIN has a 10 kOhm pullup resistor on HT-DEV-ESP, turning off redundant internal pullup should save some power * LED is connected to GPIO2 on HT-DEV-ESP and is not inverted, update definition accordingly * Remove redundant undef lines for LoRa pins Above changes were built and flashed to my [HT-DEV-ESP_V2 board purchased from Heltec's Taobao store](https://item.taobao.com/item.htm?id=521590063077). Signed-off-by: Andrew Yong --- variants/heltec_esp32c3/variant.h | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/variants/heltec_esp32c3/variant.h b/variants/heltec_esp32c3/variant.h index 6641f9d218..360d9bf1fc 100644 --- a/variants/heltec_esp32c3/variant.h +++ b/variants/heltec_esp32c3/variant.h @@ -1,24 +1,16 @@ -#define I2C_SDA 1 -#define I2C_SCL 0 - #define BUTTON_PIN 9 -#define BUTTON_NEED_PULLUP -// LED flashes brighter +// LED pin on HT-DEV-ESP_V2 and HT-DEV-ESP_V3 // https://resource.heltec.cn/download/HT-CT62/HT-CT62_Reference_Design.pdf -#define LED_PIN 18 // LED -#define LED_INVERTED 1 +// https://resource.heltec.cn/download/HT-DEV-ESP/HT-DEV-ESP_V3_Sch.pdf +#define LED_PIN 2 // LED +#define LED_INVERTED 0 -#define HAS_SCREEN 1 +#define HAS_SCREEN 0 #define HAS_GPS 0 #undef GPS_RX_PIN #undef GPS_TX_PIN -#undef LORA_SCK -#undef LORA_MISO -#undef LORA_MOSI -#undef LORA_CS - #define USE_SX1262 #define LORA_SCK 10 #define LORA_MISO 6 From 21311bbeda61ec7ca9f052fdad37757727ef3707 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Tue, 30 Apr 2024 01:54:57 +1200 Subject: [PATCH 12/19] T-Echo touch button no longer requires "wake on tap or motion" (#3745) --- src/ButtonThread.cpp | 16 +++++++--------- src/mesh/NodeDB.cpp | 3 --- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/ButtonThread.cpp b/src/ButtonThread.cpp index e9717521ad..4566de9240 100644 --- a/src/ButtonThread.cpp +++ b/src/ButtonThread.cpp @@ -196,15 +196,13 @@ int32_t ButtonThread::runOnce() #ifdef BUTTON_PIN_TOUCH case BUTTON_EVENT_TOUCH_LONG_PRESSED: { LOG_BUTTON("Touch press!\n"); - if (config.display.wake_on_tap_or_motion) { - if (screen) { - // Wake if asleep - if (powerFSM.getState() == &stateDARK) - powerFSM.trigger(EVENT_PRESS); - - // Update display (legacy behaviour) - screen->forceDisplay(); - } + if (screen) { + // Wake if asleep + if (powerFSM.getState() == &stateDARK) + powerFSM.trigger(EVENT_PRESS); + + // Update display (legacy behaviour) + screen->forceDisplay(); } break; } diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 39422b454b..249db627e8 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -352,9 +352,6 @@ void NodeDB::installDefaultModuleConfig() moduleConfig.external_notification.alert_message = true; moduleConfig.external_notification.output_ms = 100; moduleConfig.external_notification.active = true; -#endif -#ifdef TTGO_T_ECHO - config.display.wake_on_tap_or_motion = true; // Enable touch button for screen-on / refresh #endif moduleConfig.has_canned_message = true; From e51ee91c39903bc13e14f06fe4743d755f834580 Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Wed, 1 May 2024 03:07:15 +0200 Subject: [PATCH 13/19] Optimization: stop relaying when reply is received (#3753) --- src/mesh/FloodingRouter.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/mesh/FloodingRouter.cpp b/src/mesh/FloodingRouter.cpp index 4cfe982d8b..dd547a6f1a 100644 --- a/src/mesh/FloodingRouter.cpp +++ b/src/mesh/FloodingRouter.cpp @@ -35,11 +35,10 @@ bool FloodingRouter::shouldFilterReceived(const meshtastic_MeshPacket *p) void FloodingRouter::sniffReceived(const meshtastic_MeshPacket *p, const meshtastic_Routing *c) { - bool isAck = - ((c && c->error_reason == meshtastic_Routing_Error_NONE)); // consider only ROUTING_APP message without error as ACK - if (isAck && p->to != getNodeNum()) { - // do not flood direct message that is ACKed - LOG_DEBUG("Receiving an ACK not for me, but don't need to rebroadcast this direct message anymore.\n"); + bool isAckorReply = (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) && (p->decoded.request_id != 0); + if (isAckorReply && p->to != getNodeNum() && p->to != NODENUM_BROADCAST) { + // do not flood direct message that is ACKed or replied to + LOG_DEBUG("Receiving an ACK or reply not for me, but don't need to rebroadcast this direct message anymore.\n"); Router::cancelSending(p->to, p->decoded.request_id); // cancel rebroadcast for this DM } if ((p->to != getNodeNum()) && (p->hop_limit > 0) && (getFrom(p) != getNodeNum())) { From 3619ac87b8a78205d16de856f711abb49d83fa96 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 30 Apr 2024 20:14:38 -0500 Subject: [PATCH 14/19] [create-pull-request] automated change (#3754) Co-authored-by: thebentern --- protobufs | 2 +- src/mesh/generated/meshtastic/apponly.pb.h | 2 +- src/mesh/generated/meshtastic/channel.pb.h | 17 +++++++++++------ src/mesh/generated/meshtastic/deviceonly.pb.h | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/protobufs b/protobufs index 86640f20db..e21899aa6b 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 86640f20db7b9b5be42949d18e8d96ad10d47a68 +Subproject commit e21899aa6b2b49863cfa2758e5e3b6faacf04bba diff --git a/src/mesh/generated/meshtastic/apponly.pb.h b/src/mesh/generated/meshtastic/apponly.pb.h index 54629f5220..ba9f90873b 100644 --- a/src/mesh/generated/meshtastic/apponly.pb.h +++ b/src/mesh/generated/meshtastic/apponly.pb.h @@ -55,7 +55,7 @@ extern const pb_msgdesc_t meshtastic_ChannelSet_msg; /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_APPONLY_PB_H_MAX_SIZE meshtastic_ChannelSet_size -#define meshtastic_ChannelSet_size 658 +#define meshtastic_ChannelSet_size 674 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/channel.pb.h b/src/mesh/generated/meshtastic/channel.pb.h index 185a47a985..d9c7d4ffa7 100644 --- a/src/mesh/generated/meshtastic/channel.pb.h +++ b/src/mesh/generated/meshtastic/channel.pb.h @@ -34,6 +34,9 @@ typedef enum _meshtastic_Channel_Role { typedef struct _meshtastic_ModuleSettings { /* Bits of precision for the location sent in position packets. */ uint32_t position_precision; + /* Controls whether or not the phone / clients should mute the current channel + Useful for noisy public channels you don't necessarily want to disable */ + bool is_client_muted; } meshtastic_ModuleSettings; typedef PB_BYTES_ARRAY_T(32) meshtastic_ChannelSettings_psk_t; @@ -126,14 +129,15 @@ extern "C" { /* Initializer values for message structs */ #define meshtastic_ChannelSettings_init_default {0, {0, {0}}, "", 0, 0, 0, false, meshtastic_ModuleSettings_init_default} -#define meshtastic_ModuleSettings_init_default {0} +#define meshtastic_ModuleSettings_init_default {0, 0} #define meshtastic_Channel_init_default {0, false, meshtastic_ChannelSettings_init_default, _meshtastic_Channel_Role_MIN} #define meshtastic_ChannelSettings_init_zero {0, {0, {0}}, "", 0, 0, 0, false, meshtastic_ModuleSettings_init_zero} -#define meshtastic_ModuleSettings_init_zero {0} +#define meshtastic_ModuleSettings_init_zero {0, 0} #define meshtastic_Channel_init_zero {0, false, meshtastic_ChannelSettings_init_zero, _meshtastic_Channel_Role_MIN} /* Field tags (for use in manual encoding/decoding) */ #define meshtastic_ModuleSettings_position_precision_tag 1 +#define meshtastic_ModuleSettings_is_client_muted_tag 2 #define meshtastic_ChannelSettings_channel_num_tag 1 #define meshtastic_ChannelSettings_psk_tag 2 #define meshtastic_ChannelSettings_name_tag 3 @@ -159,7 +163,8 @@ X(a, STATIC, OPTIONAL, MESSAGE, module_settings, 7) #define meshtastic_ChannelSettings_module_settings_MSGTYPE meshtastic_ModuleSettings #define meshtastic_ModuleSettings_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT32, position_precision, 1) +X(a, STATIC, SINGULAR, UINT32, position_precision, 1) \ +X(a, STATIC, SINGULAR, BOOL, is_client_muted, 2) #define meshtastic_ModuleSettings_CALLBACK NULL #define meshtastic_ModuleSettings_DEFAULT NULL @@ -182,9 +187,9 @@ extern const pb_msgdesc_t meshtastic_Channel_msg; /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_CHANNEL_PB_H_MAX_SIZE meshtastic_Channel_size -#define meshtastic_ChannelSettings_size 70 -#define meshtastic_Channel_size 85 -#define meshtastic_ModuleSettings_size 6 +#define meshtastic_ChannelSettings_size 72 +#define meshtastic_Channel_size 87 +#define meshtastic_ModuleSettings_size 8 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.h b/src/mesh/generated/meshtastic/deviceonly.pb.h index 2506ec647c..b8cc806337 100644 --- a/src/mesh/generated/meshtastic/deviceonly.pb.h +++ b/src/mesh/generated/meshtastic/deviceonly.pb.h @@ -306,7 +306,7 @@ extern const pb_msgdesc_t meshtastic_OEMStore_msg; /* Maximum encoded size of messages (where known) */ /* meshtastic_DeviceState_size depends on runtime parameters */ #define MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_MAX_SIZE meshtastic_OEMStore_size -#define meshtastic_ChannelFile_size 702 +#define meshtastic_ChannelFile_size 718 #define meshtastic_NodeInfoLite_size 166 #define meshtastic_OEMStore_size 3346 #define meshtastic_PositionLite_size 28 From 57da37cfbca4ef5b47c346e4f2de02d00f33a726 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 1 May 2024 08:05:26 -0500 Subject: [PATCH 15/19] Position module should enforce precision for phone originated position packets (#3752) --- src/modules/PositionModule.cpp | 17 +++++++++++++++++ src/modules/PositionModule.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/src/modules/PositionModule.cpp b/src/modules/PositionModule.cpp index 658b8b5a76..7c459dc354 100644 --- a/src/modules/PositionModule.cpp +++ b/src/modules/PositionModule.cpp @@ -87,6 +87,23 @@ bool PositionModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mes return false; // Let others look at this message also if they want } +void PositionModule::alterReceivedProtobuf(meshtastic_MeshPacket &mp, meshtastic_Position *p) +{ + // Phone position packets need to be truncated to the channel precision + if (nodeDB->getNodeNum() == getFrom(&mp) && (precision < 32 && precision > 0)) { + LOG_DEBUG("Truncating phone position to channel precision %i\n", precision); + p->latitude_i = p->latitude_i & (UINT32_MAX << (32 - precision)); + p->longitude_i = p->longitude_i & (UINT32_MAX << (32 - precision)); + + // We want the imprecise position to be the middle of the possible location, not + p->latitude_i += (1 << (31 - precision)); + p->longitude_i += (1 << (31 - precision)); + + mp.decoded.payload.size = + pb_encode_to_bytes(mp.decoded.payload.bytes, sizeof(mp.decoded.payload.bytes), &meshtastic_Position_msg, p); + } +} + void PositionModule::trySetRtc(meshtastic_Position p, bool isLocal) { struct timeval tv; diff --git a/src/modules/PositionModule.h b/src/modules/PositionModule.h index 89ff50c644..1161159f78 100644 --- a/src/modules/PositionModule.h +++ b/src/modules/PositionModule.h @@ -42,6 +42,8 @@ class PositionModule : public ProtobufModule, private concu */ virtual bool handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Position *p) override; + virtual void alterReceivedProtobuf(meshtastic_MeshPacket &mp, meshtastic_Position *p) override; + /** Messages can be received that have the want_response bit set. If set, this callback will be invoked * so that subclasses can (optionally) send a response back to the original sender. */ virtual meshtastic_MeshPacket *allocReply() override; From ec92f7a5a396657e6b475988d1df520ab9753cd5 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 1 May 2024 08:27:43 -0500 Subject: [PATCH 16/19] Remove phone nodenum warning and empty else clause (#3756) --- src/mesh/MeshService.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index 6b8d379758..66a2e69526 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -193,10 +193,7 @@ void MeshService::handleToRadio(meshtastic_MeshPacket &p) } #endif if (p.from != 0) { // We don't let phones assign nodenums to their sent messages - LOG_WARN("phone tried to pick a nodenum, we don't allow that.\n"); p.from = 0; - } else { - // p.from = nodeDB->getNodeNum(); } if (p.id == 0) From 5095efc55fc17f1c67abc4b64e715c9c2b4acf58 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 1 May 2024 13:06:42 -0500 Subject: [PATCH 17/19] Pick up support for more than 64 GPIO lines under Portduino --- arch/portduino/portduino.ini | 2 +- src/platform/portduino/PortduinoGlue.cpp | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 4857933ecd..ef99c7870d 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -1,6 +1,6 @@ ; The Portduino based sim environment on top of any host OS, all hardware will be simulated [portduino_base] -platform = https://github.com/meshtastic/platform-native.git#659e49346aa33008b150dfb206b1817ddabc7132 +platform = https://github.com/meshtastic/platform-native.git#784007630ca43b4811c6637606440588bb5acf39 framework = arduino build_src_filter = diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index d86ac66770..8572f4cf28 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -76,7 +76,21 @@ void portduinoCustomInit() void portduinoSetup() { printf("Setting up Meshtastic on Portduino...\n"); - gpioInit(); + int max_GPIO = 0; + int GPIO_lines[] = {cs, + irq, + busy, + reset, + txen, + rxen, + displayDC, + displayCS, + displayBacklight, + displayBacklightPWMChannel, + displayReset, + touchscreenCS, + touchscreenIRQ, + user}; std::string gpioChipName = "gpiochip"; settingsStrings[i2cdev] = ""; @@ -245,6 +259,13 @@ void portduinoSetup() exit(EXIT_FAILURE); } + for (int i : GPIO_lines) { + if (i > max_GPIO) + max_GPIO = i; + } + + gpioInit(max_GPIO + 1); // Done here so we can inform Portduino how many GPIOs we need. + // Need to bind all the configured GPIO pins so they're not simulated if (settingsMap.count(cs) > 0 && settingsMap[cs] != RADIOLIB_NC) { if (initGPIOPin(settingsMap[cs], gpioChipName) != ERRNO_OK) { From 45c1b46bd0f03350106009bec03e4c3a6050895b Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 1 May 2024 13:20:26 -0500 Subject: [PATCH 18/19] Move native to spi_host to indicate spidev for LovyanGFX --- arch/portduino/portduino.ini | 2 +- src/graphics/TFTDisplay.cpp | 4 ++- src/main.cpp | 8 ++--- src/platform/portduino/PortduinoGlue.cpp | 46 +++++++++++++----------- src/platform/portduino/PortduinoGlue.h | 4 +-- 5 files changed, 34 insertions(+), 30 deletions(-) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index ef99c7870d..162411972e 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -24,7 +24,7 @@ lib_deps = ${env.lib_deps} ${networking_base.lib_deps} rweather/Crypto@^0.4.0 - https://github.com/lovyan03/LovyanGFX.git#d35e60f269dfecbb18a8cb0fd07d594c2fb7e7a8 + https://github.com/lovyan03/LovyanGFX.git#5a39989aa2c9492572255b22f033843ec8900233 build_flags = ${arduino_base.build_flags} diff --git a/src/graphics/TFTDisplay.cpp b/src/graphics/TFTDisplay.cpp index b529bf0e46..fac9a5796c 100644 --- a/src/graphics/TFTDisplay.cpp +++ b/src/graphics/TFTDisplay.cpp @@ -356,7 +356,7 @@ class LGFX : public lgfx::LGFX_Device _panel_instance = new lgfx::Panel_ILI9341; auto buscfg = _bus_instance.config(); buscfg.spi_mode = 0; - _bus_instance.spi_device(DisplaySPI); + buscfg.spi_host = settingsMap[displayspidev]; buscfg.pin_dc = settingsMap[displayDC]; // Set SPI DC pin number (-1 = disable) @@ -397,6 +397,8 @@ class LGFX : public lgfx::LGFX_Device touch_cfg.offset_rotation = 1; if (settingsMap[touchscreenI2CAddr] != -1) { touch_cfg.i2c_addr = settingsMap[touchscreenI2CAddr]; + } else { + touch_cfg.spi_host = settingsMap[touchscreenspidev]; } _touch_instance->config(touch_cfg); diff --git a/src/main.cpp b/src/main.cpp index 4a663a8a0a..063e9b355e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -729,7 +729,7 @@ void setup() if (settingsMap[use_sx1262]) { if (!rIf) { LOG_DEBUG("Attempting to activate sx1262 radio on SPI port %s\n", settingsStrings[spidev].c_str()); - LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(*LoraSPI, spiSettings); + LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI, spiSettings); rIf = new SX1262Interface((LockingArduinoHal *)RadioLibHAL, settingsMap[cs], settingsMap[irq], settingsMap[reset], settingsMap[busy]); if (!rIf->init()) { @@ -743,7 +743,7 @@ void setup() } else if (settingsMap[use_rf95]) { if (!rIf) { LOG_DEBUG("Attempting to activate rf95 radio on SPI port %s\n", settingsStrings[spidev].c_str()); - LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(*LoraSPI, spiSettings); + LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI, spiSettings); rIf = new RF95Interface((LockingArduinoHal *)RadioLibHAL, settingsMap[cs], settingsMap[irq], settingsMap[reset], settingsMap[busy]); if (!rIf->init()) { @@ -758,7 +758,7 @@ void setup() } else if (settingsMap[use_sx1280]) { if (!rIf) { LOG_DEBUG("Attempting to activate sx1280 radio on SPI port %s\n", settingsStrings[spidev].c_str()); - LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(*LoraSPI, spiSettings); + LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI, spiSettings); rIf = new SX1280Interface((LockingArduinoHal *)RadioLibHAL, settingsMap[cs], settingsMap[irq], settingsMap[reset], settingsMap[busy]); if (!rIf->init()) { @@ -773,7 +773,7 @@ void setup() } else if (settingsMap[use_sx1268]) { if (!rIf) { LOG_DEBUG("Attempting to activate sx1268 radio on SPI port %s\n", settingsStrings[spidev].c_str()); - LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(*LoraSPI, spiSettings); + LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI, spiSettings); rIf = new SX1268Interface((LockingArduinoHal *)RadioLibHAL, settingsMap[cs], settingsMap[irq], settingsMap[reset], settingsMap[busy]); if (!rIf->init()) { diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index 8572f4cf28..6151da2279 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -15,8 +15,6 @@ #include #include -HardwareSPI *DisplaySPI; -HardwareSPI *LoraSPI; std::map settingsMap; std::map settingsStrings; char *configPath = nullptr; @@ -173,6 +171,15 @@ void portduinoSetup() gpioChipName += std::to_string(settingsMap[gpiochip]); settingsStrings[spidev] = "/dev/" + yamlConfig["Lora"]["spidev"].as("spidev0.0"); + if (settingsStrings[spidev].length() == 14) { + int x = settingsStrings[spidev].at(11) - '0'; + int y = settingsStrings[spidev].at(13) - '0'; + if (x >= 0 && x < 10 && y >= 0 && y < 10) { + settingsMap[spidev] = x + y << 4; + settingsMap[displayspidev] = settingsMap[spidev]; + settingsMap[touchscreenspidev] = settingsMap[spidev]; + } + } } if (yamlConfig["GPIO"]) { settingsMap[user] = yamlConfig["GPIO"]["User"].as(RADIOLIB_NC); @@ -222,6 +229,14 @@ void portduinoSetup() settingsMap[displayBusFrequency] = yamlConfig["Display"]["BusFrequency"].as(40000000); if (yamlConfig["Display"]["spidev"]) { settingsStrings[displayspidev] = "/dev/" + yamlConfig["Display"]["spidev"].as("spidev0.1"); + if (settingsStrings[displayspidev].length() == 14) { + int x = settingsStrings[displayspidev].at(11) - '0'; + int y = settingsStrings[displayspidev].at(13) - '0'; + if (x >= 0 && x < 10 && y >= 0 && y < 10) { + settingsMap[displayspidev] = x + y << 4; + settingsMap[touchscreenspidev] = settingsMap[displayspidev]; + } + } } } settingsMap[touchscreenModule] = no_touchscreen; @@ -241,6 +256,13 @@ void portduinoSetup() settingsMap[touchscreenI2CAddr] = yamlConfig["Touchscreen"]["I2CAddr"].as(-1); if (yamlConfig["Touchscreen"]["spidev"]) { settingsStrings[touchscreenspidev] = "/dev/" + yamlConfig["Touchscreen"]["spidev"].as(""); + if (settingsStrings[touchscreenspidev].length() == 14) { + int x = settingsStrings[touchscreenspidev].at(11) - '0'; + int y = settingsStrings[touchscreenspidev].at(13) - '0'; + if (x >= 0 && x < 10 && y >= 0 && y < 10) { + settingsMap[touchscreenspidev] = x + y << 4; + } + } } } if (yamlConfig["Input"]) { @@ -319,27 +341,9 @@ void portduinoSetup() if (settingsMap[touchscreenIRQ] > 0) initGPIOPin(settingsMap[touchscreenIRQ], gpioChipName); } - - // if we specify a touchscreen dev, that is SPI. - // else if we specify a screen dev, that is SPI - // else if we specify a LoRa dev, that is SPI. - if (settingsStrings[touchscreenspidev] != "") { - SPI.begin(settingsStrings[touchscreenspidev].c_str()); - DisplaySPI = new HardwareSPI; - DisplaySPI->begin(settingsStrings[displayspidev].c_str()); - LoraSPI = new HardwareSPI; - LoraSPI->begin(settingsStrings[spidev].c_str()); - } else if (settingsStrings[displayspidev] != "") { - SPI.begin(settingsStrings[displayspidev].c_str()); - DisplaySPI = &SPI; - LoraSPI = new HardwareSPI; - LoraSPI->begin(settingsStrings[spidev].c_str()); - } else { + if (settingsStrings[spidev] != "") { SPI.begin(settingsStrings[spidev].c_str()); - LoraSPI = &SPI; - DisplaySPI = &SPI; } - return; } diff --git a/src/platform/portduino/PortduinoGlue.h b/src/platform/portduino/PortduinoGlue.h index 94cdbf2f8c..995793a216 100644 --- a/src/platform/portduino/PortduinoGlue.h +++ b/src/platform/portduino/PortduinoGlue.h @@ -56,6 +56,4 @@ enum { level_error, level_warn, level_info, level_debug }; extern std::map settingsMap; extern std::map settingsStrings; -int initGPIOPin(int pinNum, std::string gpioChipname); -extern HardwareSPI *DisplaySPI; -extern HardwareSPI *LoraSPI; \ No newline at end of file +int initGPIOPin(int pinNum, std::string gpioChipname); \ No newline at end of file From 0f4ac945591545cefb6c645573b1ef0a880cc745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 2 May 2024 12:48:50 +0200 Subject: [PATCH 19/19] fix building new TWC_mesh_v4 board --- variants/TWC_mesh_v4/platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/TWC_mesh_v4/platformio.ini b/variants/TWC_mesh_v4/platformio.ini index 9cf25c6850..4816821433 100644 --- a/variants/TWC_mesh_v4/platformio.ini +++ b/variants/TWC_mesh_v4/platformio.ini @@ -1,6 +1,6 @@ [env:TWC_mesh_v4] extends = nrf52840_base -board = TWC_mesh_v4 +board = nordic_pca10059 board_level = extra build_flags = ${nrf52840_base.build_flags} -I variants/TWC_mesh_v4 -D TWC_mesh_v4 -L".pio\libdeps\TWC_mesh_v4\BSEC2 Software Library\src\cortex-m4\fpv4-sp-d16-hard" build_src_filter = ${nrf52_base.build_src_filter} +<../variants/TWC_mesh_v4>