diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-03-29 15:46:42 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-03-29 15:46:42 +0300 |
| commit | fd16e827fd4d59636798c4cd4a7ebd00c3cb146f (patch) | |
| tree | e284c218e6c4bfbede448fb18e6c5e598c44ceaf /Software/Embedded_SW | |
| parent | 08bd4400dfd45245ae301b5cb28103322ddf865a (diff) | |
| download | Tango-fd16e827fd4d59636798c4cd4a7ebd00c3cb146f.tar.gz Tango-fd16e827fd4d59636798c4cd4a7ebd00c3cb146f.zip | |
State machine handling
Diffstat (limited to 'Software/Embedded_SW')
13 files changed, 240 insertions, 50 deletions
diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c index b09821c3e..e97d49094 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c +++ b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c @@ -14,12 +14,16 @@ #include "include.h" #include "motor.h" #include "Modules/thread/thread.h" +#include "Modules/Control/control.h" #include <stdint.h> #include <stdbool.h> MotorDriverConfigStruc MotorDriverCfg[NUM_OF_MOTORS]; TimerMotors_t FastMotorToMotorId[4] = {MOTOR_RDRIVING,MOTOR_DRYER_DRIVING,MOTOR_LDRIVING,MOTOR_WINDER}; +callback_fptr MotorMoveModuleCallback = 0; +uint32_t ControlCallBackFunction(uint32_t deviceID, uint32_t ReadValue); +uint32_t MotorMoveCallBackFunction(uint32_t deviceId, uint32_t BusyFlag); //initialize general motors driver database uint32_t MotorsInit(void) @@ -91,6 +95,10 @@ bool MotorGetnBusyState(TimerMotors_t _motorId) return true; } +bool MotorControlGetnBusyState(uint32_t _motorId, uint32_t parameter) +{ + return true; +} /* * Stop Command @@ -108,7 +116,18 @@ uint32_t MotorMove(TimerMotors_t _motorId,bool direction, uint32_t Steps) uint32_t MotorMoveWithCallback (TimerMotors_t _motorId,bool direction, uint32_t Steps, callback_fptr callback) { - return OK; + assert (callback); + //assert (isValid(deviceId)); + + //call driver action to device id with the parameter + //SetMotorSpeed (deviceId, parameter); + MotorMove(_motorId,direction,Steps); + MotorMoveModuleCallback = callback; + //start control: +//uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlFrequency, DataReadCBFunction DriverfPtr, uint32_t Parameter1, uint32_t Parameter2 ) + + uint32_t ControlId = AddControlCallback( MotorMoveCallBackFunction, eTenMilliSecond, MotorControlGetnBusyState, _motorId, 0 ); + return ControlId; } uint32_t MotorSetSpeedWithCallback (TimerMotors_t _motorId, uint32_t _freq, int MicroSteps, callback_fptr callback) @@ -116,3 +135,19 @@ uint32_t MotorSetSpeedWithCallback (TimerMotors_t _motorId, uint32_t _freq, int return OK; } +uint32_t MotorMoveCallBackFunction(uint32_t deviceId, uint32_t BusyFlag) +{ + if (BusyFlag == 1) + { + //stop this control loop + RemoveControlCallback(deviceId, MotorMoveCallBackFunction ); + //possibly: start regular control (speed etc) + //uint32_t ControlId = AddControlCallback(ControlCBFunction Callback, eOneMillisecond, NULL, deviceId, Parameter ); + + //call the module callback + MotorMoveModuleCallback(deviceId,BusyFlag); + + } + return OK; +} + diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index c09dedb6f..fc3189793 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -18,9 +18,13 @@ #include "Common/Sys_PinOut_Config/Pin_config.h" #include "Drivers/ADC_Sampling/ADC.h" #include "Drivers/Peripheral_GPIO/GPIO.h" +#include "Drivers/Peripheral_GPIO/GPIO.h" +#include "drivers/Heater/Heater.h" + #include "Modules/Stubs_Handler/Container.h" #include "drivers/twine_graphicslib/graphics_adapter.h" +#include <drivers/Flash_Memory/Flash_Memory.h> /* #include "Drivers/SPI_SDCARD/SDSPI.h" @@ -120,6 +124,7 @@ int main(void) InitParams.MaxNumberOfPrivateDistributors = 2; ReportInit (InitParams); + //FlashFS_Init(); // // Enable lazy stacking for interrupt handlers. This allows floating-point // instructions to be used within interrupt handlers, but at the expense of diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index cdf7d3fc8..b69ca095b 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -14,6 +14,8 @@ #include "Modules/Stubs_Handler/Container.h" #include "PMR/Hardware/UploadHardWareConfigurationRequest.pb-c.h" #include "PMR/Hardware/UploadHardWareConfigurationResponse.pb-c.h" +#include "PMR/Hardware/SystemResetRequest.pb-c.h" +#include "PMR/Hardware/SystemResetResponse.pb-c.h" PortInfoStruct PortInfoTable[MAX_PORT_ENUM] = { {ANALOG_MIXCHIP_TEMP,"ANALOG_MIXCHIP_TEMP"}, @@ -347,3 +349,35 @@ uint32_t HWConfigurationFunc(MessageContainer* requestContainer) } + +void HWSystemResetRequest(MessageContainer* requestContainer) +{ + uint32_t status = FAILED; + unsigned char Brd_ID = 0; + unsigned char Assy_ID = 0; + + MessageContainer responseContainer; + SystemResetRequest* request = system_reset_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + + status = 0; + + SystemResetResponse response = SYSTEM_RESET_RESPONSE__INIT; + + + responseContainer = createContainer(MESSAGE_TYPE__SystemResetResponse, requestContainer->token, true, &response, &system_reset_response__pack, &system_reset_response__get_packed_size); + + Write_status_response(status); + + free(request); + //------------------------------------------------------------------------------------------- + uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + SendChars((char*)container_buffer, container_size); + free(container_buffer); + free(requestContainer); + + ROM_SysCtlDelay(SYS_CLK_FREQ); + + HWREG(NVIC_APINT) = NVIC_APINT_VECTKEY | NVIC_APINT_SYSRESETREQ; + +} diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.h b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.h index ab55c3e57..d0bcca682 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.h +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.h @@ -309,5 +309,6 @@ typedef struct extern PortInfoStruct PortInfoTable[MAX_PORT_ENUM]; extern uint32_t HWConfigurationFunc(MessageContainer* requestContainer); +extern void HWSystemResetRequest(MessageContainer* requestContainer); #endif diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c index f3ceb4952..19953ade4 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c @@ -169,7 +169,7 @@ void HeatingTestSendResonse(uint32_t status, bool last,bool heater1Active,bool h // uint8_t* container_buffer; uint8_t container_buffer[50]; - if (stubToken[0] = 0) + if (stubToken[0] == 0) return; StubHeatingTestPollResponse response = STUB_HEATING_TEST_POLL_RESPONSE__INIT; @@ -251,9 +251,9 @@ uint32_t HeaterConfigRequestMessage(HardwarePidControl* request) //HeaterControl[HeaterId].kp = 0.5; //HeaterControl[HeaterId].ki = 0.1; //HeaterControl[HeaterId].kd = 0.0; - HeaterControl[HeaterId].kp = request->kp; - HeaterControl[HeaterId].ki = request->ki; - HeaterControl[HeaterId].kd = request->kd; + HeaterControl[HeaterId].kp = request->sensorcorrectionadjustment; + HeaterControl[HeaterId].ki = request->integraltime; + HeaterControl[HeaterId].kd = request->derivativetime; if (HeaterId < MAX_AC_HEATERS) AcHeaterConfigured[HeaterId] = true; diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index e41c79b2b..c13d6b5b3 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -243,7 +243,8 @@ uint32_t HeaterControlCBFunction(uint32_t deviceID, uint32_t ReadValue) else { InitialHeating = false; - JobPrepareReady(Module_Heaters,OK); + PrepareReady(Module_Heaters,OK); + } } if(HeaterPIDConfig[index].m_isEnabled && (HeaterPIDConfig[index].m_SetParam != 0)) diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Container.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Container.c index a26de89fe..0be3d5fa9 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Container.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Container.c @@ -165,6 +165,10 @@ void receive_callback(char* buffer, size_t length) case MESSAGE_TYPE__StubHeatingTestPollRequest: HeatingTestPollRequest(requestContainer); break; + case MESSAGE_TYPE__SystemResetRequest: + HWSystemResetRequest(requestContainer); + break; + default: //unsupported message type !! break; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h index f568f9816..fca12d50e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h @@ -33,8 +33,11 @@ typedef struct { uint32_t startoffsetpulses; uint32_t spoolbackingrate; - uint32_t segmentoffsetpulses; + uint32_t segmentoffsetpulses;// the spool winding initial length in mm uint32_t milimetersperrotation; + uint32_t SpoolBottomBackingRate;// the angle of the bottom of the spool + double NumberOfRotationPerPassage; // how many rotations per spool passage + double diameter; }InternalWinderConfigStruc; typedef struct @@ -55,7 +58,7 @@ typedef enum threadMotorsEnum SCREW_MOTOR, MAX_THREAD_MOTORS_NUM }threadMotorsEnum; - +#define MAX_THREAD_FEED_MOTORS WINDER_MOTOR+1 extern uint32_t ThreadMotorIdToMotorId[MAX_THREAD_MOTORS_NUM]; @@ -69,6 +72,8 @@ uint32_t InternalWindingConfigMessage(JobSpool* request); uint32_t DancerConfigMessage(HardwareDancer * request); +uint32_t ThreadPrepareState(void *JobDetails); + #endif //MODULES_THREAD_THREAD_H_ diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 05fb0a934..9474ee44d 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -15,11 +15,11 @@ uint32_t Winder_PrepareStage2(void); uint32_t Winder_Init(void) { - + return OK; } uint32_t Winder_Prepare(void) { - uint32_t status; + uint32_t status = 0; /* * 1. move home to the limit switch (check that the cart is clear from the limit switch, start moving, with acceleration to maximal speed. enable interrupt on the limit switch, upon interrupt stop. * 2. move back x steps - according to thehw specifications and bobine definitions in the job. move for a predefined number of steps. get a callback when done @@ -34,9 +34,9 @@ uint32_t Winder_Prepare(void) { Winder_ScrewHoming = true; status = MotorSetDirection(MOTOR_SCREW,1);//make sur to move the cart home - status = MotorSetSpeed(MOTOR_SCREW, MotorsCfg[SCREW_MOTOR].maxfreq, 8); - + status |= MotorSetSpeed(MOTOR_SCREW, MotorsCfg[SCREW_MOTOR].maxfreq, 8); } + return status; } uint32_t Winder_PrepareStage2(void) { @@ -48,22 +48,53 @@ uint32_t Winder_PrepareStage2(void) * report ready to the job STM */ status = MotorSetDirection(MOTOR_SCREW,0);//make sur to move the cart out - status |= MotorMoveSteps (MOTOR_SCREW, numOfSteps, Winder_ScrewAtOffsetCallback); - status |= MotorSetSpeed(MOTOR_SCREW, MotorsCfg[SCREW_MOTOR].maxfreq, 8); - + //status |= MotorMoveSteps (MOTOR_SCREW, numOfSteps, Winder_ScrewAtOffsetCallback); + //set motor location 0 here return status; } -uint32_t Winder_Print(void) +uint32_t Winder_Print(void *JobDetails) { - /* - * speed is set by the winding parameters and by winder rotational speed (read POSITION every 10msec) - * calculate - */ + JobTicket* JobTicket = JobDetails; + int process_speed = JobTicket->processparameters->dyeingspeed; + int dryer_speed = process_speed * MotorsCfg[DRYER_MOTOR].ratio2dryerspeed; //set dryer_speed_translation_here + float screw_speed = 0; + float RotationsPerSecond; + +/*typedef struct +{ + uint32_t startoffsetpulses; + uint32_t spoolbackingrate; + uint32_t segmentoffsetpulses; + uint32_t milimetersperrotation; + int32 SpoolBottomBackingRate;// the angle of the bottom of the spool + double NumberOfRotationPerPassage; // how many rotations per spool passage +}InternalWinderConfigStruc; + * */ +// * speed is set by the winding parameters and by winder rotational speed (read POSITION every 10msec) +// * calculate +// * 1. calculate speed according to JobTicket->processparameters->dyeingspeed + // calculation input: traverse length in milimeters/pulses, number of rotations per traverse ==> length of traverse per rotation. + screw_speed = InternalWinderCfg.segmentoffsetpulses / InternalWinderCfg.NumberOfRotationPerPassage; + // calculation input#2: number of rotations per second - (basically: speed/winder perimeter. later - according to winder actual speed - calculate according to winder position accumulation in the last second. + RotationsPerSecond = process_speed / (InternalWinderCfg.diameter * 3.1416); + // calculation input#3: speed = rotation per second * traverse per rotation = traverse per second. speed set: traverse per second (mm) * pulses per mm. + screw_speed = screw_speed*RotationsPerSecond; + //screw_speed = InternalWinderCfg.milimetersperrotation +// * 2. determine optimal micro-step setting +// * 3. calculate cart travel length from winding parameters +// * 4. start move of travel length +// * 5. register motor nBusy callback. this callback will flip between move(traverse length, hardstop) and goto(0), with handline og the coneshape and adjusting maxspeed + + //MotorMove (InternalWinderCfg.segmentoffsetpulses,screw_speed); process: set point 0, set max speed, move to the specified length, return back. + //in a callback: calculate backing rate for top and bottom, update point 0, update passing length, call the appropriate move to 0 / move; + + return OK; } uint32_t Winder_End(void) { //stop screw + StopMotor (MOTOR_SCREW,1); } void Winder_ScrewHomeLimitSwitchInterrupt(void) { @@ -78,13 +109,13 @@ uint32_t Winder_ScrewAtOffsetCallback(uint32_t NumberOfSteps) { if (NumberOfSteps == InternalWinderCfg.segmentoffsetpulses) { - JobPrepareReady(Module_Winder, OK); + PrepareReady(Module_Winder, OK); return OK; } else { //do we want to do something? - JobPrepareReady(Module_Winder, ERROR); + PrepareReady(Module_Winder, ERROR); return ERROR; } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c index f32026ca8..db32b7ba7 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c @@ -33,6 +33,9 @@ uint32_t InternalWindingConfigMessage(JobSpool* request) InternalWinderCfg.segmentoffsetpulses = request->segmentoffsetpulses; InternalWinderCfg.spoolbackingrate = request->backingrate; InternalWinderCfg.startoffsetpulses = request->startoffsetpulses; + InternalWinderCfg.SpoolBottomBackingRate = request->spoolbottombackingrate; + InternalWinderCfg.NumberOfRotationPerPassage = request->numberofrotationperpassage; + InternalWinderCfg.diameter = request->diameter; return status; } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 5f14a17a7..e850ad776 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -10,6 +10,8 @@ #include "../control/pidalgo.h" #include "PMR/Hardware/HardwareMotor.pb-c.h" #include "PMR/Hardware/HardwareMotorType.pb-c.h" +#include "PMR/Printing/JobSegment.pb-c.h" +#include "PMR/Printing/JobTicket.pb-c.h" #include "drivers/Motors/Motor.h" #include "drivers/Danser_SSI/ssi_comm.h" @@ -126,10 +128,11 @@ uint32_t ThreadControlCBFunction(uint32_t deviceID, uint32_t ReadValue) uint32_t Debug_Get_Dancer_Read(uint32_t DancerId, uint32_t Parameter1, uint32_t Parameter2) { + return (rand() % (103 + 1 + 103) - 103); } #endif //******************************************************************************************************************** - ReturnCode PrepareState(void *JobDetails) + uint32_t ThreadPrepareState(void *JobDetails) { int Motor_i; //start thread control for all motors @@ -161,7 +164,7 @@ uint32_t Debug_Get_Dancer_Read(uint32_t DancerId, uint32_t Parameter1, uint32_t AddControlCallback(ThreadControlCBFunction, eOneMillisecond,Read_Dancer_Position,ThreadMotorIdToDancerId[Motor_i],0); #endif } - + Winder_Prepare(); //set 3 dancers to the profile positions return OK; } @@ -169,13 +172,14 @@ uint32_t Debug_Get_Dancer_Read(uint32_t DancerId, uint32_t Parameter1, uint32_t //******************************************************************************************************************** ReturnCode PreSegmentState(void *JobDetails) { +//set the speed only before the first segment, speed is constant accros job + JobTicket* JobTicket = JobDetails; + int process_speed = JobTicket->processparameters->dyeingspeed; + int dryer_speed = process_speed * MotorsCfg[DRYER_MOTOR].ratio2dryerspeed; //set dryer_speed_translation_here - TimerMotors_t Motor_i; - for (Motor_i = 0;Motor_i < MAX_THREAD_MOTORS_NUM;Motor_i++) - { - MotorControlConfig[Motor_i].m_SetParam = MotorGetSpeed(getMotorId(Motor_i));//need to update SetParams on presegment stage - } // set the new speed in the dryer motor to the speed of the new segment + MotorSetSpeed(MOTOR_DRYER_DRIVING, process_speed, MotorsCfg[DRYER_MOTOR].minmicrostep); + // activate control fr all motors //set speed for both rocker motors //wait for all motors to get to the required speed (set the target speed for the control to check) diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 6d95b5d27..d22639eb1 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -62,6 +62,15 @@ typedef enum JobFail, JobStop } ReturnCode; +typedef enum +{ + ModuleIdle = 0, + ModuleWaiting, + ModuleDone, + ModuleFail +} ModuleStateEnum; + +ModuleStateEnum PrepareWaiting[MAX_SYSTEM_MODULES] = {ModuleIdle}; /******************************************************************************************** * functions describes motor operation flow and movement state during profile execution @@ -160,10 +169,84 @@ static ReturnCode PrepareState(void *JobDetails) //start other peripheral systems: chiller, waist handling //check thread type //prepare winder + PrepareWaiting[Module_Thread] = ModuleWaiting; + ThreadPrepareState(&CurrentJob); +/* + * typedef enum +{ + ModuleIdle = 0, + ModuleWaiting, + ModuleDone, + ModuleFail +} ModuleStateEnum; - +ModuleStateEnum PrepareWaiting[MAX_SYSTEM_MODULES] = {ModuleIdle}; + * typedef enum +{ + Module_Thread, + Module_Winder, + Module_IDS, + Module_Heaters, + Module_Waste, + MAX_SYSTEM_MODULES +}SYSTEM_MODULE_ID_ENUM; + * + */ return retcode; } +//******************************************************************************************************************** +uint32_t PrepareReady(int ModuleId, int result) +{ + int i; + bool ready = true; + uint32_t retcode = 0,status = OK; + + JobMessageStruc Message; + + assert (ModuleId<MAX_SYSTEM_MODULES); + assert (result<=ModuleFail); + + + PrepareWaiting[ModuleId] = result; + if (result == ModuleFail) status = ERROR; + for (i=0;i<MAX_SYSTEM_MODULES ;i++) + { + if (PrepareWaiting[i] == ModuleWaiting) + ready = false; + } + if (ready == false) return OK; + else + { + if (status == OK) Message.messageId = PreparationResultsOk; + else Message.messageId = PreparationResultsFail; + //memcpy(Message.messageData,JobDetails,MAX_MSG_LEN); + Message.msglen = 10; + if (JobmsgQ != NULL) + retcode = Mailbox_post(JobmsgQ , &Message, BIOS_NO_WAIT); + } +/* + * typedef enum +{ + ModuleIdle = 0, + ModuleWaiting, + ModuleDone, + ModuleFail +} ModuleStateEnum; + +ModuleStateEnum PrepareWaiting[MAX_SYSTEM_MODULES] = {ModuleIdle}; + * typedef enum +{ + Module_Thread, + Module_Winder, + Module_IDS, + Module_Heaters, + Module_Waste, + MAX_SYSTEM_MODULES +}SYSTEM_MODULE_ID_ENUM; + * + */ + return retcode; +} //******************************************************************************************************************** static ReturnCode PrintState(void *JobDetails) @@ -234,6 +317,7 @@ void JobRequestFunc(MessageContainer* requestContainer) memcpy(CurrentJob, Ticket,TicketSize); status = PASSED; status += HandleProcessParameters(Ticket->processparameters); + PrepareWaiting[Module_Heaters] = ModuleWaiting; } if (status == PASSED) { @@ -284,23 +368,6 @@ void StartJob(void *JobDetails) if (JobmsgQ != NULL) retcode = Mailbox_post(JobmsgQ , &Message, BIOS_NO_WAIT); } -uint32_t JobPrepareReady(int ModuleId, int result) -{ - JobMessageStruc Message; - bool retcode = false; - if (result ==OK) - { - Message.messageId = PreparationResultsOk; - } - else - { - Message.messageId = PreparationResultsFail; - } - Message.messageData[0] = ModuleId; - Message.msglen = MAX_MSG_LEN; - if (JobmsgQ != NULL) - retcode = Mailbox_post(JobmsgQ , &Message, BIOS_NO_WAIT); -} /****************************************************************************** * ======== messageTsk ======== @@ -323,9 +390,9 @@ Void jobTask(UArg arg0, UArg arg1) { case JobRequestMsg: memcpy(JobDetails,Message.messageData, Message.msglen); - ValidateState (&JobDetails); + /*ValidateState (&JobDetails); break; - case ValidationResultsOk: + case ValidationResultsOk:*/ PrepareState (&JobDetails); break; case ValidationResultsFail: diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h index e87ee8ee2..9af8fb4d3 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h @@ -103,6 +103,6 @@ void JobInit(void); void PrintingsInit(void); void JobRequestFunc(MessageContainer* requestContainer); -uint32_t JobPrepareReady(int ModuleId, int result); +uint32_t PrepareReady(int ModuleId, int result); #endif /* STATEMACHINES_PRINTSTM_H_ */ |
