diff options
| author | Avi Levkovich <avi@twine-s.com> | 2021-01-11 14:58:52 +0200 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2021-01-11 14:58:52 +0200 |
| commit | 1e3551c5fddf4b4fd7b52b762a88033149400012 (patch) | |
| tree | b7112ab703cc8077bd5347cfde0563b5cd2f7fe2 /Software/Embedded_SW | |
| parent | 69865fad49ccbc47868882a3055a8fc2dd8cf672 (diff) | |
| download | Tango-1e3551c5fddf4b4fd7b52b762a88033149400012.tar.gz Tango-1e3551c5fddf4b4fd7b52b762a88033149400012.zip | |
remove the hard codded Active_RFID_Reader = CART_2; + minor
Diffstat (limited to 'Software/Embedded_SW')
5 files changed, 30 insertions, 4 deletions
diff --git a/Software/Embedded_SW/Embedded/DataDef.h b/Software/Embedded_SW/Embedded/DataDef.h index b5edc9554..669e2cbe5 100644 --- a/Software/Embedded_SW/Embedded/DataDef.h +++ b/Software/Embedded_SW/Embedded/DataDef.h @@ -44,7 +44,7 @@ #endif //#define USE_UART4_FOR_BTSR // need change in FRPGA FPGA_1 yy > 0x20 + jumpers in main board need to read HW Version - no need when working only with stubs -//#define FORCE_BTSR_CARD_0023 // only for testing, include changes for BTSR without ASSY ID. use it with USE_UART4_FOR_BTSR +//#define FORCE_BTSR_CARD_0023 //0014 only for testing, include changes for BTSR without ASSY ID. use it with USE_UART4_FOR_BTSR //#define USE_RFID_STUB //stub only. to use it undef USE_RFID_LOGIC //#define RFID_READ_ONLY // @@ -491,6 +491,13 @@ typedef enum typedef enum { + I2C_COMM_UNKNOWN, + I2C_COMM_PASSED, + I2C_COMM_FAILED, +}I2C_COMM_STAT; + +typedef enum +{ DEFAULT_POLARITY = 0,//OPTIC_LS , MAGNETIC_LS CARD 2 INVERSION_POLARITY = 1,//MAGNETIC_LS CARD 2 - must be 1 used for xor the polarity }LS_POLARITY; @@ -636,6 +643,7 @@ typedef struct DISP_EEPROM Write_Disp_EEPROM; DISP_EEPROM Read_Disp_EEPROM; LS_STATUS Status; + I2C_COMM_STAT I2C_Status;// TBD added to calculate the pressure as new when there is i2c no communication (unable to read the eeprom) }DISP; DISP Dispenser_struct[8]; diff --git a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_DispPressSens.c b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_DispPressSens.c index 52225cb30..7c42ff823 100644 --- a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_DispPressSens.c +++ b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_DispPressSens.c @@ -46,9 +46,16 @@ void Calculateinit (void) Max = (float)(Dispenser_struct[DispenserId].Read_Disp_EEPROM.bytes.Maximal_Pressure) / 10000.0; } } + else if(Dispenser_struct[DispenserId].I2C_Status = I2C_COMM_FAILED)//#warning need to implement !!!! + { +#warning need to implement i2c status !!!! + Min = - 0.1;//-1000 / 10000.0;//default for NEW pressure sensor + Max = 1;//10000 / 10000.0;//default for NEW pressure sensor + Report("unable to read the dispenser EEPROM, use default NEW pressure values",__FILE__,__LINE__,DispenserId,RpWarning,(int)Dispenser_struct[DispenserId].Type,0); + } else { - Report("Dispenser's EEPROM - Wrong header! use default pressure values",__FILE__,__LINE__,DispenserId,RpWarning,(int)Dispenser_struct[DispenserId ].Read_Disp_EEPROM.bytes.Header,0); + Report("Dispenser's EEPROM - Wrong header! use default OLD pressure values",__FILE__,__LINE__,DispenserId,RpWarning,(int)Dispenser_struct[DispenserId ].Read_Disp_EEPROM.bytes.Header,0); } a[DispenserId] = (Max - Min) / (Bits_Max - Bits_Min);// Mpascal/Bits = 0.000352125 with default values diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c index 9023f8250..635626467 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c @@ -101,6 +101,17 @@ uint32_t Dispenser_EEPROM_Read_Data(uint8_t Dispenser_ID)//0..7 status |= I2C_EEprom_Set_for_Read_Ch(Dispenser_ID, 0xA0); status |= I2C_EEprom_Read_Ch(Dispenser_ID, 0xA0); +#warning need to implement i2c status !!!! + /* + if(status != OK) + { + Dispenser_struct[Dispenser_ID].I2C_Status = I2C_COMM_PASSED; + } + else + { + Dispenser_struct[Dispenser_ID].I2C_Status = I2C_COMM_FAILED; + LOG_ERROR (Dispenser_ID, "Dispenser I2C Comm. failed"); + }*/ return status; } uint32_t test_disp_eeprom(uint8_t Dispenser_ID , uint8_t EEprom_Add)//0..7 diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/I2C_IFS_Mux.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/I2C_IFS_Mux.c index 0593342b1..7309be156 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/I2C_IFS_Mux.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/I2C_IFS_Mux.c @@ -156,7 +156,7 @@ uint32_t Check_IFS_Availability() delayms(1); } - Active_RFID_Reader = CART_2; // temporary !!!!! + //Active_RFID_Reader = CART_2; // temporary !!!!! return status; } diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index f8c119713..131638d34 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -411,7 +411,7 @@ int main(void) } else { - #ifdef FORCE_BTSR_CARD_0023 + #ifdef FORCE_BTSR_CARD_0023//0014 // Configure the GPIO Pin PR0 for BTSR RS485 UART - Set as output to change to uart4 RS485 Direction: ROM_GPIOPinTypeGPIOOutput(GPIO_PORTR_BASE, GPIO_PIN_0); |
