From 1cfbcc73745b7c80f1d7cdd024bc49e35515a268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 25 Feb 2026 11:21:15 +0100 Subject: [PATCH 1/2] Cleanup: remove trailing whitespace and ensure final newline Remove trailing whitespace, and ensure that files end in a newline. No functional changes. --- variants/t1000-e/T1000eBoard.cpp | 2 +- variants/t1000-e/t1000e_sensors.h | 2 +- variants/t1000-e/target.cpp | 18 +++++++++--------- variants/t1000-e/variant.h | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/variants/t1000-e/T1000eBoard.cpp b/variants/t1000-e/T1000eBoard.cpp index 0d390f798..b05568da2 100644 --- a/variants/t1000-e/T1000eBoard.cpp +++ b/variants/t1000-e/T1000eBoard.cpp @@ -20,4 +20,4 @@ void T1000eBoard::begin() { Wire.begin(); delay(10); // give sx1262 some time to power up -} \ No newline at end of file +} diff --git a/variants/t1000-e/t1000e_sensors.h b/variants/t1000-e/t1000e_sensors.h index e8f790b66..993eba508 100644 --- a/variants/t1000-e/t1000e_sensors.h +++ b/variants/t1000-e/t1000e_sensors.h @@ -6,4 +6,4 @@ // see : https://github.com/Seeed-Studio/Seeed-Tracker-T1000-E-for-LoRaWAN-dev-board extern uint32_t t1000e_get_light(); -extern float t1000e_get_temperature(); \ No newline at end of file +extern float t1000e_get_temperature(); diff --git a/variants/t1000-e/target.cpp b/variants/t1000-e/target.cpp index da8fa48bb..790a77e31 100644 --- a/variants/t1000-e/target.cpp +++ b/variants/t1000-e/target.cpp @@ -26,26 +26,26 @@ static const uint32_t rfswitch_dios[Module::RFSWITCH_MAX_PINS] = { RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6, RADIOLIB_LR11X0_DIO7, - RADIOLIB_LR11X0_DIO8, + RADIOLIB_LR11X0_DIO8, RADIOLIB_NC }; static const Module::RfSwitchMode_t rfswitch_table[] = { // mode DIO5 DIO6 DIO7 DIO8 - { LR11x0::MODE_STBY, {LOW, LOW, LOW, LOW }}, + { LR11x0::MODE_STBY, {LOW, LOW, LOW, LOW }}, { LR11x0::MODE_RX, {HIGH, LOW, LOW, HIGH }}, { LR11x0::MODE_TX, {HIGH, HIGH, LOW, HIGH }}, { LR11x0::MODE_TX_HP, {LOW, HIGH, LOW, HIGH }}, - { LR11x0::MODE_TX_HF, {LOW, LOW, LOW, LOW }}, + { LR11x0::MODE_TX_HF, {LOW, LOW, LOW, LOW }}, { LR11x0::MODE_GNSS, {LOW, LOW, HIGH, LOW }}, - { LR11x0::MODE_WIFI, {LOW, LOW, LOW, LOW }}, + { LR11x0::MODE_WIFI, {LOW, LOW, LOW, LOW }}, END_OF_MODE_TABLE, }; #endif bool radio_init() { //rtc_clock.begin(Wire); - + #ifdef LR11X0_DIO3_TCXO_VOLTAGE float tcxo = LR11X0_DIO3_TCXO_VOLTAGE; #else @@ -60,7 +60,7 @@ bool radio_init() { Serial.println(status); return false; // fail } - + radio.setCRC(2); radio.explicitHeader(); @@ -97,7 +97,7 @@ mesh::LocalIdentity radio_new_identity() { void T1000SensorManager::start_gps() { gps_active = true; //_nmea->begin(); - // this init sequence should be better + // this init sequence should be better // comes from seeed examples and deals with all gps pins pinMode(GPS_EN, OUTPUT); digitalWrite(GPS_EN, HIGH); @@ -105,12 +105,12 @@ void T1000SensorManager::start_gps() { pinMode(GPS_VRTC_EN, OUTPUT); digitalWrite(GPS_VRTC_EN, HIGH); delay(10); - + pinMode(GPS_RESET, OUTPUT); digitalWrite(GPS_RESET, HIGH); delay(10); digitalWrite(GPS_RESET, LOW); - + pinMode(GPS_SLEEP_INT, OUTPUT); digitalWrite(GPS_SLEEP_INT, HIGH); pinMode(GPS_RTC_INT, OUTPUT); diff --git a/variants/t1000-e/variant.h b/variants/t1000-e/variant.h index 458f12bcc..60ca56afd 100644 --- a/variants/t1000-e/variant.h +++ b/variants/t1000-e/variant.h @@ -98,7 +98,7 @@ #define LORA_SCLK (PIN_SPI_SCK) // P0.11 #define LORA_MISO (PIN_SPI_MISO) // P1.8 #define LORA_MOSI (PIN_SPI_MOSI) // P0.9 - + #define LR11X0_DIO_AS_RF_SWITCH true #define LR11X0_DIO3_TCXO_VOLTAGE 1.6 @@ -133,4 +133,4 @@ // Buzzer #define BUZZER_EN (37) // P1.5 -#define BUZZER_PIN (25) // P0.25 \ No newline at end of file +#define BUZZER_PIN (25) // P0.25 From fa9396a12b7a642e253b53bcc06e589726529bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 25 Feb 2026 11:31:05 +0100 Subject: [PATCH 2/2] T1000-E: switch to ui-new The compiler is switched from `examples/companion_radio/ui-orig` to `examples/companion_radio/ui-new`. The handling of the momentary button was switched from `T1000eBoard::buttonStateChanged()` to a `MomentaryButton` in `variants/t1000-e/target.cpp`. Everything still seems to work properly. I briefly tested the room server and repeater modes, and did a bit more testing of the companion (USB & BLE) modes. --- variants/t1000-e/T1000eBoard.cpp | 2 -- variants/t1000-e/T1000eBoard.h | 12 ------------ variants/t1000-e/platformio.ini | 12 ++++++------ variants/t1000-e/target.cpp | 8 ++++++++ variants/t1000-e/target.h | 7 +++++++ 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/variants/t1000-e/T1000eBoard.cpp b/variants/t1000-e/T1000eBoard.cpp index b05568da2..4f54012e6 100644 --- a/variants/t1000-e/T1000eBoard.cpp +++ b/variants/t1000-e/T1000eBoard.cpp @@ -5,11 +5,9 @@ void T1000eBoard::begin() { NRF52BoardDCDC::begin(); - btn_prev_state = HIGH; #ifdef BUTTON_PIN pinMode(BATTERY_PIN, INPUT); - pinMode(BUTTON_PIN, INPUT); pinMode(LED_PIN, OUTPUT); #endif diff --git a/variants/t1000-e/T1000eBoard.h b/variants/t1000-e/T1000eBoard.h index 492236077..e44f429b4 100644 --- a/variants/t1000-e/T1000eBoard.h +++ b/variants/t1000-e/T1000eBoard.h @@ -6,7 +6,6 @@ class T1000eBoard : public NRF52BoardDCDC { protected: - uint8_t btn_prev_state; public: T1000eBoard() : NRF52Board("T1000E_OTA") {} @@ -38,17 +37,6 @@ class T1000eBoard : public NRF52BoardDCDC { return "Seeed Tracker T1000-E"; } - int buttonStateChanged() { - #ifdef BUTTON_PIN - uint8_t v = digitalRead(BUTTON_PIN); - if (v != btn_prev_state) { - btn_prev_state = v; - return (v == LOW) ? 1 : -1; - } - #endif - return 0; - } - void powerOff() override { #ifdef HAS_GPS digitalWrite(GPS_VRTC_EN, LOW); diff --git a/variants/t1000-e/platformio.ini b/variants/t1000-e/platformio.ini index ac9293086..d5f018eec 100644 --- a/variants/t1000-e/platformio.ini +++ b/variants/t1000-e/platformio.ini @@ -37,7 +37,7 @@ upload_protocol = nrfutil [env:t1000e_repeater] extends = t1000-e build_flags = ${t1000-e.build_flags} - -I examples/companion_radio/ui-orig + -I examples/companion_radio/ui-new -D ADVERT_NAME='"t1000-e Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -53,7 +53,7 @@ lib_deps = ${t1000-e.lib_deps} [env:t1000e_room_server] extends = t1000-e build_flags = ${t1000-e.build_flags} - -I examples/companion_radio/ui-orig + -I examples/companion_radio/ui-new -D ADVERT_NAME='"t1000-e Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -72,7 +72,7 @@ extends = t1000-e board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${t1000-e.build_flags} - -I examples/companion_radio/ui-orig + -I examples/companion_radio/ui-new -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 ; -D MESH_PACKET_LOGGING=1 @@ -84,7 +84,7 @@ build_flags = ${t1000-e.build_flags} build_src_filter = ${t1000-e.build_src_filter} + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + +<../examples/companion_radio/ui-new/*.cpp> lib_deps = ${t1000-e.lib_deps} densaugeo/base64 @ ~1.4.0 stevemarple/MicroNMEA @ ^2.0.6 @@ -95,7 +95,7 @@ extends = t1000-e board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld board_upload.maximum_size = 708608 build_flags = ${t1000-e.build_flags} - -I examples/companion_radio/ui-orig + -I examples/companion_radio/ui-new -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D BLE_PIN_CODE=123456 @@ -112,7 +112,7 @@ build_src_filter = ${t1000-e.build_src_filter} + + +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> + +<../examples/companion_radio/ui-new/*.cpp> lib_deps = ${t1000-e.lib_deps} densaugeo/base64 @ ~1.4.0 stevemarple/MicroNMEA @ ^2.0.6 diff --git a/variants/t1000-e/target.cpp b/variants/t1000-e/target.cpp index 790a77e31..f4a0b50f3 100644 --- a/variants/t1000-e/target.cpp +++ b/variants/t1000-e/target.cpp @@ -17,6 +17,14 @@ T1000SensorManager sensors = T1000SensorManager(nmea); NullDisplayDriver display; #endif +#ifdef PIN_USER_BTN + MomentaryButton user_btn(PIN_USER_BTN, + /*long_press_mills=*/1000, + /*reverse=*/(USER_BTN_PRESSED==LOW), + /*pulldownup=*/false, + /*multiclick=*/true); +#endif + #ifndef LORA_CR #define LORA_CR 5 #endif diff --git a/variants/t1000-e/target.h b/variants/t1000-e/target.h index d4e3c02c5..fa8264793 100644 --- a/variants/t1000-e/target.h +++ b/variants/t1000-e/target.h @@ -11,6 +11,9 @@ #ifdef DISPLAY_CLASS #include "NullDisplayDriver.h" #endif +#ifdef PIN_USER_BTN + #include +#endif class T1000SensorManager: public SensorManager { bool gps_active = false; @@ -35,6 +38,10 @@ class T1000SensorManager: public SensorManager { extern NullDisplayDriver display; #endif +#ifdef PIN_USER_BTN + extern MomentaryButton user_btn; +#endif + extern T1000eBoard board; extern WRAPPER_CLASS radio_driver; extern VolatileRTCClock rtc_clock;