Start implementing ack
All checks were successful
Build Firmware / build (push) Successful in 1m1s

This commit is contained in:
2025-04-01 14:47:18 +02:00
parent 0ea8767a8b
commit 7b1d31fdef
7 changed files with 110 additions and 47 deletions

View File

@@ -26,6 +26,8 @@ uint8_t gActiveMessage = 0;
StoredPacket loadedPacket;
uint8_t gKeyTimeout = 0;
void MESSAGES_SAVE() {
uint8_t Data[8];
EEPROM_ReadBuffer(SEQParameterEEPROM, Data, 8);
@@ -36,15 +38,15 @@ void MESSAGES_SAVE() {
Data[1]++;
EEPROM_WriteBuffer(SEQParameterEEPROM, Data);
EEPROM_WriteBuffer(MESSAGES_START + (msgIndex * sizeof(StoredPacket)) + 0,
(uint8_t *) &inBoundPacket + 4); // metadata
(uint8_t * ) & inBoundPacket + 4); // metadata
EEPROM_WriteBuffer(MESSAGES_START + (msgIndex * sizeof(StoredPacket)) + 8,
(uint8_t *) &inBoundPacket + 12); // message part 1
(uint8_t * ) & inBoundPacket + 12); // message part 1
EEPROM_WriteBuffer(MESSAGES_START + (msgIndex * sizeof(StoredPacket)) + 16,
(uint8_t *) &inBoundPacket + 20); // message part 2
(uint8_t * ) & inBoundPacket + 20); // message part 2
EEPROM_WriteBuffer(MESSAGES_START + (msgIndex * sizeof(StoredPacket)) + 24,
(uint8_t *) &inBoundPacket + 28); // message part 3
(uint8_t * ) & inBoundPacket + 28); // message part 3
EEPROM_WriteBuffer(MESSAGES_START + (msgIndex * sizeof(StoredPacket)) + 32,
(uint8_t *) &inBoundPacket + 36); // message part 4
(uint8_t * ) & inBoundPacket + 36); // message part 4
}
@@ -63,8 +65,15 @@ void updatePrevChar(KEY_Code_t Key) {
}
void MESSAGES_TimeSlice500ms(void) {
if (gKeyTimeout && gKeyTimeout++ > 2) {
gKeyTimeout = 0;
prevKey = KEY_EXIT;
}
}
void MESSAGES_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) {
gKeyTimeout = 1;
if (gEnteringSMS != SMS_NOT_ENTERING && !bKeyHeld && Key <= KEY_9) {
if (!dataPTR || dataPTR < dataPacket.data) {
dataPTR = dataPacket.data;
@@ -105,7 +114,7 @@ void MESSAGES_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) {
if (bKeyPressed) {
memset(dataPacket.data, 0, DataPacketDataSize);
prepareDataPacket();
dataPacket.flags = 126;
dataPacket.flags = 0x80 | (gCurrentVfo->OUTPUT_POWER & 0x07);
gEnteringSMS = SMS_ENTERING_MESSAGE;
}
return;
@@ -176,10 +185,10 @@ void MESSAGES_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) {
}
} else {
if (bKeyPressed) {
updatePrevChar(Key);
gRequestDisplayScreen = DISPLAY_MAIN;
}
}
updatePrevChar(Key);
break;
default:
if (!bKeyHeld && bKeyPressed)