From ef8fd8e53327c042c2444eef7f0d61ee616dd01c Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Fri, 19 Dec 2003 01:24:02 +0000 Subject: Automatic detection of FM radio hardware for V2 recorders git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4165 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/radio.c | 12 ++++++++++++ apps/recorder/radio.h | 1 + 2 files changed, 13 insertions(+) (limited to 'apps/recorder') 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 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 @@ #ifdef HAVE_FMRADIO bool radio_screen(void); void radio_stop(void); +bool radio_hardware_present(void); struct fmstation { -- cgit v1.2.3