Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TB-3PO gate output gets stuck #46

Open
djphazer opened this issue Oct 15, 2022 · 1 comment
Open

TB-3PO gate output gets stuck #46

djphazer opened this issue Oct 15, 2022 · 1 comment

Comments

@djphazer
Copy link

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?

@djphazer
Copy link
Author

oh hi, just stopping by to say I finally fixed this bug recently in my fork: djphazer@9457cb9

It was related to signed vs. unsigned type math errors, getting stuck after 36 hours... the tick counter rolls over after 72 hours, but a signed int32 will rollover at half that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant