diff --git a/Display.h b/Display.h index 5fe4c0e..3686ff8 100644 --- a/Display.h +++ b/Display.h @@ -33,31 +33,31 @@ void busyCallback(const void* p) { display_callback(); } #define DISPLAY_BLACK GxEPD_BLACK #define DISPLAY_WHITE GxEPD_WHITE -#elif DISPLAY == ADAFRUIT_TFT +#elif DISPLAY_TYPE == ADAFRUIT_TFT // t-deck #include #define DISPLAY_WHITE ST77XX_WHITE #define DISPLAY_BLACK ST77XX_BLACK -#elif DISPLAY == TFT +#elif DISPLAY_TYPE == TFT // t114 #include "src/display/ST7789.h" #define DISPLAY_WHITE ST77XX_WHITE #define DISPLAY_BLACK ST77XX_BLACK #define COLOR565(r, g, b) (((r & 0xF8) << 8) | ((g & 0xFC) << 3) | ((b & 0xF8) >> 3)) -#elif DISPLAY == MONO_OLED +#elif DISPLAY_TYPE == MONO_OLED // tbeam_s #include #define DISPLAY_WHITE SH110X_WHITE #define DISPLAY_BLACK SH110X_BLACK #endif -#if DISPLAY == EINK_BW +#if DISPLAY_TYPE == EINK_BW // use GxEPD2 because adafruit EPD support for partial refresh is bad #include #include -#elif DISPLAY == EINK_3C +#elif DISPLAY_TYPE == EINK_3C #include #include #endif diff --git a/Makefile b/Makefile index 3a86441..44a0e9e 100644 --- a/Makefile +++ b/Makefile @@ -158,6 +158,11 @@ firmware-heltec_t114: firmware-heltec_t114_gps: arduino-cli compile --log --fqbn Heltec_nRF52:Heltec_nRF52:HT-n5262 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3C\" \"-DBOARD_VARIANT=0xCB\"" + +firmware-heltec_meshpocket: + arduino-cli compile --log --fqbn Heltec_nRF52:Heltec_nRF52:HT-n5262-e213 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x46\"" + + upload-tbeam: arduino-cli upload -p $(or $(port), /dev/ttyACM0) --fqbn esp32:esp32:t-beam @sleep 1 diff --git a/RNode_Firmware_CE.ino b/RNode_Firmware_CE.ino index d02da4c..368d96b 100644 --- a/RNode_Firmware_CE.ino +++ b/RNode_Firmware_CE.ino @@ -16,6 +16,8 @@ #include #include #include "Utilities.h" +#define BOARD_MODEL BOARD_HELTEC_MESHP // MeshPocket +#include "Boards.h" #if MCU_VARIANT == MCU_NRF52 #if BOARD_MODEL == BOARD_RAK4631 || BOARD_MODEL == BOARD_OPENCOM_XL @@ -59,7 +61,13 @@ // INTERFACE_SPI is only required on NRF52 platforms, as the SPI pins are set in the class constructor and not by a setter method. // Even if custom SPI interfaces are not needed, the array must exist to prevent compilation errors. #define INTERFACE_SPI -SPIClass interface_spi[1]; +// MeshPocket has only one radio → use SPIM0 and the pins you already defined +SPIClass interface_spi[1] = { + SPIClass(NRF_SPIM0, // hardware block + interface_pins[0][3], // MISO → 23 + interface_pins[0][1], // SCK → 19 + interface_pins[0][2]) // MOSI → 22 +}; #endif FIFOBuffer serialFIFO; diff --git a/Radio.hpp b/Radio.hpp index f798e92..d957586 100644 --- a/Radio.hpp +++ b/Radio.hpp @@ -60,8 +60,13 @@ #define RSSI_OFFSET 157 +#ifdef PHY_HEADER_LORA_SYMBOLS +#undef PHY_HEADER_LORA_SYMBOLS +#endif #define PHY_HEADER_LORA_SYMBOLS 8 + + #define MODEM_TIMEOUT_MULT 1.5 // Status flags @@ -98,7 +103,7 @@ public: _csma_slot_ms(CSMA_SLOT_MIN_MS), _preambleLength(LORA_PREAMBLE_SYMBOLS_MIN), _lora_symbol_time_ms(0.0), _lora_preamble_time_ms(0), _lora_header_time_ms(0), _lora_symbol_rate(0.0), _lora_us_per_byte(0.0), _bitrate(0), - _packet{0}, _onReceive(NULL), _txp(0), _ldro(false), _limit_rate(false), _interference_detected(false), _avoid_interference(true), _difs_ms(CSMA_SIFS_MS + 2 * _csma_slot_ms), _difs_wait_start(0), _cw_wait_start(0), _cw_wait_target(0), _cw_wait_passed(0), _csma_cw(-1), _cw_band(1), _cw_min(0), _cw_max(CSMA_CW_PER_BAND_WINDOWS), _noise_floor_sampled(false), _noise_floor_sample(0), _noise_floor_buffer({0}), _noise_floor(-292), _led_id_filter(0), _preamble_detected_at(0) {}; + _packet{0}, _onReceive(NULL), _txp(0), _ldro(false), _limit_rate(false), _interference_detected(false), _avoid_interference(true), _difs_ms(CSMA_SIFS_MS + 2 * _csma_slot_ms), _difs_wait_start(0), _cw_wait_start(0), _cw_wait_target(0), _cw_wait_passed(0), _csma_cw(-1), _cw_band(1), _cw_min(0), _cw_max(CSMA_CW_PER_BAND_WINDOWS), _noise_floor_sampled(false), _noise_floor_sample(0), _noise_floor_buffer{0}, _noise_floor(-292), _led_id_filter(0), _preamble_detected_at(0) {}; virtual void reset() = 0;