diff options
author | Bertrik Sikken <bertrik@sikken.nl> | 2011-04-30 10:40:05 +0000 |
---|---|---|
committer | Bertrik Sikken <bertrik@sikken.nl> | 2011-04-30 10:40:05 +0000 |
commit | 16e793f5d1d626e6506f2b172efa03f46fb0ed39 (patch) | |
tree | 024a3241cb6c5ca9ccbc48fe115d2c4f2b4384c0 | |
parent | eac9577f7611f1c505e3168aeb956dd02865afc8 (diff) | |
download | rockbox-16e793f5d1d626e6506f2b172efa03f46fb0ed39.tar.gz rockbox-16e793f5d1d626e6506f2b172efa03f46fb0ed39.zip |
iap: update handling of IdentifyDeviceLingoes command and fix RF tuner detection code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29797 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/iap.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/iap.c b/apps/iap.c index dcdb0fbb91..11b57bb606 100644 --- a/apps/iap.c +++ b/apps/iap.c | |||
@@ -312,7 +312,12 @@ static void iap_handlepkt_mode0(void) | |||
312 | { | 312 | { |
313 | cmd_ok_mode0(cmd); | 313 | cmd_ok_mode0(cmd); |
314 | 314 | ||
315 | if (serbuf[6] == 0x35) | 315 | uint32_t lingoes = (serbuf[3] << 24) | |
316 | (serbuf[4] << 16) | | ||
317 | (serbuf[5] << 8) | | ||
318 | (serbuf[6] << 0); | ||
319 | |||
320 | if (lingoes == 0x35) | ||
316 | /* FM transmitter sends this: */ | 321 | /* FM transmitter sends this: */ |
317 | /* FF 55 0E 00 13 00 00 00 35 00 00 00 04 00 00 00 00 A6 (??)*/ | 322 | /* FF 55 0E 00 13 00 00 00 35 00 00 00 04 00 00 00 00 A6 (??)*/ |
318 | { | 323 | { |
@@ -323,12 +328,11 @@ static void iap_handlepkt_mode0(void) | |||
323 | unsigned char data3[] = {0x05, 0x02}; | 328 | unsigned char data3[] = {0x05, 0x02}; |
324 | iap_send_pkt(data3, sizeof(data3)); | 329 | iap_send_pkt(data3, sizeof(data3)); |
325 | } | 330 | } |
326 | |||
327 | else | 331 | else |
328 | { | 332 | { |
329 | /* ipod fm remote sends this: */ | 333 | /* ipod fm remote sends this: */ |
330 | /* FF 55 0E 00 13 00 00 00 8D 00 00 00 0E 00 00 00 03 41 */ | 334 | /* FF 55 0E 00 13 00 00 00 8D 00 00 00 0E 00 00 00 03 41 */ |
331 | if (serbuf[6] |= 0x80) | 335 | if (lingoes & (1 << 7)) /* bit 7 = RF tuner lingo */ |
332 | radio_present = 1; | 336 | radio_present = 1; |
333 | /* GetDevAuthenticationInfo */ | 337 | /* GetDevAuthenticationInfo */ |
334 | unsigned char data4[] = {0x00, 0x14}; | 338 | unsigned char data4[] = {0x00, 0x14}; |