diff options
-rw-r--r-- | apps/menus/time_menu.c | 2 | ||||
-rw-r--r-- | firmware/export/config/agptekrocker.h | 2 | ||||
-rw-r--r-- | firmware/target/hosted/rtc.c | 10 |
3 files changed, 11 insertions, 3 deletions
diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c index 9ef4f7323c..a6885a3dbc 100644 --- a/apps/menus/time_menu.c +++ b/apps/menus/time_menu.c | |||
@@ -37,7 +37,9 @@ | |||
37 | #include "list.h" | 37 | #include "list.h" |
38 | #include "alarm_menu.h" | 38 | #include "alarm_menu.h" |
39 | #include "screens.h" | 39 | #include "screens.h" |
40 | #if CONFIG_TUNER | ||
40 | #include "radio.h" | 41 | #include "radio.h" |
42 | #endif | ||
41 | #include "font.h" | 43 | #include "font.h" |
42 | #include "system.h" | 44 | #include "system.h" |
43 | 45 | ||
diff --git a/firmware/export/config/agptekrocker.h b/firmware/export/config/agptekrocker.h index fa010a109f..1c15117f9b 100644 --- a/firmware/export/config/agptekrocker.h +++ b/firmware/export/config/agptekrocker.h | |||
@@ -59,7 +59,7 @@ | |||
59 | #define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING | 59 | #define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING |
60 | 60 | ||
61 | /* define this if you have a real-time clock */ | 61 | /* define this if you have a real-time clock */ |
62 | #define CONFIG_RTC 0 | 62 | #define CONFIG_RTC APPLICATION |
63 | 63 | ||
64 | /* The number of bytes reserved for loadable codecs */ | 64 | /* The number of bytes reserved for loadable codecs */ |
65 | #define CODEC_SIZE 0x80000 | 65 | #define CODEC_SIZE 0x80000 |
diff --git a/firmware/target/hosted/rtc.c b/firmware/target/hosted/rtc.c index 8c430f3774..cb11d3ca3c 100644 --- a/firmware/target/hosted/rtc.c +++ b/firmware/target/hosted/rtc.c | |||
@@ -9,6 +9,7 @@ | |||
9 | * | 9 | * |
10 | * Based upon code (C) 2002 by Björn Stenberg | 10 | * Based upon code (C) 2002 by Björn Stenberg |
11 | * Copyright (C) 2011 by Thomas Jarosch | 11 | * Copyright (C) 2011 by Thomas Jarosch |
12 | * Copyright (C) 2018 by Marcin Bukat | ||
12 | * | 13 | * |
13 | * This program is free software; you can redistribute it and/or | 14 | * This program is free software; you can redistribute it and/or |
14 | * modify it under the terms of the GNU General Public License | 15 | * modify it under the terms of the GNU General Public License |
@@ -20,6 +21,7 @@ | |||
20 | * | 21 | * |
21 | ****************************************************************************/ | 22 | ****************************************************************************/ |
22 | #include <time.h> | 23 | #include <time.h> |
24 | #include <sys/time.h> | ||
23 | 25 | ||
24 | void rtc_init(void) | 26 | void rtc_init(void) |
25 | { | 27 | { |
@@ -35,6 +37,10 @@ int rtc_read_datetime(struct tm *tm) | |||
35 | 37 | ||
36 | int rtc_write_datetime(const struct tm *tm) | 38 | int rtc_write_datetime(const struct tm *tm) |
37 | { | 39 | { |
38 | (void)tm; | 40 | struct timeval tv; |
39 | return -1; | 41 | |
42 | tv.tv_sec = mktime((struct tm *)tm); | ||
43 | tv.tv_usec = 0; | ||
44 | |||
45 | return settimeofday(&tv, NULL); | ||
40 | } | 46 | } |