aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-05-29 12:08:10 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-05-29 12:08:10 +0300
commit6792c8f8769eec18cfee8ccf80a09887c48b8b6a (patch)
treeeb67c141d40ea34b4446bd6724ec77fc13385852 /Software/Embedded_SW/Embedded
parent9ae8d0e95a199dbf6be4597b0e08717d4d0754f2 (diff)
parent405096b3d489f4ea7b50b1d5db7d32241251b8d7 (diff)
downloadTango-6792c8f8769eec18cfee8ccf80a09887c48b8b6a.tar.gz
Tango-6792c8f8769eec18cfee8ccf80a09887c48b8b6a.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded')
-rw-r--r--Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c1
-rw-r--r--Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c2
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c28
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c41
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c14
-rw-r--r--Software/Embedded_SW/Embedded/Software Release Notes.txt11
-rw-r--r--Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c7
11 files changed, 85 insertions, 25 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
index 68500ac88..6c0262f66 100644
--- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
+++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
@@ -35,6 +35,7 @@
#include "third_party/fatfs/src/diskio.h"
#include "drivers/Flash_Memory/Flash_Memory.h"
#include "drivers/Flash_Memory/fatfs/ff.h"
+#include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h"
#include "third_party/fatfs/src/ffconf.h"
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 b2590abab..bee894585 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 = {1,4,0,2};
+TangoVersion_t _gTangoVersion = {1,4,0,3};
#define BUILD_DATE __DATE__
char Dat[50] = BUILD_DATE;
char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//d
diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c
index bf96335e1..3177dc787 100644
--- a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c
+++ b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c
@@ -469,7 +469,7 @@ uint32_t MotorMovetoLimitSwitch (TimerMotors_t MotorId,bool direction, uint32_t
MotorTimeLag[MotorId] = eTenMillisecond;
MotorTimeLimit[MotorId] = timeout;
- if ((MotorId == HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANHEAD)||(HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANMECH))
+ if ((MotorId == HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANHEAD)||(HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANMECH)||(HARDWARE_MOTOR_TYPE__MOTO_SCREW))
MotorTimeLag[MotorId] = 2;
MotorSetDirection( MotorId, direction);
diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
index 931b6674f..73532a7d2 100644
--- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
+++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
@@ -669,6 +669,8 @@ uint32_t AlarmHandling_ControlTrigger(uint32_t IfIndex, uint32_t ReadValue)
return OK;
}
+void AlarmHandlingInternalSetAlarm(uint32_t AlarmId, bool value);
+
void AlarmHandlingSetAlarm(uint32_t AlarmId, bool value)
{
AlarmHandlingInternalSetAlarm( AlarmId, value);
@@ -1024,12 +1026,12 @@ void AlarmHandlingTask(UArg arg0, UArg arg1)
}
}
//StartEventsNotificationResponse StartEventsNotification = START_EVENTS_NOTIFICATION_RESPONSE__INIT;
-StartEventsNotificationResponse response = START_EVENTS_NOTIFICATION_RESPONSE__INIT;
+StartEventsNotificationResponse EventsResponse = START_EVENTS_NOTIFICATION_RESPONSE__INIT;
int LargeMessagesAH = 0;
void SendEventNotifications(void)
{
MessageContainer responseContainer;
- //StartEventsNotificationResponse response = START_EVENTS_NOTIFICATION_RESPONSE__INIT;
+ //StartEventsNotificationResponse EventsResponse = START_EVENTS_NOTIFICATION_RESPONSE__INIT;
int i,e=0;
if (AlarmHandlingActive == false)
@@ -1042,20 +1044,20 @@ void SendEventNotifications(void)
return;
}
- response.n_events = 0;
+ EventsResponse.n_events = 0;
UInt Key = Task_disable();
for (i = 0;i<MAX_SYSTEM_ALARMS;i++)
{
if (AlarmState[i].Status == true)
{
- response.n_events++;
+ EventsResponse.n_events++;
}
}
- if (response.n_events)
+ if (EventsResponse.n_events)
{
- response.events = (Event **)my_malloc(sizeof(Event*)*response.n_events);
- if(response.events)
+ EventsResponse.events = (Event **)my_malloc(sizeof(Event*)*EventsResponse.n_events);
+ if(EventsResponse.events)
{
for (i = 0;i<MAX_SYSTEM_ALARMS;i++)
{
@@ -1063,7 +1065,7 @@ void SendEventNotifications(void)
{
if (AlarmState[i].EventPtr)
{
- response.events[e]=AlarmState[i].EventPtr;
+ EventsResponse.events[e]=AlarmState[i].EventPtr;
e++;
}
}
@@ -1071,17 +1073,17 @@ void SendEventNotifications(void)
}
else
{
- LOG_ERROR(response.n_events,"events malloc error");
+ LOG_ERROR(EventsResponse.n_events,"events malloc error");
Task_restore(Key);
return;
}
}
else
{
- response.events = NULL;
+ EventsResponse.events = NULL;
}
Task_restore(Key);
- responseContainer = createAllocatedContainer(MESSAGE_TYPE__StartEventsNotificationResponse, AlarmHandlingToken, false, &response, &start_events_notification_response__pack, &start_events_notification_response__get_packed_size,&alarm_response_buffer);
+ responseContainer = createAllocatedContainer(MESSAGE_TYPE__StartEventsNotificationResponse, AlarmHandlingToken, false, &EventsResponse, &start_events_notification_response__pack, &start_events_notification_response__get_packed_size,&alarm_response_buffer);
responseContainer.continuous = true;
uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer));
@@ -1096,8 +1098,8 @@ void SendEventNotifications(void)
my_free(container_buffer);
}
}
- if (response.events)
- my_free(response.events);
+ if (EventsResponse.events)
+ my_free(EventsResponse.events);
if (responseContainer.data.data)
my_free(responseContainer.data.data);
}
diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c
index 184aa52be..b89fa43ed 100644
--- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c
+++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c
@@ -22,6 +22,7 @@
#include "drivers/FPGA/FPGA.h"
#include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h"
#include "drivers/I2C_Communication/DAC/Blower.h"
+#include "drivers/valves/valve.h"
#include "modules/ids/ids_ex.h"
#include "Modules/Control/MillisecTask.h"
diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c
index 6fc728934..9c7e84bc2 100644
--- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c
+++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c
@@ -416,6 +416,8 @@ uint32_t HWConfigurationFunc(MessageContainer* requestContainer)
status = HWConfiguration(UploadRequest);
+ GeneralHwReady = true;
+
responseContainer = createContainer(MESSAGE_TYPE__UploadHardwareConfigurationResponse, requestContainer->token, true, &response, &upload_hardware_configuration_response__pack, &upload_hardware_configuration_response__get_packed_size);
if (status!= OK)
{
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c
index d312dcb78..0907c4a67 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c
@@ -205,6 +205,10 @@ uint32_t IDS_StopHomeDispenser (uint32_t DispenserId)
Disable_MidTank_Pressure_Reading(DispenserId);
Valve_Set(IDS_Id_to_AirValve[DispenserId], Atm_MidTank_OFF);
Control3WayValvesWithCallback ((Valves_t)DispenserId, MidTank_Dispenser, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer
+ if (DispenserId == LUBRICANT_DISPENSER)
+ {
+ Lubricant_2Way_Valve (START);
+ }
MotorSetMicroStep(MotorId, MotorsCfg[MotorId].microstep);
CurrentDispenserSpeed[DispenserId] = 0;
@@ -227,6 +231,36 @@ uint32_t IDS_CheckDispenserLimitSwitch (LimitSwitchAlarms LS_Id)
else
return FPGA_Read_limit_Switches(Dispenser_Id_to_Alarm_LS_Id[LS_Id]);
}
+uint32_t IDS_EmptyDispenserCallback(uint32_t motorId, uint32_t ReadValue)
+{
+ uint8_t DispenserId = motorId-HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_1;
+
+ Read_MidTank_Pressure_Sensor(DispenserId);
+ //close dry air valve in the dispenser
+ Valve_Set(IDS_Id_to_AirValve[DispenserId], Atm_MidTank_OFF);
+ Disable_MidTank_Pressure_Reading(DispenserId);
+
+ MotorStop(motorId,Hard_Hiz);
+ CurrentDispenserSpeed[DispenserId] = 0;
+ MotorSetMicroStep(motorId, MotorsCfg[motorId].microstep);
+ HomingActive[DispenserId]= false;
+ if (DispenserId == LUBRICANT_DISPENSER)
+ {
+ Lubricant_2Way_Valve (STOP);
+ }
+
+ Report("End Priming",__FILE__,millisecondCounter,(int)DispenserId,RpWarning,(int)DispenserHomingTime[DispenserId],0);
+ //MotorSetMicroStep(motorId, MotorsCfg[motorId].microstep);
+ if (HomingRequestCallback[DispenserId])
+ {
+ HomingRequestCallback[DispenserId](DispenserId,0);
+ HomingRequestCallback[DispenserId] = NULL;
+ }
+
+
+return OK;
+
+}
uint32_t IDS_EmptyDispenser (uint32_t DispenserId, uint32_t speed , callback_fptr callback)
{
@@ -254,8 +288,13 @@ uint32_t IDS_EmptyDispenser (uint32_t DispenserId, uint32_t speed , callback_fpt
IDS_Dispenser_RefillStarted(DispenserId);
IDS_Dispenser_MovingDirection(DispenserId,UP);
+ if (DispenserId == LUBRICANT_DISPENSER)
+ {
+ Lubricant_2Way_Valve (START);
+ }
+
- MotorMovetoLimitSwitch (MotorId,MotorsCfg[MotorId].directionthreadwize, speed, Dispenser_Id_to_LS_Empty_Id[DispenserId], IDS_HomeDispenserCallback,0);
+ MotorMovetoLimitSwitch (MotorId,MotorsCfg[MotorId].directionthreadwize, speed, Dispenser_Id_to_LS_Empty_Id[DispenserId], IDS_EmptyDispenserCallback,0);
CurrentDispenserSpeed[DispenserId] = speed;
return OK;
}
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
index 1d395ec8c..aea16bb60 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
@@ -7,6 +7,7 @@
#include "ids.h"
#include "ids_ex.h"
#include "../control/control.h"
+#include "../control/MillisecTask.h"
#include "../general/process.h"
#include "../control/pidalgo.h"
#include "../thread/thread.h"
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index 9ebc32f57..a68995168 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -223,7 +223,7 @@ double WinderReferenceSpeed=0;
double TotalWinderSpeed=0;
bool Add100 = false;
double Rotations = 6.0;
-bool flipflop = false;
+int flipflop = 0;
uint32_t motspeed;
float speedf;
int WinderCalculation = 0;
@@ -250,20 +250,20 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
WinderMotorSpeedRollOver=true;
}
// }
- if (flipflop)
+ if (flipflop == 0)
{
- speedf = MotorGetSpeedFromFPGA_Res(HARDWARE_MOTOR_TYPE__MOTO_SCREW);
+ MotorGetSpeedFromFPGA1(HARDWARE_MOTOR_TYPE__MOTO_SCREW);
}
- else
+ else if (flipflop == 1)
{
- MotorGetSpeedFromFPGA1(HARDWARE_MOTOR_TYPE__MOTO_SCREW);
+ speedf = MotorGetSpeedFromFPGA_Res(HARDWARE_MOTOR_TYPE__MOTO_SCREW);
}
- flipflop = 1-flipflop;
+ flipflop ++;
if (ScrewDirectionChangeCounter == CalculationDirectionChangeCounter)
return OK;
//deley TODO
-
+ flipflop = 0;
ScrewCurrentDirection = 1-ScrewCurrentDirection;
CalculationDirectionChangeCounter++;
diff --git a/Software/Embedded_SW/Embedded/Software Release Notes.txt b/Software/Embedded_SW/Embedded/Software Release Notes.txt
index a6a82ae6d..32d5e73b2 100644
--- a/Software/Embedded_SW/Embedded/Software Release Notes.txt
+++ b/Software/Embedded_SW/Embedded/Software Release Notes.txt
@@ -1,3 +1,14 @@
+Embedded SW Release note - Version 1.3.10.6 - Itma Candidate 5
+=============================================================
+change winding - fixed speed
+
+Embedded SW Release note - Version 1.3.10.5 - Itma Candidate 4
+=============================================================
+bug fixes and work around: segment free, usb log, job length, length measurements, heating
+better support for new and older dispensers
+waste indication - empty and full
+
+
Embedded SW Release note - Version 1.3.10.2 - Itma Candidate 3
=============================================================
Machine:
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
index 7ad887925..f5ae89368 100644
--- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
+++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
@@ -743,6 +743,7 @@ void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Mes
Report(infomsg,__FILE__,__LINE__,55,RpWarning,33, 44);
}*/
UInt Key = Task_disable();
+ double totlength = 0;
if (JobToken[0] != 0)
{
@@ -753,12 +754,14 @@ void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Mes
}
//previousJobLength = ProcessedLength;
jobStatus.has_progress = true;
+ totlength = TotalProcessedLength;
if (TotalProcessedLength > job_length)
{
Report("job length bigger than assigned",__FILE__,__LINE__,TotalProcessedLength,RpWarning,job_length, done);
- TotalProcessedLength = job_length;
+ //TotalProcessedLength = job_length;
+ totlength = job_length;
}
- jobStatus.progress = TotalProcessedLength;
+ jobStatus.progress = totlength;
jobStatus.has_currentsegmentindex = true;
jobStatus.currentsegmentindex = SegmentId;