diff options
author | Keith Packard <keithp@keithp.com> | 2014-05-02 12:26:07 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-05-02 13:52:45 -0700 |
commit | 027b1470c7a2d007eaab5c8d49f772b0c7559b80 (patch) | |
tree | 07f9711d5625a603b82aad080fc0283a7e4ffad0 /src/kernel/ao_beep.h | |
parent | 8e3842660274ac4bcd7b5a78f5db215222b1c4de (diff) |
altos: Add configurable beep tone
This lets you directly set the mid-range beep tone; the high and low
tones remain set off of that in the same ratio as before.
Note that none of the cc1111 products get this feature as they don't
have enough flash space anymore...
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/kernel/ao_beep.h')
-rw-r--r-- | src/kernel/ao_beep.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/kernel/ao_beep.h b/src/kernel/ao_beep.h index 55f61171..9d6ecf27 100644 --- a/src/kernel/ao_beep.h +++ b/src/kernel/ao_beep.h @@ -18,6 +18,12 @@ #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 */ @@ -28,9 +34,16 @@ * frequency = 1/2 (24e6/32) / beep */ -#define AO_BEEP_LOW 150 /* 2500Hz */ -#define AO_BEEP_MID 94 /* 3989Hz */ -#define AO_BEEP_HIGH 75 /* 5000Hz */ +#define AO_BEEP_MID_DEFAULT 94 /* 3989Hz */ + +#if HAS_BEEP_CONFIG +#define AO_BEEP_MID ao_config.mid_beep +#else +#define AO_BEEP_MID AO_BEEP_MID_DEFAULT +#endif +#define AO_BEEP_LOW AO_BEEP_MID * 150 / 94 /* 2500Hz */ +#define AO_BEEP_HIGH AO_BEEP_MID * 75 / 94 /* 5000Hz */ + #define AO_BEEP_OFF 0 /* off */ #define AO_BEEP_g 240 /* 1562.5Hz */ |