aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Drivers
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-10-15 17:03:53 +0300
committerAvi Levkovich <avi@twine-s.com>2020-10-15 17:03:53 +0300
commitfd4f2d63b097dc9e189c9d30682bd6d5cc584d48 (patch)
tree8b911df6ec6f7c29ac85aa1dd8e331ed86f1e6bf /Software/Embedded_SW/Embedded/Drivers
parent6a3361f3a9e08b63b39589add64f5802932022f3 (diff)
parent1b2dfd51ae086f40bba2934e550d9d4b8cca9cce (diff)
downloadTango-fd4f2d63b097dc9e189c9d30682bd6d5cc584d48.tar.gz
Tango-fd4f2d63b097dc9e189c9d30682bd6d5cc584d48.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Drivers')
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c1
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/Flash_Memory/FATFS/ff.c8
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/RFIDTagInfo.h97
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c2
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c19
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h2
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c8
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h2
8 files changed, 94 insertions, 45 deletions
diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c
index 21056e162..95651eba2 100644
--- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c
+++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c
@@ -434,7 +434,6 @@ uint32_t Read_Speed_Sensor_TypeII()//must be delay between Set_Speed_Sensor_Type
temp1/=F1_Prescaler1_reg6;
Speed_Hz = temp1;
#endif
- #warning change the speed from Hz to Cm/Sec
return Speed_Hz;
}
diff --git a/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/FATFS/ff.c b/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/FATFS/ff.c
index 3247e7960..00cc64c94 100644
--- a/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/FATFS/ff.c
+++ b/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/FATFS/ff.c
@@ -111,7 +111,10 @@
#error Wrong include file (ff.h).
#endif
-
+#ifdef _USE_LFN
+#undef _USE_LFN
+#define _USE_LFN 2
+#endif
/* Definitions on sector size */
#if _MAX_SS != 512 && _MAX_SS != 1024 && _MAX_SS != 2048 && _MAX_SS != 4096
#error Wrong sector size.
@@ -4033,6 +4036,7 @@ FRESULT f_mkfs (
return (disk_ioctl(pdrv, CTRL_SYNC, 0) == RES_OK) ? FR_OK : FR_DISK_ERR;
}
+#ifdef 0
#if _MULTI_PARTITION
/*-----------------------------------------------------------------------*/
@@ -4326,6 +4330,6 @@ int f_printf (
va_end(arp);
return (cc == EOF) ? cc : res;
}
-
+#endif
#endif /* !_FS_READONLY */
#endif /* _USE_STRFUNC */
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/RFIDTagInfo.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/RFIDTagInfo.h
index 1df9f3949..70e82cb39 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/RFIDTagInfo.h
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/RFIDTagInfo.h
@@ -10,45 +10,74 @@
typedef struct
{
- char TagUniqueID[8]; //RFID Tag unique ID
- char CartSN[16]; //Cartridge serial number
- uint32_t InkFactoryID:24; //Ink factory ID
- uint32_t FillSysID:16; //Filling system ID number
- char WorkOrder[10]; //Color description / ID
- char ColorName[12]; //Color description / ID
- uint32_t InkCategory:16; //Ink category (TBD)
- uint32_t Type_Rev; //TBD – can be formulation #
- uint32_t CartridgeSize; //Size in cc
- uint32_t FiledInkVol; //Size in cc
- char InkBatchNo[10]; //MFG batch No’
- char InkMFGDate[8]; //Date Ink was manufactured (20L container bar-code)
- char InkEOLDate[8]; //Ink end of life date
- char CartFillDate[8]; //Date cartridge was filled with ink (CFS)
- char WasteFillDate[8]; //Date cartridge was filled with waste (Machine)
- uint32_t Misc;
- uint32_t PluginCounter:16; //Number of times cartridge was plugged in INK Slot
- char InkFillStatus; //State indicator - successful state change when starting to fill mid. tank
- char InkUsedStatus;
- char InkEmptyStatus;
- char WasteEmptyStatus;
- char WasteFillingStatus;
- char WasteFullStatus;
- char Blocked;
- char Fail;
- uint32_t WasteCounter:16;
- char MachineIdINL[16];
- char MachineIdWST[16];
- char Spare[13];
- uint32_t Counter;
- char TagValid;
- char HashValue[32];
- uint32_t Checksum_CRC16:16;
+ uint8_t tagId[8]; //RFID Tag unique ID
+ uint8_t Serial[16]; //Cartridge serial number
+ uint8_t factoryID[3]; //Ink factory ID
+ uint8_t Padding_1_8bit; //** NA ** Union Padding for 32 bit
+ //----------------------
+ uint16_t fillingSystem; //Filling system ID number
+ uint8_t workOrder[10]; //Color description / ID
+ //----------------------
+ uint8_t colorName[12]; //Color description / ID
+ //----------------------
+ uint8_t catagory[2]; //Ink category (TBD)
+ uint16_t Paddind_1_16bit; //** NA ** Union Padding for 32 bit
+ //----------------------
+ uint32_t type; //TBD – can be formulation #
+ //----------------------
+ uint32_t cartSize; //Size in cc
+ //----------------------
+ uint32_t inkVolume; //Size in cc
+ //----------------------
+ uint8_t inkBatch[10]; //MFG batch No’
+ uint16_t Paddind_2_16bit; //** NA ** Union Padding for 32 bit
+ //----------------------
+ uint8_t inkMfgDate[8]; //Date Ink was manufactured (20L container bar-code)
+ //----------------------
+ uint8_t inkEolDate[8]; //Ink end of life date
+ //----------------------
+ uint8_t CartFillDate[8]; //Date cartridge was filled with ink (CFS)
+ //----------------------
+ uint8_t WasteFillDate[8];//Date cartridge was filled with waste (Machine)
+ //----------------------
+ uint32_t Misc;
+ //----------------------
+ uint16_t pluginCounter; //Number of times cartridge was plugged in INK Slot
+ uint8_t inkFill; //State indicator - successful state change when starting to fill mid. tank
+ uint8_t inkUsed;
+ //----------------------
+ uint8_t inkEmpty;
+ uint8_t wasteEmpty;
+ uint8_t wasteFilling;
+ uint8_t wasteFull;
+ //----------------------
+ uint8_t blocked;
+ uint8_t fail;
+ uint16_t wasteCounter;
+ //----------------------
+ uint8_t MachineIdInl[16];
+ //----------------------
+ uint8_t MachineIdWst[16];
+ //----------------------
+ uint8_t reserved[13];
+ uint8_t Paddind_2_8bit; //** NA ** Union Padding for 32 bit
+ uint16_t Paddind_3_16bit; //** NA ** Union Padding for 32 bit
+ //----------------------
+ uint32_t counter;
+ //----------------------
+ uint8_t tagValid;
+ uint8_t Paddind_3_8bit; //** NA ** Union Padding for 32 bit
+ uint16_t Paddind_4_16bit; //** NA ** Union Padding for 32 bit
+ //----------------------
+ uint8_t HashValue[16];
+ //----------------------
+ uint64_t Checksum_CRC16; //16 bit?
}NFCTag_t;
typedef union
{
NFCTag_t Struct;
- char Buf[sizeof(NFCTag_t)];
+ uint8_t Buf[sizeof(NFCTag_t)];
}NFC_Tag;
#endif /* DRIVERS_I2C_COMMUNICATION_RFID_NFC_RFIDTAGINFO_H_ */
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c
index f7253a2e2..fff11f493 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c
@@ -396,8 +396,6 @@ double GetWHSAirFlow(uint8_t OR_Id)
//------------------------------ waste volume measurement ------------------------------
-#warning need to update low and high limits and to read the eeprom on the initialization
-
double DefaultCoefficient = 10.5;//Coefficient is 10.5mV/mm for TI (not water). 9.72//TBD
double Coefficient_LowLimit = 0;//TBD
double Coefficient_HighLimit = 255;//TBD
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c
index 764ef0d44..4484f1932 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c
@@ -175,7 +175,6 @@ bool WHS_init_Blower()
bool LDACn_value = true;
bool AUXn_value = true;
bool update = 0;
- int i;
/* ---- config the WHS card 9555 configuration ----*/
@@ -391,6 +390,8 @@ bool IFS_Clearing_Suction = false;
bool IFS_Clearing_SuctionWaiting = false;
int midtank_cleared = NUM_OF_MIDTANKS;
+bool JobEndSuction = false;
+
void WHS_Set_IFS_Clearing_Suction (int midtank)
{
if (JobIsActive())
@@ -405,6 +406,12 @@ void WHS_Set_IFS_Clearing_Suction (int midtank)
}
Report("------------ WHS_Set_IFS_Clearing_Suction :-----------------", __FILE__,__LINE__, (int) IFS_Clearing_Suction, RpMessage, (int)JobIsActive(), 0);
}
+#define JobEndSuctionTime 30
+void WHS_Set_JobEndSuction (void)
+{
+ JobEndSuction = true;
+ Report("------------ WHS_Set_JobEndSuction :-----------------", __FILE__,__LINE__, (int) JobEndSuction, RpMessage, (int)JobIsActive(), 0);
+}
#define MAX_ALLOWED_BLOWER_VOLTAGE 4300
#define MIN_ALLOWED_BLOWER_VOLTAGE 2400
@@ -482,6 +489,14 @@ bool WHS_Set_Blower_Control_Closed_Loop(double Q_value)
}
}
+ if (JobEndSuction == true)
+ {
+ JobEndSuction = false;
+ Report("------------ Job end Clearing Suction -----------------", __FILE__,__LINE__, (int)4000, RpMessage, (int)JobEndSuctionTime, 0);
+ Control_Voltage_To_Blower(4000);
+ close_loop_time = JobEndSuctionTime;
+ return OK;
+ }
volt = getBlowerState();
WHS_Pid_Testing_Func(Q_value,current_dying_head_flow_Q);
//close_loop_time = 1;
@@ -614,7 +629,7 @@ uint32_t WHS_Pid_Testing_Func(double setParam,double measuredParam)
{
float calculated_speed;
//float avreageSampleValue = 0;
- int i;
+ //int i;
/*WhsBlowerSamples[WhsBlowerSamplesPointer] = measuredParam;//(-1 * TranslatedReadValue);
WhsBlowerSamplesPointer++;
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h
index f5bc52858..3033d6d06 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h
@@ -28,6 +28,8 @@ double get_average_Q(WHS_Flow_Meter ORF_id);
bool WHS_Set_Blower_Control_Closed_Loop(double Q_value);
void WHS_Start_Blower_Control_Closed_Loop (void);
void WHS_Set_IFS_Clearing_Suction (int midtank);
+void WHS_Set_JobEndSuction (void);
+
double WHS_Get_Blower_Control_Closed_Loop_SetPoint(void);
void WHS_Set_SetPoint_Q_value(double value);
void WHS_enable_control_loop(bool value);
diff --git a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c
index 2ae3da453..f5c9c09b5 100644
--- a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c
+++ b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c
@@ -111,7 +111,7 @@ bool Validate_Valve(Valves_t Valve_Id)
return true;
}
bool IgnoreMidTank = false;
-
+#ifdef 0
bool MidTankMitigation = false;
int MidTankMitigationOn = 20,MidTankMitigationOff = 10;
uint32_t MidtankMitigationControlId[NUM_OF_VALVES] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
@@ -148,8 +148,9 @@ uint32_t ValveCallback(uint32_t deviceID, uint32_t ReadValue)
MidtankMitigationCounter[deviceID] = 0;
}
}
+ return OK;
}
-
+#endif
void Valve_Command(Valves_t Valve_Id) //1 - OPEN, 0 - CLOSE
{
if (Validate_Valve(Valve_Id) == false)
@@ -421,6 +422,7 @@ void Valve_Set(Valves_t Valve_Id, bool Direction)
Report("Mid Tank Valve command ignored - bypass",__FILE__,__LINE__,(int)Valve_Id,RpWarning,Direction,0);
return;
}
+#ifdef 0
if (MidTankMitigation == true)
{
Report("Mid Tank Valve command mitigation",__FILE__,Valve_Id,(int)Valve_Id,RpWarning,Direction,0);
@@ -438,8 +440,8 @@ void Valve_Set(Valves_t Valve_Id, bool Direction)
MidtankMitigationControlId[Valve_Id] = 0xFF;
}
}
+#endif
}
-
ValveRequest[Valve_Id].Direction = Direction;
Valve_Command( Valve_Id);
#endif
diff --git a/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h b/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h
index bb171dda4..12598ed07 100644
--- a/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h
+++ b/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h
@@ -33,7 +33,7 @@ typedef enum {
EEPROM_STORAGE_MIDTANK_8_B,
//EEPROM_STORAGE_SERIAL_NUM,
//EEPROM_STORAGE_MAC_ADDR,
- EEPROM_STORAGE_DRYER_BACKLASH,
+ EEPROM_STORAGE_WINDER_CALIBRATION,
EEPROM_STORAGE_EMBEDDED_VERSION,
EEPROM_ALARM_SUPPORT,
EEPROM_ORIFICE1_ZERO_VALUE,