diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2003-12-19 01:24:02 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2003-12-19 01:24:02 +0000 |
commit | ef8fd8e53327c042c2444eef7f0d61ee616dd01c (patch) | |
tree | 0b719812d7a666d2031f0f7bd14494050a483d49 /apps/recorder | |
parent | 47f6cb30ee2333d64b6470317cf378d10b38c0f2 (diff) | |
download | rockbox-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')
-rw-r--r-- | apps/recorder/radio.c | 12 | ||||
-rw-r--r-- | apps/recorder/radio.h | 1 |
2 files changed, 13 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) | |||
74 | 74 | ||
75 | } | 75 | } |
76 | 76 | ||
77 | bool radio_hardware_present(void) | ||
78 | { | ||
79 | int val; | ||
80 | |||
81 | fmradio_set(2, 0x140885); /* 5kHz, 7.2MHz crystal, test mode 1 */ | ||
82 | val = fmradio_read(0); | ||
83 | if(val == 0x140885) | ||
84 | return true; | ||
85 | else | ||
86 | return false; | ||
87 | } | ||
88 | |||
77 | void radio_set_frequency(int freq) | 89 | void radio_set_frequency(int freq) |
78 | { | 90 | { |
79 | /* We add the standard Intermediate Frequency 10.7MHz before calculating | 91 | /* We add the standard Intermediate Frequency 10.7MHz before calculating |
diff --git a/apps/recorder/radio.h b/apps/recorder/radio.h index 45942a9990..5ddbf13d6b 100644 --- a/apps/recorder/radio.h +++ b/apps/recorder/radio.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifdef HAVE_FMRADIO | 22 | #ifdef HAVE_FMRADIO |
23 | bool radio_screen(void); | 23 | bool radio_screen(void); |
24 | void radio_stop(void); | 24 | void radio_stop(void); |
25 | bool radio_hardware_present(void); | ||
25 | 26 | ||
26 | struct fmstation | 27 | struct fmstation |
27 | { | 28 | { |