From 9208a14033619d04bcac173ce86410539d741495 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Wed, 6 Mar 2024 12:47:42 +0100 Subject: [PATCH] reuse existing variable --- src/raspikeyer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/raspikeyer.cpp b/src/raspikeyer.cpp index 5fc3d6f..1f04e72 100644 --- a/src/raspikeyer.cpp +++ b/src/raspikeyer.cpp @@ -149,7 +149,8 @@ int main() // If WPM in settings is set to 0 -> take speed from poti if (settings.wpm == 0 && (currentWpm != lastWpm)) { - KeyerQueueData keyerQueueData {KeyerQueueCommand::Config, currentWpm, settings.mode, 0}; + keyerQueueData.cmd = KeyerQueueCommand::Config; + keyerQueueData.wpm = currentWpm; queue_add_blocking(&keyerQueue, &keyerQueueData); printf("WPM has changed to: %d\n", currentWpm); lastWpm = currentWpm; @@ -175,7 +176,8 @@ int main() break; } - KeyerQueueData keyerQueueData {KeyerQueueCommand::Config, currentWpm, settings.mode, 0}; + keyerQueueData.cmd = KeyerQueueCommand::Config; + keyerQueueData.mode = settings.mode; queue_add_blocking(&keyerQueue, &keyerQueueData); display.displayIambicMode(settings.mode);