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