mirror of
https://github.com/meshtastic/firmware.git
synced 2026-10-09 06:31:35 -04:00
* CH341: fewer waits on the USB bus per radio command Every RadioLib command to a radio behind a CH341 waits on the USB bus about five times: the BUSY read before it, CS low, the command, CS high, and the BUSY read after, with a 1 us settle between the last two that usleep() turns into ~50 us of timer slack. - A BUSY read that follows the read that found BUSY low after a command is answered from it, once, within 1 ms and only if nothing else has been sent to the adapter in between: RadioLib's wait before a command then costs nothing after the wait that ended the last one. - Delays under 100 us spin on the steady clock instead of sleeping. - With a libch341 that has pinedio_transceive_select(), and where Lora.CS is D0, the CS levels travel with the SPI transfer and RadioLib's separate CS writes are dropped. Against an older libch341 this part compiles out. The HAL learns the radio's CS and BUSY pins from initLoRa(), since USBHal.h is included by PortduinoGlue.h ahead of portduino_config. Measured on an SX1262 over a CH341 (SHORT_TURBO, 6 v 6 runs of 300 s): the three-command CAD setup fell 1.01 -> 0.62 ms, CAD arm to air 6.60 -> 5.23 ms, and total packet loss 1.51 -> 1.13% (p=0.048), with collisions 4.83 -> 0.67 per run (p=0.002). Co-Authored-By: Jonathan Bennett <jbennett@incomsystems.biz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01REkPVFh6kvG4AZJ5A8AtM9 * Bump libch341-spi-userspace to 027cde5 for pinedio_transceive_select() Picks up libch341#6 (1 ms interrupt poll, poll thread woken on detach) and #7 (pinedio_transceive_select()), so the packed-CS path in USBHal.h builds in rather than compiling out. Co-Authored-By: Jonathan Bennett <jbennett@incomsystems.biz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01REkPVFh6kvG4AZJ5A8AtM9 --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
88 lines
3.9 KiB
INI
88 lines
3.9 KiB
INI
; The Portduino based 'native' environment. Currently supported on Linux targets with real LoRa hardware (or simulated).
|
|
[portduino_base]
|
|
platform =
|
|
# renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop
|
|
https://github.com/meshtastic/platform-native/archive/86c62edfb7084d11669aa255411a70580e83823b.zip
|
|
framework = arduino
|
|
|
|
build_src_filter =
|
|
${env.build_src_filter}
|
|
-<platform/>
|
|
+<platform/portduino>
|
|
-<platform/portduino/wasm/> ; emscripten-only sources, built by [env:native-wasm] (pio run -e native-wasm)
|
|
-<nimble/>
|
|
-<mesh/wifi/>
|
|
-<mesh/http/>
|
|
+<mesh/raspihttp/>
|
|
-<mesh/eth/>
|
|
-<modules/esp32>
|
|
|
|
lib_deps =
|
|
${env.lib_deps}
|
|
${networking_base.lib_deps}
|
|
${networking_extra.lib_deps}
|
|
${radiolib_base.lib_deps}
|
|
${environmental_base.lib_deps}
|
|
# renovate: datasource=git-refs depName=meshtastic/Crypto packageName=https://github.com/meshtastic/Crypto gitBranch=main
|
|
https://github.com/meshtastic/Crypto/archive/1c817c2f27aa4593e07d0f7e13b3dbf8d980bcae.zip
|
|
# renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX
|
|
lovyan03/LovyanGFX@1.2.28
|
|
; # renovate: datasource=git-refs depName=libch341-spi-userspace packageName=https://github.com/meshtastic/libch341-spi-userspace gitBranch=main
|
|
https://github.com/meshtastic/libch341-spi-userspace/archive/027cde5d9c0cecc91fffbd2d1ed4e41e32eeda79.zip
|
|
# renovate: datasource=custom.pio depName=adafruit/Adafruit seesaw Library packageName=adafruit/library/Adafruit seesaw Library
|
|
adafruit/Adafruit seesaw Library@1.7.9
|
|
# renovate: datasource=git-refs depName=RAK12034-BMX160 packageName=https://github.com/RAKWireless/RAK12034-BMX160 gitBranch=main
|
|
https://github.com/RAKWireless/RAK12034-BMX160/archive/dcead07ffa267d3c906e9ca4a1330ab989e957e2.zip
|
|
# renovate: datasource=github-tags depName=Adafruit_BME680 packageName=adafruit/Adafruit_BME680
|
|
https://github.com/adafruit/Adafruit_BME680/archive/refs/tags/2.0.6.zip
|
|
|
|
; Cross-platform build flags shared between native (Linux) and native-macos builds.
|
|
; Anything Linux-only (libbluetooth, libgpiod, libi2c, /sys/class/gpio,
|
|
; PORTDUINO_LINUX_HARDWARE, glibc-style _FORTIFY_SOURCE) goes in `build_flags`
|
|
; instead. UDP multicast also lives there because the firmware's
|
|
; UdpMulticastHandler.h unconditionally `#include <WiFi.h>` on non-NRF52
|
|
; targets, which requires the framework's bundled WiFi shim that we
|
|
; lib_ignore on macOS.
|
|
build_flags_common =
|
|
${arduino_base.build_flags}
|
|
-D ARCH_PORTDUINO
|
|
-fPIC
|
|
-Isrc/platform/portduino
|
|
-DRADIOLIB_EEPROM_UNSUPPORTED
|
|
-DMESHTASTIC_EXCLUDE_RTTTL ; No PWM/RTTTL ringtone playback support on this platform.
|
|
-lpthread
|
|
-lyaml-cpp
|
|
-ljsoncpp
|
|
!pkg-config --cflags jsoncpp --silence-errors || :
|
|
-luv
|
|
-std=gnu17
|
|
-std=gnu++17
|
|
-DMAX_TFT_COLOR_REGIONS=64
|
|
; Unity omits double support unless asked, compiling TEST_ASSERT_DOUBLE_* into an
|
|
; unconditional "Unity Double Precision Disabled" failure (test_gps_update_scheduling).
|
|
-DUNITY_INCLUDE_DOUBLE
|
|
|
|
build_flags =
|
|
${portduino_base.build_flags_common}
|
|
-DHAS_UDP_MULTICAST=1
|
|
-D_FORTIFY_SOURCE=2
|
|
-fstack-protector-all -Wstack-protector --param ssp-buffer-size=4
|
|
-DPORTDUINO_LINUX_HARDWARE
|
|
; BLE peripheral support via BlueZ D-Bus needs sdbus-c++; when the dev package is
|
|
; absent these lines emit nothing and BLE compiles out (HAS_BLUETOOTH stays 0,
|
|
; see src/platform/portduino/architecture.h). The second line flags the sdbus-c++
|
|
; 2.x API for src/platform/portduino/SdbusCompat.h. Scriptlet lines must not sit
|
|
; last in this list: native_base appends "-I ..." to the final line inline, and a
|
|
; trailing scriptlet would swallow it into the shell command.
|
|
!pkg-config --cflags --libs sdbus-c++ --silence-errors || :
|
|
!pkg-config --exists 'sdbus-c++ >= 2' && echo '-DMESHTASTIC_SDBUS_CPP_V2' || :
|
|
-lstdc++fs
|
|
-lbluetooth
|
|
-lgpiod
|
|
-li2c
|
|
lib_ignore =
|
|
Adafruit NeoPixel
|
|
Adafruit ST7735 and ST7789 Library
|
|
Adafruit SSD1306
|
|
SD
|