4 ms·
> Yes, lack of RAM So how about using a maximal linear feedback shift register of smallest size greater than the number of songs, skipping entries that are bey
by magicalhippo 7y ago
> Yes, lack of RAM
So how about using a maximal linear feedback shift register of smallest size greater than the number of songs, skipping entries that are beyond the end of the list?
Either keep the polynomials[1] in a small list, or implement them as separate functions, invoking the one you need via a function pointer. Both approaches take just a wee bit of extra FLASH/ROM, and just a few bytes of RAM.
https://en.wikipedia.org/wiki/Linear-feedback_shift_register#Some_polynomials_for_maximal_LFSRs https://en.wikipedia.org/wiki/Linear-feedback_shift_register...