*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* frequency = 1/2 (24e6/32) / beep
*/
-#define AO_BEEP_LOW 150 /* 2500Hz */
-#define AO_BEEP_MID 94 /* 3989Hz */
-#define AO_BEEP_HIGH 75 /* 5000Hz */
+#ifndef AO_BEEP_MID_DEFAULT
+#define AO_BEEP_MID_DEFAULT 94 /* 3989Hz */
+#endif
+
+#define AO_BEEP_MID ((int) ao_config.mid_beep)
+
+#define AO_BEEP_MID_PANIC AO_BEEP_MID_DEFAULT
+
+#ifndef AO_BEEP_MAKE_LOW
+#define AO_BEEP_MAKE_LOW(m) ((uint8_t) ((m) * 150 / 94)) /* 2500Hz */
+#endif
+
+#ifndef AO_BEEP_MAKE_HIGH
+#define AO_BEEP_MAKE_HIGH(m) ((uint8_t) ((m) * 75 / 94)) /* 5000Hz */
+#endif
+
+#define AO_BEEP_LOW AO_BEEP_MAKE_LOW(AO_BEEP_MID)
+#define AO_BEEP_HIGH AO_BEEP_MAKE_HIGH(AO_BEEP_MID)
+
+#define AO_BEEP_LOW_PANIC AO_BEEP_MAKE_LOW(AO_BEEP_MID_PANIC)
+#define AO_BEEP_HIGH_PANIC AO_BEEP_MAKE_HIGH(AO_BEEP_MID_PANIC)
+
#define AO_BEEP_OFF 0 /* off */
#define AO_BEEP_g 240 /* 1562.5Hz */
/* Turn on the beeper for the specified time */
void
-ao_beep_for(uint8_t beep, uint16_t ticks) __reentrant;
+ao_beep_for(uint8_t beep, AO_TICK_TYPE ticks);
/* Initialize the beeper */
void