From 362dde44b0bfb9da5316924a12a27f428bc84794 Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 26 Jan 2020 18:55:04 +0100 Subject: [PATCH] [SX126x] Added SPI transaction delay for fast platforms --- src/modules/SX126x/SX126x.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/SX126x/SX126x.cpp b/src/modules/SX126x/SX126x.cpp index 23668161..b3405914 100644 --- a/src/modules/SX126x/SX126x.cpp +++ b/src/modules/SX126x/SX126x.cpp @@ -1605,6 +1605,13 @@ int16_t SX126x::SPItransfer(uint8_t* cmd, uint8_t cmdLen, bool write, uint8_t* d RADIOLIB_VERBOSE_PRINTLN(); } RADIOLIB_VERBOSE_PRINTLN(); + #else + // some faster platforms require a short delay here + // not sure why, but it seems that long enough SPI transaction + // (e.g. setPacketParams for GFSK) will fail without it + #if defined(ARDUINO_ARCH_STM32) + delay(1); + #endif #endif // parse status