summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2004-12-24 08:42:45 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2004-12-24 08:42:45 +0000
commitdfa95c334b9cffff28059e0de39ae5305e315ee6 (patch)
tree486ed4df9a36170768e68eef2546ab072bb57c7f /firmware
parent35c69283d4728c9f94d7a5c47026036bec3e17c4 (diff)
downloadrockbox-dfa95c334b9cffff28059e0de39ae5305e315ee6.tar.gz
rockbox-dfa95c334b9cffff28059e0de39ae5305e315ee6.tar.bz2
rockbox-dfa95c334b9cffff28059e0de39ae5305e315ee6.zip
different kind of recording beep: more faint, but not disturbing prerecording, can beep while we already record (no latency due to beep)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5511 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/mpeg.h2
-rw-r--r--firmware/mpeg.c12
2 files changed, 7 insertions, 7 deletions
diff --git a/firmware/export/mpeg.h b/firmware/export/mpeg.h
index d61789c26e..671f9389f0 100644
--- a/firmware/export/mpeg.h
+++ b/firmware/export/mpeg.h
@@ -99,7 +99,7 @@ unsigned int mpeg_error(void);
void mpeg_error_clear(void);
int mpeg_get_file_pos(void);
unsigned long mpeg_get_last_header(void);
-void mpeg_beep(int freq, int duration);
+void mpeg_beep(int duration);
/* in order to keep the recording here, I have to expose this */
void rec_tick(void);
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index 26bfbc0dc3..becd3d54cb 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -2377,17 +2377,17 @@ void mpeg_set_recording_gain(int left, int right, bool use_mic)
}
/* try to make some kind of beep, also in recording mode */
-void mpeg_beep(int freq, int duration)
+void mpeg_beep(int duration)
{
- (void)freq; /* not used yet */
long starttick = current_tick;
do
- {
- mas_codec_writereg(0, 0); /* some little-understood sequence, */
- mas_codec_writereg(0, 1); /* there may be better ways */
+ { /* toggle bit 0 of codec register 0, toggling the DAC off & on.
+ * While this is still audible even without an external signal,
+ * it doesn't affect the (pre-)recording. */
+ mas_codec_writereg(0, shadow_codec_reg0 ^ 1);
+ mas_codec_writereg(0, shadow_codec_reg0);
}
while (current_tick - starttick < duration);
- mas_codec_writereg(0, shadow_codec_reg0); /* restore it */
}
void mpeg_new_file(const char *filename)