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.
25 extern uint8_t g_beepCnt
;
26 extern uint8_t beepAgain
;
27 extern uint8_t beepAgainOrig
;
28 extern uint8_t beepOn
;
32 extern uint8_t hapticTick
;
38 #if defined(CPUARM) && !defined(SIMU)
39 inline void _beep(uint8_t b
)
43 #else /* CPUARM && !SIMU */
44 inline void _beep(uint8_t b
)
48 #endif /* CPUARM && !SIMU */
50 void beep(uint8_t val
);
52 inline void beep(uint8_t) { }
59 #define AUDIO_HELLO() PUSH_SYSTEM_PROMPT(AUDIO_HELLO)
61 #define AUDIO_TX_BATTERY_LOW() PUSH_SYSTEM_PROMPT(AU_TX_BATTERY_LOW)
62 #define AUDIO_INACTIVITY() PUSH_SYSTEM_PROMPT(AU_INACTIVITY)
63 #define AUDIO_ERROR_MESSAGE(e) PUSH_SYSTEM_PROMPT((e))
64 #define AUDIO_TIMER_MINUTE(t) playDuration(t)
66 #define AUDIO_TIMER_30() PUSH_SYSTEM_PROMPT(AU_TIMER_30)
67 #define AUDIO_TIMER_20() PUSH_SYSTEM_PROMPT(AU_TIMER_20)
71 #define AUDIO_TX_BATTERY_LOW() beep(4)
72 #define AUDIO_INACTIVITY() beep(3)
73 #define AUDIO_ERROR_MESSAGE(e) beep(4)
74 #define AUDIO_TIMER_MINUTE(t) beep(2)
76 #define AUDIO_TIMER_30() { beepAgain=2; beep(2); }
77 #define AUDIO_TIMER_20() { beepAgain=1; beep(2); }
80 #define AUDIO_KEY_PRESS() beep(0)
81 #define AUDIO_KEY_ERROR() beep(2)
82 #define AUDIO_WARNING2() beep(2)
83 #define AUDIO_WARNING1() beep(3)
84 #define AUDIO_ERROR() beep(4)
85 #define AUDIO_MIX_WARNING(x) beep(1)
86 #define AUDIO_POT_MIDDLE() beep(2)
87 #define AUDIO_TIMER_COUNTDOWN(idx, val) beep(2)
88 #define AUDIO_TIMER_ELAPSED(idx) beep(3)
89 #define AUDIO_VARIO_UP() _beep(1)
90 #define AUDIO_VARIO_DOWN() _beep(1)
91 #define AUDIO_TRIM_PRESS(f) { if (!IS_KEY_FIRST(event)) warble = true; beep(1); }
92 #define AUDIO_TRIM_MIDDLE() beep(2)
93 #define AUDIO_TRIM_MIN() beep(2)
94 #define AUDIO_TRIM_MAX() beep(2)
95 #define AUDIO_PLAY(p) beep(3)
97 #define IS_AUDIO_BUSY() (g_beepCnt || beepAgain || beepOn)
101 #define AUDIO_TX_BATTERY_LOW()
102 #define AUDIO_INACTIVITY()
103 #define AUDIO_ERROR_MESSAGE(e)
104 #define AUDIO_TIMER_MINUTE(t)
105 #define AUDIO_TIMER_30()
106 #define AUDIO_TIMER_20()
107 #define AUDIO_WARNING2()
108 #define AUDIO_WARNING1()
109 #define AUDIO_ERROR()
110 #define AUDIO_MIX_WARNING(x)
111 #define AUDIO_POT_MIDDLE()
112 #define AUDIO_TIMER_LT10(m, x)
113 #define AUDIO_TIMER_00(m)
114 #define AUDIO_VARIO_UP()
115 #define AUDIO_VARIO_DOWN()
116 #define AUDIO_TRIM(event, f)
117 #define AUDIO_TRIM_MIDDLE(f)
118 #define AUDIO_TRIM_END(f)
119 #define AUDIO_PLAY(p)
120 #define IS_AUDIO_BUSY() false
123 #define AUDIO_RESET()
124 #define AUDIO_FLUSH()
126 #define PLAY_PHASE_OFF(phase)
127 #define PLAY_PHASE_ON(phase)
128 #define PLAY_SWITCH_MOVED(sw)
129 #define PLAY_LOGICAL_SWITCH_OFF(sw)
130 #define PLAY_LOGICAL_SWITCH_ON(sw)
131 #define PLAY_MODEL_NAME()
132 #define START_SILENCE_PERIOD()
137 inline void BUZZER_HEARTBEAT()
140 if (!beepAgainOrig
) {
141 beepAgainOrig
= g_beepCnt
;
147 if (beepAgain
&& beepAgainOrig
) {
149 g_beepCnt
= beepOn
? beepAgainOrig
: 8;
150 if (beepOn
) beepAgain
--;
160 warbleC
= warble
&& !warbleC
;
171 #define BUZZER_HEARTBEAT()