aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Control
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c42
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/control.c24
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/control.h1
3 files changed, 61 insertions, 6 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
index 48a28ffe4..862a0f8cf 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
@@ -113,7 +113,6 @@ static GateMutex_Handle gateMillisecDB;
uint32_t Millisec_timerBase = TIMER1_BASE; //Timer handle
/******************** Functions ********************************************/
-uint32_t Control_Delta_Position_Pass(uint32_t Current_Read,uint32_t Previous_Read);
void CalculateVOCAlarms(void);
//**********************************************************************
/******************** CODE ********************************************/
@@ -226,13 +225,18 @@ void OneMilliSecondMillisecInterrupt(UArg arg0)
return ;
}
uint32_t PT100Activity = 0;
+int32_t MillisecReadFromI2CTempSensor(uint32_t TempSensorId, MSecFptr Callback)
+{
+#warning call I2C temeratures
+ return OK;
+}
+
int32_t MillisecReadFromTempSensor(uint32_t TempSensorId, MSecFptr Callback)
{
if (TempSensorId >= MAX_MAIN_CARD_TEMP_SENS_ID) return -1;
PT100Activity++; //read request
PT100Data[TempSensorId].Callback = Callback;
PT100Data[TempSensorId].Active = true;
-
return OK;
}
//typedef uint32_t (* MSecFptr)(uint32_t deviceID, uint32_t ReadValue);
@@ -562,6 +566,8 @@ float MillisecGetPressures (int SensorId)
void setRapidPressureRead(bool value)
{
RapidPressureRead = value;
+ if (GetDiagnosticMode() == Diagnostic_Extreme_Mode)
+ RapidPressureRead = true;
}
uint16_t PumpCounter = 0;
@@ -574,11 +580,14 @@ uint32_t MillisecLowLoop(uint32_t tick)
//call all modules Millisec functions
//test dancers and speed encoders
//check all callback units (state machine waiting for completion of a change)
- bool Ten_msTick, Hundred_msTick , m90msecTick, Onesecond_Tick,OneMinute_Tick,OneHourTick;
+ bool Ten_msTick, Fifty_msTick, Hundred_msTick , m20msecTick,m70msecTick,m90msecTick, Onesecond_Tick,OneMinute_Tick,OneHourTick;
bool O100Millisecond_Tick,O200Millisecond_Tick,O400Millisecond_Tick,O500Millisecond_Tick,O600Millisecond_Tick;
//bool O100Millisecond_Tick,O200Millisecond_Tick,O400Millisecond_Tick,O500Millisecond_Tick,O600Millisecond_Tick,O800Millisecond_Tick,O900Millisecond_Tick;
Ten_msTick = (tick%eTenMillisecond == 0) ?true:false;
+ Fifty_msTick = (tick%eHundredMillisecond == 0) ?true:false; //eFiftyMillisecond
Hundred_msTick = (tick%eHundredMillisecond == 0) ?true:false;
+ m20msecTick = (tick%eHundredMillisecond == 20) ?true:false;
+ m70msecTick = (tick%eHundredMillisecond == 70) ?true:false;
m90msecTick = (tick%eHundredMillisecond == 90) ?true:false;
O100Millisecond_Tick = (tick%eOneSecond == 100) ?true:false;
O200Millisecond_Tick = (tick%eOneSecond == 200) ?true:false;
@@ -603,6 +612,29 @@ uint32_t MillisecLowLoop(uint32_t tick)
if(Machine_Idle_Mode == true)
Machine_Idle_Breathing_Led();
}
+#ifdef Use_Head_Card
+ if(Fifty_msTick)
+ {
+ Set_HeadCard_PT100();//call every 50mSec (minimum delay 30mSec)
+ }
+#endif
+#ifdef Use_Head_Card
+ if (m20msecTick) //read odd PT1000
+ {
+ for (Sensor_i = HEAD_PT100_ZONE_1_0X80_0;Sensor_i < HEAD_PT100_ZONE_2_0X80_1;Sensor_i++)
+ {
+ MillisecReadFromI2CTempSensor(Sensor_i, NULL);
+ }
+#warning call chip select replace in I2C
+ }
+ if (m70msecTick) //read odd PT1000
+ {
+ for (Sensor_i = HEAD_PT100_ZONE_2_0X80_1;Sensor_i < HEAD_PT100_RESERVE_0X8E_1;Sensor_i++)
+ {
+ MillisecReadFromI2CTempSensor(Sensor_i, NULL);
+ }
+ }
+#endif
if (m90msecTick)
{
#ifdef Use_Head_Card
@@ -645,6 +677,10 @@ uint32_t MillisecLowLoop(uint32_t tick)
}
DispensersCollectionCall();
+#ifdef Use_Head_Card
+ Head_Read_IO_Reg(0x46, HIGH);//READ HEAD CARD LS
+#endif
+
}
if (O100Millisecond_Tick)
{
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c
index d59aae8f4..b75e44001 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/control.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c
@@ -45,17 +45,27 @@
//by recieved esign flow of the user from the UI
///////////////////////////////////////////////////////////////////////////////////////////
#include "include.h"
-#include "Modules/General/GeneralHardware.h"
#include <driverlib/timer.h>
#include <inc/hw_ints.h>
+#include <PMR/Diagnostics/EventType.pb-c.h>
+
#include "drivers/adc_sampling/adc.h"
+#include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h"
+#include "drivers/FPGA/FPGA_SPI_Comm.h"
+
#include "Modules/General/buttons.h"
+#include "Modules/General/GeneralHardware.h"
+#include "Modules/AlarmHandling/AlarmHandling.h"
+
+#include "StateMachines/Printing/PrintingSTM.h"
#include "control.h"
#include "MillisecTask.h"
-#include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h"
+
+
+
/******************** Definitions ********************************************/
#define MAX_TANGO_CONTROL_DEVICES 120
/******************** STRUCTURES AND ENUMs ********************************************/
@@ -169,8 +179,16 @@ uint32_t ControlActivityLed( uint32_t Parameter1)
ACTIVITY_RED_LED_OFF; // Heaters indication - all the Heaters OFF
if(FPGA_WD_Occurred == true)
{
+ FPGA_WD_Occurred = false;
+ AlarmHandlingSetAlarm(EVENT_TYPE__FPGA_WATCHDOG_ACTIVATED,true);
+ JobEndReason = JOB_MOTOR_ALARM;
+ SendJobProgress(0.0,0,false, "Hardware Failure Error");
+ AbortJob("FPGA Watchdog Error");
+ ReportWithPackageFilter(FPGAFilter, "FPGA Watchdog Error",__FILE__,__LINE__,0,RpError, 0,0);
+
ACTIVITY_GREEN_LED_ON;
- //Motor_ReconfigAllMotors();
+ FPGA_SetMotorsInit();
+ Motor_ReconfigAllMotors();
}
else
ACTIVITY_GREEN_LED_OFF;
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.h b/Software/Embedded_SW/Embedded/Modules/Control/control.h
index 4b82aab30..78e24f495 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/control.h
+++ b/Software/Embedded_SW/Embedded/Modules/Control/control.h
@@ -17,6 +17,7 @@ typedef enum {
eNoControl = 0,
eOneMillisecond = 1,
eTenMillisecond = 10,
+ eFiftyMillisecond = 50,
eHundredMillisecond = 100,
eOneSecond = 1000,
eOneMinute = 60000,