shithub: pt2-clone

Download patch

ref: a442a3da8d17be98ece8c9508be9388c062eee9b
parent: 168a867bfa878c26edfbc5547cf69d4333d73416
author: Olav Sørensen <olav.sorensen@live.no>
date: Fri Oct 14 13:50:34 EDT 2022

Sanity checking

--- a/src/pt2_scopes.c
+++ b/src/pt2_scopes.c
@@ -1,3 +1,4 @@
+#include <assert.h>
 #include <stdint.h>
 #include <stdbool.h>
 #include <math.h> // modf()
@@ -83,6 +84,7 @@
 
 void scopeSetPeriod(int32_t ch, int32_t period)
 {
+	assert(period >= 113 && period <= 65535);
 	scope[ch].dDelta = (PAULA_PAL_CLK / (double)SCOPE_HZ) / period;
 }