diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/gwps-common.c | 7 | ||||
-rw-r--r-- | apps/gui/statusbar.c | 9 | ||||
-rw-r--r-- | apps/menus/settings_menu.c | 30 | ||||
-rw-r--r-- | apps/misc.c | 7 | ||||
-rw-r--r-- | apps/plugins/clock.c | 2 | ||||
-rw-r--r-- | apps/recorder/recording.c | 9 | ||||
-rw-r--r-- | apps/scrobbler.c | 6 |
7 files changed, 67 insertions, 3 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 70f5565b61..8fa80c725a 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c | |||
@@ -23,7 +23,9 @@ | |||
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 | ||
26 | #include "rtc.h" | 27 | #include "rtc.h" |
28 | #endif | ||
27 | #include "audio.h" | 29 | #include "audio.h" |
28 | #include "status.h" | 30 | #include "status.h" |
29 | #include "power.h" | 31 | #include "power.h" |
@@ -972,6 +974,11 @@ static char* get_tag(struct wps_data* wps_data, | |||
972 | #ifdef CONFIG_RTC | 974 | #ifdef CONFIG_RTC |
973 | case 'c': /* Real Time Clock display */ | 975 | case 'c': /* Real Time Clock display */ |
974 | *flags |= WPS_REFRESH_DYNAMIC; | 976 | *flags |= WPS_REFRESH_DYNAMIC; |
977 | #if CONFIG_RTC == RTC_DS1339_DS3231 | ||
978 | if(!rtc_detected) | ||
979 | return NULL; | ||
980 | else | ||
981 | #endif | ||
975 | { | 982 | { |
976 | int value; | 983 | int value; |
977 | char *format = 0; | 984 | char *format = 0; |
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index fbd8943315..a36ae15974 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c | |||
@@ -28,6 +28,9 @@ | |||
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 | ||
31 | 34 | ||
32 | #include "status.h" /* needed for battery_state global var */ | 35 | #include "status.h" /* needed for battery_state global var */ |
33 | #include "action.h" /* for keys_locked */ | 36 | #include "action.h" /* for keys_locked */ |
@@ -239,6 +242,9 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
239 | bar->info.led = led_read(HZ/2); /* delay should match polling interval */ | 242 | bar->info.led = led_read(HZ/2); /* delay should match polling interval */ |
240 | #endif | 243 | #endif |
241 | #ifdef CONFIG_RTC | 244 | #ifdef CONFIG_RTC |
245 | #if CONFIG_RTC == RTC_DS1339_DS3231 | ||
246 | if(rtc_detected) | ||
247 | #endif | ||
242 | { | 248 | { |
243 | struct tm* tm = get_time(); | 249 | struct tm* tm = get_time(); |
244 | bar->info.hour = tm->tm_hour; | 250 | bar->info.hour = tm->tm_hour; |
@@ -324,6 +330,9 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
324 | gui_statusbar_icon_lock_remote(display); | 330 | gui_statusbar_icon_lock_remote(display); |
325 | #endif | 331 | #endif |
326 | #ifdef CONFIG_RTC | 332 | #ifdef CONFIG_RTC |
333 | #if CONFIG_RTC == RTC_DS1339_DS3231 | ||
334 | if(rtc_detected) | ||
335 | #endif | ||
327 | gui_statusbar_time(display, bar->info.hour, bar->info.minute); | 336 | gui_statusbar_time(display, bar->info.hour, bar->info.minute); |
328 | #endif /* CONFIG_RTC */ | 337 | #endif /* CONFIG_RTC */ |
329 | #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) | 338 | #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) |
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index 508f7214a1..818271b623 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c | |||
@@ -38,6 +38,12 @@ | |||
38 | #ifdef HAVE_ALARM_MOD | 38 | #ifdef HAVE_ALARM_MOD |
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 */ | ||
46 | int rtc_detect_callback(int action,const struct menu_item_ex *this_item); | ||
41 | 47 | ||
42 | /***********************************/ | 48 | /***********************************/ |
43 | /* TAGCACHE MENU */ | 49 | /* TAGCACHE MENU */ |
@@ -206,7 +212,7 @@ static int timedate_set(void) | |||
206 | 212 | ||
207 | MENUITEM_FUNCTION(time_set, ID2P(LANG_TIME), timedate_set, NULL, NOICON); | 213 | MENUITEM_FUNCTION(time_set, ID2P(LANG_TIME), timedate_set, NULL, NOICON); |
208 | MENUITEM_SETTING(timeformat, &global_settings.timeformat, NULL); | 214 | MENUITEM_SETTING(timeformat, &global_settings.timeformat, NULL); |
209 | MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), 0, NOICON, &time_set, &timeformat); | 215 | MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), rtc_detect_callback, NOICON, &time_set, &timeformat); |
210 | #endif | 216 | #endif |
211 | 217 | ||
212 | /* System menu */ | 218 | /* System menu */ |
@@ -246,7 +252,7 @@ MENUITEM_FUNCTION(sleep_timer_call, ID2P(LANG_SLEEP_TIMER), sleep_timer, | |||
246 | setting to the user */ | 252 | setting to the user */ |
247 | #ifdef HAVE_ALARM_MOD | 253 | #ifdef HAVE_ALARM_MOD |
248 | MENUITEM_FUNCTION(alarm_screen_call, ID2P(LANG_ALARM_MOD_ALARM_MENU), | 254 | MENUITEM_FUNCTION(alarm_screen_call, ID2P(LANG_ALARM_MOD_ALARM_MENU), |
249 | (menu_function)alarm_screen, NULL, NOICON); | 255 | (menu_function)alarm_screen, rtc_detect_callback, NOICON); |
250 | #endif | 256 | #endif |
251 | 257 | ||
252 | /* Limits menu */ | 258 | /* Limits menu */ |
@@ -383,3 +389,23 @@ MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0, | |||
383 | &bookmark_settings_menu, &browse_langs, &voice_settings_menu ); | 389 | &bookmark_settings_menu, &browse_langs, &voice_settings_menu ); |
384 | /* SETTINGS MENU */ | 390 | /* SETTINGS MENU */ |
385 | /***********************************/ | 391 | /***********************************/ |
392 | |||
393 | /* callback to display rtc menus dynamically */ | ||
394 | int rtc_detect_callback(int action,const struct menu_item_ex *this_item) | ||
395 | { | ||
396 | if (action != ACTION_REQUEST_MENUITEM) | ||
397 | return action; | ||
398 | |||
399 | #if defined(CONFIG_RTC) && CONFIG_RTC == RTC_DS1339_DS3231 | ||
400 | if ((this_item == &time_menu) || | ||
401 | (this_item == &alarm_screen_call)) | ||
402 | { | ||
403 | if (!rtc_detected) | ||
404 | return ACTION_EXIT_MENUITEM; | ||
405 | } | ||
406 | #else | ||
407 | (void)this_item; | ||
408 | #endif | ||
409 | |||
410 | return action; | ||
411 | } | ||
diff --git a/apps/misc.c b/apps/misc.c index 22f6fb50a6..339bc1d0b7 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -60,6 +60,7 @@ | |||
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" | ||
63 | 64 | ||
64 | /* Format a large-range value for output, using the appropriate unit so that | 65 | /* Format a large-range value for output, using the appropriate unit so that |
65 | * the displayed value is in the range 1 <= display < 1000 (1024 for "binary" | 66 | * the displayed value is in the range 1 <= display < 1000 (1024 for "binary" |
@@ -414,6 +415,12 @@ void screen_dump(void) | |||
414 | #endif | 415 | #endif |
415 | 416 | ||
416 | #ifdef CONFIG_RTC | 417 | #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 | ||
417 | create_datetime_filename(filename, "", "dump ", ".bmp", false); | 424 | create_datetime_filename(filename, "", "dump ", ".bmp", false); |
418 | #else | 425 | #else |
419 | create_numbered_filename(filename, "", "dump_", ".bmp", 4 | 426 | create_numbered_filename(filename, "", "dump_", ".bmp", 4 |
diff --git a/apps/plugins/clock.c b/apps/plugins/clock.c index 7e52e2b552..010e293bac 100644 --- a/apps/plugins/clock.c +++ b/apps/plugins/clock.c | |||
@@ -277,7 +277,7 @@ extern const fb_data clock_timesup[]; | |||
277 | #define EXIT_BUTTON BUTTON_MENU | 277 | #define EXIT_BUTTON BUTTON_MENU |
278 | #define MODE_NEXT_BUTTON BUTTON_RIGHT | 278 | #define MODE_NEXT_BUTTON BUTTON_RIGHT |
279 | #define MODE_PREV_BUTTON BUTTON_LEFT | 279 | #define MODE_PREV_BUTTON BUTTON_LEFT |
280 | #elif (CONFIG_KEYPAD == IRIVER_H300_PAD) | 280 | #elif (CONFIG_KEYPAD == IRIVER_H300_PAD) || (CONFIG_KEYPAD == IRIVER_H100_PAD) |
281 | #define COUNTER_TOGGLE_BUTTON (BUTTON_ON|BUTTON_REL) | 281 | #define COUNTER_TOGGLE_BUTTON (BUTTON_ON|BUTTON_REL) |
282 | #define COUNTER_RESET_BUTTON (BUTTON_ON|BUTTON_REPEAT) | 282 | #define COUNTER_RESET_BUTTON (BUTTON_ON|BUTTON_REPEAT) |
283 | #define MENU_BUTTON BUTTON_SELECT | 283 | #define MENU_BUTTON BUTTON_SELECT |
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 8eea24d82d..2c5fc32b28 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c | |||
@@ -68,6 +68,9 @@ | |||
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 | ||
71 | #ifdef HAVE_RECORDING | 74 | #ifdef HAVE_RECORDING |
72 | 75 | ||
73 | static bool in_screen = false; | 76 | static bool in_screen = false; |
@@ -521,6 +524,12 @@ char *rec_create_filename(char *buffer) | |||
521 | #ifdef CONFIG_RTC | 524 | #ifdef CONFIG_RTC |
522 | /* We'll wait at least up to the start of the next second so no duplicate | 525 | /* We'll wait at least up to the start of the next second so no duplicate |
523 | names are created */ | 526 | 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 | ||
524 | return create_datetime_filename(buffer, buffer, "R", ext, true); | 533 | return create_datetime_filename(buffer, buffer, "R", ext, true); |
525 | #else | 534 | #else |
526 | return create_numbered_filename(buffer, buffer, "rec_", ext, 4 | 535 | return create_numbered_filename(buffer, buffer, "rec_", ext, 4 |
diff --git a/apps/scrobbler.c b/apps/scrobbler.c index a339429cab..1c0d98cbc6 100644 --- a/apps/scrobbler.c +++ b/apps/scrobbler.c | |||
@@ -35,6 +35,7 @@ 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" | ||
38 | #endif | 39 | #endif |
39 | 40 | ||
40 | #include "scrobbler.h" | 41 | #include "scrobbler.h" |
@@ -208,6 +209,11 @@ void scrobbler_change_event(struct mp3entry *id) | |||
208 | logf("SCROBBLER: add pending"); | 209 | logf("SCROBBLER: add pending"); |
209 | copy_mp3entry(&scrobbler_entry, id); | 210 | copy_mp3entry(&scrobbler_entry, id); |
210 | #ifdef CONFIG_RTC | 211 | #ifdef CONFIG_RTC |
212 | #if CONFIG_RTC == RTC_DS1339_DS3231 | ||
213 | if(!rtc_detected) | ||
214 | timestamp = 0; | ||
215 | else | ||
216 | #endif | ||
211 | timestamp = mktime(get_time()); | 217 | timestamp = mktime(get_time()); |
212 | #else | 218 | #else |
213 | timestamp = 0; | 219 | timestamp = 0; |