wu58430 2023-12-02 10:27:46 +08:00
parent 44ffc22d8a
commit 7e1d2c3392
4 changed files with 49 additions and 29 deletions

View file

@ -20,9 +20,11 @@
</configurations> </configurations>
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="cea36e80-e289-4d69-9030-7186d540ac0e" name="更改" comment="fix bug"> <list default="true" id="cea36e80-e289-4d69-9030-7186d540ac0e" name="更改" comment="掃描下翻譯">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ui/scanner.c" beforeDir="false" afterPath="$PROJECT_DIR$/ui/scanner.c" afterDir="false" /> <change beforePath="$PROJECT_DIR$/app/menu.c" beforeDir="false" afterPath="$PROJECT_DIR$/app/menu.c" afterDir="false" />
<change beforePath="$PROJECT_DIR$/settings.c" beforeDir="false" afterPath="$PROJECT_DIR$/settings.c" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ui/menu.c" beforeDir="false" afterPath="$PROJECT_DIR$/ui/menu.c" afterDir="false" />
</list> </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" />
@ -125,7 +127,7 @@
<workItem from="1701269777451" duration="21031000" /> <workItem from="1701269777451" duration="21031000" />
<workItem from="1701325367312" duration="22657000" /> <workItem from="1701325367312" duration="22657000" />
<workItem from="1701413653518" duration="3544000" /> <workItem from="1701413653518" duration="3544000" />
<workItem from="1701430185864" duration="4760000" /> <workItem from="1701430185864" duration="9460000" />
</task> </task>
<task id="LOCAL-00001" summary="bug fix"> <task id="LOCAL-00001" summary="bug fix">
<created>1701136012311</created> <created>1701136012311</created>
@ -246,7 +248,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1701432770200</updated> <updated>1701432770200</updated>
</task> </task>
<option name="localTasksCounter" value="18" /> <task id="LOCAL-00018" summary="掃描下翻譯">
<created>1701439333297</created>
<option name="number" value="00018" />
<option name="presentableId" value="LOCAL-00018" />
<option name="project" value="LOCAL" />
<updated>1701439333297</updated>
</task>
<option name="localTasksCounter" value="19" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@ -267,6 +276,7 @@
<MESSAGE value="create" /> <MESSAGE value="create" />
<MESSAGE value="rebuild chinese" /> <MESSAGE value="rebuild chinese" />
<MESSAGE value="fix bug" /> <MESSAGE value="fix bug" />
<option name="LAST_COMMIT_MESSAGE" value="fix bug" /> <MESSAGE value="掃描下翻譯" />
<option name="LAST_COMMIT_MESSAGE" value="掃描下翻譯" />
</component> </component>
</project> </project>

View file

@ -534,6 +534,7 @@ void MENU_AcceptSetting(void)
// save the channel name // save the channel name
memset(gTxVfo->Name, 0, sizeof(gTxVfo->Name)); memset(gTxVfo->Name, 0, sizeof(gTxVfo->Name));
memmove(gTxVfo->Name, edit, 10); memmove(gTxVfo->Name, edit, 10);
//bug
SETTINGS_SaveChannel(gSubMenuSelection, gEeprom.TX_VFO, gTxVfo, 3); SETTINGS_SaveChannel(gSubMenuSelection, gEeprom.TX_VFO, gTxVfo, 3);
gFlagReconfigureVfos = true; gFlagReconfigureVfos = true;
return; return;

View file

@ -207,11 +207,12 @@ void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO,
OffsetVFO = (VFO == 0) ? 0x0C80 : 0x0C90; OffsetVFO = (VFO == 0) ? 0x0C80 : 0x0C90;
OffsetVFO += (Channel - FREQ_CHANNEL_FIRST) * 32; OffsetVFO += (Channel - FREQ_CHANNEL_FIRST) * 32;
} }
//bug #4
uint8_t State[8];
if (Mode >= 2 || !IS_MR_CHANNEL(Channel)) if (Mode != 3 || !IS_MR_CHANNEL(Channel))
{ // copy VFO to a channel { // copy VFO to a channel
uint8_t State[8];
((uint32_t *)State)[0] = pVFO->freq_config_RX.Frequency; ((uint32_t *)State)[0] = pVFO->freq_config_RX.Frequency;
((uint32_t *)State)[1] = pVFO->TX_OFFSET_FREQUENCY; ((uint32_t *)State)[1] = pVFO->TX_OFFSET_FREQUENCY;
@ -237,27 +238,35 @@ void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO,
SETTINGS_UpdateChannel(Channel, pVFO, true); SETTINGS_UpdateChannel(Channel, pVFO, true);
if (IS_MR_CHANNEL(Channel)) // if (IS_MR_CHANNEL(Channel))
{ // it's a memory channel // { // it's a memory channel
//
#ifndef ENABLE_KEEP_MEM_NAME //#ifndef ENABLE_KEEP_MEM_NAME
// clear/reset the channel name // // clear/reset the channel name
//memset(&State, 0xFF, sizeof(State)); // //memset(&State, 0xFF, sizeof(State));
memset(&State, 0x00, sizeof(State)); // follow the QS way // memset(&State, 0x00, sizeof(State)); // follow the QS way
EEPROM_WriteBuffer(0x0F50 + OffsetMR, State); // EEPROM_WriteBuffer(0x0F50 + OffsetMR, State);
EEPROM_WriteBuffer(0x0F58 + OffsetMR, State); // EEPROM_WriteBuffer(0x0F58 + OffsetMR, State);
#else //#else
if (Mode >= 3) // if (Mode >= 3)
{ // save the channel name // { // save the channel name
memmove(State, pVFO->Name + 0, 8); // memmove(State, pVFO->Name + 0, 8);
EEPROM_WriteBuffer(0x0F50 + OffsetMR, State); // EEPROM_WriteBuffer(0x0F50 + OffsetMR, State);
//memset(State, 0xFF, sizeof(State)); // //memset(State, 0xFF, sizeof(State));
memset(State, 0x00, sizeof(State)); // follow the QS way // memset(State, 0x00, sizeof(State)); // follow the QS way
memmove(State, pVFO->Name + 8, 2); // memmove(State, pVFO->Name + 8, 2);
EEPROM_WriteBuffer(0x0F58 + OffsetMR, State); // EEPROM_WriteBuffer(0x0F58 + OffsetMR, State);
} // }
#endif //#endif
} // }
}else if(IS_MR_CHANNEL(Channel)&&Mode == 3)
{
memmove(State, pVFO->Name + 0, 8);
EEPROM_WriteBuffer(0x0F50 + OffsetMR, State);
//memset(State, 0xFF, sizeof(State));
memset(State, 0x00, sizeof(State)); // follow the QS way
memmove(State, pVFO->Name + 8, 2);
EEPROM_WriteBuffer(0x0F58 + OffsetMR, State);
} }
} }
} }

View file

@ -679,7 +679,7 @@ void UI_DisplayMenu(void) {
if (valid) { if (valid) {
const uint32_t frequency = BOARD_fetchChannelFrequency(gSubMenuSelection); const uint32_t frequency = BOARD_fetchChannelFrequency(gSubMenuSelection);
//bug way
if (!gIsInSubMenu || edit_index < 0) { // show the channel name if (!gIsInSubMenu || edit_index < 0) { // show the channel name
BOARD_fetchChannelName(String, gSubMenuSelection); BOARD_fetchChannelName(String, gSubMenuSelection);
if (String[0] == 0) if (String[0] == 0)