Skip to content

Commit 2f907f8

Browse files
committed
Removed floating point stuff
1 parent 21d5d1e commit 2f907f8

24 files changed

+146
-117
lines changed

README.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,7 @@ To enable the custom option just uncomment the line by removing the starting '#'
3434
* AM RX now allowed everywhere, although the radio really doesn't do AM, the adverts are a con !
3535
* Finer RSSI bar steps
3636
* Nicer/cleaner big numeric font than original QS big numeric font
37-
*
38-
* "MEM-CH" and "DEL-CH" menus now include channel name
39-
* "STEP" menu, added 1.25kHz option, removed 5kHz option
40-
* "TXP" menu, renamed to "TX-PWR"
41-
* "SAVE" menu, renamed to "B-SAVE"
42-
* "WX" menu, renamed to "CROS-B" ('WX' means weather here in the UK)
43-
* "ABR" menu, renamed to "BAK-LT", extended times, includes always ON option
44-
* "SCR" menu, renamed to "SCRAM"
45-
* "MIC" menu, shows mic gain in dB's, includes max mic gain possible (+15.5dB)
46-
* "VOL" menu, renamed to "BATVOL", added percentage level
47-
* "AM" menu, renamed to "MODE", shows RX modulation mode
48-
49-
Menu renames are to try and reduce 'WTF does that mean ?'
37+
* Various menu re-wordings - to try and reduce 'WTH does that mean ?'
5038

5139
# Compiler
5240

app/aircopy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static void AIRCOPY_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
136136

137137
for (i = 0; i < 7; i++)
138138
{
139-
if (Frequency >= gLowerLimitFrequencyBandTable[i] && Frequency <= gUpperLimitFrequencyBandTable[i])
139+
if (Frequency >= LowerLimitFrequencyBandTable[i] && Frequency <= UpperLimitFrequencyBandTable[i])
140140
{
141141
#ifndef DISABLE_VOICE
142142
gAnotherVoiceID = (VOICE_ID_t)Key;

app/app.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,11 +440,11 @@ void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step)
440440
{
441441
uint32_t Frequency = pInfo->ConfigRX.Frequency + (Step * pInfo->StepFrequency);
442442

443-
if (Frequency < gLowerLimitFrequencyBandTable[pInfo->Band])
444-
Frequency = FREQUENCY_FloorToStep(gUpperLimitFrequencyBandTable[pInfo->Band], pInfo->StepFrequency, gLowerLimitFrequencyBandTable[pInfo->Band]);
443+
if (Frequency < LowerLimitFrequencyBandTable[pInfo->Band])
444+
Frequency = FREQUENCY_FloorToStep(UpperLimitFrequencyBandTable[pInfo->Band], pInfo->StepFrequency, LowerLimitFrequencyBandTable[pInfo->Band]);
445445
else
446-
if (Frequency > gUpperLimitFrequencyBandTable[pInfo->Band])
447-
Frequency = gLowerLimitFrequencyBandTable[pInfo->Band];
446+
if (Frequency > UpperLimitFrequencyBandTable[pInfo->Band])
447+
Frequency = LowerLimitFrequencyBandTable[pInfo->Band];
448448

449449
pInfo->ConfigRX.Frequency = Frequency;
450450
}

app/generic.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
#include <string.h>
18+
1719
#include "app/app.h"
1820
#include "app/fm.h"
1921
#include "app/generic.h"
@@ -174,7 +176,7 @@ void GENERIC_Key_PTT(bool bKeyPressed)
174176
else
175177
gDTMF_CallMode = DTMF_CALL_MODE_DTMF;
176178

177-
sprintf(gDTMF_String, "%s", gDTMF_InputBox);
179+
strcpy(gDTMF_String, gDTMF_InputBox);
178180

179181
gDTMF_PreviousIndex = gDTMF_InputIndex;
180182
gDTMF_ReplyState = DTMF_REPLY_ANI;

app/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
104104
unsigned int i;
105105
for (i = 0; i < 7; i++)
106106
{
107-
if (Frequency >= gLowerLimitFrequencyBandTable[i] && Frequency <= gUpperLimitFrequencyBandTable[i])
107+
if (Frequency >= LowerLimitFrequencyBandTable[i] && Frequency <= UpperLimitFrequencyBandTable[i])
108108
{
109109
#ifndef DISABLE_VOICE
110110
gAnotherVoiceID = (VOICE_ID_t)Key;
@@ -123,7 +123,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
123123

124124
Frequency += 75;
125125

126-
gTxVfo->ConfigRX.Frequency = FREQUENCY_FloorToStep(Frequency, gTxVfo->StepFrequency, gLowerLimitFrequencyBandTable[gTxVfo->Band]);
126+
gTxVfo->ConfigRX.Frequency = FREQUENCY_FloorToStep(Frequency, gTxVfo->StepFrequency, LowerLimitFrequencyBandTable[gTxVfo->Band]);
127127

128128
gRequestSaveChannel = 1;
129129
return;

audio.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep)
169169
unsigned int i;
170170

171171
GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_VOICE_0);
172-
SYSTEM_DelayMs(7);
172+
SYSTEM_DelayMs(20);
173173
GPIO_ClearBit(&GPIOA->DATA, GPIOA_PIN_VOICE_0);
174174

175175
for (i = 0; i < 8; i++)
@@ -179,11 +179,12 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep)
179179
else
180180
GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_VOICE_1);
181181

