From 22eaa079a4bd20c81d221b2fa623756fc338e168 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 7 Jun 2020 16:28:45 +0300 Subject: thread loading messages 1 --- .../PMR/Stubs/StubDispenserEEpromData.pb-c.c | 26 ++++---- .../PMR/Stubs/StubDispenserEEpromData.pb-c.h | 26 ++++---- .../Stubs/StubMainCardEEpromWriteResponse.pb-c.c | 43 +++++++++++-- .../Stubs/StubMainCardEEpromWriteResponse.pb-c.h | 6 +- .../Embedded_SW/Embedded/Drivers/Motors/Motor.h | 31 ++++++++++ .../Embedded/Modules/Thread/ThreadLoad.c | 41 +++++++------ .../StateMachines/Initialization/InitSequence.h | 2 + .../StateMachines/Initialization/PowerIdle.c | 70 +++++++++++++++++++++- 8 files changed, 193 insertions(+), 52 deletions(-) (limited to 'Software') diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromData.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromData.pb-c.c index 26e3d8b31..fe523f009 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromData.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromData.pb-c.c @@ -142,7 +142,7 @@ static const ProtobufCFieldDescriptor stub_dispenser_eeprom_data__field_descript "", 8, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, offsetof(StubDispenserEEpromData, has_minimalpressure), offsetof(StubDispenserEEpromData, minimalpressure), NULL, @@ -154,7 +154,7 @@ static const ProtobufCFieldDescriptor stub_dispenser_eeprom_data__field_descript "", 9, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, offsetof(StubDispenserEEpromData, has_maximalpressure), offsetof(StubDispenserEEpromData, maximalpressure), NULL, @@ -166,7 +166,7 @@ static const ProtobufCFieldDescriptor stub_dispenser_eeprom_data__field_descript "", 10, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, offsetof(StubDispenserEEpromData, has_minimalmv), offsetof(StubDispenserEEpromData, minimalmv), NULL, @@ -178,7 +178,7 @@ static const ProtobufCFieldDescriptor stub_dispenser_eeprom_data__field_descript "", 11, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, offsetof(StubDispenserEEpromData, has_maximalmv), offsetof(StubDispenserEEpromData, maximalmv), NULL, @@ -202,7 +202,7 @@ static const ProtobufCFieldDescriptor stub_dispenser_eeprom_data__field_descript "", 13, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, offsetof(StubDispenserEEpromData, has_bubblesize), offsetof(StubDispenserEEpromData, bubblesize), NULL, @@ -214,7 +214,7 @@ static const ProtobufCFieldDescriptor stub_dispenser_eeprom_data__field_descript "", 14, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, offsetof(StubDispenserEEpromData, has_avg_nl_stepvalue_1_4), offsetof(StubDispenserEEpromData, avg_nl_stepvalue_1_4), NULL, @@ -226,7 +226,7 @@ static const ProtobufCFieldDescriptor stub_dispenser_eeprom_data__field_descript "", 15, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, offsetof(StubDispenserEEpromData, has_avg_nl_stepvalue_2_4), offsetof(StubDispenserEEpromData, avg_nl_stepvalue_2_4), NULL, @@ -238,7 +238,7 @@ static const ProtobufCFieldDescriptor stub_dispenser_eeprom_data__field_descript "", 16, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, offsetof(StubDispenserEEpromData, has_avg_nl_stepvalue_3_4), offsetof(StubDispenserEEpromData, avg_nl_stepvalue_3_4), NULL, @@ -250,7 +250,7 @@ static const ProtobufCFieldDescriptor stub_dispenser_eeprom_data__field_descript "", 17, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, offsetof(StubDispenserEEpromData, has_avg_nl_stepvalue_4_4), offsetof(StubDispenserEEpromData, avg_nl_stepvalue_4_4), NULL, @@ -262,7 +262,7 @@ static const ProtobufCFieldDescriptor stub_dispenser_eeprom_data__field_descript "", 18, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, offsetof(StubDispenserEEpromData, has_sw_reserve), offsetof(StubDispenserEEpromData, sw_reserve), NULL, @@ -322,7 +322,7 @@ static const ProtobufCFieldDescriptor stub_dispenser_eeprom_data__field_descript "", 23, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, offsetof(StubDispenserEEpromData, has_pressureslope), offsetof(StubDispenserEEpromData, pressureslope), NULL, @@ -358,7 +358,7 @@ static const ProtobufCFieldDescriptor stub_dispenser_eeprom_data__field_descript "", 26, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, offsetof(StubDispenserEEpromData, has_spare1), offsetof(StubDispenserEEpromData, spare1), NULL, @@ -370,7 +370,7 @@ static const ProtobufCFieldDescriptor stub_dispenser_eeprom_data__field_descript "", 27, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, offsetof(StubDispenserEEpromData, has_spare2), offsetof(StubDispenserEEpromData, spare2), NULL, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromData.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromData.pb-c.h index 8b1a70fd5..170c4028c 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromData.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubDispenserEEpromData.pb-c.h @@ -37,27 +37,27 @@ struct _StubDispenserEEpromData char *pcbpartnumber; char *dispensers_n; protobuf_c_boolean has_minimalpressure; - uint32_t minimalpressure; + int32_t minimalpressure; protobuf_c_boolean has_maximalpressure; - uint32_t maximalpressure; + int32_t maximalpressure; protobuf_c_boolean has_minimalmv; - uint32_t minimalmv; + int32_t minimalmv; protobuf_c_boolean has_maximalmv; - uint32_t maximalmv; + int32_t maximalmv; protobuf_c_boolean has_totalcycles; uint32_t totalcycles; protobuf_c_boolean has_bubblesize; - uint32_t bubblesize; + int32_t bubblesize; protobuf_c_boolean has_avg_nl_stepvalue_1_4; - uint32_t avg_nl_stepvalue_1_4; + int32_t avg_nl_stepvalue_1_4; protobuf_c_boolean has_avg_nl_stepvalue_2_4; - uint32_t avg_nl_stepvalue_2_4; + int32_t avg_nl_stepvalue_2_4; protobuf_c_boolean has_avg_nl_stepvalue_3_4; - uint32_t avg_nl_stepvalue_3_4; + int32_t avg_nl_stepvalue_3_4; protobuf_c_boolean has_avg_nl_stepvalue_4_4; - uint32_t avg_nl_stepvalue_4_4; + int32_t avg_nl_stepvalue_4_4; protobuf_c_boolean has_sw_reserve; - uint32_t sw_reserve; + int32_t sw_reserve; protobuf_c_boolean has_spare1_pressure; int32_t spare1_pressure; protobuf_c_boolean has_spare2_pressure; @@ -67,14 +67,14 @@ struct _StubDispenserEEpromData protobuf_c_boolean has_color; uint32_t color; protobuf_c_boolean has_pressureslope; - uint32_t pressureslope; + int32_t pressureslope; char *productiondate; protobuf_c_boolean has_atslocation; uint32_t atslocation; protobuf_c_boolean has_spare1; - uint32_t spare1; + int32_t spare1; protobuf_c_boolean has_spare2; - uint32_t spare2; + int32_t spare2; protobuf_c_boolean has_atschannel; uint32_t atschannel; protobuf_c_boolean has_unitempty; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteResponse.pb-c.c index 4d2e53d4c..818da358a 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteResponse.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteResponse.pb-c.c @@ -52,9 +52,42 @@ void stub_main_card_eeprom_write_response__free_unpacked assert(message->base.descriptor == &stub_main_card_eeprom_write_response__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -#define stub_main_card_eeprom_write_response__field_descriptors NULL -#define stub_main_card_eeprom_write_response__field_indices_by_name NULL -#define stub_main_card_eeprom_write_response__number_ranges NULL +static const ProtobufCFieldDescriptor stub_main_card_eeprom_write_response__field_descriptors[2] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(StubMainCardEEpromWriteResponse, has_address), + offsetof(StubMainCardEEpromWriteResponse, address), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(StubMainCardEEpromWriteResponse, has_data), + offsetof(StubMainCardEEpromWriteResponse, data), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_main_card_eeprom_write_response__field_indices_by_name[] = { + 0, /* field[0] = Address */ + 1, /* field[1] = Data */ +}; +static const ProtobufCIntRange stub_main_card_eeprom_write_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; const ProtobufCMessageDescriptor stub_main_card_eeprom_write_response__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, @@ -63,10 +96,10 @@ const ProtobufCMessageDescriptor stub_main_card_eeprom_write_response__descripto "", "", sizeof(StubMainCardEEpromWriteResponse), - 0, + 2, stub_main_card_eeprom_write_response__field_descriptors, stub_main_card_eeprom_write_response__field_indices_by_name, - 0, stub_main_card_eeprom_write_response__number_ranges, + 1, stub_main_card_eeprom_write_response__number_ranges, (ProtobufCMessageInit) stub_main_card_eeprom_write_response__init, NULL,NULL,NULL /* reserved[123] */ }; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteResponse.pb-c.h index 21c64bf05..90390c99f 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteResponse.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubMainCardEEpromWriteResponse.pb-c.h @@ -26,10 +26,14 @@ typedef struct _StubMainCardEEpromWriteResponse StubMainCardEEpromWriteResponse; struct _StubMainCardEEpromWriteResponse { ProtobufCMessage base; + protobuf_c_boolean has_address; + int32_t address; + protobuf_c_boolean has_data; + int32_t data; }; #define STUB_MAIN_CARD_EEPROM_WRITE_RESPONSE__INIT \ { PROTOBUF_C_MESSAGE_INIT (&stub_main_card_eeprom_write_response__descriptor) \ - } + , 0, 0, 0, 0 } /* StubMainCardEEpromWriteResponse methods */ diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.h b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.h index 79a56d785..355af95b4 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.h +++ b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.h @@ -18,6 +18,37 @@ #include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" #define TimerMotors_t HardwareMotorType + static char* MotorStr[30] = { + "Dh Clean Head", + "Dh Clean Mech", + "Dh Lid ", + "Dryer Driving", + "Dryer Lid ", + "Dryer Loadarm", + "Dispenser 1", + "Dispenser 2", + "Dispenser 3", + "Dispenser 4", + "Dispenser 5", + "Dispenser 6", + "Dispenser 7", + "Dispenser 8", + "Screw ", + "Winder ", + "Left Dancer ", + "Middle Dancer", + "Left Driving ", + "Left Loading ", + "Left pivot ", + "Right Dancer ", + "Right Driving", + "Right Loadarm", + "Right Loading", + "Spare1 1", + "Spare1 2", + "Spare2 1", + "Spare2 2", + "Spare3 1"}; //#define NUM_OF_MOTORS (HARDWARE_MOTOR_TYPE__MOTO_RLOADING + 1) // TODO After the integration with mulbery change to: diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index a91781ce4..61ceb0813 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -50,20 +50,20 @@ //#include //#include static char* LoadStagesStr[15] = { - /*00*/ "INIT", - /*01*/ "REDUCE_HEAT", - /*02*/ "LIFT_ROCKERS", - /*03*/ "SET_LOAD_ARM", - /*04*/ "OPEN_COVERS", - /*05*/ "LIFT_DANCERS", - /*06*/ "INITIAL_TENSION", - /*07*/ "CLOSE_ROCKERS", - /*08*/ "CLOSE_DANCERS", - /*09*/ "CLOSE_LIDS", - /*10*/ "JOG_FEEDER", - /*11*/ "DRYER_LOADING", - /*12*/ "RESUME_HEATING", - /*13*/ "JOG_THREAD" , + /*00*/ "Initialization", + /*01*/ "heating stop", + /*02*/ "Rockers opening", + /*03*/ "Drier unloading", + /*04*/ "Lids opening", + /*05*/ "Dancers opening", + /*06*/ "Initial tension building", + /*07*/ "Rockers closing", + /*08*/ "Dancers closing", + /*09*/ "Lids closing", + /*10*/ "Feeder jogging", + /*11*/ "Drier loading", + /*12*/ "Heating resuming", + /*13*/ "Thread jogging" , /*14*/ "END"}; /* typedef enum @@ -284,7 +284,7 @@ { TimeoutsCounter = 0; load.color = fastBILNK; - usnprintf(LoadErrorMsg, 100, "Load sequence timeout %s motor %d",LoadStagesStr[LoadStages], MotorId); + usnprintf(LoadErrorMsg, 100, "Stage %s - motor %s timeout",LoadStagesStr[LoadStages], MotorStr[MotorId]); Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0); LoadStatus = ERROR; @@ -493,7 +493,7 @@ if (HandleProcessParameters(&ProcessParametersRecover,false)!= OK) { - usnprintf(LoadErrorMsg, 100, "Load sequence error %d",LoadStagesStr[LoadStages]); + usnprintf(LoadErrorMsg, 100, "Stage %s error",LoadStagesStr[LoadStages]); Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0); } else @@ -617,8 +617,9 @@ Report("Store Number of cycles in drier - halted",__FILE__,__LINE__,numberOfCycles,RpMessage,LoadArmRounds,0); MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,numberOfCycles); TimeoutsCounter = 0; + CallbackCounter = 0; load.color = fastBILNK; - usnprintf(LoadErrorMsg, 100, "Load sequence timeout %s motor %d",LoadStagesStr[LoadStages], HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM); + usnprintf(LoadErrorMsg, 100, "Stage %s - Drier load arm timeout",LoadStagesStr[LoadStages]); Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0); LoadStatus = ERROR; MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, 200); @@ -834,7 +835,7 @@ MotorStop(HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,Hard_Hiz); MotorStop(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,Hard_Stop); load.color = fastBILNK; - usnprintf(LoadErrorMsg, 100, "Load sequence timeout %s motor %d",LoadStagesStr[LoadStages], HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM); + usnprintf(LoadErrorMsg, 100, "Stage %s - Drier load arm timeout",LoadStagesStr[LoadStages]); Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0); Report("Drier unloading timeout(1) or no movement",__FILE__,temp,DrierPrevLocation,RpWarning,ReadValue,0); LoadStatus = ERROR; @@ -950,6 +951,8 @@ { REPORT_MSG(ReadValue,"ThreadLoadStateMachine"); ThreadLoaded(); + ThreadLoadingReport(); + if (LoadStages!=ReadValue) LoadStages = ReadValue; switch (ReadValue) @@ -1038,6 +1041,7 @@ LOG_ERROR(LoadStages,"ERROR IN LOAD STATE MACHINE"); break; } + return OK; } uint32_t ThreadLoadButton(THREAD_LOAD_STAGES_ENUM ReadValue) @@ -1054,6 +1058,7 @@ uint32_t ThreadLoadButton(THREAD_LOAD_STAGES_ENUM ReadValue) } Report("ThreadLoadButton",__FILE__,__LINE__,LoadStages,RpMessage,ReadValue,0); Report("ThreadLoadButton params",__FILE__,LoadStatus,TryAgain,RpMessage,SecondTry,0); + ThreadLoadingReport(); if (LoadStatus == ERROR) { if ((SecondTry == false)&&(TryAgain == true)) diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.h b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.h index b8fb8efd7..8ce835a06 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.h +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.h @@ -29,6 +29,8 @@ MACHINE_STATE_MAX, }MACHINE_STATE_STAGES_ENUM; +extern char PowerUpToken[36+1]; + uint32_t Start_InitSequence(void); void StopInitSequence(void); MACHINE_STATE_STAGES_ENUM GetMachineState(void); diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c index 69df1c183..27ad14ea6 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c @@ -13,8 +13,15 @@ #include "modules/heaters/heaters_ex.h" #include "modules/Diagnostics/Diagnostics.h" #include "Modules/General/process.h" -#include "PMR/MachineStatus/MachineStatus.pb-c.h" #include "Modules/General/MachineStatus.h" +#include "Modules/General/buttons.h" + +#include "PMR/Power/StartPowerUpRequest.pb-c.h" +#include "PMR/Power/AbortPowerUpRequest.pb-c.h" +#include "PMR/Power/StartPowerUpResponse.pb-c.h" +#include "PMR/Power/AbortPowerUpResponse.pb-c.h" +#include "PMR/Power/PowerUpState.pb-c.h" +#include "PMR/MachineStatus/MachineStatus.pb-c.h" #include "StateMachines/Printing/PrintingSTM.h" #include "StateMachines/Initialization/PowerOffSequence.h" @@ -24,7 +31,7 @@ #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" #include "drivers/Valves/Valve.h" #include -#include "Modules/General/buttons.h" +#include "drivers/Heater/TemperatureSensor.h" #include "heaters/heaters_ex.h" @@ -166,9 +173,67 @@ void setIdleLimit (int Limit) {powerIdleSecondsLimit = Limit;} void setmachineActive(bool Active){machineActive = Active;} void resetIdleCounter (void) {powerIdleSecondsCounter = 0;} bool getIdleState (void) {return powerIdleState;} +uint32_t OutOfIdleUpdate(bool last) +{ + uint32_t status = NOT_SUPPORTED; + + double calculate; + int result = 0; + MessageContainer responseContainer; + ErrorCode Error = ERROR_CODE__NONE; + + StartPowerUpResponse response = START_POWER_UP_RESPONSE__INIT; + + if (PowerUpToken[0] == 0) + return OK; +/* response.has_state = true; + response.has_progresspercentage = true; + + if (last == false) + { + response.state = POWER_UP_STATE__HeatingStarted; + if (dryerzone1temp < 1) + response.progresspercentage = 30.0; + else + { + calculate = (double)((MillisecGetTemperatures(TEMP_SENSE_ANALOG_DRYER_TEMP1)/100)/(dryerzone1temp))*70.0; + if (calculate > 0) + result = (int)calculate; + response.progresspercentage = 30.0 + result; + } + //Report("Heating calculation",__FILE__,(int)dryerzone1temp,(int)response.progresspercentage,RpWarning,(int)result,0); + response.message = "Heating up"; + } + else + { + response.state = POWER_UP_STATE__MachineReadyToDye; + response.progresspercentage = 100.0; + response.message = "Ready to dye"; + } + //Report("PowerUpUpdate",__FILE__,last,(int)response.progresspercentage,RpWarning,(int)stage,0); + Report("OutOfIdleUpdate",__FILE__,last,response.state,RpWarning,(int)response.progresspercentage,0); + responseContainer = createContainer(MESSAGE_TYPE__StartPowerUpResponse, PowerUpToken, last, &response, &start_power_up_response__pack, &start_power_up_response__get_packed_size); + responseContainer.has_continuous = true; + responseContainer.continuous = true; + if (Error != ERROR_CODE__NONE) + { + responseContainer.has_error = true; + responseContainer.error = Error; + responseContainer.errormessage = response.message; + } + 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); + //MessageContainer responseContainer; +*/ + return status; +} uint32_t PowerIdleStartHeatingCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) { + OutOfIdleUpdate(false); if (HeaterCheckReady()==true) { //MachineStateDetail = MACHINE_STATE_MACHINE_READY_TO_DYE; @@ -178,6 +243,7 @@ uint32_t PowerIdleStartHeatingCallBackFunction(uint32_t IfIndex, uint32_t BusyFl Report("Remove control callback failed",__FILE__,__LINE__,(int)IdleHeatingControlId,RpWarning,(int)PowerIdleStartHeatingCallBackFunction,0); //InitSequenceStateMachine(InitStages); SetMachineStatus(MACHINE_STATE__Ready); + OutOfIdleUpdate(true); } return OK; -- cgit v1.3.1