Skip to content

Commit

Permalink
Add delay so GPS and Radio have time to power up (#3334)
Browse files Browse the repository at this point in the history
* Add delay so GPS and Radio have time to power up

* reduce the delay a bit

* make delay more generic / configurable

* remove whitespace changes
  • Loading branch information
lolsborn authored Mar 7, 2024
1 parent 2dd751e commit c860493
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion boards/canaryone.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,11 @@ void setup()
digitalWrite(SX126X_ANT_SW, 1);
#endif

#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
if (settingsMap[use_sx1262]) {
if (!rIf) {
Expand Down
3 changes: 3 additions & 0 deletions variants/canaryone/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit c860493

Please sign in to comment.