shithub: dporg

Download patch

ref: b079d708225b49908129e3ea54d1bb80c004b25f
parent: 83892ec1d3be06bbbaa7d476bc554c39c120c596
author: qwx <qwx@sciops.net>
date: Wed Oct 13 15:36:18 EDT 2021

fsm: fix timer drift accelerating indefinitely

--- a/fsm.c
+++ b/fsm.c
@@ -25,6 +25,8 @@
 
 	t = nsec();
 	Δtc = (t - t0) / TΔ;
+	if(Δtc <= 0)
+		Δtc = 1;
 	tc += Δtc;
 	t0 += Δtc * TΔ;
 	return Δtc;