Compare commits
2
Commits
0.0.3
...
c90f4b843d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c90f4b843d
|
||
|
|
feff689e33
|
No files matched your search
Generated
+101
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="BackendCodeEditorSettings">
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppClangFormat/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXPRESSION/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_FOR_STMT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DECLARATION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BREAK_TEMPLATE_DECLARATION/@EntryValue" value="LINE_BREAK" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_ACCESS_SPECIFIERS_FROM_CLASS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CLASS_MEMBERS_FROM_ACCESS_SPECIFIERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_COMMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_STYLE/@EntryValue" value="Space" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INITIALIZER_BRACES/@EntryValue" value="END_OF_LINE_NO_SPACE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INT_ALIGN_EQ/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INVOCABLE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_CODE/@EntryValue" value="2" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue" value="2" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_USER_LINEBREAKS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_COLON_IN_MEMBER_INITIALIZER_LISTS/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/MEMBER_INITIALIZER_LIST_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_INDENTATION/@EntryValue" value="All" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/OTHER_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_CATCH_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_ELSE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_NAMESPACE_DEFINITIONS_ON_SAME_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_WHILE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_BLOCK_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_SEMICOLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_NESTED_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_UNARY_OPERATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_SEMICOLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BETWEEN_CLOSING_ANGLE_BRACKETS_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_ARRAY_ACCESS_BRACKETS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_DECLARATION_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_METHOD_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPECIAL_ELSE_IF_TREATMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TYPE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_BINARY_OPSIGN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ARGUMENTS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_RPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_PARAMETERS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
|
||||
<option name="/Default/CodeStyle/EditorConfig/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -394,9 +394,7 @@ endif
|
||||
ifeq ($(ENABLE_REDUCE_LOW_MID_TX_POWER),1)
|
||||
CFLAGS += -DENABLE_REDUCE_LOW_MID_TX_POWER
|
||||
endif
|
||||
ifeq ($(ENABLE_BYP_RAW_DEMODULATORS),1)
|
||||
CFLAGS += -DENABLE_BYP_RAW_DEMODULATORS
|
||||
endif
|
||||
|
||||
ifeq ($(ENABLE_BLMIN_TMP_OFF),1)
|
||||
CFLAGS += -DENABLE_BLMIN_TMP_OFF
|
||||
endif
|
||||
|
||||
+6
-2
@@ -223,9 +223,10 @@ void MSG_ConfigureFSK(bool rx) {
|
||||
(1U << 15) | (1U << 14) | (1U << 8));
|
||||
} else {
|
||||
|
||||
BK4819_WriteRegister(BK4819_REG_2B, (1u << 2) | (1u << 0));
|
||||
//BK4819_WriteRegister(BK4819_REG_2B, (1u << 2) | (1u << 0));
|
||||
}
|
||||
|
||||
|
||||
// set the FM deviation level
|
||||
const uint16_t dev_val = BK4819_ReadRegister(BK4819_REG_40);
|
||||
|
||||
@@ -257,7 +258,10 @@ void MSG_ConfigureFSK(bool rx) {
|
||||
deviation = 750; // safe fallback
|
||||
break;
|
||||
}
|
||||
BK4819_WriteRegister(BK4819_REG_40, (dev_val & 0xf000) | (deviation & 0x0fff));
|
||||
if (gCurrentVfo->CHANNEL_BANDWIDTH == BK4819_FILTER_BW_FSK_OFFLOAD) {
|
||||
BK4819_WriteRegister(BK4819_REG_40, (dev_val & 0xf000) | (deviation & 0x0fff));
|
||||
}
|
||||
|
||||
// restore FM deviation level
|
||||
//BK4819_WriteRegister(BK4819_REG_40, dev_val);
|
||||
|
||||
|
||||
+288
@@ -0,0 +1,288 @@
|
||||
//
|
||||
// Created by bruno on 3/30/25.
|
||||
//
|
||||
|
||||
#include "messages.h"
|
||||
#include "ui/ui.h"
|
||||
#include "driver/uart.h"
|
||||
#include "driver/systick.h"
|
||||
|
||||
#define T9Count 9
|
||||
|
||||
const char T9Table[10][T9Count] = {
|
||||
{'#', '(', ')', ';', ':', '<', '>', '/', '0'},
|
||||
{',', '.', '?', '&', '!', ' ', '-', '_', '1'},
|
||||
{'a', 'b', 'c', 'A', 'B', 'C', '[', ']', '2'},
|
||||
{'d', 'e', 'f', 'D', 'E', 'F', '@', '%', '3'},
|
||||
{'g', 'h', 'i', 'G', 'H', 'I', '~', '$', '4'},
|
||||
{'j', 'k', 'l', 'J', 'K', 'L', '|', '*', '5'},
|
||||
{'m', 'n', 'o', 'M', 'N', 'O', '{', '}', '6'},
|
||||
{'p', 'q', 'r', 's', 'P', 'Q', 'R', 'S', '7'},
|
||||
{'t', 'u', 'v', 'T', 'U', 'V', '"', '\'', '8'},
|
||||
{'w', 'x', 'y', 'z', 'W', 'X', 'Y', 'Z', '9'}
|
||||
};
|
||||
|
||||
|
||||
uint8_t gActiveMessage = 0;
|
||||
uint8_t gActiveMessageBank = 0;
|
||||
|
||||
StoredPacket loadedPacket;
|
||||
|
||||
uint8_t gKeyTimeout = 0;
|
||||
|
||||
void MESSAGES_SAVE() {
|
||||
uint8_t Data[8];
|
||||
EEPROM_ReadBuffer(SEQParameterEEPROM, Data, 8);
|
||||
uint8_t msgIndex = Data[1];
|
||||
if (msgIndex >= MESSAGES_COUNT) {
|
||||
msgIndex = 0;
|
||||
}
|
||||
msgIndex++;
|
||||
Data[1] = msgIndex;
|
||||
EEPROM_WriteBuffer(SEQParameterEEPROM, Data);
|
||||
EEPROM_WriteBuffer(MESSAGES_START + (msgIndex * sizeof(StoredPacket)) + 0,
|
||||
(uint8_t *) &inBoundPacket + 4); // metadata
|
||||
EEPROM_WriteBuffer(MESSAGES_START + (msgIndex * sizeof(StoredPacket)) + 8,
|
||||
(uint8_t *) &inBoundPacket + 12); // message part 1
|
||||
EEPROM_WriteBuffer(MESSAGES_START + (msgIndex * sizeof(StoredPacket)) + 16,
|
||||
(uint8_t *) &inBoundPacket + 20); // message part 2
|
||||
EEPROM_WriteBuffer(MESSAGES_START + (msgIndex * sizeof(StoredPacket)) + 24,
|
||||
(uint8_t *) &inBoundPacket + 28); // message part 3
|
||||
EEPROM_WriteBuffer(MESSAGES_START + (msgIndex * sizeof(StoredPacket)) + 32,
|
||||
(uint8_t *) &inBoundPacket + 36); // message part 4
|
||||
|
||||
}
|
||||
|
||||
void MESSAGES_GET() {
|
||||
if (gActiveMessage == MESSAGES_COUNT) {
|
||||
memcpy(&loadedPacket, (uint8_t *) &dataPacket + (sizeof(DataPacket) - sizeof(StoredPacket)),
|
||||
sizeof(StoredPacket));
|
||||
} else {
|
||||
EEPROM_ReadBuffer(MESSAGES_START + (gActiveMessage * sizeof(StoredPacket)), &loadedPacket,
|
||||
sizeof(StoredPacket));
|
||||
}
|
||||
}
|
||||
|
||||
void MESSAGES_DELETE() {
|
||||
|
||||
}
|
||||
|
||||
void updatePrevChar(KEY_Code_t Key) {
|
||||
if (Key != prevKey) {
|
||||
prevKey = 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 && Key <= KEY_9) {
|
||||
if (!bKeyHeld) {
|
||||
if (!dataPTR || dataPTR < dataPacket.data) {
|
||||
dataPTR = dataPacket.data;
|
||||
}
|
||||
}
|
||||
if (gEnteringSMS == SMS_ENTERING_MESSAGE) {
|
||||
if (bKeyPressed) {
|
||||
if (prevKey != Key) {
|
||||
dataPTR++;
|
||||
//if (dataPTR - dataPacket.data >= DataPacketDataSize) {
|
||||
if (dataPTR - dataPacket.data >= 19) {
|
||||
dataPTR = dataPacket.data;
|
||||
}
|
||||
prevLetter = 0;
|
||||
}
|
||||
*(dataPTR - 1) = T9Table[Key][prevLetter];
|
||||
if (!bKeyHeld) {
|
||||
prevLetter++;
|
||||
} else {
|
||||
prevLetter--;
|
||||
}
|
||||
prevLetter = (prevLetter) % T9Count;
|
||||
updatePrevChar(Key);
|
||||
}
|
||||
return;
|
||||
} else if (gEnteringSMS == SMS_ENTERING_DEST) {
|
||||
if (!bKeyHeld) {
|
||||
if (bKeyPressed) {
|
||||
dataPacket.dest *= 10;
|
||||
dataPacket.dest += Key;
|
||||
prevLetter = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
switch (Key) {
|
||||
case KEY_PTT:
|
||||
case KEY_MENU:
|
||||
if (gEnteringSMS == SMS_NOT_ENTERING) {
|
||||
if (bKeyPressed) {
|
||||
gEnteringSMS = SMS_ENTERING_DEST;
|
||||
updatePrevChar(Key);
|
||||
}
|
||||
} else if (gEnteringSMS == SMS_ENTERING_DEST) {
|
||||
if (bKeyPressed) {
|
||||
memset(dataPacket.data, 0, DataPacketDataSize);
|
||||
prepareDataPacket();
|
||||
dataPacket.flags = 0x80 | (gCurrentVfo->OUTPUT_POWER & 0x07);
|
||||
if (dataPacket.src == 665 || dataPacket.src == 664) {
|
||||
|
||||
uint8_t out[5];
|
||||
if (dataPacket.src == 665) {
|
||||
const uint32_t id24 = 0xFFFFFF & (dataPacket.dest >> 4);
|
||||
const uint8_t btn = 0x0F & (dataPacket.dest);
|
||||
// mask just in case
|
||||
// uint32_t id24 = 0x00A38C;
|
||||
// uint8_t btn = 0x04;
|
||||
|
||||
// 3-byte big-endian ID
|
||||
out[0] = (id24 >> 16) & 0xFF;
|
||||
out[1] = (id24 >> 8) & 0xFF;
|
||||
out[2] = (id24 >> 0) & 0xFF;
|
||||
|
||||
// first nibble redundancy copy: 0xBB if btn=0xB
|
||||
out[3] = (btn << 4) | 0x04;
|
||||
|
||||
// second copy with MSB flipped (btn ^ 0x8) in the high nibble
|
||||
out[4] = ((btn ^ 0x8) << 4);
|
||||
} else {
|
||||
out[0] = (dataPacket.dest >> 8) & 0xFF;
|
||||
out[1] = dataPacket.dest & 0xFF;
|
||||
}
|
||||
|
||||
BK4819_EnterTxMute();
|
||||
RADIO_SetTxParameters();
|
||||
|
||||
uint16_t datX = BK4819_REG_30_ENABLE_VCO_CALIB |
|
||||
BK4819_REG_30_ENABLE_UNKNOWN |
|
||||
BK4819_REG_30_DISABLE_RX_LINK |
|
||||
BK4819_REG_30_DISABLE_AF_DAC |
|
||||
BK4819_REG_30_ENABLE_DISC_MODE |
|
||||
BK4819_REG_30_ENABLE_PLL_VCO |
|
||||
BK4819_REG_30_ENABLE_PA_GAIN |
|
||||
BK4819_REG_30_DISABLE_MIC_ADC |
|
||||
BK4819_REG_30_ENABLE_TX_DSP |
|
||||
BK4819_REG_30_DISABLE_RX_DSP;
|
||||
BK4819_WriteRegister(BK4819_REG_30,
|
||||
datX);
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, false);
|
||||
SYSTEM_DelayMs(20);
|
||||
|
||||
for (unsigned int x = 0; x < 15; x++) {
|
||||
for (unsigned int y = 0; y < (dataPacket.src == 665 ? 5 : 2); y++) {
|
||||
for (unsigned char i = 7; i < 8; i--) {
|
||||
if ((out[y] >> i) & 1) {
|
||||
// datX |= BK4819_REG_30_ENABLE_PA_GAIN;
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, true);
|
||||
SYSTICK_DelayUs(400 * (dataPacket.src == 665 ? 3 : 2) - 325);
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, false);
|
||||
// datX &= ~BK4819_REG_30_ENABLE_PA_GAIN;
|
||||
SYSTICK_DelayUs(400 * 1 - 325);
|
||||
} else {
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, true);
|
||||
// datX |= BK4819_REG_30_ENABLE_PA_GAIN;
|
||||
SYSTICK_DelayUs(400 * 1 - 325);
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, false);
|
||||
// datX &= ~BK4819_REG_30_ENABLE_PA_GAIN;
|
||||
SYSTICK_DelayUs(400 * (dataPacket.src == 665 ? 3 : 2) - 325);
|
||||
}
|
||||
}
|
||||
}
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, false);
|
||||
SYSTEM_DelayMs((dataPacket.src == 665 ? 3 : 15));
|
||||
}
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, false);
|
||||
SYSTEM_DelayMs(100);
|
||||
BK4819_WriteRegister(BK4819_REG_30, 0xC1FE);
|
||||
gEnteringSMS = SMS_NOT_ENTERING;
|
||||
} else {
|
||||
gEnteringSMS = SMS_ENTERING_MESSAGE;
|
||||
}
|
||||
}
|
||||
return;
|
||||
} else if (gEnteringSMS == SMS_ENTERING_MESSAGE) {
|
||||
if (bKeyPressed) {
|
||||
if (strlen((char *) dataPacket.data)) {
|
||||
MSG_FSKSendData(&dataPacket);
|
||||
gEnteringSMS = SMS_NOT_ENTERING;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case KEY_UP:
|
||||
if (gEnteringSMS == SMS_NOT_ENTERING) {
|
||||
if (bKeyPressed) {
|
||||
gActiveMessageBank++;
|
||||
gActiveMessage = gActiveMessageBank * 3;
|
||||
if (gActiveMessage > MESSAGES_COUNT) {
|
||||
gActiveMessage = 0;
|
||||
}
|
||||
if (gActiveMessageBank >= MESSAGES_COUNT / 3) {
|
||||
gActiveMessageBank = 0;
|
||||
}
|
||||
MESSAGES_GET();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KEY_DOWN:
|
||||
if (gEnteringSMS == SMS_NOT_ENTERING) {
|
||||
if (bKeyPressed) {
|
||||
gActiveMessageBank--;
|
||||
gActiveMessage = gActiveMessageBank * 3;
|
||||
if (gActiveMessage >= MESSAGES_COUNT) {
|
||||
gActiveMessage = MESSAGES_COUNT - 1;
|
||||
}
|
||||
if (gActiveMessageBank > MESSAGES_COUNT / 3) {
|
||||
gActiveMessageBank = MESSAGES_COUNT / 3 - 1;
|
||||
}
|
||||
MESSAGES_GET();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KEY_EXIT:
|
||||
if (gEnteringSMS != SMS_NOT_ENTERING) {
|
||||
if (bKeyHeld) {
|
||||
if (bKeyPressed) {
|
||||
gEnteringSMS = SMS_NOT_ENTERING;
|
||||
dataPTR = dataPacket.data;
|
||||
memset(dataPacket.data, 0, DataPacketDataSize);
|
||||
}
|
||||
} else {
|
||||
if (bKeyPressed) {
|
||||
if (gEnteringSMS == SMS_ENTERING_MESSAGE) {
|
||||
if (dataPacket.data <= dataPTR) {
|
||||
*dataPTR = '\0';
|
||||
if (dataPacket.data < dataPTR) {
|
||||
dataPTR--;
|
||||
}
|
||||
*dataPTR = '\0';
|
||||
}
|
||||
} else if (gEnteringSMS == SMS_ENTERING_DEST) {
|
||||
dataPacket.dest /= 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (bKeyPressed) {
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
}
|
||||
}
|
||||
updatePrevChar(Key);
|
||||
break;
|
||||
default:
|
||||
if (!bKeyHeld && bKeyPressed)
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// Created by bruno on 3/30/25.
|
||||
//
|
||||
|
||||
//#ifndef BRNQUANFW_MESSAGES_H
|
||||
//#define BRNQUANFW_MESSAGES_H
|
||||
#include "fskmodem.h"
|
||||
#include "../driver/keyboard.h"
|
||||
#include "../driver/eeprom.h"
|
||||
|
||||
#define MESSAGES_START (0x1C08)
|
||||
#define MESSAGES_COUNT (12)
|
||||
|
||||
typedef struct {
|
||||
uint32_t src;
|
||||
uint8_t seq;
|
||||
uint8_t ttl;
|
||||
uint8_t flags;
|
||||
uint8_t data[DataPacketDataSize];
|
||||
} StoredPacket;
|
||||
|
||||
extern uint8_t gActiveMessage;
|
||||
extern uint8_t gActiveMessageBank;
|
||||
|
||||
extern StoredPacket loadedPacket;
|
||||
|
||||
extern uint8_t gKeyTimeout;
|
||||
|
||||
void MESSAGES_GET();
|
||||
void MESSAGES_DELETE();
|
||||
void MESSAGES_SAVE();
|
||||
void MESSAGES_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld);
|
||||
void MESSAGES_TimeSlice500ms(void);
|
||||
|
||||
//#endif //BRNQUANFW_MESSAGES_H
|
||||
+3
-1
@@ -676,7 +676,9 @@ void BK4819_SetFilterBandwidth(const BK4819_FilterBandwidth_t Bandwidth, const b
|
||||
*/
|
||||
}
|
||||
|
||||
BK4819_WriteRegister(BK4819_REG_43, val);
|
||||
if (Bandwidth != BK4819_FILTER_BW_FSK_OFFLOAD) {
|
||||
BK4819_WriteRegister(BK4819_REG_43, val);
|
||||
}
|
||||
}
|
||||
|
||||
void BK4819_SetupPowerAmplifier(const uint8_t bias, const uint32_t frequency)
|
||||
|
||||
+2
-1
@@ -48,7 +48,8 @@ enum BK4819_FilterBandwidth_t
|
||||
{
|
||||
BK4819_FILTER_BW_WIDE = 0,
|
||||
BK4819_FILTER_BW_NARROW,
|
||||
BK4819_FILTER_BW_NARROWER
|
||||
BK4819_FILTER_BW_NARROWER,
|
||||
BK4819_FILTER_BW_FSK_OFFLOAD
|
||||
};
|
||||
|
||||
typedef enum BK4819_FilterBandwidth_t BK4819_FilterBandwidth_t;
|
||||
|
||||
@@ -50,10 +50,19 @@ const char gModulationStr[MODULATION_UKNOWN][4] = {
|
||||
[MODULATION_AM]="AM",
|
||||
[MODULATION_USB]="USB",
|
||||
|
||||
#ifdef ENABLE_BYP_RAW_DEMODULATORS
|
||||
[MODULATION_BYP]="BYP",
|
||||
[MODULATION_RAW]="RAW"
|
||||
#endif
|
||||
[MODULATION_RAW]="RAW",
|
||||
|
||||
[MODULATION_ALAM]="ALM",
|
||||
[MODULATION_BEEP]="BEE",
|
||||
[MODULATION_CTCO]="CTC",
|
||||
[MODULATION_FSK]="FSA",
|
||||
[MODULATION_UNK4]="UN4",
|
||||
[MODULATION_UNK5]="UN5",
|
||||
[MODULATION_UNK6]="UN6",
|
||||
[MODULATION_UNK7]="UN7",
|
||||
[MODULATION_UNK8]="UN8",
|
||||
[MODULATION_UNK9]="UN9",
|
||||
};
|
||||
|
||||
bool RADIO_CheckValidChannel(uint16_t channel, bool checkScanList, uint8_t scanList) {
|
||||
@@ -799,6 +808,7 @@ void RADIO_SetTxParameters(void) {
|
||||
case BK4819_FILTER_BW_WIDE:
|
||||
case BK4819_FILTER_BW_NARROW:
|
||||
case BK4819_FILTER_BW_NARROWER:
|
||||
case BK4819_FILTER_BW_FSK_OFFLOAD:
|
||||
#ifdef ENABLE_AM_FIX
|
||||
// BK4819_SetFilterBandwidth(Bandwidth, gCurrentVfo->Modulation == MODULATION_AM && gSetting_AM_fix);
|
||||
BK4819_SetFilterBandwidth(Bandwidth, true);
|
||||
@@ -859,14 +869,45 @@ void RADIO_SetModulation(ModulationMode_t modulation) {
|
||||
mod = BK4819_AF_BASEBAND2;
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_BYP_RAW_DEMODULATORS
|
||||
case MODULATION_BYP:
|
||||
mod = BK4819_AF_UNKNOWN3;
|
||||
break;
|
||||
case MODULATION_RAW:
|
||||
mod = BK4819_AF_BASEBAND1;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case MODULATION_ALAM:
|
||||
mod = BK4819_AF_ALAM;
|
||||
break;
|
||||
case MODULATION_BEEP:
|
||||
mod = BK4819_AF_BEEP;
|
||||
break;
|
||||
case MODULATION_CTCO:
|
||||
mod = BK4819_AF_CTCO;
|
||||
break;
|
||||
case MODULATION_FSK:
|
||||
mod = BK4819_AF_FSKO;
|
||||
break;
|
||||
case MODULATION_UNK4:
|
||||
mod = BK4819_AF_UNKNOWN4;
|
||||
break;
|
||||
case MODULATION_UNK5:
|
||||
mod = BK4819_AF_UNKNOWN5;
|
||||
break;
|
||||
case MODULATION_UNK6:
|
||||
mod = BK4819_AF_UNKNOWN6;
|
||||
break;
|
||||
case MODULATION_UNK7:
|
||||
mod = BK4819_AF_UNKNOWN7;
|
||||
break;
|
||||
case MODULATION_UNK8:
|
||||
mod = BK4819_AF_UNKNOWN8;
|
||||
break;
|
||||
case MODULATION_UNK9:
|
||||
mod = BK4819_AF_UNKNOWN9;
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
BK4819_SetAF(mod);
|
||||
|
||||
@@ -59,10 +59,19 @@ typedef enum {
|
||||
MODULATION_AM,
|
||||
MODULATION_USB,
|
||||
|
||||
#ifdef ENABLE_BYP_RAW_DEMODULATORS
|
||||
MODULATION_BYP,
|
||||
MODULATION_RAW,
|
||||
#endif
|
||||
|
||||
MODULATION_ALAM,
|
||||
MODULATION_BEEP,
|
||||
MODULATION_CTCO,
|
||||
MODULATION_FSK,
|
||||
MODULATION_UNK4,
|
||||
MODULATION_UNK5,
|
||||
MODULATION_UNK6,
|
||||
MODULATION_UNK7,
|
||||
MODULATION_UNK8,
|
||||
MODULATION_UNK9,
|
||||
|
||||
MODULATION_UKNOWN
|
||||
} ModulationMode_t;
|
||||
|
||||
@@ -876,9 +876,7 @@ void SETTINGS_WriteBuildOptions(void) {
|
||||
#ifdef ENABLE_WIDE_RX
|
||||
| (1 << 1)
|
||||
#endif
|
||||
#ifdef ENABLE_BYP_RAW_DEMODULATORS
|
||||
| (1 << 2)
|
||||
#endif
|
||||
#ifdef ENABLE_BLMIN_TMP_OFF
|
||||
| (1 << 3)
|
||||
#endif
|
||||
|
||||
@@ -987,7 +987,7 @@ void UI_DisplayMain(void) {
|
||||
|
||||
#if ENABLE_FEAT_F4HWN
|
||||
|
||||
const char *bandWidthNames[] = {"WID", "NAR", "NR+"};
|
||||
const char *bandWidthNames[] = {"WID", "NAR", "NR+", "FSK"};
|
||||
UI_PrintStringSmallNormal(bandWidthNames[vfoInfo->CHANNEL_BANDWIDTH], LCD_WIDTH + 30, 0,
|
||||
line);
|
||||
|
||||
|
||||
@@ -168,7 +168,8 @@ const char gSubMenu_W_N[][5] =
|
||||
{
|
||||
"WIDE",
|
||||
"NARR",
|
||||
"NAR+"
|
||||
"NAR+",
|
||||
"FSKQ"
|
||||
};
|
||||
|
||||
const char gSubMenu_OFF_ON[][4] =
|
||||
|
||||
@@ -126,7 +126,7 @@ extern const t_menu_item MenuList[];
|
||||
|
||||
extern const char gSubMenu_TXP[7][5];
|
||||
extern const char gSubMenu_SFT_D[3][4];
|
||||
extern const char gSubMenu_W_N[3][5];
|
||||
extern const char gSubMenu_W_N[4][5];
|
||||
extern const char gSubMenu_OFF_ON[2][4];
|
||||
extern const char gSubMenu_NA[4];
|
||||
extern const char *const gSubMenu_RXMode[4];
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// Created by bruno on 3/30/25.
|
||||
//
|
||||
|
||||
#include "messages.h"
|
||||
|
||||
|
||||
// Convert a 32-bit number to a string (10 digits, zero-padded)
|
||||
void u32_to_str(uint32_t num, char *str) {
|
||||
for (int i = 9; i >= 0; i--) {
|
||||
str[i] = '0' + (num % 10);
|
||||
num /= 10;
|
||||
}
|
||||
str[10] = '\0';
|
||||
}
|
||||
|
||||
// Convert an 8-bit number to a 2-digit string (zero-padded)
|
||||
void u8_to_str(uint8_t num, char *str) {
|
||||
str[0] = '0' + (num / 100); // Hundreds place
|
||||
str[1] = '0' + ((num / 10) % 10); // Tens place
|
||||
str[2] = '0' + (num % 10); // Ones place
|
||||
str[3] = '\0';
|
||||
}
|
||||
|
||||
|
||||
void UI_DisplayMessages(void) {
|
||||
char String[19];
|
||||
UI_DisplayClear();
|
||||
if (gEnteringSMS != SMS_NOT_ENTERING) {
|
||||
if (gEnteringSMS == SMS_ENTERING_DEST) {
|
||||
UI_PrintString("SMS dest", 0, 0, 0 /*, 8 */);
|
||||
u32_to_str(dataPacket.dest, String);
|
||||
UI_PrintStringSmallNormal(String, 0, 0, 2);
|
||||
} else if (gEnteringSMS == SMS_ENTERING_MESSAGE) {
|
||||
UI_PrintString("SMS data", 0, 0, 0 /*, 8 */);
|
||||
UI_PrintStringSmallNormal((const char *) dataPacket.data, 1, 0, 1);
|
||||
memset(gFrameBuffer[1] + 2 + (7 * strlen((const char *) dataPacket.data)), gKeyTimeout == 0 ? 0xFF : 0x80,
|
||||
6);
|
||||
}
|
||||
} else {
|
||||
uint8_t Data[8];
|
||||
EEPROM_ReadBuffer(SEQParameterEEPROM, Data, 8);
|
||||
uint8_t msgIndex = Data[1]; // index of latest written message
|
||||
|
||||
// Determine oldest message index (next to be overwritten)
|
||||
uint8_t startIndex = (msgIndex + 1) % MESSAGES_COUNT;
|
||||
|
||||
// Each bank shows 3 messages
|
||||
uint8_t messagesPerPage = 3;
|
||||
|
||||
// Compute offset for scrolling (0 = newest, higher = older)
|
||||
uint8_t pageOffset = gActiveMessageBank * messagesPerPage;
|
||||
|
||||
for (uint8_t ixa = 0; ixa < messagesPerPage; ixa++) {
|
||||
// Logical order from oldest to newest
|
||||
uint8_t logicalIndex = (startIndex + pageOffset + ixa) % MESSAGES_COUNT;
|
||||
|
||||
// If out of stored range, stop
|
||||
if (pageOffset + ixa >= MESSAGES_COUNT)
|
||||
break;
|
||||
|
||||
gActiveMessage = logicalIndex;
|
||||
MESSAGES_GET();
|
||||
|
||||
// Build the display string
|
||||
u32_to_str(gActiveMessage == MESSAGES_COUNT ? dataPacket.dest : loadedPacket.src, &String[0]);
|
||||
String[10] = '-';
|
||||
u8_to_str(loadedPacket.seq, &String[11]);
|
||||
String[14] = '-';
|
||||
|
||||
// Display a visual index (0,1,2,3... not EEPROM slot)
|
||||
uint8_t visualIndex = ixa + (gActiveMessageBank * 3);
|
||||
String[15] = (visualIndex < 10) ? ('0' + visualIndex) : ('A' + visualIndex - 10);
|
||||
String[16] = '-';
|
||||
String[17] = (gActiveMessage < 10) ? ('0' + gActiveMessage) : ('A' + gActiveMessage - 10);
|
||||
String[18] = 0;
|
||||
|
||||
// Print both metadata and message
|
||||
UI_PrintString(String, 2, 0, ixa * 2);
|
||||
UI_PrintString((const char *) loadedPacket.data, 2, 0, ixa * 2 + 1);
|
||||
}
|
||||
}
|
||||
ST7565_BlitFullScreen();
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// Created by bruno on 3/30/25.
|
||||
//
|
||||
|
||||
#ifndef BRNQUANFW_MESSAGES_H
|
||||
#define BRNQUANFW_MESSAGES_H
|
||||
#include "stdio.h"
|
||||
#include "helper.h"
|
||||
#include "../driver/st7565.h"
|
||||
#include "string.h"
|
||||
#include "../app/messages.h"
|
||||
#include "../app/fskmodem.h"
|
||||
|
||||
void UI_DisplayMessages(void);
|
||||
void u8_to_str(uint8_t num, char *str);
|
||||
void u32_to_str(uint32_t num, char *str);
|
||||
|
||||
#endif //BRNQUANFW_MESSAGES_H
|
||||
Reference in New Issue
Block a user