diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-08-16 13:30:16 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-08-16 13:30:16 +0300 |
| commit | 081feb3a75a5aa9eb30ce9bf6f4f279de30f8335 (patch) | |
| tree | 93904958b607e96d6cafeaf7655079fe0f41c255 /Software/Embedded_SW/Embedded/Modules/Thread | |
| parent | 013c584cf6dcf1dd61fa52f5841f500a4bfee459 (diff) | |
| download | Tango-081feb3a75a5aa9eb30ce9bf6f4f279de30f8335.tar.gz Tango-081feb3a75a5aa9eb30ce9bf6f4f279de30f8335.zip | |
reduce motorconfig size. remove graphic lib. alarm handling does not stop the job
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
3 files changed, 29 insertions, 20 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h index 2aa0b220a..a725468e9 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h @@ -13,7 +13,6 @@ #include "PMR/Printing/JobSpoolType.pb-c.h" #include "drivers/Motors/Motor.h" -#include "drivers/SSI_Comm/ssi_comm.h" #include "thread_ex.h" @@ -39,7 +38,7 @@ extern HardwarePidControlType ThreadMotorIdToControlId[MAX_THREAD_MOTORS_NUM]; extern bool BreakSensorenabled; extern int32_t BreakSensordebouncetimemilli; -extern HardwareMotor MotorsCfg[NUM_OF_MOTORS]; +//extern MotorDriverConfigStruc MotorsCfg[NUM_OF_MOTORS]; extern HardwarePidControl MotorsControl[MAX_THREAD_MOTORS_NUM]; //extern InternalWinderConfigStruc InternalWinderCfg; extern HardwareDancer DancersCfg[MAX_SYSTEM_DANCERS]; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index f4242be2b..92fd9549e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -6,7 +6,7 @@ */ #include"include.h" #include "thread.h" -#include "Drivers/Peripheral_GPIO/GPIO.h" + #include "drivers/Motors/Motor.h" #include "StateMachines/Printing/PrintingSTM.h" #include "Modules/Control/Control.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c index e4a5b362c..41daa4002 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c @@ -12,7 +12,7 @@ #include "PMR/common/MessageContainer.pb-c.h" #include "thread.h" -HardwareMotor MotorsCfg[NUM_OF_MOTORS]={0}; +MotorDriverConfigStruc MotorsCfg[NUM_OF_MOTORS]={0}; HardwarePidControl MotorsControl[MAX_THREAD_MOTORS_NUM] = {0}; int32_t MotorSamples[MAX_THREAD_MOTORS_NUM][MAX_CONTROL_SAMPLES] = {0}; @@ -32,22 +32,32 @@ uint32_t MotorsConfigMessage(HardwareMotor * request) uint32_t status = PASSED; TimerMotors_t Motor_i; Motor_i = request->hardwaremotortype; - /*for (i=0;i<MAX_THREAD_MOTORS_NUM;i++) - { - if (ThreadMotorIdToControlId[i] == request->hardwarepidcontroltype) - { - Motor_i = i; - break; - } - } - if (Motor_i == 0) - { - LOG_ERROR(request->hardwarepidcontroltype,"ERROR Control Id"); - return ERROR; - }*/ - //if (Motor_i< MAX_THREAD_MOTORS_NUM) - //{ - memcpy (&MotorsCfg[Motor_i],request,sizeof(HardwareMotor)); + MotorsCfg[Motor_i].configword = request->configword; + MotorsCfg[Motor_i].hardwaremotortype = request->hardwaremotortype; + MotorsCfg[Motor_i].minfrequency = request->minfrequency; + MotorsCfg[Motor_i].maxfrequency = request->maxfrequency; + MotorsCfg[Motor_i].setmicrostep = request->setmicrostep; + MotorsCfg[Motor_i].microstep = request->microstep; + MotorsCfg[Motor_i].maxchangeslope = request->maxchangeslope; + MotorsCfg[Motor_i].highlengthmicrosecond = request->highlengthmicrosecond; + MotorsCfg[Motor_i].speedmaster = request->speedmaster; + MotorsCfg[Motor_i].pulseperround = request->pulseperround; + MotorsCfg[Motor_i].pulleyradius = request->pulleyradius; + MotorsCfg[Motor_i].configword = request->configword; + MotorsCfg[Motor_i].directionthreadwize = request->directionthreadwize; + MotorsCfg[Motor_i].kvalhold = request->kvalhold; + MotorsCfg[Motor_i].kvalrun = request->kvalrun; + MotorsCfg[Motor_i].kvalacc = request->kvalacc; + MotorsCfg[Motor_i].kvaldec = request->kvaldec; + MotorsCfg[Motor_i].overcurrentthreshold = request->overcurrentthreshold; + MotorsCfg[Motor_i].stallthreshold = request->stallthreshold; + MotorsCfg[Motor_i].thermalcompensationfactor = request->thermalcompensationfactor; + MotorsCfg[Motor_i].lowspeedoptimization = request->lowspeedoptimization; + MotorsCfg[Motor_i].stslp = request->stslp; + MotorsCfg[Motor_i].intspd = request->intspd; + MotorsCfg[Motor_i].fnslpacc = request->fnslpacc; + MotorsCfg[Motor_i].fnslpdec = request->fnslpdec; + MotorsCfg[Motor_i].fsspd = request->fsspd; status = MotorConfig( Motor_i, &MotorsCfg[Motor_i]); // if (Motor_i == MOTOR_RDRIVING) |
