From a5797aceaa18ad3236423313a08eb97d7de2c2b1 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 28 Dec 2024 22:40:42 -0600 Subject: [PATCH] Add SE05X library --- arch/portduino/portduino.ini | 5 +++-- platformio.ini | 2 ++ src/detect/ScanI2CTwoWire.cpp | 8 ++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index aa1150e9a..27590c6f8 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -1,6 +1,6 @@ ; The Portduino based 'native' environment. Currently supported on Linux targets with real LoRa hardware (or simulated). [portduino_base] -platform = https://github.com/meshtastic/platform-native.git#562d189828f09fbf4c4093b3c0104bae9d8e9ff9 +platform = https://github.com/meshtastic/platform-native.git#6aeb5e6d3d01ad87494ac9a76bc16efe7650c2e1 framework = arduino build_src_filter = @@ -26,7 +26,7 @@ lib_deps = ${radiolib_base.lib_deps} rweather/Crypto@^0.4.0 https://github.com/lovyan03/LovyanGFX.git#1401c28a47646fe00538d487adcb2eb3c72de805 - https://github.com/pine64/libch341-spi-userspace#a9b17e3452f7fb747000d9b4ad4409155b39f6ef + https://github.com/pine64/libch341-spi-userspace#8695637adeabf5abf5601d8e82cb0ba19ce9ec46 build_flags = ${arduino_base.build_flags} @@ -34,6 +34,7 @@ build_flags = -Isrc/platform/portduino -DRADIOLIB_EEPROM_UNSUPPORTED -DPORTDUINO_LINUX_HARDWARE + -DNXP_WIRE=Wire -lpthread -lstdc++fs -lbluetooth diff --git a/platformio.ini b/platformio.ini index cd32ed179..76ba2cfe1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -97,6 +97,8 @@ lib_deps = https://github.com/meshtastic/ArduinoThread.git#1ae8778c85d0a2a729f989e0b1e7d7c4dc84eef0 nanopb/Nanopb@0.4.9 erriez/ErriezCRC32@1.0.1 + https://github.com/meshtastic/SE05X#031f8feccae62689ebbd06914b44bd88547535af + ; Used for the code analysis in PIO Home / Inspect check_tool = cppcheck diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index a786f874d..96e20999d 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -1,8 +1,8 @@ #include "ScanI2CTwoWire.h" #if !MESHTASTIC_EXCLUDE_I2C - #include "concurrency/LockGuard.h" +#include #if defined(ARCH_PORTDUINO) #include "linux/LinuxHardwareI2C.h" #endif @@ -460,6 +460,10 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) if (len == 5 && memcmp(expectedInfo, info, len) == 0) { LOG_INFO("NXP SE050 crypto chip found"); type = NXP_SE050; + if (SE05X.begin()) { + LOG_INFO("NXP Random %u", SE05X.random(65535)); + LOG_INFO("NXP Serial Number: %s", SE05X.serialNumber().c_str()); + } } else { LOG_INFO("FT6336U touchscreen found"); @@ -510,4 +514,4 @@ void ScanI2CTwoWire::logFoundDevice(const char *device, uint8_t address) { LOG_INFO("%s found at address 0x%x", device, address); } -#endif +#endif \ No newline at end of file