[lightwaverf] Fix millis overflow in send timeout check (#14294)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Jonathan Swoboda
2026-02-25 15:11:52 -05:00
committed by GitHub
parent 3dcc9ab765
commit a60e5c5c4f

View File

@@ -31,13 +31,12 @@ void LightWaveRF::read_tx() {
void LightWaveRF::send_rx(const std::vector<uint8_t> &msg, uint8_t repeats, bool inverted, int u_sec) {
this->lwtx_.lwtx_setup(pin_tx_, repeats, inverted, u_sec);
uint32_t timeout = 0;
uint32_t timeout = millis();
if (this->lwtx_.lwtx_free()) {
this->lwtx_.lwtx_send(msg);
timeout = millis();
ESP_LOGD(TAG, "[%i] msg start", timeout);
}
while (!this->lwtx_.lwtx_free() && millis() < (timeout + 1000)) {
while (!this->lwtx_.lwtx_free() && millis() - timeout < 1000) {
delay(10);
}
timeout = millis() - timeout;