HAPTIC is now able to work without AUDIO

New function in function switches to play an Audio track
Trims can be used to modify a mixer offset.
Offsets for Frsky can go from -128 to +127
Vibrations motor on v4 (HAPTIC option too)
This commit is contained in:
bsongis
2012-02-01 18:55:08 +00:00
parent 715c5967c7
commit 3e009decfb
13 changed files with 296 additions and 224 deletions
+16 -5
View File
@@ -28,6 +28,9 @@ extern uint8_t beepAgainOrig;
extern uint8_t beepOn;
extern bool warble;
extern bool warbleC;
#if defined(HAPTIC)
extern uint8_t hapticTick;
#endif
extern void beep(uint8_t val);
@@ -72,17 +75,25 @@ FORCEINLINE void AUDIO_HEARTBEAT()
}
}
// G: use original external buzzer for beeps
if (beepOn) {
//static bool warbleC;
warbleC = warble && !warbleC;
if (warbleC)
PORTE &= ~(1 << OUT_E_BUZZER); // speaker output 'low'
BUZZER_OFF;
else
PORTE |= (1 << OUT_E_BUZZER); // speaker output 'high'
BUZZER_ON;
#if defined(HAPTIC)
if (hapticTick-- > 0) {
HAPTIC_ON; // haptic output 'high'
}
else {
HAPTIC_OFF; // haptic output 'low'
hapticTick = g_eeGeneral.hapticStrength;
}
#endif
}
else {
PORTE &= ~(1 << OUT_E_BUZZER); // speaker output 'low'
BUZZER_OFF;
HAPTIC_OFF;
}
}