diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-12-19 18:01:18 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-12-19 18:01:18 +0200 |
| commit | 60be180a3736bf15e89f51f65bc1d7eda7b6cfae (patch) | |
| tree | b8331374188ee35815b4340f5d93ee8244dcf401 /Software/Embedded_SW/Embedded/Modules | |
| parent | 1208554e06da8aec1b074932df488769572ffcfb (diff) | |
| parent | 935b82a27fb385a68edc9ef4184614862324b304 (diff) | |
| download | Tango-60be180a3736bf15e89f51f65bc1d7eda7b6cfae.tar.gz Tango-60be180a3736bf15e89f51f65bc1d7eda7b6cfae.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
8 files changed, 127 insertions, 70 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 5f2046c3e..598c5df8a 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -150,7 +150,9 @@ uint32_t HWConfigurationInit(void) //ProcessParamsInit(); Buttons_Init(); WHS_init(); - +#ifdef Use_WHS_Card + newWHS_init(); +#endif ADC_MUX_Init(); GeneralHwReady = true; diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c index c49fd81f0..41452cbad 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c @@ -476,7 +476,7 @@ uint32_t IDS_Dispenser_Alarm_On (uint8_t DispenserId) if (Extended_Motor_Param == true) Power_Step_01_Dispenser_Mode(DispenserId,Voltage); //status |= MotorSetMicroStep(MotorId, KeepMicrostep[DispenserId]); - status |= MotorStop(DispenserId, Hard_Hiz); + status |= MotorStop(MotorId, Hard_Hiz); IDS_Dispenser_Init(DispenserId); JobEndReason = JOB_OUT_OF_DYE; return status; @@ -509,7 +509,6 @@ uint32_t IDS_Check_Pressure_Callback(uint32_t DispenserId, uint32_t ReadValue) if (GetDispenserPressure(DispenserId)>3.0) { Report("Pulling dispenser down to reduce pressure",__FILE__,DispenserId,(int)(GetDispenserPressure(DispenserId)*100),RpWarning,200,0); - MotorMove(HW_Motor_Id,1-MotorsCfg[HW_Motor_Id].directionthreadwize,200*MotorsCfg[HW_Motor_Id].microstep); } 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 3af6416cb..9fdcaaf1f 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -81,7 +81,7 @@ int lInterSegmentLength = 0; uint32_t InterSegmentStartWFCFDispensers; uint32_t WFCF = 80; bool EnableCleaning = true; - +bool JobEndSequence = false; void IDS_Dispenser_SetPreSegmentWFCFValues(double dispenserpresegmentwfcf, double ids_presegment_wfcf_timebeforesegment) { if (ids_presegment_wfcf_timebeforesegment) @@ -228,7 +228,7 @@ JobDescriptionFileBrushStop *FirstBrushStop = NULL; int brushCounter = 0; - GeneralHwReady = false; + //GeneralHwReady = false; for (Dispenser_i = 0;Dispenser_i<MAX_SYSTEM_DISPENSERS;Dispenser_i++) { DispenserUsedInJob[Dispenser_i] = false; @@ -317,7 +317,7 @@ JobDescriptionFileBrushStop *FirstBrushStop = NULL; FreeSegmentFileData(Segment); CloseJobFile(); } - GeneralHwReady = true; + //GeneralHwReady = true; int ActiveDispensers = 0; for (Dispenser_i = 0; Dispenser_i < MAX_DYE_DISPENSERS; Dispenser_i++) { @@ -657,6 +657,7 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) //JobTicket* JobTicket = JobDetails; + JobEndSequence = false; if ((feedertension>0.1)&&(feedertension<1.5)) { Report("Setting pressure from RML feeder tension",__FILE__,__LINE__,(int)(feedertension*100),RpWarning,(int)(DispenserPreparePressure*100),0); @@ -733,7 +734,7 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) } else { - /**/if (AutoHoming_Config >= AutoHoming_JobEnd_PowerOn_off) + if (AutoHoming_Config >= AutoHoming_JobEnd_PowerOn_off) { if ((HomingActive[i] == false)&&(PrimingActive[i] == false)) { @@ -744,26 +745,7 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) { Report("Inactive dispenser already homing",__FILE__,i,HomingActive[i],RpWarning,PrimingActive[i],0); } - }/**/ - /*if ((HomingActive[i] == false)&&(PrimingActive[i] == false)) - { - Report("Inactive dispenser open valve",__FILE__,i,HomingActive[i],RpWarning,PrimingActive[i],0); - Control3WayValvesWithCallback (i, Dispenser_Mixer, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer - Report("Homing Inactive dispenser",__FILE__,i,HomingActive[i],RpWarning,PrimingActive[i],0); - IDS_HomeDispenser (i, 1000 , NULL); - } - else - { - Report("Inactive dispenser already homing",__FILE__,i,HomingActive[i],RpWarning,PrimingActive[i],0); - } - }*/ - //if ((HomingActive[i] == false)&&(PrimingActive[i] == false)) - //{ - // Report("Inactive dispenser open valve",__FILE__,i,HomingActive[i],RpWarning,PrimingActive[i],0); - // Control3WayValvesWithCallback (i, Dispenser_Mixer, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer - //} - //ControlIdtoInactiveDispenserId[Dispenser_i] = AddControlCallback( IDS_Check_Pressure_Callback, eOneMinute,TemplateDataReadCBFunction ,0, 0, 0 ); - + } } } if (NumOfActiveDispensers) @@ -1401,6 +1383,12 @@ uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue) int n_dispensers = 0; JobSegment* Segment = (void *)IfIndex; + if (JobEndSequence == true) + { + Report("JobEndSequence",__FILE__,__LINE__,(int)JobBrushStopId,RpWarning,(int)SegmentNumOfBrushStops,0); + SafeRemoveControlCallback(BrushStopControlId,IDSBrushStopRestartCallback); + BrushStopControlId = 0Xff; + } if (uploadstrategy == JOB_UPLOAD_STRATEGY__Default) { Dispensers = Segment->brushstops[JobBrushStopId]->dispensers; @@ -1464,10 +1452,10 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) #endif IDS_Cleaning_Stop_Cleaning_Solution(NULL); SegmentNumOfBrushStops = Segment->n_brushstops; - BrushStopTime = Segment->length/SegmentNumOfBrushStops; //brushstop in meters + BrushStopTime = Segment->length*1000/(double)SegmentNumOfBrushStops; //brushstop in meters //brushstop in millisecond BrushStopTime = ((BrushStopTime*100)/dyeingspeed);//brushstop in seconds - BrushStopTime *= 1000; //brushstop in millisecond - Report("IDSSegmentState",__FILE__,__LINE__,(int)BrushStopTime,RpWarning,(int)SegmentNumOfBrushStops,0); + //BrushStopTime *= 1000; + Report("IDSSegmentState",__FILE__,__LINE__,(int)(BrushStopTime*1000),RpWarning,(int)SegmentNumOfBrushStops,0); if (uploadstrategy == JOB_UPLOAD_STRATEGY__Default) { Dispensers = Segment->brushstops[JobBrushStopId]->dispensers; @@ -1557,7 +1545,7 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) if (FileBrushStop) FreeBrushStopFileData(FileBrushStop); FileBrushStop = NULL; - + JobEndSequence = true; lInterSegmentLength = (dryerbufferCentimeters*1000/dyeingspeed); lInterSegmentLength-=(lInterSegmentLength%100); //round to a 100 multiplication InterSegmentStepsCount = 0; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 373e4bbd9..13b98bcb0 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -445,7 +445,7 @@ MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_LDANCER1, 500); // MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_LDANCER1,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1].directionthreadwize, 500, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1], Thread_Load_HomingCallback,25000); - MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_LDANCER1, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1].directionthreadwize, (2000*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1].microstep), Thread_Load_HomingCallback,20000); + MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_LDANCER1, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1].directionthreadwize, (5000*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1].microstep), Thread_Load_HomingCallback,20000); return OK; } @@ -607,7 +607,7 @@ CallbackCounter++; Report("Thread_Load_Dryer_Loading",__FILE__,__LINE__,LoadStages,RpMessage,CallbackCounter,0); MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize, - numberOfSteps, Thread_Load_Dryer_Loading_Callback, 100000); + numberOfSteps-400, Thread_Load_Dryer_Loading_Callback, 100000); //Keep Notation How Many Rotations In The Dryer //LoadArmInfo.LoadArmBackLash = 0; @@ -1079,7 +1079,6 @@ uint32_t ThreadLoadingReport(void) MessageContainer responseContainer; bool last = false; StartThreadLoadingResponse response = START_THREAD_LOADING_RESPONSE__INIT; - ContinueThreadLoadingResponse Cresponse = CONTINUE_THREAD_LOADING_RESPONSE__INIT; if (ThreadLoadingToken[0] == 0) return OK; @@ -1093,7 +1092,6 @@ uint32_t ThreadLoadingReport(void) if (LoadStages == THREAD_LOAD_INITIAL_TENSION) { response.state = THREAD_LOADING_STATE__ReadyForLoading; - last = true; } } else @@ -1101,32 +1099,30 @@ uint32_t ThreadLoadingReport(void) response.state = THREAD_LOADING_STATE__PreparationError; response.errorreason = LoadErrorMsg; } - responseContainer = createContainer(MESSAGE_TYPE__StartThreadLoadingResponse, ThreadLoadingToken, last, &response, &start_thread_loading_response__pack, &start_thread_loading_response__get_packed_size); - responseContainer.continuous = true; } else if (MessageState == 2) { - Cresponse.has_state = true; + response.has_state = true; if (LoadStatus == OK) { - Cresponse.state = THREAD_LOADING_STATE__Finalizing; + response.state = THREAD_LOADING_STATE__Finalizing; if (LoadStages >= THREAD_LOAD_JOG_THREAD) { - Cresponse.state = THREAD_LOADING_STATE__Completed; + response.state = THREAD_LOADING_STATE__Completed; last = true; } } else { - Cresponse.state = THREAD_LOADING_STATE__FinalizationError; - Cresponse.errorreason = LoadErrorMsg; + response.state = THREAD_LOADING_STATE__FinalizationError; + response.errorreason = LoadErrorMsg; } - responseContainer = createContainer(MESSAGE_TYPE__ContinueThreadLoadingResponse, ThreadLoadingToken, last, &Cresponse, &continue_thread_loading_response__pack, &continue_thread_loading_response__get_packed_size); - responseContainer.continuous = true; } else return ERROR; //------------------------------------------------------------------------------------------- + responseContainer = createContainer(MESSAGE_TYPE__StartThreadLoadingResponse, ThreadLoadingToken, last, &response, &start_thread_loading_response__pack, &start_thread_loading_response__get_packed_size); + responseContainer.continuous = true; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); my_free(responseContainer.data.data); @@ -1149,9 +1145,16 @@ uint32_t StartThreadLoadingFunc(MessageContainer* requestContainer) uint32_t ContinueThreadLoadingFunc(MessageContainer* requestContainer) { ContinueThreadLoadingRequest *request = continue_thread_loading_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - ustrncpy (ThreadLoadingToken, requestContainer->token,36); + ContinueThreadLoadingResponse Cresponse = CONTINUE_THREAD_LOADING_RESPONSE__INIT; + MessageContainer responseContainer; MessageState = 2; ThreadLoadingReport(); + responseContainer = createContainer(MESSAGE_TYPE__ContinueThreadLoadingResponse, requestContainer->token, true, &Cresponse, &continue_thread_loading_response__pack, &continue_thread_loading_response__get_packed_size); + responseContainer.continuous = false; + uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + my_free(responseContainer.data.data); + SendChars((char*)container_buffer, container_size); return OK; } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index f0331b4bc..dd31e9cda 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -722,6 +722,9 @@ uint32_t ThreadInitialTestStub(HardwareMotor * request) JobCounter = 0; TotalProcessedLength = 0.0; PoolerTotalProcessedLength = 0.0; + InitialProcess = true; + initialpos = 0xFFFF; + Poolerinitialpos = 0xFFFF; PrepareState = true; AlarmHandlingSetAlarm(EVENT_TYPE__THREAD_BREAK,false); AlarmHandlingSetAlarm(EVENT_TYPE__THREAD_TENSION_CONTROL_FAILURE_PULLER_DANCER,false); @@ -853,9 +856,6 @@ uint32_t ThreadInitialTestStub(HardwareMotor * request) #endif PrepareReady(Module_Thread,ModuleDone); //set 3 dancers to the profile positions - InitialProcess = true; - initialpos = 0xFFFF; - Poolerinitialpos = 0xFFFF; return OK; } diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c index c5c092ae4..65c124cbd 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c @@ -371,10 +371,10 @@ bool SetValveDirection() U8 CartridgeWasteFilling(bool status) { bool ret = notOK; - SetValveDirection(); + //SetValveDirection(); if ((status == ON) && (WHS_info.active_cartridge != no_waste_cartridge)) { - //SetValveDirection();//Valve_Set(VALVE_WASTE_TANK, WHS_info.active_cartridge); //set the valve direction + SetValveDirection();//Valve_Set(VALVE_WASTE_TANK, WHS_info.active_cartridge); //set the valve direction //Pannel_Leds(PANEL_BUTTON_OR_CRAT_ID Pannel_Led_Id, OPERATION_MODE LED_Mode); //set cartridge led color slow blink SetWastePump(OPEN); //WHS_info.WHS_pump.time = 0; @@ -385,7 +385,7 @@ U8 CartridgeWasteFilling(bool status) else // stop Waste cartridge filling { SetWastePump(CLOSE); - //Valve_Set(VALVE_WASTE_TANK, VALVE_DIR_WAST_CARTRIDGE1); //set the valve direction set to low POWER !!! + Valve_Set(VALVE_WASTE_TANK, VALVE_DIR_WASTE_CARTRIDGE1); //set the valve direction set to low POWER !!! AlarmHandlingSetAlarm( EVENT_TYPE__ALL_WASTE_CARTRIDGES_FULL, true); switch (WHS_info.active_cartridge) @@ -498,7 +498,7 @@ bool initWHS_WasteTank() WHS_info.WHS_sensors.waste_tank_empty_sensor = RdWasteTankEmptySensor(); WHS_info.WHS_sensors.waste_tank_full_sensor = SENSORnotFULL; UpdateStateMachine(); - AddControlCallback(NULL,WasteTankCBFunction, WasteTankCallBackTime , WasteTankCallBackFunction, 0,0,0);//eOneMinute + AddControlCallback("Waste tank",WasteTankCBFunction, WasteTankCallBackTime , WasteTankCallBackFunction, 0,0,0);//eOneMinute return OK; } @@ -569,14 +569,6 @@ WHS_sensor WasteTankCallBackFunction() return ret; } -/* -bool start_WHS_machin() -{ - AddControlCallback( WasteTankCBFunction, eTenMillisecond, WasteTankCallBackFunction, 0,0,0 );// eOneMinute - return OK; -} - */ - bool WasteTankCBFunction() { @@ -744,7 +736,7 @@ bool WasteTankCBFunction() MidTankValvesAction(Cartridge_MidTank_ON); // test the Mid-tank capacity is not at Nadav sequence // Enable_MidTank_Pressure_Reading(IFS_info.Ink.cart_color); - MidTank_Pressure = Read_MidTank_Pressure_Sensor(IFS_info.Ink.cart_color); + MidTank_Pressure = Get_MidTank_Pressure_Sensor(IFS_info.Ink.cart_color); if ( MidTank_Pressure > MidTank_Pressure_EMPTY ) { ReportWithPackageFilter(WasteFilter,"------------ close door MidTank_Pressure > MidTank_Pressure_EMPTY -----------------", __FILE__,__LINE__,(MidTank_Pressure_EMPTY), RpMessage, (int)(MidTank_Pressure*1000), 0); @@ -932,7 +924,7 @@ bool WasteTankCBFunction() REPORT_MSG(WHS_full," ------------ call customer support ----------------- "); Pannel_Leds(CART_1, MODE_ON); cart1.color = fastBILNK; - //IFS_TimeOutAlarm(); + IFS_TimeOutAlarm(true); break; case IFS_MidTankFull: @@ -1172,11 +1164,11 @@ bool InitCartStatus() if (WHS_info.WHS_sensors.cartridge_cover == WHS_CartridgeCoverOPEN) { REPORT_MSG(parameter," ------------ WHS_CartridgeCoverOPEN : add callback for cart1 and cart 2 ----------------- "); - IFS_info.Cartridge_Ink_device_Id = AddControlCallback(NULL, WasteTankCBFunction, eOneSecond, CartridgeInkCallBackFunction, 0,0,0 ); - WHS_info.Cartridge_Waste1_device_Id = AddControlCallback(NULL, WasteTankCBFunction, eOneSecond, CartridgeWaste1CallBackFunction, 0,0,0 ); - WHS_info.Cartridge_Waste2_device_Id = AddControlCallback(NULL, WasteTankCBFunction, eOneSecond, CartridgeWaste2CallBackFunction, 0,0,0 ); + IFS_info.Cartridge_Ink_device_Id = AddControlCallback("Ink Cartridge CB" , WasteTankCBFunction, eOneSecond, CartridgeInkCallBackFunction , 0,0,0 ); + WHS_info.Cartridge_Waste1_device_Id = AddControlCallback("Waste1 Cartridge CB", WasteTankCBFunction, eOneSecond, CartridgeWaste1CallBackFunction, 0,0,0 ); + WHS_info.Cartridge_Waste2_device_Id = AddControlCallback("Waste2 Cartridge CB", WasteTankCBFunction, eOneSecond, CartridgeWaste2CallBackFunction, 0,0,0 ); } - WHS_info.Cartridge_Cover_device_Id = AddControlCallback(NULL, WasteTankCBFunction, eOneSecond, CartridgeCoverCallBackFunction, 0,0,0 ); + WHS_info.Cartridge_Cover_device_Id = AddControlCallback("Cartridge Cover Door", WasteTankCBFunction, eOneSecond, CartridgeCoverCallBackFunction, 0,0,0 ); return OK; } @@ -1216,22 +1208,27 @@ bool SetActiveWastCartridge() uint8_t parameter = 5; bool ret = notOK; - if (( WHS_info.WHS_sensors.waste_cartridge1_precense_sensor == PRECENSE ) && - (WHS_info.cartridge_1.autheticate == PASSED)) + if (( WHS_info.WHS_sensors.waste_cartridge1_precense_sensor == PRECENSE ) + && (WHS_info.cartridge_1.autheticate == PASSED) + && (WHS_info.cartridge_1.status == WasteEmpty)) { REPORT_MSG(parameter," ------------ WHS : active_cartridge = waste_cartridge 1 ----------------- "); WHS_info.active_cartridge = waste_cartridge1; + AlarmHandlingSetAlarm( EVENT_TYPE__NO_WASTE_CARTRIDGE_AVAILABLE, false); } - else if (( WHS_info.WHS_sensors.waste_cartridge2_precense_sensor == PRECENSE) && - (WHS_info.cartridge_2.autheticate == PASSED)) + else if (( WHS_info.WHS_sensors.waste_cartridge2_precense_sensor == PRECENSE) + && (WHS_info.cartridge_2.autheticate == PASSED) + && (WHS_info.cartridge_2.status == WasteEmpty)) { REPORT_MSG(parameter," ------------ WHS : active_cartridge = waste_cartridge 2 ----------------- "); WHS_info.active_cartridge = waste_cartridge2; + AlarmHandlingSetAlarm( EVENT_TYPE__NO_WASTE_CARTRIDGE_AVAILABLE, false); } else { REPORT_MSG(parameter," ------------ WHS : NO active_cartridge ----------------- "); WHS_info.active_cartridge = no_waste_cartridge; + AlarmHandlingSetAlarm( EVENT_TYPE__NO_WASTE_CARTRIDGE_AVAILABLE, true); } return ret; diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/newWHS_init.c b/Software/Embedded_SW/Embedded/Modules/Waste/newWHS_init.c new file mode 100644 index 000000000..d9801f179 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Modules/Waste/newWHS_init.c @@ -0,0 +1,48 @@ + + + + +#include "include.h" +#include <DataDef.h> +#include <Modules/Waste/newWHS_init.h> + +#include <Drivers/I2C_Communication/WHS_Card/IO_Ports_TCA9555/WHS_IO.h> +#include <Drivers/I2C_Communication/WHS_Card/IO_Ports_TCA9555/TCA9555_Driver.h> +#include <Drivers/I2C_Communication/WHS_Card/I2C_WHS_Mux.h> +#include <Drivers/I2C_Communication/I2C.h> +#include "Drivers/I2C_Communication/WHS_Card/WHS_data.h" +#include <Drivers/I2C_Communication/WHS_Card/EEPROM/WHS_EEPROM.h> +#include <Drivers/I2C_Communication/WHS_Card/D_EMC2302_Fan/WHS_Fan.h> +#include <Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC/Max_5805.h> +bool test_9555(void); + + +bool newWHS_init(void) +{ + bool status = OK; +// status = Select_Main_WHS_Mux_Channel(); + status |= WHS_IO_Init(); + if (Test_WHS_EEPROM()!= OK) + { + ReportWithPackageFilter(WasteFilter,"------------ Test_WHS_EEPROM U32: test is failed-----------------", __FILE__,__LINE__,0, RpMessage, 0, 0); + } + status = Test_WHS_Fan(); + status = Test_WHS_blower(); + status |= Test_WHS_valve(); + status |= Test_WHS_pump(); + + //test_9555(); + return status; +} + + +bool test_9555(void) +{ + bool status = OK; + + status = D_TCA9555_Write_IO(I2C_ID_WHS_CARD, I2CExp1_ADDRESS, TCA9555_PORT_0, Whs_I2C_EXP_U3_0x40_VALUE.uchar[0]); + + return status; +} + + diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/newWHS_init.h b/Software/Embedded_SW/Embedded/Modules/Waste/newWHS_init.h new file mode 100644 index 000000000..ca2894499 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Modules/Waste/newWHS_init.h @@ -0,0 +1,20 @@ +/* + * newWHS_init.h + * + * Created on: Dec 11, 2019 + * Author: Shai + */ + +#ifndef newWHS_init_H_ +#define newWHS_init_H_ + +//#include <Drivers/I2C_Communication/WHS_Card/IO_Ports_TCA9555/TCA9555_Driver.h> +//#include <Drivers/I2C_Communication/WHS_Card/WHS_data.h> + + + + +bool newWHS_init(void); + + +#endif |
