Issue 19 solved
Revert the last Haptic changes (was unfinished, no more spare time during the week-end, sorry!) Revert my last modification on main views (offset not displayed in Bar Graphs, I was wrong) PPM Center now configurable for each servo No mean on the Batt voltage when in the calibration menu to have a faster response when calibrating SD card Backup / Restore Models feature started Some french translations fixed
This commit is contained in:
-115
@@ -1,115 +0,0 @@
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
|
||||
* - Cameron Weeks <th9xer@gmail.com>
|
||||
* - Erez Raviv
|
||||
* - Jean-Pierre Parisy
|
||||
* - Karl Szmutny <shadow@privy.de>
|
||||
* - Michael Blandford
|
||||
* - Michal Hlavinka
|
||||
* - Pat Mackenzie
|
||||
* - Philip Moss
|
||||
* - Rob Thomson
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* open9x is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef haptic_h
|
||||
#define haptic_h
|
||||
|
||||
|
||||
#if defined(PCBARM)
|
||||
#include "ersky9x/haptic.h"
|
||||
#endif
|
||||
|
||||
|
||||
//haptic
|
||||
#define HAPTIC_QUEUE_LENGTH (8) //8 seems to suit most alerts
|
||||
|
||||
|
||||
|
||||
|
||||
class hapticQueue
|
||||
{
|
||||
public:
|
||||
|
||||
hapticQueue();
|
||||
|
||||
// only difference between these two functions is that one does the
|
||||
// interupt queue (Now) and the other queues for playing ASAP.
|
||||
void playNow(uint8_t tLen, uint8_t tPause, uint8_t tRepeat=0);
|
||||
|
||||
void playASAP(uint8_t tLen, uint8_t tPause, uint8_t tRepeat=0);
|
||||
|
||||
inline bool busy() { return (buzzTimeLeft > 0); }
|
||||
|
||||
void event(uint8_t e);
|
||||
|
||||
|
||||
|
||||
// heartbeat is responsibile for issueing the haptic buzzs and general square waves
|
||||
// it is essentially the life of the class.
|
||||
void heartbeat();
|
||||
|
||||
// bool freeslots(uint8_t slots);
|
||||
|
||||
inline bool empty() {
|
||||
return (t_queueRidx == t_queueWidx);
|
||||
}
|
||||
|
||||
protected:
|
||||
inline uint8_t getHapticLength(uint8_t tLen);
|
||||
|
||||
private:
|
||||
uint8_t t_queueRidx;
|
||||
uint8_t t_queueWidx;
|
||||
|
||||
|
||||
uint8_t buzzTimeLeft;
|
||||
uint8_t buzzPause;
|
||||
|
||||
// queue arrays
|
||||
uint8_t queueHapticLength[HAPTIC_QUEUE_LENGTH];
|
||||
uint8_t queueHapticPause[HAPTIC_QUEUE_LENGTH];
|
||||
uint8_t queueHapticRepeat[HAPTIC_QUEUE_LENGTH];
|
||||
uint8_t buzzHaptic;
|
||||
uint8_t hapticTick;
|
||||
|
||||
|
||||
#if defined(PCBSTD)
|
||||
uint8_t buzzCounter;
|
||||
#endif
|
||||
};
|
||||
|
||||
//wrapper function - dirty but results in a space saving!!!
|
||||
extern hapticQueue haptic;
|
||||
|
||||
void hapticDefevent(uint8_t e);
|
||||
|
||||
#define HAPTIC_SPINUP (10);
|
||||
|
||||
|
||||
|
||||
#define IS_HAPTIC_BUSY() haptic.busy()
|
||||
|
||||
|
||||
#define HAPTIC_HEARTBEAT() haptic.heartbeat()
|
||||
|
||||
#endif // haptic_h
|
||||
Reference in New Issue
Block a user