Fix a frame bug with the effect Stream that after a certain time will…#5739
Fix a frame bug with the effect Stream that after a certain time will…#5739Ryrumeli wants to merge 1 commit into
Conversation
… start skipping Tested in my ESP32 Wroom. Basically, there was an oversight where the 32 bits float is tested against a temporary 16 bit variable. As soon as it extrapolates (In the highest speed for the effect in about over an hour) there is an erratic shit that happens instead of the desired effect. Just applying a similar solution to the one in Stream 2 fixed it completely.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe random stream effect now compares and stores only the low 16 bits of its iteration counter when tracking zone changes. ChangesRandom stream zone tracking
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| } | ||
|
|
||
| SEGENV.aux1 = it; | ||
| SEGENV.aux1 = it & 0xFFFF; |
There was a problem hiding this comment.
this is redundant, aux1 is uint16_t
|
thanks for finding and fixing this. looks good, the last line is unnecessary though. |
There was a problem hiding this comment.
Fix looks good to me.
As a small correction to the description: there is no float involved. The problem is a comparison it != aux1 that is performed in full 32bit, while aux1 only has 16bit, and the effect behaves erratically after some time. The patch fixes it by masking out the upper 16bits so the comparison continues to work as expected.
Tested in my ESP32 Wroom.
Basically, there was an oversight where the 32 bits float is tested against a temporary 16 bit variable. As soon as it extrapolates (In the highest speed for the effect in about over an hour) there is an erratic shit that happens instead of the desired effect. Just applying a similar solution to the one in Stream 2 fixed it completely, by using & 0xFFFF.
Working Version:

Glitch happening:

Summary by CodeRabbit