summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/gwps-common.c7
-rw-r--r--apps/gui/statusbar.c9
-rw-r--r--apps/menus/settings_menu.c30
-rw-r--r--apps/misc.c7
-rw-r--r--apps/recorder/recording.c9
-rw-r--r--apps/scrobbler.c6
6 files changed, 2 insertions, 66 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index d59ac130fc..b321d3b133 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -23,9 +23,7 @@
23#include <stdlib.h> 23#include <stdlib.h>
24#include "system.h" 24#include "system.h"
25#include "settings.h" 25#include "settings.h"
26#ifdef CONFIG_RTC
27#include "rtc.h" 26#include "rtc.h"
28#endif
29#include "audio.h" 27#include "audio.h"
30#include "status.h" 28#include "status.h"
31#include "power.h" 29#include "power.h"
@@ -974,11 +972,6 @@ static char* get_tag(struct wps_data* wps_data,
974#ifdef CONFIG_RTC 972#ifdef CONFIG_RTC
975 case 'c': /* Real Time Clock display */ 973 case 'c': /* Real Time Clock display */
976 *flags |= WPS_REFRESH_DYNAMIC; 974 *flags |= WPS_REFRESH_DYNAMIC;
977#if CONFIG_RTC == RTC_DS1339_DS3231
978 if(!rtc_detected)
979 return NULL;
980 else
981#endif
982 { 975 {
983 int value; 976 int value;
984 char *format = 0; 977 char *format = 0;
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index a36ae15974..fbd8943315 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -28,9 +28,6 @@
28#include "powermgmt.h" 28#include "powermgmt.h"
29#include "usb.h" 29#include "usb.h"
30#include "led.h" 30#include "led.h"
31#ifdef CONFIG_RTC
32#include "rtc.h"
33#endif
34 31
35#include "status.h" /* needed for battery_state global var */ 32#include "status.h" /* needed for battery_state global var */
36#include "action.h" /* for keys_locked */ 33#include "action.h" /* for keys_locked */
@@ -242,9 +239,6 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
242 bar->info.led = led_read(HZ/2); /* delay should match polling interval */ 239 bar->info.led = led_read(HZ/2); /* delay should match polling interval */
243#endif 240#endif
244#ifdef CONFIG_RTC 241#ifdef CONFIG_RTC
245#if CONFIG_RTC == RTC_DS1339_DS3231
246 if(rtc_detected)
247#endif
248 { 242 {
249 struct tm* tm = get_time(); 243 struct tm* tm = get_time();
250 bar->info.hour = tm->tm_hour; 244 bar->info.hour = tm->tm_hour;
@@ -330,9 +324,6 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
330 gui_statusbar_icon_lock_remote(display); 324 gui_statusbar_icon_lock_remote(display);
331#endif 325#endif
332#ifdef CONFIG_RTC 326#ifdef CONFIG_RTC
333#if CONFIG_RTC == RTC_DS1339_DS3231
334 if(rtc_detected)
335#endif
336 gui_statusbar_time(display, bar->info.hour, bar->info.minute); 327 gui_statusbar_time(display, bar->info.hour, bar->info.minute);
337#endif /* CONFIG_RTC */ 328#endif /* CONFIG_RTC */
338#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) 329#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index 050bf88d82..8caa5fd8b0 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -38,12 +38,6 @@
38#ifdef HAVE_RTC_ALARM 38#ifdef HAVE_RTC_ALARM
39#include "alarm_menu.h" 39#include "alarm_menu.h"
40#endif 40#endif
41#ifdef CONFIG_RTC
42#include "rtc.h"
43#endif
44
45/* callback to display rtc menus dynamically */
46int rtc_detect_callback(int action,const struct menu_item_ex *this_item);
47 41
48/***********************************/ 42/***********************************/
49/* TAGCACHE MENU */ 43/* TAGCACHE MENU */
@@ -208,7 +202,7 @@ static int timedate_set(void)
208 202
209MENUITEM_FUNCTION(time_set, ID2P(LANG_TIME), timedate_set, NULL, NOICON); 203MENUITEM_FUNCTION(time_set, ID2P(LANG_TIME), timedate_set, NULL, NOICON);
210MENUITEM_SETTING(timeformat, &global_settings.timeformat, NULL); 204MENUITEM_SETTING(timeformat, &global_settings.timeformat, NULL);
211MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), rtc_detect_callback, NOICON, &time_set, &timeformat); 205MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), 0, NOICON, &time_set, &timeformat);
212#endif 206#endif
213 207
214/* System menu */ 208/* System menu */
@@ -216,7 +210,7 @@ MENUITEM_SETTING(poweroff, &global_settings.poweroff, NULL);
216 210
217#ifdef HAVE_RTC_ALARM 211#ifdef HAVE_RTC_ALARM
218MENUITEM_FUNCTION(alarm_screen_call, ID2P(LANG_ALARM_MOD_ALARM_MENU), 212MENUITEM_FUNCTION(alarm_screen_call, ID2P(LANG_ALARM_MOD_ALARM_MENU),
219 (menu_function)alarm_screen, rtc_detect_callback, NOICON); 213 (menu_function)alarm_screen, NULL, NOICON);
220#endif 214#endif
221 215
222/* Limits menu */ 216/* Limits menu */
@@ -358,23 +352,3 @@ MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0,
358 &bookmark_settings_menu, &browse_langs, &voice_settings_menu ); 352 &bookmark_settings_menu, &browse_langs, &voice_settings_menu );
359/* SETTINGS MENU */ 353/* SETTINGS MENU */
360/***********************************/ 354/***********************************/
361
362/* callback to display rtc menus dynamically */
363int rtc_detect_callback(int action,const struct menu_item_ex *this_item)
364{
365 if (action != ACTION_REQUEST_MENUITEM)
366 return action;
367
368#if defined(CONFIG_RTC) && CONFIG_RTC == RTC_DS1339_DS3231
369 if ((this_item == &time_menu) ||
370 (this_item == &alarm_screen_call))
371 {
372 if (!rtc_detected)
373 return ACTION_EXIT_MENUITEM;
374 }
375#else
376 (void)this_item;
377#endif
378
379 return action;
380}
diff --git a/apps/misc.c b/apps/misc.c
index 339bc1d0b7..22f6fb50a6 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -60,7 +60,6 @@
60#include "gui/gwps-common.h" 60#include "gui/gwps-common.h"
61 61
62#include "misc.h" 62#include "misc.h"
63#include "rtc.h"
64 63
65/* Format a large-range value for output, using the appropriate unit so that 64/* Format a large-range value for output, using the appropriate unit so that
66 * the displayed value is in the range 1 <= display < 1000 (1024 for "binary" 65 * the displayed value is in the range 1 <= display < 1000 (1024 for "binary"
@@ -415,12 +414,6 @@ void screen_dump(void)
415#endif 414#endif
416 415
417#ifdef CONFIG_RTC 416#ifdef CONFIG_RTC
418#if CONFIG_RTC == RTC_DS1339_DS3231
419 if(!rtc_detected)
420 create_numbered_filename(filename, "", "dump_", ".bmp", 4
421 IF_CNFN_NUM_(, NULL));
422 else
423#endif
424 create_datetime_filename(filename, "", "dump ", ".bmp", false); 417 create_datetime_filename(filename, "", "dump ", ".bmp", false);
425#else 418#else
426 create_numbered_filename(filename, "", "dump_", ".bmp", 4 419 create_numbered_filename(filename, "", "dump_", ".bmp", 4
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index 2c5fc32b28..8eea24d82d 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -68,9 +68,6 @@
68#include "screen_access.h" 68#include "screen_access.h"
69#include "action.h" 69#include "action.h"
70#include "radio.h" 70#include "radio.h"
71#ifdef CONFIG_RTC
72#include "rtc.h"
73#endif
74#ifdef HAVE_RECORDING 71#ifdef HAVE_RECORDING
75 72
76static bool in_screen = false; 73static bool in_screen = false;
@@ -524,12 +521,6 @@ char *rec_create_filename(char *buffer)
524#ifdef CONFIG_RTC 521#ifdef CONFIG_RTC
525 /* We'll wait at least up to the start of the next second so no duplicate 522 /* We'll wait at least up to the start of the next second so no duplicate
526 names are created */ 523 names are created */
527#if CONFIG_RTC == RTC_DS1339_DS3231
528 if(!rtc_detected)
529 return create_numbered_filename(buffer, buffer, "rec_", ext, 4
530 IF_CNFN_NUM_(, &file_number));
531 else
532#endif
533 return create_datetime_filename(buffer, buffer, "R", ext, true); 524 return create_datetime_filename(buffer, buffer, "R", ext, true);
534#else 525#else
535 return create_numbered_filename(buffer, buffer, "rec_", ext, 4 526 return create_numbered_filename(buffer, buffer, "rec_", ext, 4
diff --git a/apps/scrobbler.c b/apps/scrobbler.c
index 1c0d98cbc6..a339429cab 100644
--- a/apps/scrobbler.c
+++ b/apps/scrobbler.c
@@ -35,7 +35,6 @@ http://www.audioscrobbler.net/wiki/Portable_Player_Logging
35#ifdef CONFIG_RTC 35#ifdef CONFIG_RTC
36#include "time.h" 36#include "time.h"
37#include "timefuncs.h" 37#include "timefuncs.h"
38#include "rtc.h"
39#endif 38#endif
40 39
41#include "scrobbler.h" 40#include "scrobbler.h"
@@ -209,11 +208,6 @@ void scrobbler_change_event(struct mp3entry *id)
209 logf("SCROBBLER: add pending"); 208 logf("SCROBBLER: add pending");
210 copy_mp3entry(&scrobbler_entry, id); 209 copy_mp3entry(&scrobbler_entry, id);
211#ifdef CONFIG_RTC 210#ifdef CONFIG_RTC
212#if CONFIG_RTC == RTC_DS1339_DS3231
213 if(!rtc_detected)
214 timestamp = 0;
215 else
216#endif
217 timestamp = mktime(get_time()); 211 timestamp = mktime(get_time());
218#else 212#else
219 timestamp = 0; 213 timestamp = 0;