aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-12-10 12:20:55 +0200
committerAvi Levkovich <avi@twine-s.com>2020-12-10 12:20:55 +0200
commitafaee9a1cc07c5578aa9630963d895380d64f51b (patch)
tree1c69fd2188f53ca3d0266ab68f3d79f83d0987d5 /Software/Embedded_SW
parent322073a52f4afc5c09903a92dd1c12bd111cd040 (diff)
downloadTango-afaee9a1cc07c5578aa9630963d895380d64f51b.tar.gz
Tango-afaee9a1cc07c5578aa9630963d895380d64f51b.zip
fix idle and timing in control. remove error file for release
Diffstat (limited to 'Software/Embedded_SW')
-rw-r--r--Software/Embedded_SW/Embedded/Common/report/reportInit.c16
-rw-r--r--Software/Embedded_SW/Embedded/Communication/Container.c2
-rw-r--r--Software/Embedded_SW/Embedded/Main.c2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/control.c4
-rw-r--r--Software/Embedded_SW/Embedded/Modules/General/Safety.c2
-rw-r--r--Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c2
6 files changed, 20 insertions, 8 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/report/reportInit.c b/Software/Embedded_SW/Embedded/Common/report/reportInit.c
index 633b8ca34..d80db5d73 100644
--- a/Software/Embedded_SW/Embedded/Common/report/reportInit.c
+++ b/Software/Embedded_SW/Embedded/Common/report/reportInit.c
@@ -85,7 +85,7 @@ bool isReportActive(void)
}
uint32_t OpenLogFile(void)
{
- int len;
+ /*int len;
uint32_t Bytes = 0;
LogFileHandle = my_malloc(sizeof(FIL));
if (LogFileHandle)
@@ -105,18 +105,21 @@ uint32_t OpenLogFile(void)
else
LogFresult = FR_INT_ERR;
- return LogFresult;
+ return LogFresult;*/
+ return OK;
}
uint32_t CloseLogFile(void)
{
/* perform default error output */
- int len;
+ /*int len;
uint32_t Bytes = 0;
len = usnprintf(RepMessage, 80, "Closing Log File %s %s",__DATE__, __TIME__);
LogFresult = f_write(LogFileHandle,RepMessage,len,&Bytes );
LogFresult = f_close(LogFileHandle);
LogFileHandle = NULL;
- return LogFresult;
+ return LogFresult;*/
+ return OK;
+
}
uint32_t LogToFile(char *message, /* The formatted message */
char *FileName,
@@ -127,7 +130,7 @@ uint32_t LogToFile(char *message, /* The formatted message
{
/* print user supplied error code */
- uint32_t Bytes = 0;
+/* uint32_t Bytes = 0;
int len;
if (LogFileHandle == NULL)
return OK;
@@ -138,6 +141,9 @@ uint32_t LogToFile(char *message, /* The formatted message
f_lseek(LogFileHandle, 0);
return LogFresult;
+ */
+ return OK;
+
}
int ReportResponseFunc(char *message, /* The formatted message */
char *FileName,
diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c
index 2103c5d2f..cce9747bc 100644
--- a/Software/Embedded_SW/Embedded/Communication/Container.c
+++ b/Software/Embedded_SW/Embedded/Communication/Container.c
@@ -149,7 +149,7 @@ void receive_callback(char* buffer, size_t length)
ReportWithPackageFilter(CommFilter,"Message received", __FILE__,__LINE__,requestContainer->type, RpMessage,length, 0);
}
#endif
- if ((requestContainer->type != MESSAGE_TYPE__KeepAliveRequest)||(requestContainer->type != MESSAGE_TYPE__KeepAliveResponse))
+ if ((requestContainer->type != MESSAGE_TYPE__KeepAliveRequest)&&(requestContainer->type != MESSAGE_TYPE__KeepAliveResponse))
resetIdleCounter();
//ReportWithPackageFilter(CommFilter,"Message received", __FILE__,__LINE__,requestContainer->type, RpMessage,length, 0);
if (keepalivetest == false)
diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c
index d046df48d..16334a0ad 100644
--- a/Software/Embedded_SW/Embedded/Main.c
+++ b/Software/Embedded_SW/Embedded/Main.c
@@ -450,7 +450,7 @@ int main(void)
IDLE_TASK_package_init();
Start_InitSequence();
- PowerIdleInit();
+ //PowerIdleInit();
BIOS_start();
return (0);
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c
index e02bd8191..e6da43178 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/control.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c
@@ -83,6 +83,7 @@ typedef struct
DataReadCBFunction ControlDataReadPtr;
ControlCBFunction ControlCallbackPtr;
uint32_t ControlTiming;
+ uint32_t LastCalled;
char *Name;
}ControlDeviceStruc;
@@ -613,10 +614,13 @@ uint32_t ControlLowLoop(uint32_t tick)
{
if (tick - ControlArray[ControlLowDevice_i].StartTick<=skipped_ticks)
continue;
+ if (tick - ControlArray[ControlLowDevice_i].LastCalled<=skipped_ticks)
+ continue;
if (ControlArray[ControlLowDevice_i].ControlTiming == eOneMillisecond)
continue;
if (ControlArray[ControlLowDevice_i].StartTick == tick)
continue;
+ ControlArray[ControlLowDevice_i].LastCalled = tick;
if (((tick - ControlArray[ControlLowDevice_i].StartTick)%ControlArray[ControlLowDevice_i].ControlTiming)<=skipped_ticks) // run the control on exact intervals
{
diff --git a/Software/Embedded_SW/Embedded/Modules/General/Safety.c b/Software/Embedded_SW/Embedded/Modules/General/Safety.c
index ebbc3d326..a70866fd6 100644
--- a/Software/Embedded_SW/Embedded/Modules/General/Safety.c
+++ b/Software/Embedded_SW/Embedded/Modules/General/Safety.c
@@ -205,10 +205,10 @@ uint32_t Safety_Main_State(uint32_t IfIndex, uint32_t BusyFlag)
{
if (Check_Disp_Safety_Stop_Indication(Disp_i) == false)
{
- AlarmHandlingSetAlarm(DispenserAlarm[Disp_i], false);
if (DispenserAlarm[Disp_i] == true)
{
IDS_Dispenser_Alarm_Off(Disp_i);
+ AlarmHandlingSetAlarm(DispenserAlarm[Disp_i], false);
}
DispenserAlarm[Disp_i] = 0;
DispenserOverPressure[Disp_i] = false;
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c
index 9b722ff04..d7a49dfe0 100644
--- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c
+++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c
@@ -471,6 +471,8 @@ uint32_t InitSequenceInitialBlowerActivation(void)
Turn_the_Blower_On();//Turn on with the Default_Voltage
Control_Voltage_To_Blower(1); //stop the blower
HeadBlowersInit();
+ PowerIdleInit();
+
Task_sleep (1000);
if (WHS_Type == WHS_TYPE_NEW)