Fix potential bug with wait loops

This commit is contained in:
Pascal Langer committed 2020-12-10 16:52:34 +01:00
1 parent 2b0f663482
commit ebb8a33c1a
5 files changed
+7 -7

No files matched your search

+1 -1
View File
@@ -451,7 +451,7 @@ uint16_t WK_cb()
}
packet_sent = 0;
uint8_t start=micros();
while ((uint8_t)micros()-start < 100) // Wait max 100µs
while ((uint8_t)((uint8_t)micros()-start) < 100) // Wait max 100µs
if(CYRF_ReadRegister(CYRF_04_TX_IRQ_STATUS) & 0x02)
break;
if((packet_count & 0x03) == 0)