Index: apps/lang/english.lang =================================================================== --- apps/lang/english.lang (revision 17636) +++ apps/lang/english.lang (working copy) @@ -11716,3 +11716,20 @@ recording: "Stop Recording And Shutdown" + + id: LANG_FM_SIGNAL_STRENGTH + desc: Signal strength of a received FM station + user: + + *: none + radio: "Field strength" + + + *: none + radio: "Field strength" + + + *: none + radio: "Field strength" + + Index: apps/lang/polski.lang =================================================================== --- apps/lang/polski.lang (revision 17636) +++ apps/lang/polski.lang (working copy) @@ -11574,3 +11574,20 @@ + + id: LANG_FM_SIGNAL_STRENGTH + desc: Signal strength of a received FM station + user: + + *: none + radio: "Poziom sygnalu" + + + *: none + radio: "Poziom sygnalu" + + + *: none + radio: "Poziom sygnalu" + + Index: apps/recorder/radio.c =================================================================== --- apps/recorder/radio.c (revision 17636) +++ apps/recorder/radio.c (working copy) @@ -456,6 +456,9 @@ gui_buttonbar_init(&buttonbar); gui_buttonbar_set_display(&buttonbar, &(screens[SCREEN_MAIN]) ); #endif +#ifdef HAVE_RADIO_FIELD_METER + int radio_field_strength[2]={0,0}; +#endif /* change status to "in screen" */ in_screen = true; @@ -874,7 +877,12 @@ } } } - +#ifdef HAVE_RADIO_FIELD_METER + radio_field_strength[1] = radio_field_strength[0]; + radio_field_strength[0] = tuner_get(RADIO_FIELD_STRENGTH); + if(radio_field_strength[0] != radio_field_strength[1]) + update_screen = true; +#endif #if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR) seconds = audio_recorded_time() / HZ; if (update_screen || seconds > last_seconds) @@ -910,6 +918,11 @@ str(LANG_RADIO_SCAN_MODE)); FOR_NB_SCREENS(i) screens[i].puts_scroll(0, top_of_screen + 3, buf); +#ifdef HAVE_RADIO_FIELD_METER + snprintf(buf, 128, "%s: %d dBu", str(LANG_FM_SIGNAL_STRENGTH),radio_field_strength[0]); + FOR_NB_SCREENS(i) + screens[i].puts_scroll(0, top_of_screen + 4, buf); +#endif #if CONFIG_CODEC != SWCODEC if(audio_status() == AUDIO_STATUS_RECORD) Index: firmware/drivers/tuner/lv24020lp.c =================================================================== --- firmware/drivers/tuner/lv24020lp.c (revision 17636) +++ firmware/drivers/tuner/lv24020lp.c (working copy) @@ -900,6 +900,8 @@ int lv24020lp_get(int setting) { int val = -1; + const unsigned char fst[7] = {0x00, 0x03, 0x05, 0x07, 0x0f, 0x1f, 0x2f}; + unsigned char fst_ndx, fs; mutex_lock(&tuner_mtx); @@ -927,6 +929,14 @@ tuner_power(false); break; } + + case RADIO_FIELD_STRENGTH: + fs = RSS_FS(lv24020lp_read(RADIO_STAT)); + for(fst_ndx=0; fst_ndx<7; fst_ndx++) + if(fs == fst[fst_ndx]) + break; + val = 75 - 10*fst_ndx; + break; default: val = lv24020lp_debug_info(setting); Index: firmware/drivers/tuner/tea5767.c =================================================================== --- firmware/drivers/tuner/tea5767.c (revision 17636) +++ firmware/drivers/tuner/tea5767.c (working copy) @@ -123,6 +123,10 @@ case RADIO_STEREO: val = read_bytes[2] >> 7; break; + + case RADIO_FIELD_STRENGTH: + val = 9 + 3*(read_bytes[3] >> 4); + break; } return val; Index: firmware/export/lv24020lp.h =================================================================== --- firmware/export/lv24020lp.h (revision 17636) +++ firmware/export/lv24020lp.h (working copy) @@ -23,6 +23,7 @@ /* Define additional tuner messages here */ #define HAVE_RADIO_REGION +#define HAVE_RADIO_FIELD_METER #define LV24020LP_CTRL_STAT (RADIO_GET_CHIP_FIRST+0) #define LV24020LP_REG_STAT (RADIO_GET_CHIP_FIRST+1) Index: firmware/export/tea5767.h =================================================================== --- firmware/export/tea5767.h (revision 17636) +++ firmware/export/tea5767.h (working copy) @@ -23,6 +23,7 @@ #define HAVE_RADIO_REGION #define HAVE_RADIO_MUTE_TIMEOUT +#define HAVE_RADIO_FIELD_METER struct tea5767_region_data { Index: firmware/export/tuner.h =================================================================== --- firmware/export/tuner.h (revision 17636) +++ firmware/export/tuner.h (working copy) @@ -42,7 +42,7 @@ RADIO_PRESENT = 0, RADIO_TUNED, RADIO_STEREO, - + RADIO_FIELD_STRENGTH, /* Put new general-purpose readback values above this line */ __RADIO_GET_STANDARD_LAST };