diff --git a/src/kaleidoscope/hardware/ErgoDoxScanner.cpp b/src/kaleidoscope/hardware/ErgoDoxScanner.cpp index 630dc3d3..7ed32212 100644 --- a/src/kaleidoscope/hardware/ErgoDoxScanner.cpp +++ b/src/kaleidoscope/hardware/ErgoDoxScanner.cpp @@ -185,15 +185,16 @@ out: void ErgoDoxScanner::reattachExpanderOnError() { - static uint8_t attach_counter; + static uint32_t start_time = millis(); if (!expander_error_) return; - if (attach_counter++ != 0) + if (millis() - start_time < 5000) return; expander_error_ = initExpander(); + start_time = millis(); } }