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