Merge pull request #6 from MDHSweden/pwmDriver

Drivers Approved by Lennart
This commit is contained in:
Lennart Eriksson 2016-09-19 20:00:01 +02:00 committed by GitHub
commit 7ac27abd99

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;
}