1
0
Fork 0

Only play effects on arrival, use real tag

Remove the overide of the tag value used for testing.
We don't plan yet on playing effects when a tag leaves, so avoid
playing the effects twice and only do so when arriving.
This commit is contained in:
Teo-CD 2023-12-17 21:53:36 +00:00
parent aaa2b6553c
commit a438cb13d4

View file

@ -68,12 +68,13 @@ __attribute__((noreturn)) int main() {
tagEvent = rfid.checkTags(); tagEvent = rfid.checkTags();
if (tagEvent) { if (tagEvent) {
tagEvent = 4;
Com::sendFigUpdate(tagEvent); Com::sendFigUpdate(tagEvent);
/* Start the audio first because of the possible WAV parsing delay. */ /* Currently, we only play effects when placing a new figurine. */
if (!isIdGone(tagEvent)) {
/* Start the audio first as WAV parsing might delay playback. */
speaker.playNewSound(tagEvent); speaker.playNewSound(tagEvent);
lcd.startNewAnim(tagEvent); lcd.startNewAnim(tagEvent);
}
} }
/* TODO: Drop delay, WFE+timer interrupt(s) ? */ /* TODO: Drop delay, WFE+timer interrupt(s) ? */