0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 14:48:03 +03:00

Removed floating point stuff

This commit is contained in:
OneOfEleven
2023-09-13 02:01:35 +01:00
parent 21d5d1ee15
commit 2f907f82f8
24 changed files with 146 additions and 117 deletions

View File

@ -136,7 +136,7 @@ static void AIRCOPY_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
for (i = 0; i < 7; i++)
{
if (Frequency >= gLowerLimitFrequencyBandTable[i] && Frequency <= gUpperLimitFrequencyBandTable[i])
if (Frequency >= LowerLimitFrequencyBandTable[i] && Frequency <= UpperLimitFrequencyBandTable[i])
{
#ifndef DISABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;

View File

@ -440,11 +440,11 @@ void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step)
{
uint32_t Frequency = pInfo->ConfigRX.Frequency + (Step * pInfo->StepFrequency);
if (Frequency < gLowerLimitFrequencyBandTable[pInfo->Band])
Frequency = FREQUENCY_FloorToStep(gUpperLimitFrequencyBandTable[pInfo->Band], pInfo->StepFrequency, gLowerLimitFrequencyBandTable[pInfo->Band]);
if (Frequency < LowerLimitFrequencyBandTable[pInfo->Band])
Frequency = FREQUENCY_FloorToStep(UpperLimitFrequencyBandTable[pInfo->Band], pInfo->StepFrequency, LowerLimitFrequencyBandTable[pInfo->Band]);
else
if (Frequency > gUpperLimitFrequencyBandTable[pInfo->Band])
Frequency = gLowerLimitFrequencyBandTable[pInfo->Band];
if (Frequency > UpperLimitFrequencyBandTable[pInfo->Band])
Frequency = LowerLimitFrequencyBandTable[pInfo->Band];
pInfo->ConfigRX.Frequency = Frequency;
}

View File

@ -14,6 +14,8 @@
* limitations under the License.
*/
#include <string.h>
#include "app/app.h"
#include "app/fm.h"
#include "app/generic.h"
@ -174,7 +176,7 @@ void GENERIC_Key_PTT(bool bKeyPressed)
else
gDTMF_CallMode = DTMF_CALL_MODE_DTMF;
sprintf(gDTMF_String, "%s", gDTMF_InputBox);
strcpy(gDTMF_String, gDTMF_InputBox);
gDTMF_PreviousIndex = gDTMF_InputIndex;
gDTMF_ReplyState = DTMF_REPLY_ANI;

View File

@ -104,7 +104,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
unsigned int i;
for (i = 0; i < 7; i++)
{
if (Frequency >= gLowerLimitFrequencyBandTable[i] && Frequency <= gUpperLimitFrequencyBandTable[i])
if (Frequency >= LowerLimitFrequencyBandTable[i] && Frequency <= UpperLimitFrequencyBandTable[i])
{
#ifndef DISABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
@ -123,7 +123,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
Frequency += 75;
gTxVfo->ConfigRX.Frequency = FREQUENCY_FloorToStep(Frequency, gTxVfo->StepFrequency, gLowerLimitFrequencyBandTable[gTxVfo->Band]);
gTxVfo->ConfigRX.Frequency = FREQUENCY_FloorToStep(Frequency, gTxVfo->StepFrequency, LowerLimitFrequencyBandTable[gTxVfo->Band]);
gRequestSaveChannel = 1;
return;