Index: firmware/export/ipod_remote_tuner.h =================================================================== --- firmware/export/ipod_remote_tuner.h (revision 27468) +++ firmware/export/ipod_remote_tuner.h (working copy) @@ -27,9 +27,6 @@ #define TIMEOUT_VALUE 20 extern int radio_present; -extern int tuner_frequency; -extern int tuner_signal_power; -extern int radio_tuned; /* update tuner state: plugged or unplugged when in radio mode */ extern void rmt_tuner_region(int region); Index: firmware/drivers/tuner/ipod_remote_tuner.c =================================================================== --- firmware/drivers/tuner/ipod_remote_tuner.c (revision 27468) +++ firmware/drivers/tuner/ipod_remote_tuner.c (working copy) @@ -35,18 +35,19 @@ static unsigned char tuner_param = 0x00, old_tuner_param = 0xFF; /* temp var for tests to avoid looping execution in submenus settings*/ -int mono_mode = -1, old_region = -1; +static int mono_mode = -1, old_region = -1; int radio_present = 0; -int tuner_frequency = 0; -int tuner_signal_power = 0; -int radio_tuned = 0; -int rds_event = 0; -char rds_radioname[9]; -char rds_radioinfo[65]; +static int tuner_frequency = 0; +static int tuner_signal_power = 0; +static bool radio_tuned = false; +static bool rds_event = false; -union FRQ { +static char rds_radioname[9]; +static char rds_radioinfo[65]; + +static union FRQ { unsigned long int frequency_radio; char data_frequency[4]; }Frequency; @@ -61,7 +62,7 @@ memcpy(Frequency.data_frequency,tempdata,4); tuner_frequency = (Frequency.frequency_radio*1000); - radio_tuned = 1; + radio_tuned = true; rmt_tuner_signal_power(serbuf[7]); } @@ -69,7 +70,7 @@ { if (curr_freq != tuner_frequency) { - radio_tuned = 0; + radio_tuned = false; tuner_signal_power = 0; /* clear rds name and info */ memset(rds_radioname,' ',sizeof(rds_radioname)); @@ -108,7 +109,7 @@ mono_mode = -1; old_region = -1; tuner_frequency = 0; - radio_tuned = 0; + radio_tuned = false; /* tuner HW on */ unsigned char data[] = {0x07, 0x05, 0x01}; @@ -142,7 +143,7 @@ { unsigned char data[] = {0x07, 0x11, 0x08}; /* RSSI level */ unsigned char updown = 0x00; - radio_tuned = 0; + radio_tuned = false; iap_send_pkt(data, sizeof(data)); if (param == 1) @@ -278,9 +279,7 @@ } while((ipod_rmt_tuner_get(RADIO_TUNED) == 0) && (timeout < TIMEOUT_VALUE)); - if (timeout >= TIMEOUT_VALUE) - return true; - else return false; + return (timeout >= TIMEOUT_VALUE); } void rmt_tuner_rds_data(void) @@ -293,7 +292,7 @@ { strlcpy(rds_radioinfo,serbuf+5,(serbuf[0]-4)); } - rds_event = 1; + rds_event = true; } /* tuner abstraction layer: set something to the tuner */ @@ -326,13 +325,13 @@ &fm_region_data[global_settings.fm_region]; /* case: scan for presets, back to beginning of the band */ - if ((radio_tuned == 1) && (value == fmr->freq_min)) + if (radio_tuned && (value == fmr->freq_min)) { tuner_set(RADIO_FREQUENCY,value); } /* scan through frequencies */ - if (radio_tuned == 1) + if (radio_tuned) { if ((tuner_frequency <= fmr->freq_min) && (tuner_frequency >= fmr->freq_max)) @@ -354,17 +353,17 @@ if (reply_timeout() == true) return 0; } - radio_tuned = 0; + radio_tuned = false; } if (tuner_frequency == value) { - radio_tuned = 1; + radio_tuned = true; return 1; } else { - radio_tuned = 0; + radio_tuned = false; return 0; } } @@ -423,7 +422,7 @@ /* radio tuned: yes no */ case RADIO_TUNED: val = 0; - if (radio_tuned == 1) + if (radio_tuned) val = 1; break; @@ -438,7 +437,7 @@ if (rds_event) { val = 1; - rds_event = 0; + rds_event = false; } break; }