diff --git a/tools/plotymlag.py b/tools/plotymlag.py index 96b5bf8..264a98d 100644 --- a/tools/plotymlag.py +++ b/tools/plotymlag.py @@ -5,7 +5,13 @@ import time size = 10 -lag = concore.tryparam("lag", 0) +lag = concore.tryparam("lag", 0) +if lag >= size: + logging.warning( + "Requested lag (%d) exceeds buffer size (%d). Clamping to %d.", + lag, size, size - 1 + ) + lag = size - 1 logging.info(f"plot ym with lag={lag}") concore.delay = 0.005