From 076c0f3f1aaba1088b73e72712752d7d5aa82564 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Thu, 18 Apr 2024 13:48:36 +0200 Subject: [PATCH] start in muted state --- game-ctrl/buttons.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/game-ctrl/buttons.c b/game-ctrl/buttons.c index 88e796f..183caa0 100644 --- a/game-ctrl/buttons.c +++ b/game-ctrl/buttons.c @@ -49,7 +49,7 @@ static uint8_t buttonsMoveDownPressed() { void buttonsExec(void *handle) { static uint32_t unmuteTimestamp; uint32_t currentTimestamp = getSeconds(); - static bool unmuteFlag = true; + static bool mutedFlag = true; if (! stoneIsValid()) { @@ -88,16 +88,16 @@ void buttonsExec(void *handle) { if (buttonPressed == 1) { canvasShow(); - if (! unmuteFlag) { + if (mutedFlag) { soundCtrl(SOUND_UNMUTE); - unmuteFlag = true; + mutedFlag = false; } unmuteTimestamp = currentTimestamp; } - if (unmuteFlag && (unmuteTimestamp + MUTE_DELAY < currentTimestamp)) { + if ((! mutedFlag) && (unmuteTimestamp + MUTE_DELAY < currentTimestamp)) { soundCtrl(SOUND_MUTE); - unmuteFlag = false; + mutedFlag = true; } }