Lots of refactoring

This commit is contained in:
2025-06-11 10:55:00 -05:00
parent a437bcf8b5
commit aaa7f0dc29
35 changed files with 1165 additions and 809 deletions

View File

@@ -22,6 +22,7 @@
#include "stdbool.h"
#include "eeprom.h"
#include "pwr_level.h"
#include "System/system.h"
extern uint8_t Test_Mode, catch_up_flag;
extern uint8_t Taps_Flag;
@@ -263,29 +264,14 @@ void FREQ_Init(void)
freq.numFrequencies = 0;
if(Test_Mode) //
if(!EE_LoadFrequencies())
{
FREQ_LoadFactoryDefaults();
// frq_update_flag = false;
}
else
{
if(!EE_LoadFrequencies())
{
FREQ_LoadFactoryDefaults();
}
}
Send_Ctrl_Word(SLP_CTRL_WRD,SDSIGNAL); // Put unused DDS to sleep
// tmp = Calc_Freq(32768);
// Load_Frq_Gen(SINGLE,tmp,0); // testing only 8KHz
// Load_Ramp(7829367); // 350KHz ramp waveform
Load_Ramp(6710886); // 300KHz ramp waveform
// Load_Ramp(20132659); // 900KHz ramp waveform
// Load_Ramp(72370199); // 3.2352MHz ramp waveform
}
@@ -684,6 +670,11 @@ FREQUENCY_t FREQ_GetFreqByIndex(uint32_t index)
return freqArray[index];
}
FREQUENCY_t* FREQ_GetFreqPointerByIndex(uint32_t index)
{
return &freqArray[index];
}
uint32_t FREQ_GetNumFrequencies(void)
{
return freq.numFrequencies;