diff --git a/src/main/java/com/rusefi/dfu/DfuConnectionUtil.java b/src/main/java/com/rusefi/dfu/DfuConnectionUtil.java index db6489e..e4102e1 100644 --- a/src/main/java/com/rusefi/dfu/DfuConnectionUtil.java +++ b/src/main/java/com/rusefi/dfu/DfuConnectionUtil.java @@ -10,8 +10,9 @@ public class DfuConnectionUtil { while (state.getState() == DfuCommandGetStatus.State.DFU_DOWNLOAD_BUSY || state.getState() == DfuCommandGetStatus.State.DFU_ERROR) { state = DfuCommandGetStatus.read(logger, device); logger.info("Loop state " + state); - if (System.currentTimeMillis() - enter > 10 * DfuConnection.SECOND) - throw new IllegalStateException("State does not look good"); + long durationMs = System.currentTimeMillis() - enter; + if (durationMs > 10 * DfuConnection.SECOND) + throw new IllegalStateException("State does not look good after " + durationMs + "ms, still " + state); } }