Improved motor driver
This commit is contained in:
johan9107 2016-09-19 17:12:05 +02:00
parent c0c9aa8572
commit 57dbfee7a2

View File

@ -13,8 +13,8 @@
#include "drivers/pwm.h" #include "drivers/pwm.h"
#include "drivers/motors.h" #include "drivers/motors.h"
int MotorPWMPeriode = 2000; //Micro seconds const int MotorPWMPeriode = 2000; //Micro seconds
int MotorPWMInitPulse = 1000; const int MotorPWMInitPulse = 1000;
/* A struct of a pwm motor profile */ /* A struct of a pwm motor profile */
typedef struct typedef struct
@ -126,16 +126,13 @@ uint32_t setMotorOutput(motorOutput motorOutput)
switch(motorOutput) switch(motorOutput)
{ {
case PWM: case PWM:
MotorPWMPeriode = 2000;
prescaler = 88; prescaler = 88;
break; break;
case Oneshot125: case Oneshot125:
MotorPWMPeriode = 16000;
prescaler = 11; prescaler = 11;
break; break;
default: default:
MotorPWMPeriode = 2000; prescaler = 11;
prescaler = 88;
break; break;
} }