summaryrefslogtreecommitdiffstats
path: root/apps/recorder/radio.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2003-12-19 01:24:02 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2003-12-19 01:24:02 +0000
commitef8fd8e53327c042c2444eef7f0d61ee616dd01c (patch)
tree0b719812d7a666d2031f0f7bd14494050a483d49 /apps/recorder/radio.c
parent47f6cb30ee2333d64b6470317cf378d10b38c0f2 (diff)
downloadrockbox-ef8fd8e53327c042c2444eef7f0d61ee616dd01c.tar.gz
rockbox-ef8fd8e53327c042c2444eef7f0d61ee616dd01c.zip
Automatic detection of FM radio hardware for V2 recorders
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4165 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder/radio.c')
-rw-r--r--apps/recorder/radio.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c
index 0459ff3d74..ab0c1eb004 100644
--- a/apps/recorder/radio.c
+++ b/apps/recorder/radio.c
@@ -74,6 +74,18 @@ void radio_stop(void)
}
+bool radio_hardware_present(void)
+{
+ int val;
+
+ fmradio_set(2, 0x140885); /* 5kHz, 7.2MHz crystal, test mode 1 */
+ val = fmradio_read(0);
+ if(val == 0x140885)
+ return true;
+ else
+ return false;
+}
+
void radio_set_frequency(int freq)
{
/* We add the standard Intermediate Frequency 10.7MHz before calculating