summaryrefslogtreecommitdiff
path: root/firmware/tuner_philips.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-08-24 09:13:51 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-08-24 09:13:51 +0000
commit4021798aec181d1280b3ac2044df82fb3131d9ce (patch)
tree41e8034ae2bbe9f3f7643c844a3d12793917e5f6 /firmware/tuner_philips.c
parentc7e4f5f2596bc7812b0569eabeea557686b43bb1 (diff)
FM radio: fix by Antonius Hellman, no more crash when loading preset files with more than 32 entries
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7398 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/tuner_philips.c')
-rw-r--r--firmware/tuner_philips.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/tuner_philips.c b/firmware/tuner_philips.c
index 72dbf9df5b..59c6d219d8 100644
--- a/firmware/tuner_philips.c
+++ b/firmware/tuner_philips.c
@@ -37,7 +37,7 @@ void philips_set(int setting, int value)
/* init values */
write_bytes[0] = 0x80; /* mute */
write_bytes[1] = 0x00;
- write_bytes[2] = 0x00;
+ write_bytes[2] = 0x10;
#if CONFIG_TUNER_XTAL == 32768000
write_bytes[3] = 0x1A; /* 32.768MHz, soft mute,
stereo noise cancelling */
@@ -55,9 +55,9 @@ void philips_set(int setting, int value)
{
int n;
#if CONFIG_TUNER_XTAL == 32768000
- n = (4 * (value - 225000)) / 32768;
+ n = (4 * (value + 225000)) / 32768;
#else
- n = (4 * (value - 225000)) / 50000;
+ n = (4 * (value + 225000)) / 50000;
#endif
write_bytes[0] = (write_bytes[0] & 0xC0) | (n >> 8);
write_bytes[1] = n & 0xFF;