From c4ac0ac68b8b8b12cd03691b407e03d809e67935 Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 19 Jan 2025 21:46:00 +0100 Subject: [PATCH] [CI] Add artificial delay to unit test emulated SPI --- extras/test/unit/include/TestHal.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extras/test/unit/include/TestHal.hpp b/extras/test/unit/include/TestHal.hpp index 56b90cb6..ae98745b 100644 --- a/extras/test/unit/include/TestHal.hpp +++ b/extras/test/unit/include/TestHal.hpp @@ -196,7 +196,12 @@ class TestHal : public RadioLibHal { // process the SPI byte in[i] = this->radio->HandleSPI(out[i]); - // outpu debug + // artificial delay to emulate SPI running at a finite speed + // this is added because timeouts are based on time duration, + // so we need to make sure some time actually elapses + this->delayMicroseconds(100); + + // output debug HAL_LOG(fmt::format("out={:#02x}, in={:#02x}", out[i], in[i])); } }