aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread.h8
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c10
2 files changed, 15 insertions, 3 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h
index 475f63795..f0dd35da9 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h
@@ -1,3 +1,7 @@
+
+#ifndef MODULES_THREAD_THREAD_H_
+#define MODULES_THREAD_THREAD_H_
+
#include "PMR/common/MessageContainer.pb-c.h"
#include "PMR/Hardware/HardwareMotor.pb-c.h"
#include "PMR/Hardware/HardwareMotorType.pb-c.h"
@@ -53,3 +57,7 @@ uint32_t MotorsConfigMessage(HardwareMotor * request);
uint32_t InternalWindingConfigMessage(JobSpool* request);
uint32_t DancerConfigMessage(HardwareDancer * request);
+
+
+#endif //MODULES_THREAD_THREAD_H_
+
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index 13c81fb39..44e5c8936 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -10,6 +10,9 @@
#include "../control/pidalgo.h"
#include "PMR/Hardware/HardwareMotor.pb-c.h"
#include "PMR/Hardware/HardwareMotorType.pb-c.h"
+#include "drivers/Motors/Motor.h"
+#include "drivers/Heater/TemperatureSensor.h"
+#include "drivers/Heater/Heater.h"
////////////////////////////////State machine operation////////////////////////////////////
//the state machine operation is used to operate in runtime correct profile flow execution
//by recieved esign flow of the user from the UI
@@ -186,8 +189,9 @@ static ReturnCode PrepareState(void *JobDetails)
MotorControlConfig[Motor_i].m_mesuredParam = 0;
MotorControlConfig[Motor_i].m_preError = 0;
MotorControlConfig[Motor_i].m_SetParam = 0;//need to update SetParams on presegment stage
- AddControlCallback(DeviceId2Motor[Motor_i], ThreadControlCBFunction, eOneMillisecond,TemplateDataReadCBFunction,Motor_i);
+ AddControlCallback(ThreadControlCBFunction, eOneMillisecond,TemplateDataReadCBFunction,Motor_i,0);
}
+
//set 3 dancers to the profile positions
return NextState;
}
@@ -196,10 +200,10 @@ static ReturnCode PrepareState(void *JobDetails)
static ReturnCode PreSegmentState(void *JobDetails)
{
- int Motor_i;
+ TimerMotors_t Motor_i;
for (Motor_i = 0;Motor_i < MAX_THREAD_MOTORS_NUM;Motor_i++)
{
- MotorControlConfig[Motor_i].m_SetParam = getMotorFreq(Motor_i);//need to update SetParams on presegment stage
+ 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
// activate control fr all motors