reuse existing variable

This commit is contained in:
Martin Brodbeck 2024-03-06 12:47:42 +01:00
parent 98183b14ec
commit 9208a14033

View file

@ -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);