aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-10-22 13:02:11 +0300
committerShlomo Hecht <shlomo@twine-s.com>2020-10-22 13:02:11 +0300
commit1c089e07b393722183acaee32b903df630b32862 (patch)
treea239b132f9b1b3254defce11e1498af4e20a3baf /Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
parent8e3e86feb7ceba3e87349d71398b6b5a3c82d42d (diff)
downloadTango-1c089e07b393722183acaee32b903df630b32862.tar.gz
Tango-1c089e07b393722183acaee32b903df630b32862.zip
memory saving, version 1.5.0.2
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c62
1 files changed, 42 insertions, 20 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
index 62a52bcf3..99f29d22b 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
@@ -47,7 +47,6 @@
#include "modules/Diagnostics/Diagnostics.h"
#include "Modules/General/MachineStatus.h"
-#include "drivers/Flash_Memory/Flash_Memory.h"
#include "drivers/Flash_Memory/fatfs/ff.h"
#include "drivers/Flash_ram/FlashProgram.h"
@@ -68,6 +67,12 @@
#include "drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART/WHS_Uart.h"
#include "Drivers/Uart_Comm/WHS_Controller_Comm/Shinko/ACS-13AC5E3.h"
+#include <Drivers/I2C_Communication/RFID_NFC/NFC_MainBaord.h>
+#include <Drivers/I2C_Communication/RFID_NFC/logi-tag/LT_RFID.h>
+#include <Drivers/I2C_Communication/RFID_NFC/RFIDTagInfo.h>
+#include <Drivers/I2C_Communication/RFID_NFC/I2C_IFS_Mux.h>
+#include <Drivers/I2C_Communication/RFID_NFC/NFC.h>
+
Task_Handle Millisecond_Task_Handle;
/******************** Definitions ********************************************/
@@ -600,6 +605,7 @@ uint32_t MillisecLowLoop(uint32_t tick)
{
uint8_t Motor_i,Disp_i,temp;
TEMPERATURE_SENSOR_ID_ENUM Sensor_i;
+ RFID_READER_ID readerID;
//static int temp=0;
//call all modules Millisec functions
@@ -647,6 +653,24 @@ uint32_t MillisecLowLoop(uint32_t tick)
if (m20msecTick)
{
ADC0SS0Handler();
+ /*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*/
+ /*{
+ //finish reading the setup before start reading the value
+ WHS_Shinko_Communication(R_Value); // Reading every fourth cycle (Set HW, Request, Set HW, Response)
+ }
+ }*/
}
if(Fifty_msTick)
{
@@ -696,6 +720,18 @@ uint32_t MillisecLowLoop(uint32_t tick)
}
Trigger_InputsReading();
+
+ #ifdef USE_RFID
+ //every 100 m sec
+ for(readerID = READER_1; readerID < Max_Readers ; readerID++)
+ {
+ if(DiscoverRFIDTagEvery100mSec[readerID] == true)
+ {
+ RFIDCallEvery100mSec(readerID);
+ break;
+ }
+ }
+ #endif
}
if (Gradient_Tick)
DispensersCollectionCall();
@@ -720,24 +756,6 @@ 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*/
- {
- //finish reading the setup before start reading the value
- WHS_Shinko_Communication(R_Value); // Reading every fourth cycle (Set HW, Request, Set HW, Response)
- }
- }
}
if ((O500Millisecond_Tick)&&(RapidPressureRead == false))
{
@@ -810,6 +828,10 @@ uint32_t MillisecLowLoop(uint32_t tick)
//call IFS state machine
midTankStateMachine();
+
+ #ifdef USE_RFID
+ RFIDCycleEvery1Sec();
+ #endif
}
if (Tensecond_Tick)
{
@@ -821,7 +843,6 @@ uint32_t MillisecLowLoop(uint32_t tick)
}
#endif
- Shinko_Read = true;//start cycle of R/W setup or value every 10Sec
}
if (OneMinute_Tick)
{
@@ -845,6 +866,7 @@ uint32_t MillisecLowLoop(uint32_t tick)
#ifdef CONTROL_DEBUG
ResetControlTime();
#endif
+ Shinko_Read = true;//start cycle of R/W setup or value every 10Sec
}
if (TenMinutes_Tick)
{