diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2021-01-04 07:34:23 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2021-01-04 07:34:23 +0200 |
| commit | b0dc79e93c1a17667211bff5c7e48eb2d69ad386 (patch) | |
| tree | e6ad34eefc4424efa2f853ffa7f3899f52cf494d /Software/Embedded_SW | |
| parent | ea8e85d116842845d35a6060aa0b33c40dad6aa3 (diff) | |
| download | Tango-b0dc79e93c1a17667211bff5c7e48eb2d69ad386.tar.gz Tango-b0dc79e93c1a17667211bff5c7e48eb2d69ad386.zip | |
enabling work with evaluation board
Diffstat (limited to 'Software/Embedded_SW')
14 files changed, 80 insertions, 26 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/Sys_PinOut_Config/Pin_config.c b/Software/Embedded_SW/Embedded/Common/Sys_PinOut_Config/Pin_config.c index 10fbdfafa..4e7e5364d 100644 --- a/Software/Embedded_SW/Embedded/Common/Sys_PinOut_Config/Pin_config.c +++ b/Software/Embedded_SW/Embedded/Common/Sys_PinOut_Config/Pin_config.c @@ -1,5 +1,6 @@ #include <stdbool.h> #include <stdint.h> +#include <DataDef.h> #include <driverlib/gpio.h> #include <inc/hw_memmap.h> diff --git a/Software/Embedded_SW/Embedded/Communication/Connection.c b/Software/Embedded_SW/Embedded/Communication/Connection.c index ec15c1596..c33f3710c 100644 --- a/Software/Embedded_SW/Embedded/Communication/Connection.c +++ b/Software/Embedded_SW/Embedded/Communication/Connection.c @@ -193,7 +193,7 @@ void KeepAliveRequestFunc(MessageContainer* requestContainer) //keep_alive_request__free_unpacked(request,NULL); } -int KARequestId = 0x01010101; +int KARequestId = 0x41414141; char KARequestToken[36+1]; void KeepAliveResponseFunc(MessageContainer* requestContainer) { @@ -215,7 +215,7 @@ void KeepAliveRequest1Second(void) KeepAliveResponse request = KEEP_ALIVE_REQUEST__INIT; - strcpy(KARequestToken,"Happy days are coming to us, soon"); + strcpy(KARequestToken,"Happy days are coming to us, soonZYX"); memcpy(&KARequestToken[32],&KARequestId,sizeof(KARequestId)); KARequestId++; //Report("keepalive request sent",__FILE__,__LINE__,KARequestId,RpWarning,msec_millisecondCounter, 0); diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c index 0b308408c..62d283f0b 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c @@ -358,8 +358,12 @@ uint32_t Get_Dryer_Fan_Tacho() } uint32_t Read_Dryer_Fan_Tacho() { +#ifndef EVALUATION_BOARD Drayer_Fan_Speed_RPM = Calculate_Tacho_Fan_Speed(FPGA_Freq, 12, F1_Prescaler1_reg5, F1_Tacho_reg8); return Drayer_Fan_Speed_RPM; +#else + return 100; +#endif } void Control_Dryer_Fan_PWM(uint8_t PWM_Command_Precent)// 0 - 100% diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c index e9c674b25..c3ce35868 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c @@ -482,9 +482,10 @@ uint32_t ActivateCleanerPump() uint32_t DeActivateCleanerPump() { - +#ifndef EVALUATION_BOARD F2_CTRL_Reg.ushort &= ~CLEANER_PUMP_SSR3_CTRL; F2_CTRL = F2_CTRL_Reg.ushort; +#endif return OK; } //---------------------------------- @@ -494,16 +495,20 @@ void Power_Off()//Power Down #ifdef WATCHDOG ROM_WatchdogResetDisable(WATCHDOG0_BASE); #endif +#ifndef EVALUATION_BOARD F2_CTRL_Reg.ushort |= PDOWN_RL1_CTRL; F2_CTRL = F2_CTRL_Reg.ushort; +#endif } void Power_Reset()// Resets the MCU { utilsStoreLocalTime(); +#ifndef EVALUATION_BOARD F3_SW_RESET_reg &= ~BIT0; SysCtlDelay(1000); F3_SW_RESET_reg |= BIT0; +#endif SysCtlReset(); } @@ -511,15 +516,19 @@ void Power_Reset()// Resets the MCU uint32_t ActivateChiller() //WHS Cooler / WHS DX Cooler { +#ifndef EVALUATION_BOARD F2_CTRL_Reg.ushort |= CHILLER_SSR9_CTRL; F2_CTRL = F2_CTRL_Reg.ushort; +#endif return OK; } uint32_t DeActivateChiller() //WHS Cooler / WHS DX Cooler { +#ifndef EVALUATION_BOARD F2_CTRL_Reg.ushort &= ~CHILLER_SSR9_CTRL; F2_CTRL = F2_CTRL_Reg.ushort; +#endif return OK; } diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SSI_Comm.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SSI_Comm.c index 765ba1a7a..36a349682 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SSI_Comm.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SSI_Comm.c @@ -132,6 +132,7 @@ uint8_t FPGA_SSI_Dryer_ENC_Transnit() uint32_t FPGA_SSI_Dryer_ENC_Receive() { +#ifndef EVALUATION_BOARD INT2SHORT Int2Short; unsigned int temp; @@ -147,6 +148,6 @@ uint32_t FPGA_SSI_Dryer_ENC_Receive() Dryer_ENC.Gen_status = temp & 0x3; temp = temp >> 2; Dryer_ENC.Position = (temp & 0x3FFF); - +#endif return OK; } diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/DAC/Blower.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/DAC/Blower.c index 57b57a41d..307d815ee 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/DAC/Blower.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/DAC/Blower.c @@ -156,8 +156,10 @@ uint32_t Turn_the_Blower_On() voltage = Default_Voltage; if (WHS_Type == WHS_TYPE_UNKNOWN) { +#ifndef EVALUATION_BOARD status = Write_Control_Register(); status |= Write_DAC_and_Input_Register(DAC_mV2Bits(Default_Voltage)); +#endif } else //new WHS { @@ -177,7 +179,9 @@ uint32_t Control_Voltage_To_Blower(uint32_t mV) } if (WHS_Type == WHS_TYPE_UNKNOWN) { +#ifndef EVALUATION_BOARD status |= Write_DAC_and_Input_Register(DAC_mV2Bits(mV)); +#endif } else //new WHS { @@ -196,7 +200,9 @@ uint32_t Turn_the_Blower_Off() if (WHS_Type == WHS_TYPE_UNKNOWN) { +#ifndef EVALUATION_BOARD status |= Write_DAC_and_Input_Register(0); +#endif } else //new WHS { 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 c04cabc4a..0593342b1 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 @@ -137,7 +137,7 @@ uint32_t Reset_and_Check_IFS_Availability(PANEL_BUTTON_OR_CRAT_ID Cart_ID) // IFS_Availability[Cart_ID-1] = IFS_RECOGNIZED; // } #else - IFS_Availability[Cart_ID-1] = WITHOUT_IFS; + IFS_Availability[Cart_ID-1] = IFS_AVAILABILITY_UNKNOWN; #endif return status; diff --git a/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.c b/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.c index 71d26888d..cfa8c2382 100644 --- a/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.c +++ b/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.c @@ -86,13 +86,15 @@ void MCU_E2PromUpdateResetReason(int i) uint32_t Head; uint32_t RESC = SysCtlResetCauseGet(); +#ifndef EVALUATION_BOARD + EEPROMRead(&Head,EEPROM_RESET_REASON_HEAD_ADDRESS, 4); if (Head>=EEPROM_RESET_REASON_MAX_DATA) Head=0; Head++; RESC+=(i*0x1000); EEPROMProgram(&Head, EEPROM_RESET_REASON_HEAD_ADDRESS, 4); EEPROMProgram(&RESC, (EEPROM_RESET_REASON_HEAD_ADDRESS+(Head*4)), 4); - +#endif } /*************************************************/ diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index 9c647e847..c8e2e80b9 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -314,6 +314,7 @@ int main(void) HibernateCalendarSet(&LocalTime); } OpenLogFile(); +#ifndef EVALUATION_BOARD Data = MCU_E2PromEmbeddedVersionRead(); memcpy (&Version,&Data,4); i = memcmp(&Version,&_gTangoVersion,4); @@ -325,7 +326,7 @@ int main(void) MCU_E2PromProgram(EEPROM_INIT_FAILURE_COUNTER,0); } MCU_E2PromRead(EEPROM_INIT_FAILURE_COUNTER,&InitFailures); - +#endif Init_All_I2C(); #ifndef EVALUATION_BOARD Block_Main_MUX_TCA9548A_0xE4();//unused, same i2c as head and whs cards diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index c5fffff60..f9401c248 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -618,7 +618,7 @@ uint16_t realtimetest[101]; uint16_t dbgflag[50]; uint32_t dbttime[50]; bool Ten_msTick, Fifty_msTick, Hundred_msTick , m20msecTick,m90msecTick, Onesecond_Tick,Tensecond_Tick,OneMinute_Tick,TenMinutes_Tick,OneHourTick,Gradient_Tick; -bool O700Millisecond_Tick,O200Millisecond_Tick,O400Millisecond_Tick,O500Millisecond_Tick,O600Millisecond_Tick,O800Millisecond_Tick; +bool O700Millisecond_Tick,O200Millisecond_Tick,O400Millisecond_Tick,O500Millisecond_Tick,O600Millisecond_Tick,O800Millisecond_Tick,m50msecTick; uint32_t MillisecLowLoop(uint32_t tick) { @@ -636,7 +636,7 @@ uint32_t MillisecLowLoop(uint32_t tick) Fifty_msTick = (tick%eHundredMillisecond == 40) ?true:false; //eFiftyMillisecond Hundred_msTick = (tick%eHundredMillisecond == 0) ?true:false; m20msecTick = (tick%eHundredMillisecond == 20) ?true:false; - //m70msecTick = (tick%eHundredMillisecond == 70) ?true:false; + m50msecTick = (tick%50== 0) ?true:false; m90msecTick = (tick%eHundredMillisecond == 90) ?true:false; O700Millisecond_Tick = (tick%eOneSecond == 700) ?true:false; O200Millisecond_Tick = (tick%eOneSecond == 200) ?true:false; @@ -672,6 +672,14 @@ uint32_t MillisecLowLoop(uint32_t tick) dbgflag[2]++; dbttime[2] = msec_millisecondCounter; Read_Dryer_ENC_Position(); + dbgflag[3]++; + } + if (m50msecTick) //50 milli + { +#ifdef USE_UART4_FOR_BTSR + //call every 50mSec + BTSR_State_Machine(RUFeeder1); +#endif } if (m20msecTick) { @@ -682,11 +690,6 @@ uint32_t MillisecLowLoop(uint32_t tick) WHS_Read_GPI_Registers(); Trigger_PT100_Read();//call every 50mSec (minimum delay 30mSec) //Set_HeadCard_PT100();//call every 50mSec (minimum delay 30mSec) - - #ifdef USE_UART4_FOR_BTSR - //call every 50mSec - BTSR_State_Machine(RUFeeder1); - #endif } if (m90msecTick) { diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 19507775e..71bae1f40 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -1376,8 +1376,8 @@ uint32_t IDSCheckSegmentData(void *SegmentDetails, int SegmentId) //for (Brush_i=JobBrushStopId;Brush_i<PrevSegment->brushstopscount;Brush_i++) #bug 3348 - unhandled jobstops stops too soon for (Brush_i=JobBrushStopId;Brush_i<PrevSegment->brushstopscount;Brush_i++) { - if (status == ERROR) - break; + //if (status == ERROR) + // break; tFileBrushStop = GetNextBrushStopFromJobFile(); if (tFileBrushStop) { diff --git a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c index 2c67a623b..5b0cf9cb7 100644 --- a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c +++ b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c @@ -49,7 +49,7 @@ double MidTankEmptyLimit = MidTank_Pressure_EMPTY; MidTankStateEnum midTankState = 0; char CartridgeRequestToken[36+1]; -int CartridgeRequestId = 0x01010101; +int CartridgeRequestId = 0x31313131; bool RdInkCartridgeSensor() { @@ -199,7 +199,7 @@ uint32_t ReadInkCartridgeData() CartridgeValidationRequest ValidationReq = CARTRIDGE_VALIDATION_REQUEST__INIT; Cartridge CartridgeData; - strcpy(CartridgeRequestToken,"Happy days are coming to us, soon"); + strcpy(CartridgeRequestToken,"Happy days are coming to us, soonXXX"); memcpy(&CartridgeRequestToken[32],&CartridgeRequestId,sizeof(CartridgeRequestId)); CartridgeRequestId++; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index ffbb504db..2b1e52134 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -320,8 +320,21 @@ { TimeoutsCounter = 0; load.color = fastBILNK; - usnprintf(LoadErrorMsg, 100, "/Stage %s - %s timeout",LoadStagesStr[LoadStages], MotorStr[MotorId]); - Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0); + if (LoadStages == THREAD_LOAD_INITIAL_TENSION) + { + usnprintf(LoadErrorMsg, 100, "/Stage %s - no cone in winder!!",LoadStagesStr[LoadStages]); + Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0); + } + else if (LoadStages == THREAD_LOAD_JOG_THREAD) + { + usnprintf(LoadErrorMsg, 100, "/Stage %s - Dryer door is open!!",LoadStagesStr[LoadStages]); + Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0); + } + else + { + usnprintf(LoadErrorMsg, 100, "/Stage %s - %s timeout",LoadStagesStr[LoadStages], MotorStr[MotorId]); + Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0); + } LoadStatus = ERROR; ThreadLoadingReport(); @@ -447,13 +460,13 @@ { REPORT_MSG(LoadStages, "Thread Load State Machine step Thread_Load_Initial_Tension"); load.color = BLINK; + CallbackCounter++; if (FPGA_Read_limit_Switches(GPI_SW_SPOOL_EXISTS)==LIMIT) { REPORT_MSG(LIMIT, "No cone in winder"); Thread_Load_HomingCallback(HARDWARE_MOTOR_TYPE__MOTO_WINDER,NO_LIMIT); //return ERROR; } - CallbackCounter++; MotorMovetoBreakSensor (HARDWARE_MOTOR_TYPE__MOTO_WINDER,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_WINDER].directionthreadwize, 500, Thread_Load_HomingCallback,10000); return OK; @@ -805,6 +818,13 @@ //Jog Thread Shortly To Make Sure Spool Is Running. Report End Of Loading { REPORT_MSG(LoadStages, "Thread Load State Machine step Thread_Load_Jog_Thread"); + if (Get_COVER_1_State(DryerDoor)) + { + CallbackCounter++; + REPORT_MSG(LIMIT, "Dryer door open"); + Thread_Load_HomingCallback(HARDWARE_MOTOR_TYPE__MOTO_WINDER,NO_LIMIT); + return ERROR; + } keepfeedertension = feedertension; ProcessParametersKeep.feedertension = 0.0; ThreadJoggingFunc(20); diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index 0da78dc9c..06dac8fdc 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -213,21 +213,26 @@ uint32_t InitSequenceMidTankCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag Disable_MidTank_Pressure_Reading(portId); Valve_Set(IDS_Id_to_AirValve[portId], Atm_MidTank_OFF ); //Atm_MidTank_OFF/ON //Control3WayValvesWithCallback ((Valves_t)portId, MidTank_Dispenser, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer - } else if (MidTankOperationCounter >= MidTankReadPressure) { //read pressure for midtank (MidTankOperationCounter-MidTankCloseAir) portId = MidTankOperationCounter%MAX_SYSTEM_DISPENSERS; - Read_MidTank_Pressure_Sensor(portId); + if((IfIndex==0)||(Get_MidTank_Pressure_Sensor(portId)<0.5)) + { + Read_MidTank_Pressure_Sensor(portId); + } } else if (MidTankOperationCounter >= MidTankOpenAir) { //open air valve for midtank (MidTankOperationCounter-MidTankOpenAir) portId = (MidTankOperationCounter - MidTankOpenAir) ; //0-7 - Enable_MidTank_Pressure_Reading(portId); - Valve_Set(IDS_Id_to_AirValve[portId], Atm_MidTank_ON ); //Atm_MidTank_OFF/ON - Control3WayValvesWithCallback ((Valves_t)portId, Dispenser_Mixer, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer + if((IfIndex==0)||(Get_MidTank_Pressure_Sensor(portId)<0.5)) + { + Enable_MidTank_Pressure_Reading(portId); + Valve_Set(IDS_Id_to_AirValve[portId], Atm_MidTank_ON ); //Atm_MidTank_OFF/ON + Control3WayValvesWithCallback ((Valves_t)portId, Dispenser_Mixer, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer + } } MidTankOperationCounter++; return OK; @@ -544,6 +549,8 @@ uint32_t InitSequenceWaitForCoolerCallBackFunction(uint32_t IfIndex, uint32_t Bu } else Report("InitSequenceWaitForCoolerCallBackFunction called too late",__FILE__,__LINE__,(int)InitStages,RpWarning,(int)MachineStateDetail,0); + MidTankControlId = AddControlCallback("Init Midtank", InitSequenceMidTankCallBackFunction, 300/*eHundredMillisecond*/, TemplateDataReadCBFunction,1,0, 0 ); + return OK; } uint32_t InitSequenceWaitForCooler(void) |
