0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 06:39:49 +03:00

aircopy update

This commit is contained in:
OneOfEleven
2023-10-12 12:58:58 +01:00
parent e05e17f8c9
commit 0b606e6425
5 changed files with 30 additions and 24 deletions

View File

@ -27,6 +27,8 @@
#include "ui/inputbox.h"
#include "ui/ui.h"
#define AIR_COPY_MAX_BLOCK 120
static const uint16_t Obfuscation[8] = {0x6C16, 0xE614, 0x912E, 0x400D, 0x3521, 0x40D5, 0x0313, 0x80E9};
aircopy_state_t g_aircopy_state;
@ -47,9 +49,9 @@ void AIRCOPY_SendMessage(void)
for (i = 0; i < 34; i++)
g_fsk_buffer[i + 1] ^= Obfuscation[i % 8];
if (++g_air_copy_block_number >= 0x78)
if (++g_air_copy_block_number >= AIR_COPY_MAX_BLOCK)
{
g_aircopy_state = AIRCOPY_COMPLETE;
g_aircopy_state = AIRCOPY_TX_COMPLETE;
g_update_display = true;
}
@ -104,12 +106,11 @@ void AIRCOPY_StorePacket(void)
if (Offset == 0x1E00)
{
g_aircopy_state = AIRCOPY_COMPLETE;
g_aircopy_state = AIRCOPY_RX_COMPLETE;
g_update_display = true;
}
g_air_copy_block_number++;
return;
}
}

View File

@ -26,7 +26,8 @@ enum aircopy_state_e
AIRCOPY_READY = 0,
AIRCOPY_RX,
AIRCOPY_TX,
AIRCOPY_COMPLETE
AIRCOPY_RX_COMPLETE,
AIRCOPY_TX_COMPLETE
};
typedef enum aircopy_state_e aircopy_state_t;