From 12975b23e543fc11396bc2a75e182f2aac1b90bb Mon Sep 17 00:00:00 2001 From: Federico Maggi Date: Wed, 21 Apr 2021 23:39:11 +0200 Subject: [PATCH] delay(1) -> delayMicroseconds(250) --- src/modules/CC1101/CC1101.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/modules/CC1101/CC1101.cpp b/src/modules/CC1101/CC1101.cpp index 5650852a..4fe96dbf 100644 --- a/src/modules/CC1101/CC1101.cpp +++ b/src/modules/CC1101/CC1101.cpp @@ -311,9 +311,9 @@ int16_t CC1101::startTransmit(uint8_t* data, size_t len, uint8_t addr) { * Does this work for all rates? If 1 ms is longer than the 1ms delay * then the entire FIFO will be transmitted during that delay. * - * TODO: drop this delay(1) or come up with a better solution: + * TODO: test this on real hardware */ - delay(1); + delayMicroseconds(250); } } @@ -388,9 +388,6 @@ int16_t CC1101::readData(uint8_t* data, size_t len) { bytesInFIFO = SPIgetRegValue(CC1101_REG_RXBYTES, 6, 0); } - // add terminating null - data[readBytes] = 0; - // check if status bytes are enabled (default: CC1101_APPEND_STATUS_ON) bool isAppendStatus = SPIgetRegValue(CC1101_REG_PKTCTRL1, 2, 2) == CC1101_APPEND_STATUS_ON;