summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/rtc.c
diff options
context:
space:
mode:
authorLiveboxAndy <liveboxandy@gmail.com>2018-11-17 10:31:50 +0000
committerFranklin Wei <git@fwei.tk>2019-07-26 20:11:33 -0400
commitd462d26ff0fb382af5edd1af1ff752ca17e72a14 (patch)
tree99821272fc2854f1b7f98104154b50703acc3750 /firmware/target/hosted/rtc.c
parentc8ec64ed27f354f6fa438d9f03935744346fff09 (diff)
downloadrockbox-d462d26ff0fb382af5edd1af1ff752ca17e72a14.tar.gz
rockbox-d462d26ff0fb382af5edd1af1ff752ca17e72a14.tar.bz2
rockbox-d462d26ff0fb382af5edd1af1ff752ca17e72a14.zip
Fix issue with building the UI Simulator for Windows
Addition of rtc support for AGPtEK ROCKER broke building the UI Simulator for Windows. This patch removes the rtc support if building UI Simulator for Windows.
Diffstat (limited to 'firmware/target/hosted/rtc.c')
-rw-r--r--firmware/target/hosted/rtc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/firmware/target/hosted/rtc.c b/firmware/target/hosted/rtc.c
index c5bf9816a9..178e797a8d 100644
--- a/firmware/target/hosted/rtc.c
+++ b/firmware/target/hosted/rtc.c
@@ -22,11 +22,12 @@
****************************************************************************/
#include <time.h>
#include <sys/time.h>
+#if !defined(WIN32)
#include <sys/ioctl.h>
#include <linux/rtc.h>
#include <fcntl.h>
#include <unistd.h>
-
+#endif
void rtc_init(void)
{
}
@@ -41,12 +42,12 @@ int rtc_read_datetime(struct tm *tm)
int rtc_write_datetime(const struct tm *tm)
{
-#if defined(AGPTEK_ROCKER)
+#if defined(AGPTEK_ROCKER) && !defined(WIN32)
struct timeval tv;
struct tm *tm_time;
int rtc = open("/dev/rtc0", O_WRONLY);
-
+
tv.tv_sec = mktime((struct tm *)tm);
tv.tv_usec = 0;