AEFeinstein / Super-2022-Swadge-FW

MIT License
10 stars 8 forks source link

Unbreak the metronome #63

Closed Brycey92 closed 4 years ago

AEFeinstein commented 4 years ago

Dangit, tAccumulatedUs is a bit of a misnomer because it does count up and down, and when it counts down, it may go negative for a moment on the 'tock'

// Subtract from tAccumulatedUs
tunernome->tAccumulatedUs -= tElapsedUs;
// If it's crossed the threshold for one beat
if(tunernome->tAccumulatedUs <= 0)
{

With that in mind, if make it signed again, this warns that you're comparing signed and unsigned variables.

if(tunernome->tAccumulatedUs >= tunernome->usPerBeat)

I'll fix that warning in master, but you really should try to nip all warnings before submitting a PR. Some warnings are dumb, I'll give you that, but they're there for a reason.