mirror of
https://github.com/armel/uv-k1-k5v3-firmware-custom.git
synced 2026-10-04 12:07:24 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15d9731611 | ||
|
|
6cb9535ca2 | ||
|
|
b8eca8810f | ||
|
|
227242567d | ||
|
|
e534610d86 | ||
|
|
f3e1a37701 | ||
|
|
75a6e20026 |
No files matched your search
+1
-1
@@ -306,7 +306,7 @@ static void LoadVoiceSamples()
|
||||
{
|
||||
gVoiceBuf[gVoiceBufWriteIndex][i] = VOICE_SAMPLES[Buf[i]];
|
||||
}
|
||||
VOCIE_BUF_ForwardWriteIndex();
|
||||
VOICE_BUF_ForwardWriteIndex();
|
||||
gVoiceBufLen++;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -97,7 +97,7 @@ void VOICE_Start()
|
||||
if (gVoiceBufLen > 0)
|
||||
{
|
||||
memcpy(DAC_Buf, gVoiceBuf[gVoiceBufReadIndex], VOICE_BUF_SIZE);
|
||||
VOCIE_BUF_ForwardReadIndex();
|
||||
VOICE_BUF_ForwardReadIndex();
|
||||
gVoiceBufLen--;
|
||||
}
|
||||
else
|
||||
@@ -110,7 +110,7 @@ void VOICE_Start()
|
||||
gVoiceBuf[gVoiceBufReadIndex], //
|
||||
VOICE_BUF_SIZE //
|
||||
);
|
||||
VOCIE_BUF_ForwardReadIndex();
|
||||
VOICE_BUF_ForwardReadIndex();
|
||||
gVoiceBufLen--;
|
||||
}
|
||||
else
|
||||
@@ -141,7 +141,7 @@ void DMA1_Channel2_3_IRQHandler()
|
||||
if (gVoiceBufLen > 0)
|
||||
{
|
||||
memcpy(DAC_Buf, gVoiceBuf[gVoiceBufReadIndex], VOICE_BUF_SIZE);
|
||||
VOCIE_BUF_ForwardReadIndex();
|
||||
VOICE_BUF_ForwardReadIndex();
|
||||
gVoiceBufLen--;
|
||||
}
|
||||
else
|
||||
@@ -158,7 +158,7 @@ void DMA1_Channel2_3_IRQHandler()
|
||||
gVoiceBuf[gVoiceBufReadIndex], //
|
||||
VOICE_BUF_SIZE //
|
||||
);
|
||||
VOCIE_BUF_ForwardReadIndex();
|
||||
VOICE_BUF_ForwardReadIndex();
|
||||
gVoiceBufLen--;
|
||||
}
|
||||
else
|
||||
|
||||
+2
-2
@@ -26,12 +26,12 @@ extern uint8_t gVoiceBufReadIndex;
|
||||
extern uint8_t gVoiceBufWriteIndex;
|
||||
extern uint8_t gVoiceBufLen;
|
||||
|
||||
static inline void VOCIE_BUF_ForwardReadIndex()
|
||||
static inline void VOICE_BUF_ForwardReadIndex()
|
||||
{
|
||||
gVoiceBufReadIndex = (1 + gVoiceBufReadIndex) % VOICE_BUF_CAP;
|
||||
}
|
||||
|
||||
static inline void VOCIE_BUF_ForwardWriteIndex()
|
||||
static inline void VOICE_BUF_ForwardWriteIndex()
|
||||
{
|
||||
gVoiceBufWriteIndex = (1 + gVoiceBufWriteIndex) % VOICE_BUF_CAP;
|
||||
}
|
||||
|
||||
+30
-1
@@ -999,7 +999,7 @@ void RADIO_SetModulation(ModulationMode_t modulation)
|
||||
mod = BK4819_AF_FM;
|
||||
break;
|
||||
case MODULATION_AM:
|
||||
mod = BK4819_AF_AM;
|
||||
mod = BK4819_AF_FM; // AM no longer needs special AF setting
|
||||
break;
|
||||
case MODULATION_USB:
|
||||
mod = BK4819_AF_BASEBAND2;
|
||||
@@ -1017,6 +1017,35 @@ void RADIO_SetModulation(ModulationMode_t modulation)
|
||||
|
||||
BK4819_SetAF(mod);
|
||||
|
||||
// HACK, FIXME:
|
||||
// What follows is a direct copy of the AM enable/disable code from
|
||||
// the original UV-K1 firmware. It is not clear why these specific register
|
||||
// values are used for AM all of a sudden instead of the AF setting like on
|
||||
// the BK4819, nor what exactly they do.
|
||||
// So for now we just keep it as is to maintain compatibility.
|
||||
//
|
||||
if (modulation != MODULATION_AM)
|
||||
{
|
||||
uint16_t uVar1 = BK4819_ReadRegister(0x31);
|
||||
BK4819_WriteRegister(0x31,uVar1 & 0xfffffffe);
|
||||
BK4819_WriteRegister(0x42,0x6b5a);
|
||||
BK4819_WriteRegister(0x43, 0x3028);
|
||||
BK4819_WriteRegister(0x2a,0x7400);
|
||||
BK4819_WriteRegister(0x2b,0);
|
||||
BK4819_WriteRegister(0x2f,0x9890);
|
||||
//BK4819_WriteRegister(0x48, 0xb3a8); // set AF RX gain and DAC settings
|
||||
}
|
||||
else
|
||||
{
|
||||
uint16_t uVar1 = BK4819_ReadRegister(0x31);
|
||||
BK4819_WriteRegister(0x31,uVar1 | 1);
|
||||
BK4819_WriteRegister(0x42,0x6f5c);
|
||||
BK4819_WriteRegister(0x43, 0x347c);
|
||||
BK4819_WriteRegister(0x2a,0x7434);
|
||||
BK4819_WriteRegister(0x2b,0x600);
|
||||
BK4819_WriteRegister(0x2f,0x9990);
|
||||
}
|
||||
|
||||
BK4819_SetRegValue(afDacGainRegSpec, 0xF);
|
||||
BK4819_WriteRegister(BK4819_REG_3D, modulation == MODULATION_USB ? 0 : 0x2AAB);
|
||||
BK4819_SetRegValue(afcDisableRegSpec, modulation != MODULATION_FM);
|
||||
|
||||
+2
-2
@@ -34,7 +34,7 @@
|
||||
"ENABLE_SHOW_CHARGE_LEVEL": false,
|
||||
"ENABLE_REVERSE_BAT_SYMBOL": false,
|
||||
"ENABLE_NO_CODE_SCAN_TIMEOUT": true,
|
||||
"ENABLE_AM_FIX": true,
|
||||
"ENABLE_AM_FIX": false,
|
||||
"ENABLE_SQUELCH_MORE_SENSITIVE": true,
|
||||
"ENABLE_FASTER_CHANNEL_SCAN": true,
|
||||
"ENABLE_RSSI_BAR": true,
|
||||
@@ -70,7 +70,7 @@
|
||||
"ENABLE_NAVIG_LEFT_RIGHT": true,
|
||||
"ENABLE_SWD": false,
|
||||
"VERSION_STRING_1": "v0.22",
|
||||
"VERSION_STRING_2": "v4.3"
|
||||
"VERSION_STRING_2": "v4.3.1"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Reference in new issue
Block a user