* Fix following automatic server emails CMake options: -DTHR_TRACE=YES -DVARIO=YES -DGAUGES=NO -DAUTOSWITCH=YES -DTRANSLATIONS=FR -DACCURAT_THROTTLE_STATS=NO -DSP22=NO -DPCB=9X -DARITHMETIC_OVERFLOW_CHECK=NO -DFONT=SQT5 -DHELI=NO -DEEPROM_PROGRESS_BAR=YES -DTEMPLATES=NO -DFRSKY_STICKS=NO -DVOICE=NO -DDBLKEYS=NO -DGRAPHICS=YES -DFAI=YES -DBATTGRAPH=YES -DTURNIGY_TRANSMITTER_FIX=NO -DPWM_BACKLIGHT=NO -DNAVIGATION=NO -DBOLD=YES -DDSM2=NO -DGVARS=NO -DAUTOSOURCE=YES -DCURVES=NO -DWS_HOW_HIGH=YES -DPPM_LIMITS_SYMETRICAL=NO -DHAPTIC=NO -DUNITS=METRIC -DPPM_UNIT=PERCENT_PREC1 -DAUDIO=YES -DGPS=NO -DPPM_CENTER_ADJUSTABLE=NO -DSPLASH=YES -DFAS_OFFSET=NO -DFLIGHT_MODES=NO -DOVERRIDE_CHANNEL_FUNCTION=YES * Fix some missing translations for avr * Compilation fixes
61 lines
1.6 KiB
C++
61 lines
1.6 KiB
C++
/*
|
|
* Copyright (C) OpenTX
|
|
*
|
|
* Based on code named
|
|
* th9x - http://code.google.com/p/th9x
|
|
* er9x - http://code.google.com/p/er9x
|
|
* gruvin9x - http://code.google.com/p/gruvin9x
|
|
*
|
|
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
|
*
|
|
* 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.
|
|
*/
|
|
|
|
#include "opentx.h"
|
|
|
|
uint8_t g_beepCnt;
|
|
uint8_t beepAgain = 0;
|
|
uint8_t beepAgainOrig = 0;
|
|
uint8_t beepOn = false;
|
|
bool warble = false;
|
|
bool warbleC;
|
|
|
|
// The various "beep" tone lengths
|
|
static const pm_uint8_t beepTab[] PROGMEM = {
|
|
// key, trim, warn2, warn1, error
|
|
1, 1, 2, 10, 60, //xShort
|
|
1, 1, 4, 20, 80, //short
|
|
1, 1, 8, 30, 100, //normal
|
|
2, 2, 15, 40, 120, //long
|
|
5, 5, 30, 50, 150, //xLong
|
|
};
|
|
|
|
void beep(uint8_t val)
|
|
{
|
|
#if defined(HAPTIC) && !defined(AUDIO)
|
|
// completely untested
|
|
if (val == 0)
|
|
haptic.play(5, 0, PLAY_NOW);
|
|
else
|
|
haptic.event(AU_ERROR);
|
|
#endif
|
|
|
|
#if !defined(AUDIO)
|
|
if (g_eeGeneral.alarmsFlash && val>1) {
|
|
flashCounter = FLASH_DURATION;
|
|
}
|
|
#endif
|
|
|
|
if (g_eeGeneral.beepMode>0 || (g_eeGeneral.beepMode==0 && val!=0) || (g_eeGeneral.beepMode==-1 && val>=3)) {
|
|
_beep(pgm_read_byte(beepTab+5*(2+g_eeGeneral.beepLength)+val));
|
|
}
|
|
}
|
|
|