182-
SYSTICK_DelayUs(1200);
182+
SYSTICK_DelayUs(1000);
183183
GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_VOICE_0);
184184
SYSTICK_DelayUs(1200);
185185
GPIO_ClearBit(&GPIOA->DATA, GPIOA_PIN_VOICE_0);
186186
VoiceID <<= 1;
187+
SYSTICK_DelayUs(200);
187188
}
188189
}
189190

board.c

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@
3939
#include "settings.h"
4040
#include "sram-overlay.h"
4141

42+
static const uint32_t gDefaultFrequencyTable[] =
43+
{
44+
14502500,
45+
14552500,
46+
43477500,
47+
43502500,
48+
43697500
49+
};
50+
4251
void BOARD_FLASH_Init(void)
4352
{
4453
FLASH_Init(FLASH_READ_MODE_1_CYCLE);
@@ -389,7 +398,7 @@ void BOARD_EEPROM_Init(void)
389398
gEeprom.KEY_2_LONG_PRESS_ACTION = (Data[4] < ACTION_OPT_LEN) ? Data[4] : ACTION_OPT_FM;
390399
gEeprom.SCAN_RESUME_MODE = (Data[5] < 3) ? Data[5] : SCAN_RESUME_CO;
391400
gEeprom.AUTO_KEYPAD_LOCK = (Data[6] < 2) ? Data[6] : false;
392-
gEeprom.POWER_ON_DISPLAY_MODE = (Data[7] < 3) ? Data[7] : POWER_ON_DISPLAY_MODE_MESSAGE;
401+
gEeprom.POWER_ON_DISPLAY_MODE = (Data[7] < 3) ? Data[7] : POWER_ON_DISPLAY_MODE_VOLTAGE;
393402

394403
// 0E98..0E9F
395404
EEPROM_ReadBuffer(0x0E98, Data, 8);
@@ -478,9 +487,6 @@ void BOARD_EEPROM_Init(void)
478487
EEPROM_ReadBuffer(0x0F40, Data, 8);
479488
gSetting_F_LOCK = (Data[0] < 6) ? Data[0] : F_LOCK_OFF;
480489

481-
gUpperLimitFrequencyBandTable = UpperLimitFrequencyBandTable;
482-
gLowerLimitFrequencyBandTable = LowerLimitFrequencyBandTable;
483-
484490
gSetting_350TX = (Data[1] < 2) ? Data[1] : false; // was true
485491
gSetting_KILLED = (Data[2] < 2) ? Data[2] : false;
486492
gSetting_200TX = (Data[3] < 2) ? Data[3] : false;
@@ -587,4 +593,17 @@ void BOARD_FactoryReset(bool bIsAll)
587593
EEPROM_WriteBuffer(i, Template);
588594
}
589595
}
596+
597+
if (bIsAll)
598+
{
599+
RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_FIRST + 5, 5, 43300000);
600+
for (i = 0; i < 5; i++)
601+
{
602+
const uint32_t Frequency = gDefaultFrequencyTable[i];
603+
gRxVfo->ConfigRX.Frequency = Frequency;
604+
gRxVfo->ConfigTX.Frequency = Frequency;
605+
gRxVfo->Band = FREQUENCY_GetBand(Frequency);
606+
SETTINGS_SaveChannel(MR_CHANNEL_FIRST + i, 0, gRxVfo, 2);
607+
}
608+
}
590609
}

firmware

-1.86 KB
Binary file not shown.

firmware.bin

-4.95 KB
Binary file not shown.

firmware.packed.bin

-4.95 KB
Binary file not shown.

0 commit comments

Comments
 (0)