aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-12-27 12:09:52 +0200
committerShlomo Hecht <shlomo@twine-s.com>2018-12-27 12:09:52 +0200
commit2769e72857ebc543d8f40a3cbca218f2f010a77d (patch)
treeb35fc9781886083ffad35a17dffee947cfdb1800 /Software/Embedded_SW
parent637d6a416fa3ba7784a8ebb2a28fb169d8baa574 (diff)
downloadTango-2769e72857ebc543d8f40a3cbca218f2f010a77d.tar.gz
Tango-2769e72857ebc543d8f40a3cbca218f2f010a77d.zip
Version 1.3.0.8 changes for connection resiliance: priorities, diagnostics and alarm handling
Diffstat (limited to 'Software/Embedded_SW')
-rw-r--r--Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c2
-rw-r--r--Software/Embedded_SW/Embedded/Communication/CommunicationTask.c2
-rw-r--r--Software/Embedded_SW/Embedded/Communication/Container.c2
-rw-r--r--Software/Embedded_SW/Embedded/Embedded.cfg38
-rw-r--r--Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c8
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c22
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c2
-rw-r--r--Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c6
-rw-r--r--Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c6
9 files changed, 46 insertions, 42 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c
index eadfdd1d0..1bbd5a8ad 100644
--- a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c
+++ b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c
@@ -20,7 +20,7 @@ typedef struct
} TangoVersion_t;
-TangoVersion_t _gTangoVersion = {001,003,000,006};
+TangoVersion_t _gTangoVersion = {1,3,0,8};
#define BUILD_DATE __DATE__
char Dat[50] = BUILD_DATE;
char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//d
diff --git a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c
index 5afc618ff..eb4ebbaf1 100644
--- a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c
+++ b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c
@@ -126,7 +126,7 @@ uint32_t CommunicationTaskMessageReceived(uint32_t buffer,uint16_t msgSize)
* this communication task is created statically in system initialization, in blocking mode
* over one of the chosen ommunication methods (USB or Blutooth).
******************************************************************************/
-uint32_t cLength[50] = {0};
+uint32_t cLength[51] = {0};
byte cindex = 0;
void communicationTask(UArg arg0, UArg arg1)
{
diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c
index 0c3ad2f8e..8543f0493 100644
--- a/Software/Embedded_SW/Embedded/Communication/Container.c
+++ b/Software/Embedded_SW/Embedded/Communication/Container.c
@@ -76,7 +76,7 @@ MessageContainer createContainer(MessageType type, char* token, protobuf_c_boole
container.data.data = response_buffer;
container.data.len = response_size;
- if (SuspendLargeMessages == true)
+ // if (SuspendLargeMessages == true)
{
// Report("EndJobMessage",__FILE__,__LINE__,(int)type,RpWarning,(int)response_size,0);
TxmsgId[Txindex] = type;
diff --git a/Software/Embedded_SW/Embedded/Embedded.cfg b/Software/Embedded_SW/Embedded/Embedded.cfg
index 240a79a6f..f12df421c 100644
--- a/Software/Embedded_SW/Embedded/Embedded.cfg
+++ b/Software/Embedded_SW/Embedded/Embedded.cfg
@@ -122,16 +122,17 @@ ControlTaskParams.stackSize = 2048;
ControlTaskParams.priority = 11;
Program.global.control = Task.create("&controlTask", ControlTaskParams);
-var CommRxTaskParams = new Task.Params();
-CommRxTaskParams.instance.name = "communication";
-CommRxTaskParams.priority = 10;
-CommRxTaskParams.stackSize = 8192;
-Program.global.communication = Task.create("&communicationTask", CommRxTaskParams);
+var AlarmHandlingTaskParams = new Task.Params();
+AlarmHandlingTaskParams.instance.name = "AlarmHandling";
+AlarmHandlingTaskParams.stackSize = 1024;
+AlarmHandlingTaskParams.priority = 10;
+Program.global.AlarmHandling = Task.create("&AlarmHandlingTask", AlarmHandlingTaskParams);
-var HeaterControlTaskParams = new Task.Params();
-HeaterControlTaskParams.instance.name = "HeatersControl";
-HeaterControlTaskParams.priority = 9;
-Program.global.HeatersControl = Task.create("&HeatersControlTask", HeaterControlTaskParams);
+var CommTxTaskParams = new Task.Params();
+CommTxTaskParams.instance.name = "communicationTx";
+CommTxTaskParams.priority = 9;
+CommTxTaskParams.stackSize = 4096;
+Program.global.communicationTx = Task.create("&communicationTxTask", CommTxTaskParams);
var ProcessTaskParams = new Task.Params();
ProcessTaskParams.instance.name = "process";
@@ -139,17 +140,16 @@ ProcessTaskParams.stackSize = 2048;
ProcessTaskParams.priority = 8;
Program.global.process = Task.create("&jobTask", ProcessTaskParams);
-var CommTxTaskParams = new Task.Params();
-CommTxTaskParams.instance.name = "communicationTx";
-CommTxTaskParams.priority = 7;
-CommTxTaskParams.stackSize = 4096;
-Program.global.communicationTx = Task.create("&communicationTxTask", CommTxTaskParams);
+var HeaterControlTaskParams = new Task.Params();
+HeaterControlTaskParams.instance.name = "HeatersControl";
+HeaterControlTaskParams.priority = 7;
+Program.global.HeatersControl = Task.create("&HeatersControlTask", HeaterControlTaskParams);
-var AlarmHandlingTaskParams = new Task.Params();
-AlarmHandlingTaskParams.instance.name = "AlarmHandling";
-AlarmHandlingTaskParams.stackSize = 1024;
-AlarmHandlingTaskParams.priority = 6;
-Program.global.AlarmHandling = Task.create("&AlarmHandlingTask", AlarmHandlingTaskParams);
+var CommRxTaskParams = new Task.Params();
+CommRxTaskParams.instance.name = "communicationRx";
+CommRxTaskParams.priority = 6;
+CommRxTaskParams.stackSize = 8192;
+Program.global.communication = Task.create("&communicationTask", CommRxTaskParams);
var MillisecLowTaskParams = new Task.Params();
MillisecLowTaskParams.instance.name = "MilliSecondLow";
diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
index c54976195..8d5955636 100644
--- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
+++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
@@ -498,8 +498,8 @@ uint32_t AlarmHandlingEmptyCBFunction(uint32_t IfIndex, uint32_t ReadValue)
uint32_t AlarmHandlingStart(void)
{
- if (EventsNotificationRequestAccepted == false)
- return ERROR;
+ //if (EventsNotificationRequestAccepted == false)
+ // return ERROR;
if ( AlarmHandlingActive == false)
{
AlarmHandlingActive = true;
@@ -684,7 +684,7 @@ uint32_t AlarmHandlingLoop(uint32_t tick)
//Motor Status
//machine cover open
- if (tick%eOneSecond == 0)
+ if ((tick%eOneSecond == 0)&&(EventsNotificationRequestAccepted==true))
SendEventNotifications();
return OK;
}
@@ -814,7 +814,7 @@ uint32_t StartEventsNotificationRequestFunc(MessageContainer* requestContainer)
// ReportInitParams InitParams;
//ControlStart();
EventsNotificationRequestAccepted = true;
- AlarmHandlingStart();
+ //AlarmHandlingStart();
StartEventsNotificationRequest* request = start_events_notification_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
ustrncpy (AlarmHandlingToken, requestContainer->token,36);
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index 6915cc657..fed1311bd 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -181,7 +181,7 @@ int32_t TotalWinderSpeed=0;
uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
{
uint32_t Steps;
- double temp;
+ double temp,tempScrewSpeed;
double screw_horizontal_speed = 0;
double RotationsPerSecond;
int32_t Averagewinderspeed = 0;
@@ -232,16 +232,17 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
}
screw_horizontal_speed = ScrewNumberOfSteps / InternalWinderCfg.NumberOfRotationPerPassage;
RotationsPerSecond = WinderReferenceSpeed / (double)MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_WINDER].pulseperround;
- ROM_IntMasterDisable();
- ScrewSpeed = screw_horizontal_speed*RotationsPerSecond;
+ tempScrewSpeed = screw_horizontal_speed*RotationsPerSecond;
+ //ROM_IntMasterDisable();
CurrentControlledSpeed[SCREW_MOTOR] = ScrewSpeed;
temp = SYS_CLK_FREQ;
temp *= ScrewNumberOfSteps;
- temp /= ScrewSpeed;
- if (ScrewRunningTime != temp)
+ temp /= tempScrewSpeed;
+ if ((ScrewRunningTime != temp)||(ScrewSpeed != tempScrewSpeed))
{
+ ScrewSpeed = tempScrewSpeed;
ScrewRunningTime = temp;//(SYS_CLK_FREQ*Steps)/ScrewSpeed;
- ROM_IntMasterEnable();
+ //ROM_IntMasterEnable();
//usnprintf(TempScrewStr, 100, "Winder: Horizon,Rotation, PPR, RPP{ %d, %d ,%d, %d} ",(int)screw_horizontal_speed,(int)RotationsPerSecond,(int)InternalWinderCfg.NumberOfRotationPerPassage,(int)MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_WINDER].pulseperround);
usnprintf(ScrewStr, 100, "Winder: Steps,Speed, Time, WinderSpeed{ %d, %d ,%d, %d} ",(int)ScrewNumberOfSteps,(int)ScrewSpeed,(int)temp,(int)WinderReferenceSpeed);
// Report(logmsg[index],__FILE__,__LINE__,index,RpWarning,index, Counter[index]);
@@ -253,7 +254,7 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
}
/********************************************************************************/
- ROM_IntMasterEnable();
+ //ROM_IntMasterEnable();
return OK;
}
@@ -313,6 +314,7 @@ uint32_t Winder_Presegment(void *JobDetails, uint32_t SegmentId)
REPORT_MSG(ScrewRunningTime,"Winder pre segment - ScrewRunningTime");
// MotorSetDirection (HARDWARE_MOTOR_TYPE__MOTO_SCREW, ScrewCurrentDirection);
//ScrewDirection = 1-ScrewDirection;
+ REPORT_MSG(SegmentId,"Winder pre segment - SegmentId");
REPORT_MSG(ScrewSpeed,"Winder pre segment - ScrewSpeed");
//MotorSetSpeedDirect(HARDWARE_MOTOR_TYPE__MOTO_SCREW,ScrewSpeed);
ScrewsStartControlTimer ();
@@ -398,12 +400,10 @@ void ScrewTimerInterrupt(int ARG0)
{
ROM_TimerIntClear(Screw_timerBase, TIMER_TIMA_TIMEOUT); // Clear the timer interrupt
ROM_IntMasterDisable();
- //ScrewDirectionChange(0,NOTBUSY);
if (SCREW_TimerActivated == true)
{
MotorSetDirection (HARDWARE_MOTOR_TYPE__MOTO_SCREW, ScrewCurrentDirection);
-// ScrewCurrentDirection = 1-ScrewCurrentDirection;
MotorSetSpeedDirect(HARDWARE_MOTOR_TYPE__MOTO_SCREW,ScrewSpeed);
ROM_TimerLoadSet(Screw_timerBase, TIMER_A,(int)ScrewRunningTime);
ScrewDirectionChangeCounter++;
@@ -412,11 +412,11 @@ void ScrewTimerInterrupt(int ARG0)
{
TimerDisable(Screw_timerBase, TIMER_A);
}
- Report("ScrewTimerInterrupt dir, duration, speed", __FILE__,ScrewCurrentDirection,ScrewRunningTime, RpMessage, ScrewSpeed, 0);
+ ROM_IntMasterEnable();
+ //Report("ScrewTimerInterrupt dir, duration, speed", __FILE__,ScrewCurrentDirection,ScrewRunningTime, RpMessage, ScrewSpeed, 0);
//
// Enable all interrupts.
//
- ROM_IntMasterEnable();
return ;
}
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index 72391e3a9..94858cae2 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -462,7 +462,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
usnprintf(Message, 60, "Dancer %d limit %d value %d Zero %d",DancerId,DancerStopActivityLimit[index],avreageSampleValue,DancersCfg[DancerId].zeropoint);
//JobAbortedByUser = true;
ThreadControlActive = false;
- MotorGetStatusFromFPGA(ThreadMotorIdToMotorId[index]);
+ //MotorGetStatusFromFPGA(ThreadMotorIdToMotorId[index]);
JobEndReason = JOB_WINDER_DANCER_FAIL+DancerId;
SendJobProgress(0.0,0,false, Message);
//EndState(CurrentJob,Message );
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
index 34ac6a857..e044808ca 100644
--- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
+++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
@@ -925,7 +925,8 @@ Void jobTask(UArg arg0, UArg arg1)
job_request__free_unpacked(CurrentRequest,NULL);
CurrentRequest = NULL;
SuspendLargeMessages = false;
- DiagnosticsStart();
+ LOG_ERROR(4,"ResumeLargeMessages PrintingResultsOk");
+ //DiagnosticsStart();
//CleanState(CurrentJob);
break;
case PrintingResultsFail:
@@ -935,7 +936,8 @@ Void jobTask(UArg arg0, UArg arg1)
job_request__free_unpacked(CurrentRequest,NULL);
CurrentRequest = NULL;
SuspendLargeMessages = false;
- DiagnosticsStart();
+ LOG_ERROR(3,"ResumeLargeMessages PrintingResultsFail");
+ //DiagnosticsStart();
//send message data as a validation error message to host
ExitState(Message.messageData);
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c
index 12c925bd8..85421fae5 100644
--- a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c
+++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c
@@ -333,9 +333,10 @@ uint32_t DistanceToSpoolReady(int ModuleId, ModuleStateEnum result)
else
{
SuspendLargeMessages = true;
- DiagnosticsStop();
+ //DiagnosticsStop();
PrtMessage->messageId = FinishResultsFail;
SendJobProgress(0.0, 0, false, "DistanceToSpool Fail");
+ LOG_ERROR(1,"SuspendLargeMessages DistanceToSpoolReady");
}
//memcpy(Message.messageData,JobDetails,MAX_MSG_LEN);
Message.msglen = 10;
@@ -374,7 +375,8 @@ uint32_t EndState(void *JobDetails, char *Message)
{
//ROM_IntMasterDisable();
SuspendLargeMessages = true;
- DiagnosticsStop();
+ LOG_ERROR(2,"SuspendLargeMessages EndState");
+ //DiagnosticsStop();
if (Configured[Module_Winder])
{
PrepareWaiting[Module_Winder] = ModuleIdle;