OpenSourceEBike / TSDZ2_wireless

TSDZ2_wireless
36 stars 11 forks source link

fix for lost sequences when calling play_next in succession #101

Closed 4var1 closed 3 years ago

4var1 commented 3 years ago

Am in training again all day today - but this is a fix of sorts. The fix will cause the led sequences to play a bit fast if you call any of the play_ functions a lot - I'll work on a better solution later this evening.

play_next - queues a sequence that will play after the currently playing (if one is playing) sequence completes.

Calling play_next in quick succession will always lose the previous 'play_next' - as it does not use the queue properly - but always queues at 'read position+1'. In other words - last writer wins.

So you should only see the last sequence if you queue lots of play_next in quick succession.

play_now - will start playing a sequence immediately - it won't wait for current playing sequence to complete.