More refactoring

Lots of things removed but compiles again
This commit is contained in:
2025-06-25 11:18:44 -05:00
parent 0556b06cab
commit 2ff7291c63
31 changed files with 1247 additions and 2569 deletions

View File

@@ -19,7 +19,6 @@
#include "spi.h"
#include "lcd.h"
#include "main.h"
#include "frq.h"
#include "pro_key.h"
#include "menu1.h"
#include "mode.h"
@@ -77,23 +76,7 @@ extern SYSTEM_DATA_t sys;
ClampData_t clampData;
void setSafeMode(bool safe)
{
sys.safeMode = safe;
//Select_Estop((safe ? ISOLATED : CONNECTED));
driver_isolateOutput(true);
if (safe)
{
//clear shift registers to known state
Port_State[MID_SR] = USB_STATE_MID; //
Port_State[BOTTOM_SR] = USB_STATE_BOT; //
Port_State[TOP_SR] = USB_STATE_TOP;
SPI0_SendBytes(Port_State, 3, EXPANDER); // Update shift register
Delay_Ticks(1);
Send_Ctrl_Word(SLP_CTRL_WRD2, SIGNAL); // Switch signal off
}
}
bool isUsbConnected(void)
{
@@ -141,7 +124,7 @@ static void init(void)
io_expanderClearAll(false);
io_backlightOn(true, NO_UPDATE);
io_ampABOn(true, NO_UPDATE);
io_connectAmpAB(true, NO_UPDATE);
io_update();
BL_ReadInfo();
@@ -199,7 +182,8 @@ int main(void)
// USB connected
if (!prevUsbConnected)
{
setSafeMode(true);
driver_setSafe(true);
//setSafeMode(true);
}
Display_USB();
@@ -214,7 +198,8 @@ int main(void)
//init();
// check that things are safe before exiting safe mode
setSafeMode(false);
//setSafeMode(false);
driver_setSafe(false);
prevUsbConnected = false;
}
}
@@ -332,80 +317,9 @@ int main(void)
Display_Update();
}
#if 0
switch (Task)
{
case PRIMARY_TASK:
pro_key(pressed); // process primary keys front 6 first menu
break;
case BAT_INSERTION_ERROR:
if(Shut_down_tmr == 0); //Display_Bat_Error();
Power_Down(); // Stores last settings and powers off
break;
case LOW_BATTERY_TASK:
if(Low_Bat_timer == 0)
Task = PWR_OFF_TASK;
break;
}
#endif
#if 0
if(old_freq != frequency && frq_chg_tmr == 0 && (!frq_update_flag))
{
Update_Frequency();
//Port_changed_flag = true;
}
if(Bat_Type == BAT_ERROR)
Task = BAT_INSERTION_ERROR;
if (Port_timer == 0)
Read_Tx_Ports(); // check for whats plugged in at the ports every 100mS.
if(Port_changed_flag)
{
Select_Output_Port();
Update_Frequency();
Init_Pwr_Level_One(); // Set power out level 1
}
if((!Check_For_Clamp_New()))
{
Check_For_Open_Circuit(); // DC mode only
}
else
{
EXPANDER_SET(BYPASS_ON, true);
//Port_State[MID_SR] |= BYPASS_ON; // Set relay to By Pass protection cap
//SPI0_SendBytes(Port_State, 3, EXPANDER); // Send_Update_Port();
}
if (Check_For_Clamp())
{
doClampPower();
}
//Send_Wireless_Data(); // Send system update to Receiver.
if (Taps_adjust_timer == 0)
Check_Taps(); // Check for optimum Taps
#endif
}