Haptic / Taranis fix

This commit is contained in:
bsongis
2014-04-29 10:08:54 +02:00
parent 1378ce75d3
commit 667dd5fe9e
2 changed files with 13 additions and 5 deletions
+6 -1
View File
@@ -242,8 +242,13 @@ void debugPutc(const char c);
// Haptic driver // Haptic driver
void hapticInit(void); void hapticInit(void);
void hapticOff(void); void hapticOff(void);
void hapticOn(uint32_t pwmPercent);
#define HAPTIC_OFF() hapticOff() #define HAPTIC_OFF() hapticOff()
#if defined(REVPLUS)
void hapticOn(uint32_t pwmPercent);
#else
void hapticOn();
#define HAPTIC_ON() hapticOn()
#endif
extern uint8_t currentTrainerMode; extern uint8_t currentTrainerMode;
+7 -4
View File
@@ -39,22 +39,25 @@
void hapticOff(void) void hapticOff(void)
{ {
#if defined(REVPLUS) #if defined(REVPLUS)
return; //TODO PWM support return; // TODO PWM support
#else #else
GPIO_ResetBits(GPIO_HAPTIC, PIN_HAPTIC); GPIO_ResetBits(GPIO_HAPTIC, PIN_HAPTIC);
#endif #endif
} }
#if defined(REVPLUS)
void hapticOn(uint32_t pwmPercent) void hapticOn(uint32_t pwmPercent)
{ {
#if defined(REVPLUS)
// pwmPercent 0-100 // pwmPercent 0-100
return; //TODO PWM support return; // TODO PWM support
}
#else #else
void hapticOn()
{
// No PWM before REVPLUS // No PWM before REVPLUS
GPIO_SetBits(GPIO_HAPTIC, PIN_HAPTIC); GPIO_SetBits(GPIO_HAPTIC, PIN_HAPTIC);
#endif
} }
#endif
void hapticInit(void) void hapticInit(void)
{ {