aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Control
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2020-09-10 13:32:00 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2020-09-10 13:32:00 +0300
commiteee2ca563c712da4d8ef976238642b5247330740 (patch)
treec8a8a8a06cbcb118b3e71e43338cee67d7d9316e /Software/Embedded_SW/Embedded/Modules/Control
parentc794c0c66533fc6d02563444d329b8af3d0fe482 (diff)
parent6e127075e212e66a890fe130c9b9b90953c70bbd (diff)
downloadTango-eee2ca563c712da4d8ef976238642b5247330740.tar.gz
Tango-eee2ca563c712da4d8ef976238642b5247330740.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c39
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h2
2 files changed, 36 insertions, 5 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
index 327b5d19b..06434ee50 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
@@ -65,6 +65,9 @@
#include <Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.h>
#include <Drivers/I2C_Communication/I2C_Task.h>
+#include "drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART/WHS_Uart.h"
+#include "Drivers/Uart_Comm/WHS_Controller_Comm/Shinko/ACS-13AC5E3.h"
+
Task_Handle Millisecond_Task_Handle;
/******************** Definitions ********************************************/
@@ -496,9 +499,17 @@ uint32_t MillisecLoop(uint32_t tick)
#ifdef test_RTFU_dancer
test_dancer_responce_RTFU();
#else
+#ifdef FOUR_WINDERS
+ Dancer_Data[HARDWARE_DANCER_0] = Read_Dancer_Position(HARDWARE_DANCER_0);
+ Dancer_Data[HARDWARE_DANCER_1] = Read_Dancer_Position(HARDWARE_DANCER_1);
+ Dancer_Data[HARDWARE_DANCER_2] = Read_Dancer_Position(HARDWARE_DANCER_2);
+ Dancer_Data[HARDWARE_DANCER_3] = Read_Dancer_Position(HARDWARE_DANCER_3);
+ Dancer_Data[HARDWARE_DANCER_4] = Read_Dancer_Position(HARDWARE_DANCER_4);
+#else
Dancer_Data[FEEDER_DANCER] = Read_Dancer_Position(FEEDER_DANCER);
Dancer_Data[POOLER_DANCER] = Read_Dancer_Position(POOLER_DANCER);
Dancer_Data[WINDER_DANCER] = Read_Dancer_Position(WINDER_DANCER);
+#endif
#endif
#endif
@@ -582,7 +593,7 @@ void setRapidPressureRead(bool value)
if (GetDiagnosticMode() == Diagnostic_Extreme_Mode)
RapidPressureRead = true;
}
-
+bool Shinko_Read = true;
uint16_t PumpCounter = 0;
uint16_t realtimetest[101];
uint32_t MillisecLowLoop(uint32_t tick)
@@ -709,6 +720,23 @@ uint32_t MillisecLowLoop(uint32_t tick)
if (isMotorConfigured(Motor_i))
MotorGetStatusFromFPGA(Motor_i);
}
+ if ((WHS_Type == WHS_TYPE_NEW)&&(Shinko_Read == true))
+ {
+ if(ShinkoTempDeg.Read_Setup == 0x00)//didn't read it yet
+ {
+ WHS_Shinko_Communication(R_SETUP);
+ }
+ else
+ if(0)//TBD - need stop condition to write only once (all the steps) , Read_Setup != setup, Read_Setup != 0, Read_Setup != Prev_Read_Setup
+ {
+ // option to wrte + read setup and stop when read = write
+ WHS_Shinko_Communication(W_SETUP);
+ }
+ else
+ {
+ WHS_Shinko_Communication(R_Value); // Reading every fourth cycle (Set HW, Request, Set HW, Response)
+ }
+ }
}
if ((O500Millisecond_Tick)&&(RapidPressureRead == false))
{
@@ -730,9 +758,8 @@ uint32_t MillisecLowLoop(uint32_t tick)
{
//char Lenstr[160];
//static int Counter = 0;
- MachineUpdateResponseFunc();
+ //MachineUpdateResponseFunc();
//KeepAliveOneSecondCall();
-
//TemperatureListString(Lenstr);
//ReportWithPackageFilter(ThreadFilter,Lenstr,__FILE__,__LINE__,(int)Counter++,RpWarning,(int) msec_millisecondCounter,0);
for (Sensor_i = StartPT100;Sensor_i < MAX_HEAD_CARD_TEMP_SENS_ID;Sensor_i++)
@@ -767,6 +794,9 @@ uint32_t MillisecLowLoop(uint32_t tick)
}
*/
}
+ if (Head_Type == HEAD_TYPE_ARC) {
+ HeadBlowersControlLoop();
+ }
//call waste state machine
Waste_StateMachine_OneSecond_Call();
@@ -784,7 +814,7 @@ uint32_t MillisecLowLoop(uint32_t tick)
}
if (OneMinute_Tick)
{
-// MachineUpdateResponseFunc();
+ MachineUpdateResponseFunc();
/* for (Motor_i = 0;Motor_i < NUM_OF_MOTORS;Motor_i++)
{
if (Motor_i == HARDWARE_MOTOR_TYPE__MOTO_SCREW)
@@ -808,6 +838,7 @@ uint32_t MillisecLowLoop(uint32_t tick)
{
waste_seq_step1();// include 1Sec delay <- to open !!!!
}*/
+ Shinko_Read = true;
}
if (OneHourTick)
{
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h
index 226d0d57a..f7351d0b1 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h
@@ -50,7 +50,7 @@ void MillisecLogClose(void);
#endif
-
+extern bool Shinko_Read;
extern bool watchdogCriticalAlarm;
extern Task_Handle Millisecond_Task_Handle;