summaryrefslogtreecommitdiff
path: root/apps/settings_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings_menu.c')
-rw-r--r--apps/settings_menu.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index 678eda437e..5ad7a1e79c 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -116,12 +116,12 @@ static Menu deep_discharge(void)
116} 116}
117#endif 117#endif
118 118
119#ifdef HAVE_RTC 119#ifdef HAVE_LCD_BITMAP
120static Menu timedate_set(void) 120static Menu timedate_set(void)
121{ 121{
122 int timedate[7]; /* hour,minute,second,year,month,day,dayofweek */ 122 int timedate[7]; /* hour,minute,second,year,month,day,dayofweek */
123 123
124 124#ifdef HAVE_RTC
125 timedate[0] = rtc_read(0x03); /* hour */ 125 timedate[0] = rtc_read(0x03); /* hour */
126 timedate[1] = rtc_read(0x02); /* minute */ 126 timedate[1] = rtc_read(0x02); /* minute */
127 timedate[2] = rtc_read(0x01); /* second */ 127 timedate[2] = rtc_read(0x01); /* second */
@@ -141,10 +141,24 @@ static Menu timedate_set(void)
141 timedate[4] = ((timedate[4] & 0x10) >> 4) * 10 + (timedate[4] & 0x0f); 141 timedate[4] = ((timedate[4] & 0x10) >> 4) * 10 + (timedate[4] & 0x0f);
142 /* day */ 142 /* day */
143 timedate[5] = ((timedate[5] & 0x30) >> 4) * 10 + (timedate[5] & 0x0f); 143 timedate[5] = ((timedate[5] & 0x30) >> 4) * 10 + (timedate[5] & 0x0f);
144 144#else /* SIMULATOR */
145 /* hour */
146 timedate[0] = 0;
147 /* minute */
148 timedate[1] = 0;
149 /* second */
150 timedate[2] = 0;
151 /* year */
152 timedate[3] = 0;
153 /* month */
154 timedate[4] = 1;
155 /* day */
156 timedate[5] = 1;
157#endif
145 158
146 set_time(str(LANG_TIME),timedate); 159 set_time(str(LANG_TIME),timedate);
147 160
161#ifdef HAVE_RTC
148 if(timedate[0] != -1) { 162 if(timedate[0] != -1) {
149 /* hour */ 163 /* hour */
150 timedate[0] = ((timedate[0]/10) << 4 | timedate[0]%10) & 0x3f; 164 timedate[0] = ((timedate[0]/10) << 4 | timedate[0]%10) & 0x3f;
@@ -168,6 +182,7 @@ static Menu timedate_set(void)
168 rtc_write(0x04, timedate[6] | (rtc_read(0x04) & 0xf8)); /* dayofweek */ 182 rtc_write(0x04, timedate[6] | (rtc_read(0x04) & 0xf8)); /* dayofweek */
169 rtc_write(0x00, 0x00); /* 0.1 + 0.01 seconds */ 183 rtc_write(0x00, 0x00); /* 0.1 + 0.01 seconds */
170 } 184 }
185#endif
171 return MENU_OK; 186 return MENU_OK;
172} 187}
173#endif 188#endif
@@ -319,7 +334,7 @@ static Menu system_settings_menu(void)
319#ifdef HAVE_CHARGE_CTRL 334#ifdef HAVE_CHARGE_CTRL
320 { str(LANG_DISCHARGE), deep_discharge }, 335 { str(LANG_DISCHARGE), deep_discharge },
321#endif 336#endif
322#ifdef HAVE_RTC 337#ifdef HAVE_LCD_BITMAP
323 { str(LANG_TIME), timedate_set }, 338 { str(LANG_TIME), timedate_set },
324#endif 339#endif
325 { str(LANG_RESET), reset_settings }, 340 { str(LANG_RESET), reset_settings },