diff --git a/.github/workflows/build_raspbian.yml b/.github/workflows/build_raspbian.yml
index 103f43a715..7a25892bc8 100644
--- a/.github/workflows/build_raspbian.yml
+++ b/.github/workflows/build_raspbian.yml
@@ -41,5 +41,5 @@ jobs:
with:
name: firmware-raspbian-${{ steps.version.outputs.version }}.zip
path: |
- release/meshtasticd_linux_arm64
+ release/meshtasticd_linux_aarch64
bin/config-dist.yaml
diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml
index bd7d5f1be7..c92ec06ea4 100644
--- a/.github/workflows/main_matrix.yml
+++ b/.github/workflows/main_matrix.yml
@@ -245,7 +245,7 @@ jobs:
id: version
- name: Move files up
- run: mv -b -t ./ ./*tbeam-2*/littlefs*.bin ./*tbeam-2*/bleota.bin ./*tbeam-s3*/bleota-s3.bin ./**/firmware*.bin ./*t-echo*/Meshtastic_nRF52_factory_erase.uf2 ./**/firmware-*.uf2 ./**/firmware-*-ota.zip ./**/*.elf ./*native*/*device-*.sh ./*native*/*device-*.bat ./firmware-raspbian-*/release/meshtasticd_linux_arm64 ./firmware-raspbian-*/bin/config-dist.yaml
+ run: mv -b -t ./ ./*tbeam-2*/littlefs*.bin ./*tbeam-2*/bleota.bin ./*tbeam-s3*/bleota-s3.bin ./**/firmware*.bin ./*t-echo*/Meshtastic_nRF52_factory_erase.uf2 ./**/firmware-*.uf2 ./**/firmware-*-ota.zip ./**/*.elf ./*native*/*device-*.sh ./*native*/*device-*.bat ./firmware-raspbian-*/release/meshtasticd_linux_aarch64 ./firmware-raspbian-*/bin/config-dist.yaml
- name: Repackage in single firmware zip
uses: actions/upload-artifact@v3
diff --git a/.github/workflows/package_raspbian.yml b/.github/workflows/package_raspbian.yml
index 61f82e9d77..2f9a99e583 100644
--- a/.github/workflows/package_raspbian.yml
+++ b/.github/workflows/package_raspbian.yml
@@ -40,7 +40,7 @@ jobs:
mkdir -p .debpkg/usr/sbin
mkdir -p .debpkg/etc/meshtasticd
mkdir -p .debpkg/usr/lib/systemd/system/
- cp release/meshtasticd_linux_arm64 .debpkg/usr/sbin/meshtasticd
+ cp release/meshtasticd_linux_aarch64 .debpkg/usr/sbin/meshtasticd
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
chmod +x .debpkg/usr/sbin/meshtasticd
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
diff --git a/Dockerfile b/Dockerfile
index 63eccc4b44..21e42ad876 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -12,7 +12,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install build deps
USER root
RUN apt-get update && \
- apt-get -y install wget python3 g++ zip python3-venv git vim ca-certificates
+ apt-get -y install wget python3 g++ zip python3-venv git vim ca-certificates libgpiod-dev libyaml-cpp-dev libbluetooth-dev
# create a non-priveleged user & group
RUN groupadd -g 1000 mesh && useradd -ml -u 1000 -g 1000 mesh
@@ -32,10 +32,10 @@ FROM frolvlad/alpine-glibc:glibc-2.31
RUN apk --update add --no-cache g++ shadow && \
groupadd -g 1000 mesh && useradd -ml -u 1000 -g 1000 mesh
-COPY --from=builder /tmp/firmware/release/meshtasticd_linux_amd64 /home/mesh/
+COPY --from=builder /tmp/firmware/release/meshtasticd_linux_x86_64 /home/mesh/
USER mesh
WORKDIR /home/mesh
-CMD sh -cx "./meshtasticd_linux_amd64 --hwid '${HWID:-$RANDOM}'"
+CMD sh -cx "./meshtasticd_linux_x86_64 --hwid '${HWID:-$RANDOM}'"
-HEALTHCHECK NONE
+HEALTHCHECK NONE
\ No newline at end of file
diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini
index 98bb309b94..970640480c 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#8a66ef82cf38a4135d85cbb5043d0e8ebbb8ba17
+platform = https://github.com/meshtastic/platform-native.git#04435d06e39916a6c019d511518d8e95c659dfbd
framework = arduino
build_src_filter =
@@ -23,9 +23,14 @@ lib_deps =
${env.lib_deps}
${networking_base.lib_deps}
rweather/Crypto@^0.4.0
+ lovyan03/LovyanGFX@^1.1.12
build_flags =
${arduino_base.build_flags}
-fPIC
-Isrc/platform/portduino
- -DRADIOLIB_EEPROM_UNSUPPORTED
\ No newline at end of file
+ -DRADIOLIB_EEPROM_UNSUPPORTED
+ -DPORTDUINO_LINUX_HARDWARE
+ -lbluetooth
+ -lgpiod
+ -lyaml-cpp
\ No newline at end of file
diff --git a/bin/build-native.sh b/bin/build-native.sh
index 64c5adb504..7e9fcb632c 100755
--- a/bin/build-native.sh
+++ b/bin/build-native.sh
@@ -14,14 +14,7 @@ rm -r $OUTDIR/* || true
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
platformio pkg update
-
-if command -v raspi-config &>/dev/null; then
- pio run --environment raspbian
- cp .pio/build/raspbian/program $OUTDIR/meshtasticd_linux_arm64
-else
- pio run --environment native
- cp .pio/build/native/program $OUTDIR/meshtasticd_linux_amd64
-fi
-
+pio run --environment native
+cp .pio/build/native/program "$OUTDIR/meshtasticd_linux_$(arch)"
cp bin/device-install.* $OUTDIR
cp bin/device-update.* $OUTDIR
diff --git a/bin/config-dist.yaml b/bin/config-dist.yaml
index 4079e7676f..99a08ad875 100644
--- a/bin/config-dist.yaml
+++ b/bin/config-dist.yaml
@@ -14,6 +14,12 @@ Lora:
# IRQ: 17
# Reset: 22
+# Module: sx1262 # pinedio
+# CS: 0
+# IRQ: 10
+# Busy: 11
+# spidev: spidev0.1
+
# Module: RF95 # Adafruit RFM9x
# Reset: 25
# CS: 7
@@ -31,10 +37,19 @@ Lora:
# Busy: 20
# Reset: 18
+# DIO3_TCXO_VOLTAGE: true # the Waveshare Core1262 and others are known to need this setting
+
+# TXen: x # TX and RX enable pins
+# RXen: x
+
### Set gpio chip to use in /dev/. Defaults to 0.
### Notably the Raspberry Pi 5 puts the GPIO header on gpiochip4
# gpiochip: 4
+### Specify the SPI device to use in /dev/. Defaults to spidev0.0
+### Some devices, like the pinedio, may require spidev0.1 as a workaround.
+# spidev: spidev0.0
+
### Define GPIO buttons here:
GPIO:
@@ -58,6 +73,18 @@ Display:
# Height: 320
# Reset: 27
# Rotate: true
+# Invert: true
+
+### Waveshare 1.44inch LCD HAT
+# Panel: ST7735S
+# CS: 8 #Chip Select
+# DC: 25 # Data/Command pin
+# Backlight: 24
+# Width: 128
+# Height: 128
+# Reset: 27
+# OffsetX: 0
+# OffsetY: 0
Touchscreen:
# Module: XPT2046
diff --git a/bin/native-install.sh b/bin/native-install.sh
index d1d0c8707b..cc6d968f9b 100755
--- a/bin/native-install.sh
+++ b/bin/native-install.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-cp release/meshtasticd_linux_arm64 /usr/sbin/meshtasticd
+cp "release/meshtasticd_linux_$(arch)" /usr/sbin/meshtasticd
mkdir /etc/meshtasticd
if [[ -f "/etc/meshtasticd/config.yaml" ]]; then
cp bin/config-dist.yaml /etc/meshtasticd/config-upgrade.yaml
diff --git a/platformio.ini b/platformio.ini
index b526a8fa20..f017dcceec 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -115,7 +115,7 @@ lib_deps =
https://github.com/boschsensortec/Bosch-BSEC2-Library#v1.5.2400
boschsensortec/BME68x Sensor Library@^1.1.40407
adafruit/Adafruit MCP9808 Library@^2.0.0
- https://github.com/Tinyu-Zhao/INA3221@^0.0.1
+ https://github.com/KodinLanewave/INA3221@^1.0.0
adafruit/Adafruit INA260 Library@^1.5.0
adafruit/Adafruit INA219@^1.2.0
adafruit/Adafruit SHTC3 Library@^1.0.0
diff --git a/src/ButtonThread.h b/src/ButtonThread.h
index 7138d3b6af..3301df0973 100644
--- a/src/ButtonThread.h
+++ b/src/ButtonThread.h
@@ -38,7 +38,7 @@ class ButtonThread : public concurrency::OSThread
#ifdef BUTTON_PIN_TOUCH
OneButton userButtonTouch;
#endif
-#if defined(ARCH_RASPBERRY_PI)
+#if defined(ARCH_PORTDUINO)
OneButton userButton;
#endif
static bool shutdown_on_long_stop;
@@ -49,8 +49,8 @@ class ButtonThread : public concurrency::OSThread
// callback returns the period for the next callback invocation (or 0 if we should no longer be called)
ButtonThread() : OSThread("Button")
{
-#if defined(ARCH_RASPBERRY_PI) || defined(BUTTON_PIN)
-#if defined(ARCH_RASPBERRY_PI)
+#if defined(ARCH_PORTDUINO) || defined(BUTTON_PIN)
+#if defined(ARCH_PORTDUINO)
if (settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC)
userButton = OneButton(settingsMap[user], true, true);
#elif defined(BUTTON_PIN)
@@ -68,7 +68,7 @@ class ButtonThread : public concurrency::OSThread
userButton.attachMultiClick(userButtonMultiPressed);
userButton.attachLongPressStart(userButtonPressedLongStart);
userButton.attachLongPressStop(userButtonPressedLongStop);
-#if defined(ARCH_RASPBERRY_PI)
+#if defined(ARCH_PORTDUINO)
if (settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC)
wakeOnIrq(settingsMap[user], FALLING);
#else
@@ -105,7 +105,7 @@ class ButtonThread : public concurrency::OSThread
#if defined(BUTTON_PIN)
userButton.tick();
canSleep &= userButton.isIdle();
-#elif defined(ARCH_RASPBERRY_PI)
+#elif defined(ARCH_PORTDUINO)
if (settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC) {
userButton.tick();
canSleep &= userButton.isIdle();
@@ -143,7 +143,7 @@ class ButtonThread : public concurrency::OSThread
powerFSM.trigger(EVENT_PRESS);
}
#endif
-#if defined(ARCH_RASPBERRY_PI)
+#if defined(ARCH_PORTDUINO)
if ((settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC) &&
(settingsMap[user] != moduleConfig.canned_message.inputbroker_pin_press) ||
!moduleConfig.canned_message.enabled) {
diff --git a/src/RedirectablePrint.cpp b/src/RedirectablePrint.cpp
index 2d73c7c9b5..ba09076ed8 100644
--- a/src/RedirectablePrint.cpp
+++ b/src/RedirectablePrint.cpp
@@ -99,10 +99,17 @@ size_t RedirectablePrint::log(const char *logLevel, const char *format, ...)
int hour = hms / SEC_PER_HOUR;
int min = (hms % SEC_PER_HOUR) / SEC_PER_MIN;
int sec = (hms % SEC_PER_HOUR) % SEC_PER_MIN; // or hms % SEC_PER_MIN
-
+#ifdef ARCH_PORTDUINO
+ r += ::printf("%s | %02d:%02d:%02d %u ", logLevel, hour, min, sec, millis() / 1000);
+#else
r += printf("%s | %02d:%02d:%02d %u ", logLevel, hour, min, sec, millis() / 1000);
+#endif
} else
+#ifdef ARCH_PORTDUINO
+ r += ::printf("%s | ??:??:?? %u ", logLevel, millis() / 1000);
+#else
r += printf("%s | ??:??:?? %u ", logLevel, millis() / 1000);
+#endif
auto thread = concurrency::OSThread::currentThread;
if (thread) {
diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp
index a5c932f1f9..990fb36ea4 100644
--- a/src/detect/ScanI2CTwoWire.cpp
+++ b/src/detect/ScanI2CTwoWire.cpp
@@ -2,7 +2,7 @@
#include "concurrency/LockGuard.h"
#include "configuration.h"
-#if defined(ARCH_RASPBERRY_PI)
+#if defined(ARCH_PORTDUINO)
#include "linux/LinuxHardwareI2C.h"
#endif
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp
index fee9393b06..0e0b5f8b6e 100644
--- a/src/gps/GPS.cpp
+++ b/src/gps/GPS.cpp
@@ -16,7 +16,7 @@
#define GPS_RESET_MODE HIGH
#endif
-#if defined(NRF52840_XXAA) || defined(NRF52833_XXAA) || defined(ARCH_ESP32) || defined(ARCH_RASPBERRY_PI)
+#if defined(NRF52840_XXAA) || defined(NRF52833_XXAA) || defined(ARCH_ESP32) || defined(aLinuxInputImpl)
HardwareSerial *GPS::_serial_gps = &Serial1;
#else
HardwareSerial *GPS::_serial_gps = NULL;
@@ -924,7 +924,7 @@ GPS *GPS::createGps()
if (!_en_gpio)
_en_gpio = PIN_GPS_EN;
#endif
-#ifdef ARCH_RASPBERRY_PI
+#ifdef ARCH_PORTDUINO
if (!settingsMap[has_gps])
return nullptr;
#endif
@@ -1286,4 +1286,4 @@ int32_t GPS::disable()
setAwake(false);
return INT32_MAX;
-}
+}
\ No newline at end of file
diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp
index a7fcd0c349..00880ad051 100644
--- a/src/graphics/Screen.cpp
+++ b/src/graphics/Screen.cpp
@@ -43,7 +43,7 @@ along with this program. If not, see .
#include "sleep.h"
#include "target_specific.h"
-#if HAS_WIFI && !defined(ARCH_RASPBERRY_PI)
+#if HAS_WIFI && !defined(ARCH_PORTDUINO)
#include "mesh/wifi/WiFiAPClient.h"
#endif
@@ -52,7 +52,7 @@ along with this program. If not, see .
#include "modules/esp32/StoreForwardModule.h"
#endif
-#if ARCH_RASPBERRY_PI
+#if ARCH_PORTDUINO
#include "platform/portduino/PortduinoGlue.h"
#endif
@@ -930,8 +930,8 @@ Screen::Screen(ScanI2C::DeviceAddress address, meshtastic_Config_DisplayConfig_O
#elif defined(USE_ST7567)
dispdev = new ST7567Wire(address.address, -1, -1, geometry,
(address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE);
-#elif ARCH_RASPBERRY_PI
- if (settingsMap[displayPanel] == st7789) {
+#elif ARCH_PORTDUINO
+ if (settingsMap[displayPanel] != no_screen) {
LOG_DEBUG("Making TFTDisplay!\n");
dispdev = new TFTDisplay(address.address, -1, -1, geometry,
(address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE);
@@ -976,7 +976,7 @@ void Screen::handleSetOn(bool on)
#ifdef T_WATCH_S3
PMU->enablePowerOutput(XPOWERS_ALDO2);
#endif
-#if !ARCH_RASPBERRY_PI
+#if !ARCH_PORTDUINO
dispdev->displayOn();
#endif
dispdev->displayOn();
@@ -1060,7 +1060,7 @@ void Screen::setup()
uint8_t dmac[6];
getMacAddr(dmac);
snprintf(ourId, sizeof(ourId), "%02x%02x", dmac[4], dmac[5]);
-#if ARCH_RASPBERRY_PI
+#if ARCH_PORTDUINO
handleSetOn(false); // force clean init
#endif
@@ -1075,7 +1075,7 @@ void Screen::setup()
#endif
serialSinceMsec = millis();
-#if ARCH_RASPBERRY_PI
+#if ARCH_PORTDUINO
if (settingsMap[touchscreenModule]) {
touchScreenImpl1 =
new TouchScreenImpl1(dispdev->getWidth(), dispdev->getHeight(), static_cast(dispdev)->getTouch);
@@ -1344,7 +1344,7 @@ void Screen::setFrames()
// call a method on debugInfoScreen object (for more details)
normalFrames[numframes++] = &Screen::drawDebugInfoSettingsTrampoline;
-#if HAS_WIFI && !defined(ARCH_RASPBERRY_PI)
+#if HAS_WIFI && !defined(ARCH_PORTDUINO)
if (isWifiAvailable()) {
// call a method on debugInfoScreen object (for more details)
normalFrames[numframes++] = &Screen::drawDebugInfoWiFiTrampoline;
@@ -1588,7 +1588,7 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
#endif
} else {
// TODO: Raspberry Pi supports more than just the one screen size
-#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) || defined(ST7789_CS) || ARCH_RASPBERRY_PI) && \
+#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) || defined(ST7789_CS) || ARCH_PORTDUINO) && \
!defined(DISPLAY_FORCE_SMALL_FONTS)
display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8,
imgInfoL1);
@@ -1615,7 +1615,7 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
// Jm
void DebugInfo::drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
{
-#if HAS_WIFI && !defined(ARCH_RASPBERRY_PI)
+#if HAS_WIFI && !defined(ARCH_PORTDUINO)
const char *wifiName = config.network.wifi_ssid;
display->setFont(FONT_SMALL);
diff --git a/src/graphics/TFTDisplay.cpp b/src/graphics/TFTDisplay.cpp
index df1aefb3dc..9b107ba52e 100644
--- a/src/graphics/TFTDisplay.cpp
+++ b/src/graphics/TFTDisplay.cpp
@@ -1,6 +1,6 @@
#include "configuration.h"
#include "main.h"
-#if ARCH_RASPBERRY_PI
+#if ARCH_PORTDUINO
#include "platform/portduino/PortduinoGlue.h"
#endif
@@ -331,7 +331,7 @@ static LGFX *tft = nullptr;
#include // Graphics and font library for ILI9341 driver chip
static TFT_eSPI *tft = nullptr; // Invoke library, pins defined in User_Setup.h
-#elif ARCH_RASPBERRY_PI
+#elif ARCH_PORTDUINO
#include // Graphics and font library for ST7735 driver chip
class LGFX : public lgfx::LGFX_Device
@@ -344,8 +344,12 @@ class LGFX : public lgfx::LGFX_Device
public:
LGFX(void)
{
-
- _panel_instance = new lgfx::Panel_ST7789;
+ if (settingsMap[displayPanel] == st7789)
+ _panel_instance = new lgfx::Panel_ST7789;
+ else if (settingsMap[displayPanel] == st7735)
+ _panel_instance = new lgfx::Panel_ST7735;
+ else if (settingsMap[displayPanel] == st7735s)
+ _panel_instance = new lgfx::Panel_ST7735S;
auto buscfg = _bus_instance.config();
buscfg.spi_mode = 0;
@@ -356,19 +360,14 @@ class LGFX : public lgfx::LGFX_Device
auto cfg = _panel_instance->config(); // Gets a structure for display panel settings.
LOG_DEBUG("Height: %d, Width: %d \n", settingsMap[displayHeight], settingsMap[displayWidth]);
- cfg.pin_cs = settingsMap[displayCS]; // Pin number where CS is connected (-1 = disable)
+ cfg.pin_cs = settingsMap[displayCS]; // Pin number where CS is connected (-1 = disable)
+ cfg.pin_rst = settingsMap[displayReset];
cfg.panel_width = settingsMap[displayWidth]; // actual displayable width
cfg.panel_height = settingsMap[displayHeight]; // actual displayable height
- cfg.offset_x = 0; // Panel offset amount in X direction
- cfg.offset_y = 0; // Panel offset amount in Y direction
+ cfg.offset_x = settingsMap[displayOffsetX]; // Panel offset amount in X direction
+ cfg.offset_y = settingsMap[displayOffsetY]; // Panel offset amount in Y direction
cfg.offset_rotation = 0; // Rotation direction value offset 0~7 (4~7 is mirrored)
- cfg.dummy_read_pixel = 9; // Number of bits for dummy read before pixel readout
- cfg.dummy_read_bits = 1; // Number of bits for dummy read before non-pixel data read
- cfg.readable = true; // Set to true if data can be read
- cfg.invert = true; // Set to true if the light/darkness of the panel is reversed
- cfg.rgb_order = false; // Set to true if the panel's red and blue are swapped
- cfg.dlen_16bit = false; // Set to true for panels that transmit data length in 16-bit units with 16-bit parallel or SPI
- cfg.bus_shared = true; // If the bus is shared with the SD card, set to true (bus control with drawJpgFile etc.)
+ cfg.invert = settingsMap[displayInvert]; // Set to true if the light/darkness of the panel is reversed
_panel_instance->config(cfg);
@@ -399,7 +398,7 @@ class LGFX : public lgfx::LGFX_Device
static LGFX *tft = nullptr;
#endif
-#if defined(ST7735_CS) || defined(ST7789_CS) || defined(ILI9341_DRIVER) || defined(RAK14014) || ARCH_RASPBERRY_PI
+#if defined(ST7735_CS) || defined(ST7789_CS) || defined(ILI9341_DRIVER) || defined(RAK14014) || ARCH_PORTDUINO
#include "SPILock.h"
#include "TFTDisplay.h"
#include
@@ -407,7 +406,7 @@ static LGFX *tft = nullptr;
TFTDisplay::TFTDisplay(uint8_t address, int sda, int scl, OLEDDISPLAY_GEOMETRY geometry, HW_I2C i2cBus)
{
LOG_DEBUG("TFTDisplay!\n");
-#if ARCH_RASPBERRY_PI
+#if ARCH_PORTDUINO
if (settingsMap[displayRotate]) {
setGeometry(GEOMETRY_RAWMODE, settingsMap[configNames::displayHeight], settingsMap[configNames::displayWidth]);
} else {
@@ -460,7 +459,7 @@ void TFTDisplay::sendCommand(uint8_t com)
// handle display on/off directly
switch (com) {
case DISPLAYON: {
-#if ARCH_RASPBERRY_PI
+#if ARCH_PORTDUINO
display(true);
if (settingsMap[displayBacklight] > 0)
digitalWrite(settingsMap[displayBacklight], TFT_BACKLIGHT_ON);
@@ -492,7 +491,7 @@ void TFTDisplay::sendCommand(uint8_t com)
break;
}
case DISPLAYOFF: {
-#if ARCH_RASPBERRY_PI
+#if ARCH_PORTDUINO
tft->clear();
if (settingsMap[displayBacklight] > 0)
digitalWrite(settingsMap[displayBacklight], !TFT_BACKLIGHT_ON);
diff --git a/src/graphics/images.h b/src/graphics/images.h
index 7f3cd46fcc..207fc3a86c 100644
--- a/src/graphics/images.h
+++ b/src/graphics/images.h
@@ -14,7 +14,7 @@ const uint8_t imgUser[] PROGMEM = {0x3C, 0x42, 0x99, 0xA5, 0xA5, 0x99, 0x42, 0x3
const uint8_t imgPositionEmpty[] PROGMEM = {0x20, 0x30, 0x28, 0x24, 0x42, 0xFF};
const uint8_t imgPositionSolid[] PROGMEM = {0x20, 0x30, 0x38, 0x3C, 0x7E, 0xFF};
-#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) || defined(ST7789_CS) || ARCH_RASPBERRY_PI) && \
+#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) || defined(ST7789_CS) || ARCH_PORTDUINO) && \
!defined(DISPLAY_FORCE_SMALL_FONTS)
const uint8_t imgQuestionL1[] PROGMEM = {0xff, 0x01, 0x01, 0x32, 0x7b, 0x49, 0x49, 0x6f, 0x26, 0x01, 0x01, 0xff};
const uint8_t imgQuestionL2[] PROGMEM = {0x0f, 0x08, 0x08, 0x08, 0x06, 0x0f, 0x0f, 0x06, 0x08, 0x08, 0x08, 0x0f};
diff --git a/src/input/LinuxInput.cpp b/src/input/LinuxInput.cpp
index ea588c4bfc..d2a94e94ea 100644
--- a/src/input/LinuxInput.cpp
+++ b/src/input/LinuxInput.cpp
@@ -1,7 +1,6 @@
-#if ARCH_RASPBERRY_PI
-#include "LinuxInput.h"
#include "configuration.h"
-
+#if ARCH_PORTDUINO
+#include "LinuxInput.h"
#include "platform/portduino/PortduinoGlue.h"
#include
#include
diff --git a/src/input/LinuxInput.h b/src/input/LinuxInput.h
index c7f0113799..aa1e8e3402 100644
--- a/src/input/LinuxInput.h
+++ b/src/input/LinuxInput.h
@@ -1,5 +1,5 @@
#pragma once
-#if ARCH_RASPBERRY_PI
+#if ARCH_PORTDUINO
#include "InputBroker.h"
#include "concurrency/OSThread.h"
#include
diff --git a/src/input/LinuxInputImpl.cpp b/src/input/LinuxInputImpl.cpp
index d12f457ecd..4ddda1923b 100644
--- a/src/input/LinuxInputImpl.cpp
+++ b/src/input/LinuxInputImpl.cpp
@@ -1,6 +1,7 @@
-#if ARCH_RASPBERRY_PI
-#include "LinuxInputImpl.h"
+#include "configuration.h"
+#if ARCH_PORTDUINO
#include "InputBroker.h"
+#include "LinuxInputImpl.h"
LinuxInputImpl *aLinuxInputImpl;
diff --git a/src/input/LinuxInputImpl.h b/src/input/LinuxInputImpl.h
index b5bfdc4c2c..e734b02943 100644
--- a/src/input/LinuxInputImpl.h
+++ b/src/input/LinuxInputImpl.h
@@ -1,4 +1,4 @@
-#ifdef ARCH_RASPBERRY_PI
+#ifdef ARCH_PORTDUINO
#pragma once
#include "LinuxInput.h"
#include "main.h"
diff --git a/src/input/TouchScreenImpl1.cpp b/src/input/TouchScreenImpl1.cpp
index 145033c950..3e4ed4163b 100644
--- a/src/input/TouchScreenImpl1.cpp
+++ b/src/input/TouchScreenImpl1.cpp
@@ -4,7 +4,7 @@
#include "configuration.h"
#include "modules/ExternalNotificationModule.h"
-#ifdef ARCH_RASPBERRY_PI
+#ifdef ARCH_PORTDUINO
#include "platform/portduino/PortduinoGlue.h"
#endif
@@ -17,7 +17,7 @@ TouchScreenImpl1::TouchScreenImpl1(uint16_t width, uint16_t height, bool (*getTo
void TouchScreenImpl1::init()
{
-#if ARCH_RASPBERRY_PI
+#if ARCH_PORTDUINO
if (settingsMap[touchscreenModule]) {
TouchScreenBase::init(true);
inputBroker->registerSource(this);
diff --git a/src/input/kbI2cBase.cpp b/src/input/kbI2cBase.cpp
index 366e7fbb19..1dba4e34dc 100644
--- a/src/input/kbI2cBase.cpp
+++ b/src/input/kbI2cBase.cpp
@@ -187,7 +187,7 @@ int32_t KbI2cBase::runOnce()
i2cBus->requestFrom((int)cardkb_found.address, 1);
- while (i2cBus->available()) {
+ if (i2cBus->available()) {
char c = i2cBus->read();
InputEvent e;
e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE;
@@ -222,7 +222,11 @@ int32_t KbI2cBase::runOnce()
case 0x00: // nopress
e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE;
break;
- default: // all other keys
+ default: // all other keys
+ if (c > 127) { // bogus key value
+ e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE;
+ break;
+ }
e.inputEvent = ANYKEY;
e.kbchar = c;
break;
@@ -238,4 +242,4 @@ int32_t KbI2cBase::runOnce()
LOG_WARN("Unknown kb_model 0x%02x\n", kb_model);
}
return 300;
-}
+}
\ No newline at end of file
diff --git a/src/main.cpp b/src/main.cpp
index 38c35cf158..a0246afe05 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -66,7 +66,7 @@ NRF52Bluetooth *nrf52Bluetooth;
#include "platform/portduino/SimRadio.h"
#endif
-#ifdef ARCH_RASPBERRY_PI
+#ifdef ARCH_PORTDUINO
#include "linux/LinuxHardwareI2C.h"
#include "platform/portduino/PortduinoGlue.h"
#include
@@ -74,7 +74,7 @@ NRF52Bluetooth *nrf52Bluetooth;
#include
#endif
-#if HAS_BUTTON || defined(ARCH_RASPBERRY_PI)
+#if HAS_BUTTON || defined(ARCH_PORTDUINO)
#include "ButtonThread.h"
#endif
#include "PowerFSMThread.h"
@@ -141,32 +141,12 @@ std::pair nodeTelemetrySensorsMap[_meshtastic_TelemetrySenso
Router *router = NULL; // Users of router don't care what sort of subclass implements that API
-#ifdef ARCH_RASPBERRY_PI
-void getPiMacAddr(uint8_t *dmac)
-{
- std::fstream macIdentity;
- macIdentity.open("/sys/kernel/debug/bluetooth/hci0/identity", std::ios::in);
- std::string macLine;
- getline(macIdentity, macLine);
- macIdentity.close();
-
- dmac[0] = strtol(macLine.substr(0, 2).c_str(), NULL, 16);
- dmac[1] = strtol(macLine.substr(3, 2).c_str(), NULL, 16);
- dmac[2] = strtol(macLine.substr(6, 2).c_str(), NULL, 16);
- dmac[3] = strtol(macLine.substr(9, 2).c_str(), NULL, 16);
- dmac[4] = strtol(macLine.substr(12, 2).c_str(), NULL, 16);
- dmac[5] = strtol(macLine.substr(15, 2).c_str(), NULL, 16);
-}
-#endif
-
const char *getDeviceName()
{
uint8_t dmac[6];
-#ifdef ARCH_RASPBERRY_PI
- getPiMacAddr(dmac);
-#else
+
getMacAddr(dmac);
-#endif
+
// Meshtastic_ab3c or Shortname_abcd
static char name[20];
snprintf(name, sizeof(name), "%02x%02x", dmac[4], dmac[5]);
@@ -211,13 +191,13 @@ static int32_t ledBlinker()
uint32_t timeLastPowered = 0;
-#if HAS_BUTTON || defined(ARCH_RASPBERRY_PI)
+#if HAS_BUTTON || defined(ARCH_PORTDUINO)
bool ButtonThread::shutdown_on_long_stop = false;
#endif
static Periodic *ledPeriodic;
static OSThread *powerFSMthread;
-#if HAS_BUTTON || defined(ARCH_RASPBERRY_PI)
+#if HAS_BUTTON || defined(ARCH_PORTDUINO)
static OSThread *buttonThread;
uint32_t ButtonThread::longPressTime = 0;
#endif
@@ -613,7 +593,7 @@ void setup()
} else
router = new ReliableRouter();
-#if HAS_BUTTON || defined(ARCH_RASPBERRY_PI)
+#if HAS_BUTTON || defined(ARCH_PORTDUINO)
// Buttons. Moved here cause we need NodeDB to be initialized
buttonThread = new ButtonThread();
#endif
@@ -664,12 +644,14 @@ void setup()
pinMode(LORA_CS, OUTPUT);
digitalWrite(LORA_CS, HIGH);
SPI1.begin(false);
-#else // HW_SPI1_DEVICE
+#else // HW_SPI1_DEVICE
SPI.setSCK(LORA_SCK);
SPI.setTX(LORA_MOSI);
SPI.setRX(LORA_MISO);
SPI.begin(false);
-#endif // HW_SPI1_DEVICE
+#endif // HW_SPI1_DEVICE
+#elif ARCH_PORTDUINO
+ SPI.begin(settingsStrings[spidev].c_str());
#elif !defined(ARCH_ESP32) // ARCH_RP2040
SPI.begin();
#else
@@ -715,7 +697,7 @@ void setup()
// the current region name)
#if defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7789_CS)
screen->setup();
-#elif ARCH_RASPBERRY_PI
+#elif defined(ARCH_PORTDUINO)
if (screen_found.port != ScanI2C::I2CPort::NO_I2C || settingsMap[displayPanel]) {
screen->setup();
}
@@ -732,7 +714,7 @@ void setup()
digitalWrite(SX126X_ANT_SW, 1);
#endif
-#ifdef ARCH_RASPBERRY_PI
+#ifdef ARCH_PORTDUINO
if (settingsMap[use_sx1262]) {
if (!rIf) {
LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI, spiSettings);
@@ -822,7 +804,7 @@ void setup()
}
#endif
-#if defined(USE_SX1262) && !defined(ARCH_RASPBERRY_PI)
+#if defined(USE_SX1262) && !defined(ARCH_PORTDUINO)
if (!rIf) {
rIf = new SX1262Interface(RadioLibHAL, SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY);
if (!rIf->init()) {
@@ -997,4 +979,4 @@ void loop()
mainDelay.delay(delayMsec);
}
// if (didWake) LOG_DEBUG("wake!\n");
-}
+}
\ No newline at end of file
diff --git a/src/main.h b/src/main.h
index 8a646c80b2..1a93298aad 100644
--- a/src/main.h
+++ b/src/main.h
@@ -62,7 +62,6 @@ extern graphics::Screen *screen;
// Return a human readable string of the form "Meshtastic_ab13"
const char *getDeviceName();
-void getPiMacAddr(uint8_t *dmac);
extern uint32_t timeLastPowered;
diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp
index 4de79de0bd..1a619f34e6 100644
--- a/src/mesh/NodeDB.cpp
+++ b/src/mesh/NodeDB.cpp
@@ -27,7 +27,7 @@
#include
#endif
-#ifdef ARCH_RASPBERRY_PI
+#ifdef ARCH_PORTDUINO
#include "platform/portduino/PortduinoGlue.h"
#endif
@@ -195,7 +195,7 @@ void NodeDB::installDefaultConfig()
config.bluetooth.fixed_pin = defaultBLEPin;
#if defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7789_CS)
bool hasScreen = true;
-#elif ARCH_RASPBERRY_PI
+#elif ARCH_PORTDUINO
bool hasScreen = false;
if (settingsMap[displayPanel])
hasScreen = true;
@@ -464,11 +464,8 @@ void NodeDB::init()
*/
void NodeDB::pickNewNodeNum()
{
-#ifdef ARCH_RASPBERRY_PI
- getPiMacAddr(ourMacAddr); // Make sure ourMacAddr is set
-#else
+
getMacAddr(ourMacAddr); // Make sure ourMacAddr is set
-#endif
// Pick an initial nodenum based on the macaddr
NodeNum nodeNum = (ourMacAddr[2] << 24) | (ourMacAddr[3] << 16) | (ourMacAddr[4] << 8) | ourMacAddr[5];
diff --git a/src/mesh/RF95Interface.cpp b/src/mesh/RF95Interface.cpp
index d7f319f8ee..72e0f823f9 100644
--- a/src/mesh/RF95Interface.cpp
+++ b/src/mesh/RF95Interface.cpp
@@ -4,6 +4,10 @@
#include "configuration.h"
#include "error.h"
+#if ARCH_PORTDUINO
+#include "PortduinoGlue.h"
+#endif
+
#define MAX_POWER 20
// if we use 20 we are limited to 1% duty cycle or hw might overheat. For continuous operation set a limit of 17
// In theory up to 27 dBm is possible, but the modules installed in most radios can cope with a max of 20. So BIG WARNING
@@ -23,10 +27,18 @@ void RF95Interface::setTransmitEnable(bool txon)
{
#ifdef RF95_TXEN
digitalWrite(RF95_TXEN, txon ? 1 : 0);
+#elif ARCH_PORTDUINO
+ if (settingsMap[txen] != RADIOLIB_NC) {
+ digitalWrite(settingsMap[txen], txon ? 1 : 0);
+ }
#endif
#ifdef RF95_RXEN
digitalWrite(RF95_RXEN, txon ? 0 : 1);
+#elif ARCH_PORTDUINO
+ if (settingsMap[rxen] != RADIOLIB_NC) {
+ digitalWrite(settingsMap[rxen], txon ? 0 : 1);
+ }
#endif
}
@@ -62,6 +74,16 @@ bool RF95Interface::init()
#ifdef RF95_RXEN
pinMode(RF95_RXEN, OUTPUT);
digitalWrite(RF95_RXEN, 1);
+#endif
+#if ARCH_PORTDUINO
+ if (settingsMap[txen] != RADIOLIB_NC) {
+ pinMode(settingsMap[txen], OUTPUT);
+ digitalWrite(settingsMap[txen], 0);
+ }
+ if (settingsMap[rxen] != RADIOLIB_NC) {
+ pinMode(settingsMap[rxen], OUTPUT);
+ digitalWrite(settingsMap[rxen], 0);
+ }
#endif
setTransmitEnable(false);
@@ -202,4 +224,4 @@ bool RF95Interface::sleep()
lora->sleep();
return true;
-}
+}
\ No newline at end of file
diff --git a/src/mesh/SX126xInterface.cpp b/src/mesh/SX126xInterface.cpp
index 45519ff875..7220dd3e5c 100644
--- a/src/mesh/SX126xInterface.cpp
+++ b/src/mesh/SX126xInterface.cpp
@@ -2,7 +2,7 @@
#include "configuration.h"
#include "error.h"
#include "mesh/NodeDB.h"
-#ifdef ARCH_RASPBERRY_PI
+#ifdef ARCH_PORTDUINO
#include "PortduinoGlue.h"
#endif
@@ -30,18 +30,25 @@ template bool SX126xInterface::init()
digitalWrite(SX126X_POWER_EN, HIGH);
#endif
+#if ARCH_PORTDUINO
+ float tcxoVoltage = 0;
+ if (settingsMap[dio3_tcxo_voltage])
+ tcxoVoltage = 1.8;
// FIXME: correct logic to default to not using TCXO if no voltage is specified for SX126X_DIO3_TCXO_VOLTAGE
-#if !defined(SX126X_DIO3_TCXO_VOLTAGE)
+#elif !defined(SX126X_DIO3_TCXO_VOLTAGE)
float tcxoVoltage =
0; // "TCXO reference voltage to be set on DIO3. Defaults to 1.6 V, set to 0 to skip." per
// https://github.com/jgromes/RadioLib/blob/690a050ebb46e6097c5d00c371e961c1caa3b52e/src/modules/SX126x/SX126x.h#L471C26-L471C104
// (DIO3 is free to be used as an IRQ)
- LOG_DEBUG("SX126X_DIO3_TCXO_VOLTAGE not defined, not using DIO3 as TCXO reference voltage\n");
#else
float tcxoVoltage = SX126X_DIO3_TCXO_VOLTAGE;
- LOG_DEBUG("SX126X_DIO3_TCXO_VOLTAGE defined, using DIO3 as TCXO reference voltage at %f V\n", SX126X_DIO3_TCXO_VOLTAGE);
// (DIO3 is not free to be used as an IRQ)
#endif
+ if (tcxoVoltage == 0)
+ LOG_DEBUG("SX126X_DIO3_TCXO_VOLTAGE not defined, not using DIO3 as TCXO reference voltage\n");
+ else
+ LOG_DEBUG("SX126X_DIO3_TCXO_VOLTAGE defined, using DIO3 as TCXO reference voltage at %f V\n", tcxoVoltage);
+
// FIXME: May want to set depending on a definition, currently all SX126x variant files use the DC-DC regulator option
bool useRegulatorLDO = false; // Seems to depend on the connection to pin 9/DCC_SW - if an inductor DCDC?
@@ -77,7 +84,7 @@ template bool SX126xInterface::init()
#ifdef SX126X_DIO2_AS_RF_SWITCH
LOG_DEBUG("Setting DIO2 as RF switch\n");
bool dio2AsRfSwitch = true;
-#elif defined(ARCH_RASPBERRY_PI)
+#elif defined(ARCH_PORTDUINO)
bool dio2AsRfSwitch = false;
if (settingsMap[dio2_as_rf_switch]) {
LOG_DEBUG("Setting DIO2 as RF switch\n");
@@ -93,6 +100,12 @@ template bool SX126xInterface::init()
// If a pin isn't defined, we set it to RADIOLIB_NC, it is safe to always do external RF switching with RADIOLIB_NC as it has
// no effect
+#if ARCH_PORTDUINO
+ if (res == RADIOLIB_ERR_NONE) {
+ LOG_DEBUG("Using MCU pin %i as RXEN and pin %i as TXEN to control RF switching\n", settingsMap[rxen], settingsMap[txen]);
+ lora.setRfSwitchPins(settingsMap[rxen], settingsMap[txen]);
+ }
+#else
#ifndef SX126X_RXEN
#define SX126X_RXEN RADIOLIB_NC
LOG_DEBUG("SX126X_RXEN not defined, defaulting to RADIOLIB_NC\n");
@@ -105,7 +118,7 @@ template bool SX126xInterface::init()
LOG_DEBUG("Using MCU pin %i as RXEN and pin %i as TXEN to control RF switching\n", SX126X_RXEN, SX126X_TXEN);
lora.setRfSwitchPins(SX126X_RXEN, SX126X_TXEN);
}
-
+#endif
if (config.lora.sx126x_rx_boosted_gain) {
uint16_t result = lora.setRxBoostedGainMode(true);
LOG_INFO("Set RX gain to boosted mode; result: %d\n", result);
@@ -322,4 +335,4 @@ template bool SX126xInterface::sleep()
#endif
return true;
-}
+}
\ No newline at end of file
diff --git a/src/mesh/SX128xInterface.cpp b/src/mesh/SX128xInterface.cpp
index 6b7b0f438d..47a79ea520 100644
--- a/src/mesh/SX128xInterface.cpp
+++ b/src/mesh/SX128xInterface.cpp
@@ -3,6 +3,10 @@
#include "error.h"
#include "mesh/NodeDB.h"
+#if ARCH_PORTDUINO
+#include "PortduinoGlue.h"
+#endif
+
// Particular boards might define a different max power based on what their hardware can do
#ifndef SX128X_MAX_POWER
#define SX128X_MAX_POWER 13
@@ -31,6 +35,16 @@ template bool SX128xInterface::init()
digitalWrite(RF95_FAN_EN, 1);
#endif
+#if ARCH_PORTDUINO
+ if (settingsMap[rxen] != RADIOLIB_NC) {
+ pinMode(settingsMap[rxen], OUTPUT);
+ digitalWrite(settingsMap[rxen], LOW); // Set low before becoming an output
+ }
+ if (settingsMap[txen] != RADIOLIB_NC) {
+ pinMode(settingsMap[txen], OUTPUT);
+ digitalWrite(settingsMap[txen], LOW); // Set low before becoming an output
+ }
+#else
#if defined(SX128X_RXEN) && (SX128X_RXEN != RADIOLIB_NC) // set not rx or tx mode
pinMode(SX128X_RXEN, OUTPUT);
digitalWrite(SX128X_RXEN, LOW); // Set low before becoming an output
@@ -38,6 +52,7 @@ template bool SX128xInterface::init()
#if defined(SX128X_TXEN) && (SX128X_TXEN != RADIOLIB_NC)
pinMode(SX128X_TXEN, OUTPUT);
digitalWrite(SX128X_TXEN, LOW);
+#endif
#endif
RadioLibInterface::init();
@@ -75,6 +90,10 @@ template bool SX128xInterface::init()
if (res == RADIOLIB_ERR_NONE) {
lora.setRfSwitchPins(SX128X_RXEN, SX128X_TXEN);
}
+#elif ARCH_PORTDUINO
+ if (res == RADIOLIB_ERR_NONE && settingsMap[rxen] != RADIOLIB_NC && settingsMap[txen] != RADIOLIB_NC) {
+ lora.setRfSwitchPins(settingsMap[rxen], settingsMap[txen]);
+ }
#endif
if (res == RADIOLIB_ERR_NONE)
@@ -148,14 +167,21 @@ template void SX128xInterface::setStandby()
}
assert(err == RADIOLIB_ERR_NONE);
-
+#if ARCH_PORTDUINO
+ if (settingsMap[rxen] != RADIOLIB_NC) {
+ digitalWrite(settingsMap[rxen], LOW);
+ }
+ if (settingsMap[txen] != RADIOLIB_NC) {
+ digitalWrite(settingsMap[txen], LOW);
+ }
+#else
#if defined(SX128X_RXEN) && (SX128X_RXEN != RADIOLIB_NC) // we have RXEN/TXEN control - turn off RX and TX power
digitalWrite(SX128X_RXEN, LOW);
#endif
#if defined(SX128X_TXEN) && (SX128X_TXEN != RADIOLIB_NC)
digitalWrite(SX128X_TXEN, LOW);
#endif
-
+#endif
isReceiving = false; // If we were receiving, not any more
activeReceiveStart = 0;
disableInterrupt();
@@ -176,11 +202,21 @@ template void SX128xInterface::addReceiveMetadata(meshtastic_Mes
*/
template void SX128xInterface::configHardwareForSend()
{
+#if ARCH_PORTDUINO
+ if (settingsMap[txen] != RADIOLIB_NC) {
+ digitalWrite(settingsMap[txen], HIGH);
+ }
+ if (settingsMap[rxen] != RADIOLIB_NC) {
+ digitalWrite(settingsMap[rxen], LOW);
+ }
+
+#else
#if defined(SX128X_TXEN) && (SX128X_TXEN != RADIOLIB_NC) // we have RXEN/TXEN control - turn on TX power / off RX power
digitalWrite(SX128X_TXEN, HIGH);
#endif
#if defined(SX128X_RXEN) && (SX128X_RXEN != RADIOLIB_NC)
digitalWrite(SX128X_RXEN, LOW);
+#endif
#endif
RadioLibInterface::configHardwareForSend();
@@ -197,11 +233,21 @@ template void SX128xInterface::startReceive()
setStandby();
+#if ARCH_PORTDUINO
+ if (settingsMap[rxen] != RADIOLIB_NC) {
+ digitalWrite(settingsMap[rxen], HIGH);
+ }
+ if (settingsMap[txen] != RADIOLIB_NC) {
+ digitalWrite(settingsMap[txen], LOW);
+ }
+
+#else
#if defined(SX128X_RXEN) && (SX128X_RXEN != RADIOLIB_NC) // we have RXEN/TXEN control - turn on RX power / off TX power
digitalWrite(SX128X_RXEN, HIGH);
#endif
#if defined(SX128X_TXEN) && (SX128X_TXEN != RADIOLIB_NC)
digitalWrite(SX128X_TXEN, LOW);
+#endif
#endif
// We use the PREAMBLE_DETECTED and HEADER_VALID IRQ flag to detect whether we are actively receiving
@@ -281,4 +327,4 @@ template bool SX128xInterface::sleep()
#endif
return true;
-}
+}
\ No newline at end of file
diff --git a/src/meshUtils.h b/src/meshUtils.h
index a6436a8d59..e32ef230a1 100644
--- a/src/meshUtils.h
+++ b/src/meshUtils.h
@@ -8,5 +8,6 @@ template constexpr const T &clamp(const T &v, const T &lo, const T &hi
#if (defined(ARCH_PORTDUINO) && !defined(STRNSTR))
#define STRNSTR
+#include
char *strnstr(const char *s, const char *find, size_t slen);
#endif
\ No newline at end of file
diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp
index cc6d8e39d0..3127b09861 100644
--- a/src/modules/CannedMessageModule.cpp
+++ b/src/modules/CannedMessageModule.cpp
@@ -1,5 +1,5 @@
#include "configuration.h"
-#if ARCH_RASPBERRY_PI
+#if ARCH_PORTDUINO
#include "PortduinoGlue.h"
#endif
#if HAS_SCREEN
diff --git a/src/modules/Modules.cpp b/src/modules/Modules.cpp
index 5ed49a4d87..37c7576f6e 100644
--- a/src/modules/Modules.cpp
+++ b/src/modules/Modules.cpp
@@ -17,7 +17,7 @@
#include "modules/TextMessageModule.h"
#include "modules/TraceRouteModule.h"
#include "modules/WaypointModule.h"
-#if ARCH_RASPBERRY_PI
+#if ARCH_PORTDUINO
#include "input/LinuxInputImpl.h"
#endif
#if HAS_TELEMETRY
@@ -50,7 +50,7 @@
void setupModules()
{
if (config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER) {
-#if HAS_BUTTON || ARCH_RASPBERRY_PI
+#if HAS_BUTTON || ARCH_PORTDUINO
inputBroker = new InputBroker();
#endif
adminModule = new AdminModule();
@@ -67,7 +67,7 @@ void setupModules()
new RemoteHardwareModule();
new ReplyModule();
-#if HAS_BUTTON || ARCH_RASPBERRY_PI
+#if HAS_BUTTON || ARCH_PORTDUINO
rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1();
if (!rotaryEncoderInterruptImpl1->init()) {
delete rotaryEncoderInterruptImpl1;
@@ -85,7 +85,7 @@ void setupModules()
kbMatrixImpl->init();
#endif // INPUTBROKER_MATRIX_TYPE
#endif // HAS_BUTTON
-#if ARCH_RASPBERRY_PI
+#if ARCH_PORTDUINO
aLinuxInputImpl = new LinuxInputImpl();
aLinuxInputImpl->init();
#endif
diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp
index 5464c6c492..a13e7eba21 100644
--- a/src/platform/portduino/PortduinoGlue.cpp
+++ b/src/platform/portduino/PortduinoGlue.cpp
@@ -8,10 +8,8 @@
#include
#include
-#ifdef ARCH_RASPBERRY_PI
#include "PortduinoGlue.h"
#include "linux/gpio/LinuxGPIOPin.h"
-#include "pigpio.h"
#include "yaml-cpp/yaml.h"
#include
#include