5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
24 #define HAPTIC_QUEUE_LENGTH 4
32 // only difference between these two functions is that one does the
33 // interupt queue (Now) and the other queues for playing ASAP.
34 void play(uint8_t tLen
, uint8_t tPause
, uint8_t tRepeat
=0);
36 inline bool busy() { return (buzzTimeLeft
> 0); }
38 void event(uint8_t e
);
40 // heartbeat is responsibile for issueing the haptic buzzs and general square waves
41 // it is essentially the life of the class.
44 // bool freeslots(uint8_t slots);
47 return (t_queueRidx
== t_queueWidx
);
51 inline uint8_t getHapticLength(uint8_t tLen
) {
52 return ((g_eeGeneral
.hapticLength
* 2) + tLen
) * 2;
65 uint8_t queueHapticLength
[HAPTIC_QUEUE_LENGTH
];
66 uint8_t queueHapticPause
[HAPTIC_QUEUE_LENGTH
];
67 uint8_t queueHapticRepeat
[HAPTIC_QUEUE_LENGTH
];
70 extern hapticQueue haptic
;
72 #define IS_HAPTIC_BUSY() haptic.busy()
73 #define HAPTIC_HEARTBEAT() haptic.heartbeat()