From c57f6376a149b2d02d8135ac418f30b3037e8377 Mon Sep 17 00:00:00 2001 From: Steven Osborn Date: Mon, 4 Mar 2024 20:25:25 -0800 Subject: [PATCH 1/4] Add delay so GPS and Radio have time to power up --- boards/canaryone.json | 2 +- src/main.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/boards/canaryone.json b/boards/canaryone.json index d8f966a475..da7c0986f4 100644 --- a/boards/canaryone.json +++ b/boards/canaryone.json @@ -7,7 +7,7 @@ "cpu": "cortex-m4", "extra_flags": "-DARDUINO_NRF52840_CANARY -DNRF52840_XXAA", "f_cpu": "64000000L", - "hwids": [["0x239A", "0x4405"]], + "hwids": [["0x239A", "0x4405"], ["0x239A", "0x009F"]], "usb_product": "CanaryOne", "mcu": "nrf52840", "variant": "canaryone", diff --git a/src/main.cpp b/src/main.cpp index fbfb983d24..3467dd0fca 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -529,6 +529,7 @@ void setup() digitalWrite(LED_PIN, 1 ^ LED_INVERTED); // turn on for now #endif + // Hello LOG_INFO("Meshtastic hwvendor=%d, swver=%s\n", HW_VENDOR, optstr(APP_VERSION)); @@ -540,6 +541,7 @@ void setup() nrf52Setup(); #endif + #ifdef ARCH_RP2040 rp2040Setup(); #endif @@ -679,6 +681,11 @@ void setup() digitalWrite(SX126X_ANT_SW, 1); #endif +#ifdef CANARYONE + // This is required to give the GPS time to start up + delay(500); +#endif + #ifdef ARCH_PORTDUINO if (settingsMap[use_sx1262]) { if (!rIf) { From 554acbe9d4fee5d607296e733ccd5aed316b28b0 Mon Sep 17 00:00:00 2001 From: Steven Osborn Date: Mon, 4 Mar 2024 23:29:03 -0800 Subject: [PATCH 2/4] reduce the delay a bit --- src/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 3467dd0fca..bc058d896b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -682,8 +682,9 @@ void setup() #endif #ifdef CANARYONE - // This is required to give the GPS time to start up - delay(500); + // This is required to give the GPS time to start up as this board has a separate power supply + // for the GPS and Radio which is not turned on until initVariant() is called + delay(100); #endif #ifdef ARCH_PORTDUINO From a51a29a6322eb2e19a343b8537d232c06653d14e Mon Sep 17 00:00:00 2001 From: Steven Osborn Date: Tue, 5 Mar 2024 08:07:18 -0800 Subject: [PATCH 3/4] make delay more generic / configurable --- src/main.cpp | 7 +++---- variants/canaryone/variant.h | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index bc058d896b..4a525ee42e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -681,10 +681,9 @@ void setup() digitalWrite(SX126X_ANT_SW, 1); #endif -#ifdef CANARYONE - // This is required to give the GPS time to start up as this board has a separate power supply - // for the GPS and Radio which is not turned on until initVariant() is called - delay(100); +#ifdef PIN_PWR_DELAY_MS + // This may be required to give the peripherals time to power up. + delay(PIN_PWR_DELAY_MS); #endif #ifdef ARCH_PORTDUINO diff --git a/variants/canaryone/variant.h b/variants/canaryone/variant.h index e31ba3c58f..21aa921cec 100644 --- a/variants/canaryone/variant.h +++ b/variants/canaryone/variant.h @@ -103,6 +103,9 @@ static const uint8_t A0 = PIN_A0; #define EXTERNAL_FLASH_DEVICES MX25R1635F #define EXTERNAL_FLASH_USE_QSPI +// Add a delay on startup to allow LoRa and GPS to power up +#define PIN_PWR_DELAY_MS 100 + /* * Lora radio */ From 8e2f33ef2a3acaa93245344b777265d0d69a3f11 Mon Sep 17 00:00:00 2001 From: Steven Osborn Date: Tue, 5 Mar 2024 08:09:35 -0800 Subject: [PATCH 4/4] remove whitespace changes --- src/main.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 4a525ee42e..6b542c0170 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -529,7 +529,6 @@ void setup() digitalWrite(LED_PIN, 1 ^ LED_INVERTED); // turn on for now #endif - // Hello LOG_INFO("Meshtastic hwvendor=%d, swver=%s\n", HW_VENDOR, optstr(APP_VERSION)); @@ -541,7 +540,6 @@ void setup() nrf52Setup(); #endif - #ifdef ARCH_RP2040 rp2040Setup(); #endif