This commit is contained in:
wu58430 2023-12-04 17:10:44 +08:00
parent 3db141428c
commit ee072c8e5c
5 changed files with 44 additions and 22 deletions

View file

@ -20,7 +20,13 @@
</configurations> </configurations>
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="cea36e80-e289-4d69-9030-7186d540ac0e" name="更改" comment="MDC RX" /> <list default="true" id="cea36e80-e289-4d69-9030-7186d540ac0e" name="更改" comment="MDC RX">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.c" beforeDir="false" afterPath="$PROJECT_DIR$/main.c" afterDir="false" />
<change beforePath="$PROJECT_DIR$/misc.c" beforeDir="false" afterPath="$PROJECT_DIR$/misc.c" afterDir="false" />
<change beforePath="$PROJECT_DIR$/misc.h" beforeDir="false" afterPath="$PROJECT_DIR$/misc.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/radio.c" beforeDir="false" afterPath="$PROJECT_DIR$/radio.c" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -126,7 +132,7 @@
<workItem from="1701413653518" duration="3544000" /> <workItem from="1701413653518" duration="3544000" />
<workItem from="1701430185864" duration="10115000" /> <workItem from="1701430185864" duration="10115000" />
<workItem from="1701559895523" duration="22519000" /> <workItem from="1701559895523" duration="22519000" />
<workItem from="1701678199532" duration="355000" /> <workItem from="1701678199532" duration="2557000" />
</task> </task>
<task id="LOCAL-00001" summary="bug fix"> <task id="LOCAL-00001" summary="bug fix">
<created>1701136012311</created> <created>1701136012311</created>
@ -324,7 +330,21 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1701678519893</updated> <updated>1701678519893</updated>
</task> </task>
<option name="localTasksCounter" value="29" /> <task id="LOCAL-00029" summary="MDC RX">
<created>1701678580088</created>
<option name="number" value="00029" />
<option name="presentableId" value="LOCAL-00029" />
<option name="project" value="LOCAL" />
<updated>1701678580088</updated>
</task>
<task id="LOCAL-00030" summary="MDC RX">
<created>1701678635953</created>
<option name="number" value="00030" />
<option name="presentableId" value="LOCAL-00030" />
<option name="project" value="LOCAL" />
<updated>1701678635953</updated>
</task>
<option name="localTasksCounter" value="31" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">

32
main.c
View file

@ -49,7 +49,7 @@ void _putchar(char c)
void Main(void) void Main(void)
{ {
BOOT_Mode_t BootMode; //BOOT_Mode_t BootMode;
// Enable clock gating of blocks we need // Enable clock gating of blocks we need
SYSCON_DEV_CLK_GATE = 0 SYSCON_DEV_CLK_GATE = 0
@ -86,7 +86,9 @@ void Main(void)
SETTINGS_InitEEPROM(); SETTINGS_InitEEPROM();
SETTINGS_LoadCalibration(); SETTINGS_LoadCalibration();
#ifdef ENABLE_MDC1200
MDC1200_init();
#endif
RADIO_ConfigureChannel(0, VFO_CONFIGURE_RELOAD); RADIO_ConfigureChannel(0, VFO_CONFIGURE_RELOAD);
RADIO_ConfigureChannel(1, VFO_CONFIGURE_RELOAD); RADIO_ConfigureChannel(1, VFO_CONFIGURE_RELOAD);
@ -98,27 +100,23 @@ void Main(void)
BOARD_ADC_GetBatteryInfo(&gBatteryVoltages[i], &gBatteryCurrent); BOARD_ADC_GetBatteryInfo(&gBatteryVoltages[i], &gBatteryCurrent);
BATTERY_GetReadings(false); BATTERY_GetReadings(false);
#ifdef ENABLE_MDC1200
MDC1200_init();
#endif
#ifdef ENABLE_AM_FIX #ifdef ENABLE_AM_FIX
AM_fix_init(); AM_fix_init();
#endif #endif
BootMode = BOOT_GetMode(); //BootMode = BOOT_GetMode();
if (BootMode == BOOT_MODE_F_LOCK) // if (BootMode == BOOT_MODE_F_LOCK)
{ gMenuListCount = 48;
gF_LOCK = true; // flag to say include the hidden menu items
gMenuListCount = 49;
}else gMenuListCount=41;
// wait for user to release all butts before moving on // wait for user to release all butts before moving on
if (/*!GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT) ||*/ // if (/*!GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT) ||*/
KEYBOARD_Poll() != KEY_INVALID || // KEYBOARD_Poll() != KEY_INVALID ||
BootMode != BOOT_MODE_NORMAL) // BootMode != BOOT_MODE_NORMAL)
{ // keys are pressed // { // keys are pressed
UI_DisplayReleaseKeys(BootMode); // UI_DisplayReleaseKeys(BootMode);
BACKLIGHT_TurnOn(); BACKLIGHT_TurnOn();
while (KEYBOARD_Poll() != KEY_INVALID) // 500ms while (KEYBOARD_Poll() != KEY_INVALID) // 500ms
{ {
@ -126,7 +124,7 @@ void Main(void)
gKeyReading0 = KEY_INVALID; gKeyReading0 = KEY_INVALID;
gKeyReading1 = KEY_INVALID; gKeyReading1 = KEY_INVALID;
gDebounceCounter = 0; gDebounceCounter = 0;
} // }
//close PS //close PS
// if (!gChargingWithTypeC && gBatteryDisplayLevel == 0) // if (!gChargingWithTypeC && gBatteryDisplayLevel == 0)
// { // {

1
misc.c
View file

@ -226,7 +226,6 @@ bool gIsNoaaMode;
bool gUpdateDisplay; bool gUpdateDisplay;
bool gF_LOCK = false;
uint8_t gShowChPrefix; uint8_t gShowChPrefix;

1
misc.h
View file

@ -310,7 +310,6 @@ extern bool gIsNoaaMode;
#endif #endif
extern volatile bool gNextTimeslice; extern volatile bool gNextTimeslice;
extern bool gUpdateDisplay; extern bool gUpdateDisplay;
extern bool gF_LOCK;
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
extern uint8_t gFM_ChannelPosition; extern uint8_t gFM_ChannelPosition;
#endif #endif

View file

@ -780,6 +780,12 @@ void RADIO_SetupRegisters(bool switchToForeground)
BK4819_DisableDTMF(); BK4819_DisableDTMF();
BK4819_EnableDTMF(); BK4819_EnableDTMF();
InterruptMask |= BK4819_REG_3F_DTMF_5TONE_FOUND; InterruptMask |= BK4819_REG_3F_DTMF_5TONE_FOUND;
#ifdef ENABLE_MDC1200
BK4819_enable_mdc1200_rx(true);
InterruptMask |= BK4819_REG_3F_FSK_RX_SYNC | BK4819_REG_3F_FSK_RX_FINISHED | BK4819_REG_3F_FSK_FIFO_ALMOST_FULL;
#endif
} }
else else
{ {