benirose / O_C-BenisphereSuite

Benisphere Suite is a continuation of Hemisphere Suite, an alternate firmware for Ornament and Crime, featuring a dual-applet framework with dozens of different modular functions.
168 stars 17 forks source link

TB-3PO gate output gets stuck #46

Open djphazer opened 1 year ago

djphazer commented 1 year ago

Sometimes, after leaving my rack powered on for a long time, the 2nd output of TB-3PO gets stuck high. Everything else appears to work fine, the pitch CV still comes out normally, I can switch to other applets and they work, but the problem persists with TB-3PO until I cycle power. It's hard to reproduce because it only happens after it's been sitting idle for probably >24 hours... but it's happened more than a few times.

My hunch is that it has something to do with the EndOfADCLag() function: bool EndOfADCLag(int ch) { return (--adc_lag_countdown[ch] == 0); }

If you overflow a regular signed int by subtracting 1, what happens? Will it eventually rollover and end up back at 0?