From 2ae7b3067b9c4ab86236969da1060abf3c077981 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 8 Sep 2022 21:55:53 -0400 Subject: [PATCH] wav_position modulo instead of - length --- cubesatsim/cubesatsim.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index c0688a72..ce0bf7a4 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -3484,7 +3484,7 @@ bool TimerHandler0(struct repeating_timer *t) { pwm_set_gpio_level(BPSK_PWM_PIN, (config.top + 1) * 0.5); */ if (wav_position > bufLen) { // 300) { - wav_position = wav_position - bufLen; + wav_position = wav_position % bufLen; // Serial.print("\nR"); // Serial.print(" "); // Serial.println(millis());