projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Allow beep tone spacing to be changed
[fw/altos]
/
src
/
kernel
/
ao_beep.h
diff --git
a/src/kernel/ao_beep.h
b/src/kernel/ao_beep.h
index 085dd5b12f42d27ff27745eb6adf4c4ba81bcad2..8141d85a3d7d5b39ec675df4fa77966f096aeef3 100644
(file)
--- a/
src/kernel/ao_beep.h
+++ b/
src/kernel/ao_beep.h
@@
-19,12
+19,6
@@
#ifndef _AO_BEEP_H_
#define _AO_BEEP_H_
#ifndef _AO_BEEP_H_
#define _AO_BEEP_H_
-#ifndef HAS_BEEP_CONFIG
-#if defined(USE_EEPROM_CONFIG) && USE_EEPROM_CONFIG || HAS_EEPROM
-#define HAS_BEEP_CONFIG 1
-#endif
-#endif
-
/*
* ao_beep.c
*/
/*
* ao_beep.c
*/
@@
-35,15
+29,27
@@
* frequency = 1/2 (24e6/32) / beep
*/
* frequency = 1/2 (24e6/32) / beep
*/
+#ifndef AO_BEEP_MID_DEFAULT
#define AO_BEEP_MID_DEFAULT 94 /* 3989Hz */
#define AO_BEEP_MID_DEFAULT 94 /* 3989Hz */
+#endif
+
+#define AO_BEEP_MID ((int) ao_config.mid_beep)
-#if HAS_BEEP_CONFIG
-#define AO_BEEP_MID ao_config.mid_beep
-#else
-#define AO_BEEP_MID AO_BEEP_MID_DEFAULT
+#define AO_BEEP_MID_PANIC AO_BEEP_MID_DEFAULT
+
+#ifndef AO_BEEP_MAKE_LOW
+#define AO_BEEP_MAKE_LOW(m) ((m) * 150 / 94) /* 2500Hz */
+#endif
+
+#ifndef AO_BEEP_MAKE_HIGH
+#define AO_BEEP_MAKE_HIGH(m) ((m) * 75 / 94) /* 5000Hz */
#endif
#endif
-#define AO_BEEP_LOW AO_BEEP_MID * 150 / 94 /* 2500Hz */
-#define AO_BEEP_HIGH AO_BEEP_MID * 75 / 94 /* 5000Hz */
+
+#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_OFF 0 /* off */
@@
-79,7
+85,7
@@
ao_beep(uint8_t beep);
/* Turn on the beeper for the specified time */
void
/* 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
/* Initialize the beeper */
void