diff --git a/docs/CREDITS b/docs/CREDITS index 91e87d3954..4174781a7d 100644 --- a/docs/CREDITS +++ b/docs/CREDITS @@ -514,6 +514,7 @@ Giovanni Zilli Shiloh Hawley Peter Lecký Wilfred Hughes +Laurent Gautier The libmad team The wavpack team diff --git a/firmware/drivers/tuner/ipod_remote_tuner.c b/firmware/drivers/tuner/ipod_remote_tuner.c index 82357593d4..9822c07c6b 100644 --- a/firmware/drivers/tuner/ipod_remote_tuner.c +++ b/firmware/drivers/tuner/ipod_remote_tuner.c @@ -43,7 +43,7 @@ int radio_tuned = 0; int rds_event = 0; char rds_radioname[9]; -char rds_radioinfo[70]; /* do we need more? */ +char rds_radioinfo[65]; union FRQ { unsigned long int frequency_radio; @@ -102,6 +102,13 @@ void rmt_tuner_sleep(int state) { if (state == 0) { + tuner_param = 0x00; + old_tuner_param = 0xFF; + mono_mode = -1; + old_region = -1; + tuner_frequency = 0; + radio_tuned = 0; + /* tuner HW on */ unsigned char data[] = {0x07, 0x05, 0x01}; iap_send_pkt(data, sizeof(data)); @@ -293,7 +300,11 @@ int ipod_rmt_tuner_set(int setting, int value) case RADIO_SLEEP: { rmt_tuner_sleep(value); - sleep(HZ/2); + sleep(HZ/10); + if(value) + { + tuner_frequency = 0; + } break; } @@ -319,6 +330,11 @@ int ipod_rmt_tuner_set(int setting, int value) /* scan through frequencies */ if (radio_tuned == 1) { + if ((tuner_frequency <= fmr->freq_min) + && (tuner_frequency >= fmr->freq_max)) + { + tuner_set(RADIO_FREQUENCY,value); + } /* scan down */ if(value < tuner_frequency) rmt_tuner_scan(-1); @@ -326,8 +342,14 @@ int ipod_rmt_tuner_set(int setting, int value) else rmt_tuner_scan(1); + sleep(HZ/10); if (reply_timeout()) - return 0; + { + tuner_set(RADIO_FREQUENCY,value); + rmt_tuner_scan(1); + if (reply_timeout() == true) + return 0; + } radio_tuned = 0; }