diff --git a/app/aircopy.c b/app/aircopy.c index 9e5532f..cda195c 100644 --- a/app/aircopy.c +++ b/app/aircopy.c @@ -41,6 +41,14 @@ uint8_t gAirCopyIsSendMode; uint16_t g_FSK_Buffer[36]; +static void AIRCOPY_clear() +{ + for (uint8_t i = 0; i < 15; i++) + { + crc[i] = 0; + } +} + bool AIRCOPY_SendMessage(void) { static uint8_t gAircopySendCountdown = 1; @@ -183,12 +191,15 @@ static void AIRCOPY_Key_EXIT(bool bKeyPressed, bool bKeyHeld) } if (gInputBoxIndex == 0) { + gAircopyStep = 1; gFSKWriteIndex = 0; gAirCopyBlockNumber = 0; gInputBoxIndex = 0; - gErrorsDuringAirCopy = 0; + gErrorsDuringAirCopy = lErrorsDuringAirCopy = 0; gAirCopyIsSendMode = 0; + AIRCOPY_clear(); + BK4819_PrepareFSKReceive(); gAircopyState = AIRCOPY_TRANSFER; @@ -205,6 +216,7 @@ static void AIRCOPY_Key_MENU(bool bKeyPressed, bool bKeyHeld) return; } + gAircopyStep = 1; gFSKWriteIndex = 0; gAirCopyBlockNumber = 0; gInputBoxIndex = 0; @@ -213,6 +225,8 @@ static void AIRCOPY_Key_MENU(bool bKeyPressed, bool bKeyHeld) g_FSK_Buffer[1] = 0; g_FSK_Buffer[35] = 0xDCBA; + AIRCOPY_clear(); + GUI_DisplayScreen(); gAircopyState = AIRCOPY_TRANSFER; diff --git a/misc.c b/misc.c index 6c99d51..d8e3a89 100644 --- a/misc.c +++ b/misc.c @@ -121,6 +121,7 @@ enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx; bool gSaveRxMode = false; uint8_t crc[15] = { 0 }; uint8_t lErrorsDuringAirCopy = 0; + uint8_t gAircopyStep = 0; #endif #ifdef ENABLE_AUDIO_BAR diff --git a/misc.h b/misc.h index 9fcc6d5..bf28f1e 100644 --- a/misc.h +++ b/misc.h @@ -173,6 +173,7 @@ extern enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx; extern bool gSaveRxMode; extern uint8_t crc[15]; extern uint8_t lErrorsDuringAirCopy; + extern uint8_t gAircopyStep; #endif #ifdef ENABLE_AUDIO_BAR diff --git a/ui/aircopy.c b/ui/aircopy.c index 88e7af0..0c3da4c 100644 --- a/ui/aircopy.c +++ b/ui/aircopy.c @@ -49,6 +49,7 @@ void UI_DisplayAircopy(void) pPrintStr = "AIR COPY"; } else { pPrintStr = "AIR COPY(CMP)"; + gAircopyState = AIRCOPY_READY; } UI_PrintString(pPrintStr, 2, 127, 0, 8); @@ -78,7 +79,7 @@ void UI_DisplayAircopy(void) } // Draw gauge - if(gAircopyState != AIRCOPY_READY) + if(gAircopyStep != 0) { UI_PrintString(String, 2, 127, 5, 8);