Index: apps/recorder/radio.c =================================================================== --- apps/recorder/radio.c (revision 24897) +++ apps/recorder/radio.c (working copy) @@ -503,6 +503,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; @@ -950,6 +953,13 @@ } } +#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) @@ -999,6 +1009,12 @@ screens[i].puts_scroll(0, top_of_screen + 5, buf); #endif #endif /* SIMULATOR */ + +#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: apps/lang/english.lang =================================================================== --- apps/lang/english.lang (revision 24897) +++ apps/lang/english.lang (working copy) @@ -13349,3 +13349,20 @@ remote: "Remote Screen" + + id: LANG_FM_SIGNAL_STRENGTH + desc: Signal strength of a received FM station + user: core + + *: none + radio: "Field strength" + + + *: none + radio: "Field strength" + + + *: none + radio: "Field strength" + + Index: firmware/export/tuner.h =================================================================== --- firmware/export/tuner.h (revision 24897) +++ firmware/export/tuner.h (working copy) @@ -46,6 +46,7 @@ RADIO_STEREO, /* RADIO_EVENT is an event that requests a screen update */ RADIO_EVENT, + RADIO_FIELD_STRENGTH, /* Put new general-purpose readback values above this line */ __RADIO_GET_STANDARD_LAST Index: firmware/export/lv24020lp.h =================================================================== --- firmware/export/lv24020lp.h (revision 24897) +++ firmware/export/lv24020lp.h (working copy) @@ -25,6 +25,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 24897) +++ firmware/export/tea5767.h (working copy) @@ -25,6 +25,7 @@ #define HAVE_RADIO_REGION #define HAVE_RADIO_MUTE_TIMEOUT +#define HAVE_RADIO_FIELD_METER struct tea5767_region_data { Index: firmware/export/si4700.h =================================================================== --- firmware/export/si4700.h (revision 24897) +++ firmware/export/si4700.h (working copy) @@ -26,6 +26,7 @@ #define _SI4700_H_ #define HAVE_RADIO_REGION +#define HAVE_RADIO_FIELD_METER struct si4700_region_data { Index: firmware/drivers/tuner/tea5767.c =================================================================== --- firmware/drivers/tuner/tea5767.c (revision 24897) +++ firmware/drivers/tuner/tea5767.c (working copy) @@ -130,6 +130,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/drivers/tuner/lv24020lp.c =================================================================== --- firmware/drivers/tuner/lv24020lp.c (revision 24897) +++ firmware/drivers/tuner/lv24020lp.c (working copy) @@ -934,6 +934,8 @@ int lv24020lp_get(int setting) { int val = -1; + const unsigned char fst[7] = {0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f}; + unsigned char fst_ndx, fs; mutex_lock(&tuner_mtx); @@ -961,6 +963,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/si4700.c =================================================================== --- firmware/drivers/tuner/si4700.c (revision 24897) +++ firmware/drivers/tuner/si4700.c (working copy) @@ -458,6 +458,10 @@ case RADIO_STEREO: val = si4700_st(); break; + + case RADIO_FIELD_STRENGTH: + val = si4700_read_reg(STATUSRSSI) & 0xFF; + break; } return val;