Add function to test if serial configuration is in progress

This was formely tested all over using testing for the state of
gSerialConfigCountDown_500ms in a couple of ways. This logic have been
extracted into a function to make the code more readable.
Also testing it with > 0 was a bit misleading as the variable is
unsigned so tesing with == and != is enough.
This commit is contained in:
Juan Antonio
2023-12-09 12:23:03 +01:00
committed by egzumer
parent 4322a7d8a9
commit a153e63be1
5 changed files with 24 additions and 23 deletions

View File

@@ -107,7 +107,7 @@ void GENERIC_Key_PTT(bool bKeyPressed)
{
gInputBoxIndex = 0;
if (!bKeyPressed || gSerialConfigCountDown_500ms > 0)
if (!bKeyPressed || SerialConfigInProgress())
{ // PTT released
if (gCurrentFunction == FUNCTION_TRANSMIT)
{ // we are transmitting .. stop