Mercurial > public > ostc4
annotate Discovery/Src/tMenuEditSystem.c @ 603:c56ed16dbd39
T3 profile view: Added visualization of deco data
author | Ideenmodellierer |
---|---|
date | Wed, 06 Jan 2021 19:41:43 +0100 |
parents | 1c95f811967c |
children | 0fc1b47d2482 |
rev | line source |
---|---|
38 | 1 /////////////////////////////////////////////////////////////////////////////// |
2 /// -*- coding: UTF-8 -*- | |
3 /// | |
4 /// \file Discovery/Src/tMenuEditSystem.c | |
5 /// \brief Main Template file for Menu Edit System settings | |
6 /// \author heinrichs weikamp gmbh | |
7 /// \date 05-Aug-2014 | |
8 /// | |
9 /// \details | |
10 /// | |
11 /// $Id$ | |
12 /////////////////////////////////////////////////////////////////////////////// | |
13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh | |
14 /// | |
15 /// This program is free software: you can redistribute it and/or modify | |
16 /// it under the terms of the GNU General Public License as published by | |
17 /// the Free Software Foundation, either version 3 of the License, or | |
18 /// (at your option) any later version. | |
19 /// | |
20 /// This program is distributed in the hope that it will be useful, | |
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
23 /// GNU General Public License for more details. | |
24 /// | |
25 /// You should have received a copy of the GNU General Public License | |
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
27 ////////////////////////////////////////////////////////////////////////////// | |
28 | |
29 /* Includes ------------------------------------------------------------------*/ | |
30 #include "tMenuEditSystem.h" | |
31 | |
138 | 32 #include "data_exchange_main.h" |
38 | 33 #include "externLogbookFlash.h" |
34 #include "gfx_fonts.h" | |
35 #include "ostc.h" | |
36 #include "settings.h" // for getLicence() | |
37 #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass() | |
343
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
38 #include "tMenu.h" |
38 | 39 #include "tMenuEdit.h" |
343
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
40 #include "tMenuSystem.h" |
520 | 41 #include "tMenuEditCustom.h" |
389
ebc2b571a0b9
Fix case for case sensitive OS
Jan Mulder <jan@jlmulder.nl>
parents:
384
diff
changeset
|
42 #include "motion.h" |
343
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
43 #include "t7.h" |
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
44 |
493
b560e474e319
Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents:
468
diff
changeset
|
45 |
343
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
46 /*#define HAVE_DEBUG_VIEW */ |
379 | 47 static uint8_t infoPage = 0; |
38 | 48 |
49 /* Private function prototypes -----------------------------------------------*/ | |
50 void openEdit_DateTime(void); | |
51 void openEdit_Language(void); | |
52 void openEdit_Design(void); | |
53 void openEdit_Information(void); | |
54 void openEdit_Reset(void); | |
55 //void openEdit_ShowDebugInfo(void); | |
56 //void openEdit_Salinity(void); | |
57 | |
58 /* Announced function prototypes -----------------------------------------------*/ | |
59 uint8_t OnAction_Date (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
60 uint8_t OnAction_Time (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
567 | 61 uint8_t OnAction_12HR (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
38 | 62 uint8_t OnAction_DDMMYY (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
63 uint8_t OnAction_MMDDYY (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
64 uint8_t OnAction_YYMMDD (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
65 uint8_t OnAction_DST (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
66 uint8_t OnAction_English (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
67 uint8_t OnAction_German (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
68 uint8_t OnAction_French (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
69 uint8_t OnAction_Italian (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
70 uint8_t OnAction_Espanol (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
71 //uint8_t OnAction_Design_t7 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
72 //uint8_t OnAction_Design_t7ft (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
73 //uint8_t OnAction_Design_t3 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
74 | |
75 uint8_t OnAction_Units (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
76 uint8_t OnAction_Colorscheme (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
77 uint8_t OnAction_DebugInfo (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
78 | |
79 uint8_t OnAction_Exit (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
80 uint8_t OnAction_Confirm (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
81 uint8_t OnAction_RebootRTE (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
82 uint8_t OnAction_ResetDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
83 uint8_t OnAction_ResetAll (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
84 uint8_t OnAction_ResetLogbook (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
85 uint8_t OnAction_RebootMainCPU (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
86 uint8_t OnAction_Nothing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
87 uint8_t OnAction_LogbookOffset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
88 uint8_t OnAction_SetFactoryDefaults(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
89 uint8_t OnAction_SetBatteryCharge(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
468
aa1d71875e25
Moved and deactivated analyse sample buffer switch:
ideenmodellierer
parents:
446
diff
changeset
|
90 #ifdef ENABLE_ANALYSE_SAMPLES |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
91 uint8_t OnAction_RecoverSampleIdx(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
468
aa1d71875e25
Moved and deactivated analyse sample buffer switch:
ideenmodellierer
parents:
446
diff
changeset
|
92 #endif |
38 | 93 #ifdef SCREENTEST |
94 uint8_t OnAction_ScreenTest (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
95 #endif | |
96 uint8_t OnAction_Information (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
97 /* | |
98 uint8_t OnAction_Salinity (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
99 uint8_t OnAction_TestCLog (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
100 */ | |
101 | |
102 /* Exported functions --------------------------------------------------------*/ | |
103 | |
104 void openEdit_System(uint8_t line) | |
105 { | |
106 set_globalState_Menu_Line(line); | |
107 resetMenuEdit(CLUT_MenuPageSystem); | |
108 | |
109 if(actual_menu_content == MENU_SURFACE) | |
110 { | |
111 switch(line) | |
112 { | |
113 case 1: | |
114 default: | |
115 openEdit_DateTime(); | |
116 break; | |
117 case 2: | |
118 openEdit_Language(); | |
119 break; | |
120 case 3: | |
121 openEdit_Design(); | |
122 break; | |
123 case 4: | |
520 | 124 openEdit_Information(); |
38 | 125 break; |
126 case 5: | |
127 openEdit_Reset(); | |
128 break; | |
129 /* | |
130 case 3: | |
131 openEdit_DecoFutureTTS(); | |
132 break; | |
133 case 4: | |
134 openEdit_DecoLastStop(); | |
135 break; | |
136 */ | |
137 } | |
138 } | |
139 else | |
140 { | |
520 | 141 openEdit_CustomviewDivemodeMenu(line); |
38 | 142 } |
143 | |
144 } | |
145 | |
146 /* Private functions ---------------------------------------------------------*/ | |
147 | |
148 | |
149 void openEdit_DateTime(void) | |
150 { | |
151 RTC_DateTypeDef Sdate; | |
152 RTC_TimeTypeDef Stime; | |
153 uint8_t day,month,year,hour,minute, dateFormat, ddmmyy, mmddyy, yymmdd; | |
154 char text[32]; | |
155 SSettings *pSettings; | |
156 const SDiveState * pStateReal = stateRealGetPointer(); | |
157 | |
158 pSettings = settingsGetPointer(); | |
159 translateDate(pStateReal->lifeData.dateBinaryFormat, &Sdate); | |
160 translateTime(pStateReal->lifeData.timeBinaryFormat, &Stime); | |
161 year = Sdate.Year; | |
162 month = Sdate.Month; | |
163 day = Sdate.Date; | |
164 hour = Stime.Hours; | |
165 minute= Stime.Minutes; | |
166 | |
167 if(year < 16) | |
168 year = 16; | |
169 | |
170 if(month < 1) | |
171 month = 1; | |
172 | |
173 if(day < 1) | |
174 day = 1; | |
175 | |
176 // daylightsaving = Stime.DayLightSaving; | |
177 dateFormat = pSettings->date_format; | |
178 ddmmyy = 0; | |
179 mmddyy = 0; | |
180 yymmdd = 0; | |
181 | |
182 if(dateFormat == DDMMYY) | |
183 ddmmyy = 1; | |
184 else | |
185 if(dateFormat == MMDDYY) | |
186 mmddyy = 1; | |
187 else | |
188 yymmdd = 1; | |
189 | |
190 text[0] = '\001'; | |
191 text[1] = TXT_DateAndTime; | |
192 text[2] = 0; | |
193 | |
194 write_topline(text); | |
195 | |
196 write_label_fix( 20, 340, ME_Y_LINE1, &FontT42, TXT_TimeConfig); | |
567 | 197 write_label_fix( 20, 340, ME_Y_LINE2, &FontT42, TXT_Format); |
198 write_label_fix( 20, 340, ME_Y_LINE3, &FontT42, TXT_DateConfig); | |
199 write_label_var( 600, 800, ME_Y_LINE4, &FontT48, "\016\016DDMMYY\017"); | |
200 write_label_fix( 20, 790, ME_Y_LINE5, &FontT42, TXT_Format); | |
38 | 201 // write_label_fix( 350 ,580, 250, &FontT42, TXT_Daylightsaving); |
202 | |
203 write_field_2digit(StMSYS1_Time, 320, 780, ME_Y_LINE1, &FontT48, "##:##", (uint32_t)hour, (uint32_t)minute, 0, 0); | |
567 | 204 write_field_on_off(StMSYS1_12HR, 320, 790, ME_Y_LINE2, &FontT48, "12 HR", pSettings->amPMTime); |
205 write_field_2digit(StMSYS1_Date, 320, 780, ME_Y_LINE3, &FontT48, "##-##-20##", (uint32_t)day, (uint32_t)month, (uint32_t)year, 0); | |
206 write_field_on_off(StMSYS1_DDMMYY, 320, 790, ME_Y_LINE4, &FontT48, "DDMMYY", ddmmyy); | |
207 write_field_on_off(StMSYS1_MMDDYY, 320, 790, ME_Y_LINE5, &FontT48, "MMDDYY", mmddyy); | |
208 write_field_on_off(StMSYS1_YYMMDD, 320, 790, ME_Y_LINE6, &FontT48, "YYMMDD", yymmdd); | |
38 | 209 // write_field_on_off(StMSYS1_DST, 350, 580, 310, &FontT48, "Active", daylightsaving); |
210 | |
211 setEvent(StMSYS1_Date, (uint32_t)OnAction_Date); | |
212 setEvent(StMSYS1_Time, (uint32_t)OnAction_Time); | |
567 | 213 setEvent(StMSYS1_12HR, (uint32_t)OnAction_12HR); |
38 | 214 setEvent(StMSYS1_DDMMYY, (uint32_t)OnAction_DDMMYY); |
215 setEvent(StMSYS1_MMDDYY, (uint32_t)OnAction_MMDDYY); | |
216 setEvent(StMSYS1_YYMMDD, (uint32_t)OnAction_YYMMDD); | |
217 // setEvent(StMSYS1_DST, (uint32_t)OnAction_DST); | |
218 | |
219 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
220 } | |
221 | |
222 | |
223 uint8_t OnAction_Date(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
224 { | |
225 uint8_t digitContentNew; | |
226 uint32_t newDay, newMonth, newYear; | |
227 RTC_DateTypeDef sdatestructure; | |
228 | |
229 | |
230 if(action == ACTION_BUTTON_ENTER) | |
231 { | |
232 return digitContent; | |
233 } | |
234 if(action == ACTION_BUTTON_ENTER_FINAL) | |
235 { | |
236 evaluateNewString(editId, &newDay, &newMonth, &newYear, 0); | |
237 if(newDay == 0) | |
238 newDay = 1; | |
239 if(newDay > 31) | |
240 newDay = 31; | |
241 if(newMonth == 0) | |
242 newMonth = 1; | |
243 if(newMonth > 12) | |
244 newMonth = 12; | |
245 if((newMonth == 2) && (newDay > 29)) | |
246 newDay = 29; | |
247 if((newDay > 30) && ((newMonth == 4) ||(newMonth == 6) ||(newMonth == 9) ||(newMonth == 11))) | |
248 newDay = 30; | |
249 if(newYear < 17) | |
250 newYear = 17; | |
251 if(newYear > 99) | |
252 newYear = 99; | |
253 | |
254 sdatestructure.Date = newDay; | |
255 sdatestructure.Month = newMonth; | |
256 sdatestructure.Year = newYear; | |
257 setWeekday(&sdatestructure); | |
258 | |
259 setDate(sdatestructure); | |
260 | |
261 tMenuEdit_newInput(editId, newDay, newMonth, newYear, 0); | |
262 return UNSPECIFIC_RETURN; | |
263 } | |
264 if(action == ACTION_BUTTON_NEXT) | |
265 { | |
266 digitContentNew = digitContent + 1; | |
267 if((blockNumber == 0) && (digitContentNew > '0' + 31)) | |
268 digitContentNew = '1'; | |
269 if((blockNumber == 1) && (digitContentNew > '0' + 12)) | |
270 digitContentNew = '1'; | |
271 // year range 2017-2018 | |
55
a7683f9765da
Italian activated (needs some fine tuning), special characters (?,?,?,?,? and others) currently not working...
heinrichsweikamp
parents:
38
diff
changeset
|
272 if((blockNumber == 2) && (digitContentNew > '0' + 22)) |
a7683f9765da
Italian activated (needs some fine tuning), special characters (?,?,?,?,? and others) currently not working...
heinrichsweikamp
parents:
38
diff
changeset
|
273 digitContentNew = '0' + 18; |
38 | 274 return digitContentNew; |
275 } | |
276 if(action == ACTION_BUTTON_BACK) | |
277 { | |
278 digitContentNew = digitContent - 1; | |
279 if((blockNumber == 0) && (digitContentNew < '1')) | |
280 digitContentNew = '0' + 31; | |
281 if((blockNumber == 1) && (digitContentNew < '1')) | |
282 digitContentNew = '0' + 12; | |
283 // year range 2016-2018 | |
284 if((blockNumber == 2) && (digitContentNew < '0' + 17)) | |
285 digitContentNew = '0' + 18; | |
286 return digitContentNew; | |
287 } | |
288 /* | |
289 if(action == ACTION_BUTTON_NEXT) | |
290 { | |
291 digitContentNew = digitContent + 1; | |
292 if((blockNumber == 2) && (digitNumber == 0) && (digitContentNew > '2')) | |
293 digitContentNew = '1'; | |
294 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew > '3')) | |
295 digitContentNew = '0'; | |
296 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew > '1')) | |
297 digitContentNew = '0'; | |
298 if(digitContentNew > '9') | |
299 digitContentNew = '0'; | |
300 return digitContentNew; | |
301 } | |
302 if(action == ACTION_BUTTON_BACK) | |
303 { | |
304 digitContentNew = digitContent - 1; | |
305 if((blockNumber == 2) && (digitNumber == 0) && (digitContentNew < '1')) | |
306 digitContentNew = '2'; | |
307 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew < '0')) | |
308 digitContentNew = '3'; | |
309 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew < '0')) | |
310 digitContentNew = '1'; | |
311 if(digitContentNew < '0') | |
312 digitContentNew = '9'; | |
313 return digitContentNew; | |
314 } | |
315 */ | |
316 return UNSPECIFIC_RETURN; | |
317 } | |
318 | |
319 | |
320 uint8_t OnAction_Time(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
321 { | |
322 uint8_t digitContentNew; | |
323 uint32_t newHour, newMinute; | |
324 RTC_TimeTypeDef stimestructure; | |
325 | |
326 if(action == ACTION_BUTTON_ENTER) | |
327 { | |
328 return digitContent; | |
329 } | |
330 if(action == ACTION_BUTTON_ENTER_FINAL) | |
331 { | |
332 evaluateNewString(editId, &newHour, &newMinute, 0, 0); | |
333 if(newHour > 23) | |
334 newHour = 23; | |
335 if(newMinute > 59) | |
336 newMinute = 59; | |
337 | |
338 stimestructure.Hours = newHour; | |
339 stimestructure.Minutes = newMinute; | |
340 stimestructure.Seconds = 0; | |
341 | |
342 setTime(stimestructure); | |
343 | |
344 tMenuEdit_newInput(editId, newHour, newMinute, 0, 0); | |
345 return UNSPECIFIC_RETURN; | |
346 } | |
347 if(action == ACTION_BUTTON_NEXT) | |
348 { | |
349 digitContentNew = digitContent + 1; | |
350 if((blockNumber == 0) && (digitContentNew > '0' + 23)) | |
351 digitContentNew = '0'; | |
352 if((blockNumber == 1) && (digitContentNew > '0' + 59)) | |
353 digitContentNew = '0'; | |
354 return digitContentNew; | |
355 } | |
356 if(action == ACTION_BUTTON_BACK) | |
357 { | |
358 digitContentNew = digitContent - 1; | |
359 if((blockNumber == 0) && (digitContentNew < '0')) | |
360 digitContentNew = '0' + 23; | |
361 if((blockNumber == 1) && (digitContentNew < '0')) | |
362 digitContentNew = '0' + 59; | |
363 return digitContentNew; | |
364 } | |
365 /* | |
366 if(action == ACTION_BUTTON_NEXT) | |
367 { | |
368 digitContentNew = digitContent + 1; | |
369 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew > '2')) | |
370 digitContentNew = '0'; | |
371 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew > '5')) | |
372 digitContentNew = '0'; | |
373 if(digitContentNew > '9') | |
374 digitContentNew = '0'; | |
375 return digitContentNew; | |
376 } | |
377 if(action == ACTION_BUTTON_BACK) | |
378 { | |
379 digitContentNew = digitContent - 1; | |
380 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew < '0')) | |
381 digitContentNew = '2'; | |
382 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew < '0')) | |
383 digitContentNew = '5'; | |
384 if(digitContentNew < '0') | |
385 digitContentNew = '9'; | |
386 return digitContentNew; | |
387 } | |
388 */ | |
389 return UNSPECIFIC_RETURN; | |
390 } | |
391 | |
567 | 392 uint8_t OnAction_12HR(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
393 { | |
394 SSettings *pSettings; | |
395 | |
396 pSettings = settingsGetPointer(); | |
397 pSettings->amPMTime = !(pSettings->amPMTime); | |
398 | |
399 tMenuEdit_set_on_off(editId, pSettings->amPMTime); | |
400 | |
401 return UNSPECIFIC_RETURN; | |
402 } | |
38 | 403 |
404 uint8_t OnAction_DDMMYY(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
405 { | |
406 SSettings *pSettings; | |
407 | |
408 pSettings = settingsGetPointer(); | |
409 pSettings->date_format = DDMMYY; | |
410 | |
411 tMenuEdit_set_on_off(editId, 1); | |
412 tMenuEdit_set_on_off(StMSYS1_MMDDYY, 0); | |
413 tMenuEdit_set_on_off(StMSYS1_YYMMDD, 0); | |
414 | |
415 return UNSPECIFIC_RETURN; | |
416 } | |
417 | |
418 | |
419 uint8_t OnAction_MMDDYY(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
420 { | |
421 SSettings *pSettings; | |
422 | |
423 pSettings = settingsGetPointer(); | |
424 pSettings->date_format = MMDDYY; | |
425 | |
426 tMenuEdit_set_on_off(editId, 1); | |
427 tMenuEdit_set_on_off(StMSYS1_DDMMYY, 0); | |
428 tMenuEdit_set_on_off(StMSYS1_YYMMDD, 0); | |
429 | |
430 return UNSPECIFIC_RETURN; | |
431 } | |
432 | |
433 | |
434 uint8_t OnAction_YYMMDD(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
435 { | |
436 SSettings *pSettings; | |
437 | |
438 pSettings = settingsGetPointer(); | |
439 pSettings->date_format = YYMMDD; | |
440 | |
441 tMenuEdit_set_on_off(editId, 1); | |
442 tMenuEdit_set_on_off(StMSYS1_MMDDYY, 0); | |
443 tMenuEdit_set_on_off(StMSYS1_DDMMYY, 0); | |
444 | |
445 return UNSPECIFIC_RETURN; | |
446 } | |
447 | |
448 | |
449 uint8_t OnAction_DST(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
450 { | |
451 RTC_TimeTypeDef stimestructure; | |
452 uint8_t newDST; | |
453 | |
454 get_RTC_DateTime(0, &stimestructure); | |
455 newDST = stimestructure.DayLightSaving; | |
456 if(newDST) | |
457 newDST = 0; | |
458 else | |
459 newDST = 1; | |
460 stimestructure.DayLightSaving = newDST; | |
461 set_RTC_DateTime(0, &stimestructure); | |
462 | |
463 tMenuEdit_set_on_off(editId, newDST); | |
464 | |
465 return UNSPECIFIC_RETURN; | |
466 } | |
467 | |
468 | |
469 void openEdit_Language(void) | |
470 { | |
471 char text[32]; | |
472 uint8_t actualLanguage, active; | |
473 SSettings *pSettings; | |
474 | |
475 pSettings = settingsGetPointer(); | |
476 actualLanguage = pSettings->selected_language; | |
477 | |
478 text[0] = '\001'; | |
479 text[1] = TXT_Language; | |
480 text[2] = 0; | |
481 write_topline(text); | |
482 | |
483 text[0] = TXT_LanguageName; | |
484 text[1] = 0; | |
485 | |
486 pSettings->selected_language = LANGUAGE_English; | |
487 if( actualLanguage == pSettings->selected_language) | |
488 active = 1; | |
489 else | |
490 active = 0; | |
491 write_field_on_off(StMSYS2_English, 30, 500, ME_Y_LINE1, &FontT48, text, active); | |
492 | |
493 pSettings->selected_language = LANGUAGE_German; | |
494 if( actualLanguage == pSettings->selected_language) | |
495 active = 1; | |
496 else | |
497 active = 0; | |
498 write_field_on_off(StMSYS2_German, 30, 800, ME_Y_LINE2, &FontT48, text, active); | |
499 | |
500 pSettings->selected_language = LANGUAGE_French; | |
501 if( actualLanguage == pSettings->selected_language) | |
502 active = 1; | |
503 else | |
504 active = 0; | |
505 write_field_on_off(StMSYS2_French, 30, 800, ME_Y_LINE3, &FontT48, text, active); | |
55
a7683f9765da
Italian activated (needs some fine tuning), special characters (?,?,?,?,? and others) currently not working...
heinrichsweikamp
parents:
38
diff
changeset
|
506 |
38 | 507 |
508 pSettings->selected_language = LANGUAGE_Italian; | |
509 if( actualLanguage == pSettings->selected_language) | |
510 active = 1; | |
511 else | |
512 active = 0; | |
513 write_field_on_off(StMSYS2_Italian, 30, 800, ME_Y_LINE4, &FontT48, text, active); | |
514 | |
102
4276d56eb37c
hPa instead of mbar, enabled Spanish language
heinrichsweikamp
parents:
64
diff
changeset
|
515 |
38 | 516 pSettings->selected_language = LANGUAGE_Espanol; |
517 if( actualLanguage == pSettings->selected_language) | |
518 active = 1; | |
519 else | |
520 active = 0; | |
521 write_field_on_off(StMSYS2_Espanol, 30, 800, ME_Y_LINE5, &FontT48, text, active); | |
102
4276d56eb37c
hPa instead of mbar, enabled Spanish language
heinrichsweikamp
parents:
64
diff
changeset
|
522 |
38 | 523 pSettings->selected_language = actualLanguage; |
524 | |
525 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
526 | |
527 setEvent(StMSYS2_English, (uint32_t)OnAction_English); | |
528 setEvent(StMSYS2_German, (uint32_t)OnAction_German); | |
529 setEvent(StMSYS2_French, (uint32_t)OnAction_French); | |
55
a7683f9765da
Italian activated (needs some fine tuning), special characters (?,?,?,?,? and others) currently not working...
heinrichsweikamp
parents:
38
diff
changeset
|
530 setEvent(StMSYS2_Italian, (uint32_t)OnAction_Italian); |
102
4276d56eb37c
hPa instead of mbar, enabled Spanish language
heinrichsweikamp
parents:
64
diff
changeset
|
531 setEvent(StMSYS2_Espanol, (uint32_t)OnAction_Espanol); |
38 | 532 } |
533 | |
534 | |
535 uint8_t OnAction_English (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
536 { | |
537 SSettings *pSettings = settingsGetPointer(); | |
538 pSettings->selected_language = LANGUAGE_English; | |
539 return EXIT_TO_MENU_WITH_LOGO; | |
540 } | |
541 | |
542 | |
543 uint8_t OnAction_German (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
544 { | |
545 SSettings *pSettings = settingsGetPointer(); | |
546 pSettings->selected_language = LANGUAGE_German; | |
547 return EXIT_TO_MENU_WITH_LOGO; | |
548 } | |
549 | |
550 | |
551 uint8_t OnAction_French (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
552 { | |
553 SSettings *pSettings = settingsGetPointer(); | |
554 pSettings->selected_language = LANGUAGE_French; | |
555 return EXIT_TO_MENU_WITH_LOGO; | |
556 } | |
557 | |
558 | |
559 uint8_t OnAction_Italian (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
560 { | |
561 SSettings *pSettings = settingsGetPointer(); | |
562 pSettings->selected_language = LANGUAGE_Italian; | |
563 return EXIT_TO_MENU_WITH_LOGO; | |
564 } | |
565 | |
566 | |
567 uint8_t OnAction_Espanol (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
568 { | |
569 SSettings *pSettings = settingsGetPointer(); | |
570 pSettings->selected_language = LANGUAGE_Espanol; | |
571 return EXIT_TO_MENU_WITH_LOGO; | |
572 } | |
573 | |
574 | |
575 void openEdit_Design(void) | |
576 { | |
577 refresh_Design(); | |
578 | |
579 write_field_button(StMSYS3_Units, 400, 700, ME_Y_LINE1, &FontT48, ""); | |
580 write_field_button(StMSYS3_Colors, 400, 700, ME_Y_LINE2, &FontT48, ""); | |
343
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
581 #ifdef HAVE_DEBUG_VIEW |
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
582 write_field_button(StMSYS3_Debug, 400, 700, ME_Y_LINE3, &FontT48, ""); |
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
583 #endif |
38 | 584 setEvent(StMSYS3_Units, (uint32_t)OnAction_Units); |
585 setEvent(StMSYS3_Colors, (uint32_t)OnAction_Colorscheme); | |
343
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
586 #ifdef HAVE_DEBUG_VIEW |
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
587 setEvent(StMSYS3_Debug, (uint32_t)OnAction_DebugInfo); |
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
588 #endif |
38 | 589 } |
590 | |
591 | |
592 void refresh_Design(void) | |
593 { | |
594 char text[32]; | |
595 | |
596 // header | |
597 text[0] = '\001'; | |
598 text[1] = TXT_2BYTE; | |
599 text[2] = TXT2BYTE_Layout; | |
600 text[3] = 0; | |
601 write_topline(text); | |
602 | |
603 // units | |
604 text[0] = TXT_2BYTE; | |
605 text[1] = TXT2BYTE_Units; | |
606 text[2] = 0; | |
607 write_label_var( 30, 200, ME_Y_LINE1, &FontT48, text); | |
608 | |
609 if(settingsGetPointer()->nonMetricalSystem) | |
610 { | |
611 text[1] = TXT2BYTE_Units_feet; | |
612 } | |
613 else | |
614 { | |
615 text[1] = TXT2BYTE_Units_metric; | |
616 } | |
617 write_label_var( 400, 700, ME_Y_LINE1, &FontT48, text); | |
618 | |
619 // colorscheme | |
620 text[0] = TXT_2BYTE; | |
621 text[1] = TXT2BYTE_Farbschema; | |
622 text[2] = 0; | |
118
ee7f2cd9b9b4
Enlarge text limits to get string displayed completly
Ideenmodellierer
parents:
103
diff
changeset
|
623 write_label_var( 30, 300, ME_Y_LINE2, &FontT48, text); |
38 | 624 |
625 text[0] = '0' + settingsGetPointer()->tX_colorscheme; | |
626 text[1] = 0; | |
627 write_label_var( 400, 700, ME_Y_LINE2, &FontT48, text); | |
628 | |
343
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
629 #ifdef HAVE_DEBUG_VIEW |
38 | 630 // specials |
631 text[0] = TXT_2BYTE; | |
632 text[1] = TXT2BYTE_ShowDebug; | |
633 text[2] = 0; | |
634 write_label_var( 30, 700, ME_Y_LINE3, &FontT48, text); | |
635 | |
636 if(settingsGetPointer()->showDebugInfo) | |
637 text[0] = '\005'; | |
638 else | |
639 text[0] = '\006'; | |
640 text[1] = 0; | |
641 write_label_var( 400, 700, ME_Y_LINE3, &FontT48, text); | |
343
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
642 #endif |
38 | 643 |
644 // design | |
645 text[0] = TXT_Depth; | |
646 text[1] = 0; | |
647 write_content( 30, 700, ME_Y_LINE4, &FontT24, text, CLUT_Font031); | |
648 write_content( 30, 700, ME_Y_LINE4 + 30 + 70, &FontT48, "___________", CLUT_DIVE_FieldSeperatorLines); | |
649 write_content(280, 700, ME_Y_LINE4 + 30 + 70 - 3, &FontT48, "|", CLUT_DIVE_pluginbox); | |
650 write_content(290, 700, ME_Y_LINE4 + 30 + 70 - 37, &FontT48, "_______________", CLUT_DIVE_pluginbox); | |
651 write_content( 30, 700, ME_Y_LINE4 + 30, &FontT144, "24.7", CLUT_Font027); | |
652 | |
653 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
654 } | |
655 | |
656 | |
657 uint8_t OnAction_Units(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
658 { | |
659 settingsGetPointer()->nonMetricalSystem = !(settingsGetPointer()->nonMetricalSystem); | |
660 return EXIT_TO_MENU_WITH_LOGO;//UPDATE_DIVESETTINGS; | |
661 } | |
662 | |
663 | |
664 uint8_t OnAction_Colorscheme(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
665 { | |
666 uint8_t newColorscheme; | |
667 | |
668 newColorscheme = settingsGetPointer()->tX_colorscheme + 1; | |
669 | |
670 if(newColorscheme > 3) | |
671 newColorscheme = 0; | |
672 | |
673 settingsGetPointer()->tX_colorscheme = newColorscheme; | |
674 GFX_use_colorscheme(newColorscheme); | |
675 tHome_init_compass(); | |
676 return UNSPECIFIC_RETURN; | |
677 } | |
678 | |
679 | |
680 uint8_t OnAction_DebugInfo(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
681 { | |
682 settingsGetPointer()->showDebugInfo = !(settingsGetPointer()->showDebugInfo); | |
683 return UPDATE_DIVESETTINGS; | |
684 } | |
685 | |
686 | |
687 | |
688 | |
689 /* | |
690 uint8_t OnAction_Design_t7ft (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
691 { | |
692 SSettings *pSettings = settingsGetPointer(); | |
693 if((pSettings->design == 7) && pSettings->nonMetricalSystem) | |
694 return EXIT_TO_MENU; | |
695 pSettings->design = 7; | |
696 pSettings->nonMetricalSystem = 1; | |
697 tMenuEdit_set_on_off(StMSYS3_t7, 0); | |
698 tMenuEdit_set_on_off(StMSYS3_t7ft, 1); | |
699 tMenuEdit_set_on_off(StMSYS3_t3, 0); | |
700 return UPDATE_DIVESETTINGS; | |
701 } | |
702 | |
703 | |
704 uint8_t OnAction_Design_t7 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
705 { | |
706 SSettings *pSettings = settingsGetPointer(); | |
707 if((pSettings->design == 7) && (pSettings->nonMetricalSystem == 0)) | |
708 return EXIT_TO_MENU; | |
709 pSettings->design = 7; | |
710 pSettings->nonMetricalSystem = 0; | |
711 tMenuEdit_set_on_off(StMSYS3_t7, 1); | |
712 tMenuEdit_set_on_off(StMSYS3_t7ft, 0); | |
713 tMenuEdit_set_on_off(StMSYS3_t3, 0); | |
714 return UPDATE_DIVESETTINGS; | |
715 } | |
716 | |
717 | |
718 uint8_t OnAction_Design_t3 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
719 { | |
720 SSettings *pSettings = settingsGetPointer(); | |
721 if(pSettings->design == 3) | |
722 return EXIT_TO_MENU; | |
723 pSettings->design = 3; | |
724 pSettings->nonMetricalSystem = 0; | |
725 tMenuEdit_set_on_off(StMSYS3_t7, 0); | |
726 tMenuEdit_set_on_off(StMSYS3_t7ft,0); | |
727 tMenuEdit_set_on_off(StMSYS3_t3, 1); | |
728 return UPDATE_DIVESETTINGS; | |
729 } | |
730 */ | |
731 | |
732 | |
368
50ea68c7a153
Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
ideenmodellierer
parents:
259
diff
changeset
|
733 |
38 | 734 void openEdit_Information(void) |
735 { | |
736 char text[70]; | |
737 | |
738 infoPage = 0; | |
739 | |
740 text[0] = '\001'; | |
741 text[1] = TXT_Information; | |
742 text[2] = 0; | |
743 write_topline(text); | |
744 | |
745 text[0] = TXT_2BYTE; | |
746 text[1] = TXT2BYTE_ButtonNext; | |
747 text[2] = 0; | |
748 | |
520 | 749 write_field_button(StMSYS4_Info, 30, 800, ME_Y_LINE6, &FontT48, text); |
38 | 750 |
520 | 751 setEvent(StMSYS4_Info, (uint32_t)OnAction_Information); |
38 | 752 } |
753 | |
754 | |
755 uint8_t OnAction_Information (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
756 { | |
757 resetEnterPressedToStateBeforeButtonAction(); | |
758 | |
759 infoPage++; | |
760 if(infoPage > 3) | |
761 return EXIT_TO_MENU; | |
762 else | |
763 return UNSPECIFIC_RETURN; | |
764 } | |
765 | |
766 | |
767 void refresh_InformationPage(void) | |
768 { | |
769 char text_header[5]; | |
770 char text_button[5]; | |
771 char text_content[256]; | |
772 uint8_t date[3], year,month,day; | |
773 | |
774 RTC_DateTypeDef Sdate, Sdate2; | |
775 float temperature1, temperature2, voltage, offsetTemperature; | |
776 | |
777 //RTC_TimeTypeDef Stime; | |
778 | |
779 /* | |
780 SDeviceLine batteryChargeCycles; | |
781 SDeviceLine batteryChargeCompleteCycles; | |
782 SDeviceLine temperatureMinimum; | |
783 SDeviceLine temperatureMaximum; | |
784 SDeviceLine depthMaximum; | |
785 SDeviceLine diveCycles; | |
786 SDeviceLine voltageMinimum; | |
787 */ | |
788 | |
789 switch(infoPage) | |
790 { | |
791 case 0: | |
792 text_header[0] = '\001'; | |
793 text_header[1] = TXT_Information; | |
794 text_header[2] = 0; | |
795 | |
796 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, "Dive Computer OSTC4"); | |
797 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, "Design heinrichs/weikamp"); | |
798 | |
799 Sdate.Year = firmwareDataGetPointer()->release_year; | |
800 Sdate.Month = firmwareDataGetPointer()->release_month; | |
801 Sdate.Date = firmwareDataGetPointer()->release_day; | |
802 | |
803 if(settingsGetPointer()->date_format == DDMMYY) | |
804 { | |
805 day = 0; | |
806 month = 1; | |
807 year = 2; | |
808 } | |
809 else | |
810 if(settingsGetPointer()->date_format == MMDDYY) | |
811 { | |
812 day = 1; | |
813 month = 0; | |
814 year = 2; | |
815 } | |
816 else | |
817 { | |
818 day = 2; | |
819 month = 1; | |
820 year = 0; | |
821 } | |
822 date[day] = Sdate.Date; | |
823 date[month] = Sdate.Month; | |
824 date[year] = Sdate.Year; | |
825 snprintf(text_content,40,"Firmware release date: %02d.%02d.%02d",date[0],date[1],date[2]); | |
826 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content); | |
827 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, "for more information"); | |
64 | 828 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, "info@heinrichsweikamp.com"); |
38 | 829 |
830 text_button[0] = TXT_2BYTE; | |
831 text_button[1] = TXT2BYTE_ButtonNext; | |
832 text_button[2] = 0; | |
833 break; | |
834 | |
835 case 1: | |
836 text_header[0] = '\001'; | |
837 text_header[1] = TXT_2BYTE; | |
838 text_header[2] = TXT2BYTE_Usage_Battery; | |
839 text_header[3] = 0; | |
840 | |
841 text_content[0] = TXT_2BYTE; | |
842 text_content[1] = TXT2BYTE_ChargeCycles; | |
843 text_content[2] = 0; | |
844 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content); | |
57 | 845 snprintf(text_content,80,"%ld (%ld)",stateDeviceGetPointer()->batteryChargeCycles.value_int32,stateDeviceGetPointer()->batteryChargeCompleteCycles.value_int32); |
38 | 846 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content); |
847 | |
848 translateDate(stateDeviceGetPointer()->batteryChargeCycles.date_rtc_dr, &Sdate); | |
849 translateDate(stateDeviceGetPointer()->batteryChargeCompleteCycles.date_rtc_dr, &Sdate2); | |
850 snprintf(text_content,80,"%u.%u.20%02u (%u.%u.20%02u)",Sdate.Date,Sdate.Month,Sdate.Year, Sdate2.Date,Sdate2.Month,Sdate2.Year); | |
851 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content); | |
852 | |
853 text_content[0] = TXT_2BYTE; | |
854 text_content[1] = TXT2BYTE_LowestVoltage; | |
855 text_content[2] = 0; | |
856 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content); | |
857 | |
404
e729b8e7654d
Bugfix: display of time of minimum voltag:
ideenmodellierer
parents:
389
diff
changeset
|
858 translateDate(stateDeviceGetPointer()->voltageMinimum.date_rtc_dr, &Sdate); |
38 | 859 voltage = ((float)stateDeviceGetPointer()->voltageMinimum.value_int32) / 1000; |
860 snprintf(text_content,80,"%0.3fV (%u.%u.20%02u)",voltage, Sdate.Date,Sdate.Month,Sdate.Year); | |
861 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content); | |
862 | |
863 text_button[0] = TXT_2BYTE; | |
864 text_button[1] = TXT2BYTE_ButtonNext; | |
865 text_button[2] = 0; | |
866 break; | |
867 | |
868 case 2: | |
869 text_header[0] = '\001'; | |
870 text_header[1] = TXT_2BYTE; | |
871 text_header[2] = TXT2BYTE_Usage_Dives; | |
872 text_header[3] = 0; | |
873 | |
874 text_content[0] = TXT_2BYTE; | |
875 text_content[1] = TXT2BYTE_NumberOfDives; | |
876 text_content[2] = 0; | |
877 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content); | |
878 | |
57 | 879 snprintf(text_content,80,"%ld (%ld)",stateDeviceGetPointer()->diveCycles.value_int32,(stateDeviceGetPointer()->depthMaximum.value_int32 - 1000) / 100); |
38 | 880 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content); |
881 | |
882 translateDate(stateDeviceGetPointer()->diveCycles.date_rtc_dr, &Sdate); | |
883 translateDate(stateDeviceGetPointer()->depthMaximum.date_rtc_dr, &Sdate2); | |
884 snprintf(text_content,80,"%u.%u.20%02u (%u.%u.20%02u)",Sdate.Date,Sdate.Month,Sdate.Year, Sdate2.Date,Sdate2.Month,Sdate2.Year); | |
885 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content); | |
886 | |
887 text_content[0] = TXT_2BYTE; | |
888 text_content[1] = TXT2BYTE_HoursOfOperation; | |
889 text_content[2] = 0; | |
890 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content); | |
891 | |
57 | 892 snprintf(text_content,80,"%ld",(stateDeviceGetPointer()->hoursOfOperation.value_int32)/3600); |
38 | 893 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content); |
894 | |
895 text_button[0] = TXT_2BYTE; | |
896 text_button[1] = TXT2BYTE_ButtonNext; | |
897 text_button[2] = 0; | |
898 break; | |
899 | |
900 case 3: | |
901 text_header[0] = '\001'; | |
902 text_header[1] = TXT_2BYTE; | |
903 text_header[2] = TXT2BYTE_Usage_Environment; | |
904 text_header[3] = 0; | |
905 | |
906 text_content[0] = TXT_2BYTE; | |
907 text_content[1] = TXT2BYTE_AmbientTemperature; | |
908 text_content[2] = 0; | |
909 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content); | |
910 | |
911 temperature1 = ((float)stateDeviceGetPointer()->temperatureMinimum.value_int32) / 100; | |
912 temperature2 = ((float)stateDeviceGetPointer()->temperatureMaximum.value_int32) / 100; | |
913 snprintf(text_content,80,"%0.2f\140C / %0.2f\140C",temperature1,temperature2); | |
914 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content); | |
915 | |
916 translateDate(stateDeviceGetPointer()->temperatureMinimum.date_rtc_dr, &Sdate); | |
917 translateDate(stateDeviceGetPointer()->temperatureMaximum.date_rtc_dr, &Sdate2); | |
918 snprintf(text_content,80,"(%u.%u.20%02u / %u.%u.20%02u)",Sdate.Date,Sdate.Month,Sdate.Year, Sdate2.Date,Sdate2.Month,Sdate2.Year); | |
919 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content); | |
920 | |
921 text_content[0] = TXT_2BYTE; | |
922 text_content[1] = TXT2BYTE_Korrekturwerte; | |
923 text_content[2] = 0; | |
924 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content); | |
925 | |
926 offsetTemperature = ((float)settingsGetPointer()->offsetTemperature_centigrad) / 10; | |
103
f5d2f02dc73f
Generalize TEXT of pressure unit
Dmitry Romanov <kitt@bk.ru>
parents:
102
diff
changeset
|
927 snprintf(text_content,80,"%i %s / %0.2f\140C",settingsGetPointer()->offsetPressure_mbar, TEXT_PRESSURE_UNIT, offsetTemperature); |
38 | 928 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content); |
929 | |
930 text_button[0] = TXT_2BYTE; | |
931 text_button[1] = TXT2BYTE_Exit; | |
932 text_button[2] = 0; | |
933 break; | |
934 } | |
935 | |
936 write_topline(text_header); | |
520 | 937 tMenuEdit_newButtonText(StMSYS4_Info, text_button); |
38 | 938 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonNext,0); |
939 } | |
940 | |
941 | |
942 void openEdit_Reset(void) | |
943 { | |
944 char text[32]; | |
945 | |
946 text[0] = '\001'; | |
947 text[1] = TXT_2BYTE; | |
948 text[2] = TXT2BYTE_ResetMenu; | |
949 text[3] = 0; | |
950 write_topline(text); | |
951 | |
952 text[0] = TXT_2BYTE; | |
953 text[1] = TXT2BYTE_LogbookOffset; | |
954 text[7] = 0; | |
955 | |
956 write_label_var( 30, 400, ME_Y_LINE1, &FontT48, text); | |
957 | |
520 | 958 write_field_udigit(StMSYS5_LogbookOffset,420, 800, ME_Y_LINE1, &FontT48, "####", settingsGetPointer()->logbookOffset,0,0,0); |
38 | 959 |
960 text[0] = TXT_2BYTE; | |
961 text[2] = 0; | |
962 | |
963 text[1] = TXT2BYTE_ResetAll; | |
520 | 964 write_field_button(StMSYS5_ResetAll, 30, 800, ME_Y_LINE2, &FontT48, text); |
38 | 965 |
966 text[1] = TXT2BYTE_ResetDeco; | |
520 | 967 write_field_button(StMSYS5_ResetDeco, 30, 800, ME_Y_LINE3, &FontT48, text); |
38 | 968 |
969 text[1] = TXT2BYTE_Reboot; | |
520 | 970 write_field_button(StMSYS5_Reboot, 30, 800, ME_Y_LINE4, &FontT48, text); |
38 | 971 |
972 text[1] = TXT2BYTE_Maintenance; | |
520 | 973 write_field_button(StMSYS5_Maintenance, 30, 800, ME_Y_LINE5, &FontT48, text); |
38 | 974 |
975 #ifndef RESETLOGBLOCK | |
976 text[1] = TXT2BYTE_ResetLogbook; | |
520 | 977 write_field_button(StMSYS5_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text); |
38 | 978 #else |
528
a9c195be907e
Added new option to gas configuration: "Off":
Ideenmodellierer
parents:
520
diff
changeset
|
979 text[0] = '\031'; |
38 | 980 text[1] = TXT_2BYTE; |
981 text[2] = TXT2BYTE_ResetLogbook; | |
982 text[3] = 0; | |
520 | 983 write_field_button(StMSYS5_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text); |
38 | 984 text[0] = TXT_2BYTE; |
985 text[2] = 0; | |
986 #endif | |
987 | |
520 | 988 setEvent(StMSYS5_LogbookOffset, (uint32_t)OnAction_LogbookOffset); |
989 setEvent(StMSYS5_ResetAll, (uint32_t)OnAction_Confirm); | |
990 setEvent(StMSYS5_ResetDeco, (uint32_t)OnAction_Confirm); | |
991 setEvent(StMSYS5_Reboot, (uint32_t)OnAction_Confirm); | |
992 setEvent(StMSYS5_Maintenance, (uint32_t)OnAction_Confirm); | |
38 | 993 #ifndef RESETLOGBLOCK |
520 | 994 setEvent(StMSYS5_ResetLogbook, (uint32_t)OnAction_Confirm); |
38 | 995 #else |
520 | 996 setEvent(StMSYS5_ResetLogbook, (uint32_t)OnAction_Nothing); |
38 | 997 #endif |
998 | |
999 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
1000 } | |
1001 | |
1002 | |
1003 void openEdit_ResetConfirmation(uint32_t editIdOfCaller) | |
1004 { | |
1005 char text[32]; | |
1006 | |
1007 resetMenuEdit(CLUT_MenuPageSystem); | |
1008 | |
1009 text[0] = '\001'; | |
1010 text[1] = TXT_2BYTE; | |
1011 text[2] = TXT2BYTE_AreYouSure; | |
1012 text[3] = 0; | |
1013 write_topline(text); | |
1014 | |
1015 text[0] = TXT_2BYTE; | |
1016 text[2] = 0; | |
1017 text[1] = TXT2BYTE_Abort; | |
1018 | |
520 | 1019 write_field_button(StMSYS5_Exit, 30, 800, ME_Y_LINE1, &FontT48, text); |
38 | 1020 |
1021 text[2] = 0; | |
1022 text[3] = 0; | |
1023 switch(editIdOfCaller) | |
1024 { | |
520 | 1025 case StMSYS5_Reboot: |
1026 case StMSYS5_RebootRTE: | |
1027 case StMSYS5_RebootMainCPU: | |
38 | 1028 text[1] = TXT2BYTE_RebootMainCPU; |
520 | 1029 write_field_button(StMSYS5_RebootMainCPU, 30, 800, ME_Y_LINE2, &FontT48, text); |
38 | 1030 text[1] = TXT2BYTE_RebootRTE; |
520 | 1031 write_field_button(StMSYS5_RebootRTE, 30, 800, ME_Y_LINE3, &FontT48, text); |
1032 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); | |
1033 setEvent(StMSYS5_RebootMainCPU, (uint32_t)OnAction_RebootMainCPU); | |
1034 setEvent(StMSYS5_RebootRTE, (uint32_t)OnAction_RebootRTE); | |
38 | 1035 text[0] = '\025'; |
1036 text[1] = TXT_2BYTE; | |
1037 text[2] = TXT2BYTE_DecoDataLost; | |
1038 text[3] = 0; | |
1039 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text); | |
1040 break; | |
1041 | |
520 | 1042 case StMSYS5_ResetDeco: |
38 | 1043 text[1] = TXT2BYTE_ResetDeco; |
1044 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); | |
520 | 1045 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); |
38 | 1046 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetDeco); |
1047 text[0] = '\025'; | |
1048 text[1] = TXT_2BYTE; | |
1049 text[2] = TXT2BYTE_DecoDataLost; | |
1050 text[3] = 0; | |
1051 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text); | |
1052 break; | |
1053 | |
520 | 1054 case StMSYS5_ResetAll: |
38 | 1055 text[1] = TXT2BYTE_ResetAll; |
1056 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); | |
520 | 1057 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); |
38 | 1058 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetAll); |
1059 break; | |
1060 | |
520 | 1061 case StMSYS5_ResetLogbook: |
38 | 1062 text[1] = TXT2BYTE_ResetLogbook; |
1063 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); | |
520 | 1064 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); |
38 | 1065 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetLogbook); |
1066 break; | |
1067 | |
520 | 1068 case StMSYS5_Maintenance: |
1069 case StMSYS5_SetBattCharge: | |
1070 case StMSYS5_SetSampleIndx: | |
38 | 1071 text[0] = TXT_2BYTE; |
1072 text[1] = TXT2BYTE_SetFactoryDefaults; | |
1073 text[2] = 0; | |
520 | 1074 write_field_button(StMSYS5_SetFactoryBC, 30, 800, ME_Y_LINE2, &FontT48, text); |
38 | 1075 |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1076 #ifdef ENABLE_ANALYSE_SAMPLES |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1077 text[0] = TXT_2BYTE; |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1078 text[1] = TXT2BYTE_SetSampleIndex; |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1079 text[2] = 0; |
520 | 1080 write_field_button(StMSYS5_SetSampleIndx, 30, 800, ME_Y_LINE3, &FontT48, text); |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1081 #endif |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1082 |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1083 |
38 | 1084 if(stateRealGetPointer()->lifeData.battery_charge == 0) |
1085 { | |
1086 text[0] = TXT_2BYTE; | |
1087 text[1] = TXT2BYTE_SetBatteryCharge; | |
1088 text[2] = 0; | |
1089 snprintf(&text[2],10,": %u%%",settingsGetPointer()->lastKnownBatteryPercentage); | |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1090 #ifdef ENABLE_ANALYSE_SAMPLES |
520 | 1091 write_field_button(StMSYS5_SetBattCharge, 30, 800, ME_Y_LINE4, &FontT48, text); |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1092 #else |
520 | 1093 write_field_button(StMSYS5_SetBattCharge, 30, 800, ME_Y_LINE3, &FontT48, text); |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1094 #endif |
38 | 1095 |
520 | 1096 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); |
1097 setEvent(StMSYS5_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); | |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1098 #ifdef ENABLE_ANALYSE_SAMPLES |
520 | 1099 setEvent(StMSYS5_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1100 #endif |
520 | 1101 setEvent(StMSYS5_SetBattCharge, (uint32_t)OnAction_SetBatteryCharge); |
38 | 1102 } |
1103 else | |
1104 { | |
520 | 1105 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); |
1106 setEvent(StMSYS5_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); | |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1107 #ifdef ENABLE_ANALYSE_SAMPLES |
520 | 1108 setEvent(StMSYS5_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1109 #endif |
38 | 1110 } |
520 | 1111 // write_field_button(StMSYS5_ScreenTest, 30, 800, ME_Y_LINE3, &FontT48, "Screen Test"); |
1112 // setEvent(StMSYS5_ScreenTest, (uint32_t)OnAction_ScreenTest); | |
38 | 1113 |
1114 text[0] = TXT_2BYTE; | |
1115 text[1] = TXT2BYTE_WarnBatteryLow; | |
1116 text[2] = 0; | |
1117 snprintf(&text[2],10,": %01.2fV",stateRealGetPointer()->lifeData.battery_voltage); | |
435
8851702173e0
Bugfix display battery voltage in maintainance menu:
ideenmodellierer
parents:
424
diff
changeset
|
1118 write_label_var( 30, 800, ME_Y_LINE5, &FontT42, text); |
8851702173e0
Bugfix display battery voltage in maintainance menu:
ideenmodellierer
parents:
424
diff
changeset
|
1119 |
38 | 1120 snprintf(&text[0],30,"Code: %X",getLicence()); |
1121 write_label_var( 30, 800, ME_Y_LINE6, &FontT42, text); | |
1122 break; | |
1123 | |
1124 } | |
1125 | |
1126 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
1127 } | |
1128 | |
1129 uint8_t OnAction_LogbookOffset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1130 { | |
1131 uint8_t digitContentNew; | |
1132 uint32_t newOffset; | |
1133 | |
1134 if(action == ACTION_BUTTON_ENTER) | |
1135 return digitContent; | |
1136 | |
1137 if(action == ACTION_BUTTON_ENTER_FINAL) | |
1138 { | |
1139 evaluateNewString(editId, &newOffset, 0, 0, 0); | |
1140 if(newOffset > 9000) | |
1141 newOffset = 0; | |
1142 tMenuEdit_newInput(editId, newOffset, 0, 0, 0); | |
1143 settingsGetPointer()->logbookOffset = (uint16_t)newOffset; | |
1144 return UPDATE_DIVESETTINGS; | |
1145 } | |
1146 | |
1147 if(action == ACTION_BUTTON_NEXT) | |
1148 { | |
1149 digitContentNew = digitContent + 1; | |
1150 if(digitContentNew > '9') | |
1151 digitContentNew = '0'; | |
1152 return digitContentNew; | |
1153 } | |
1154 | |
1155 if(action == ACTION_BUTTON_BACK) | |
1156 { | |
1157 digitContentNew = digitContent - 1; | |
1158 if(digitContentNew < '0') | |
1159 digitContentNew = '9'; | |
1160 return digitContentNew; | |
1161 } | |
1162 return UNSPECIFIC_RETURN; | |
1163 } | |
1164 | |
1165 uint8_t OnAction_Nothing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1166 { | |
1167 return UNSPECIFIC_RETURN; | |
1168 } | |
1169 | |
1170 uint8_t OnAction_Exit (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1171 { | |
1172 return EXIT_TO_MENU; | |
1173 } | |
1174 uint8_t OnAction_Confirm (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1175 { | |
1176 openEdit_ResetConfirmation(editId); | |
1177 return UNSPECIFIC_RETURN; | |
1178 } | |
1179 | |
1180 uint8_t OnAction_RebootRTE (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1181 { | |
1182 MX_SmallCPU_Reset_To_Standard(); | |
1183 return EXIT_TO_MENU; | |
1184 } | |
1185 | |
1186 uint8_t OnAction_ResetDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1187 { | |
1188 clearDeco(); | |
1189 return EXIT_TO_MENU; | |
1190 } | |
1191 | |
1192 uint8_t OnAction_ResetAll (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1193 { | |
1194 set_settings_to_Standard(); | |
1195 check_and_correct_settings(); | |
1196 | |
1197 return UPDATE_AND_EXIT_TO_HOME; | |
1198 } | |
1199 | |
1200 uint8_t OnAction_ResetLogbook (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1201 { | |
1202 write_label_var( 430, 740, 350, &FontT42, "Wait"); | |
1203 ext_flash_erase_logbook(); | |
1204 | |
1205 SSettings * pSettings = settingsGetPointer(); | |
1206 pSettings->lastDiveLogId = 255; | |
1207 pSettings->logFlashNextSampleStartAddress = 0; | |
1208 | |
1209 return EXIT_TO_MENU; | |
1210 } | |
1211 | |
1212 uint8_t OnAction_RebootMainCPU (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1213 { | |
1214 settingsGetPointer()->showDebugInfo = 0; | |
1215 extern uint8_t bootToBootloader; | |
1216 bootToBootloader = 1; | |
1217 return UNSPECIFIC_RETURN; | |
1218 } | |
1219 | |
1220 | |
1221 uint8_t OnAction_SetFactoryDefaults(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1222 { | |
1223 settingsWriteFactoryDefaults(settingsGetPointer()->ButtonResponsiveness[3], settingsGetPointer()->buttonBalance); | |
1224 return EXIT_TO_MENU; | |
1225 } | |
1226 | |
468
aa1d71875e25
Moved and deactivated analyse sample buffer switch:
ideenmodellierer
parents:
446
diff
changeset
|
1227 #ifdef ENABLE_ANALYSE_SAMPLES |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1228 uint8_t OnAction_RecoverSampleIdx(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1229 { |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1230 char text[32]; |
558
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1231 uint8_t openSec; |
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1232 uint8_t retval = UNSPECIFIC_RETURN; |
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1233 openSec = ext_flash_AnalyseSampleBuffer(); |
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1234 snprintf(&text[0],30,"OpenSec: %d",openSec); |
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1235 write_label_var( 30, 800, ME_Y_LINE6, &FontT42, text); |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1236 |
558
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1237 if(openSec == 2) |
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1238 { |
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1239 retval = UPDATE_DIVESETTINGS; |
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1240 } |
66aef216828b
Changed operation mode of RecoverSampleIndex:
Ideenmodellierer
parents:
528
diff
changeset
|
1241 return retval; |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1242 } |
468
aa1d71875e25
Moved and deactivated analyse sample buffer switch:
ideenmodellierer
parents:
446
diff
changeset
|
1243 #endif |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1244 |
38 | 1245 uint8_t OnAction_SetBatteryCharge(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
1246 { | |
1247 setBatteryPercentage(settingsGetPointer()->lastKnownBatteryPercentage); | |
1248 // setBatteryPercentage(100); | |
1249 return EXIT_TO_MENU; | |
1250 } | |
1251 | |
1252 #ifdef SCREENTEST | |
1253 uint8_t OnAction_ScreenTest (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1254 { | |
1255 static uint8_t FrameCount = 1; // 0 is invisible frame | |
1256 char text[5]; | |
1257 GFX_DrawCfgScreen tTestScreen; | |
1258 tTestScreen.FBStartAdress = 0; | |
1259 tTestScreen.ImageHeight = 480; | |
1260 tTestScreen.ImageWidth = 800; | |
1261 tTestScreen.LayerIndex = 1; | |
1262 | |
520 | 1263 set_globalState(StMSYS5_ScreenTest); |
38 | 1264 tTestScreen.FBStartAdress = getFrameByNumber(FrameCount); |
1265 if(tTestScreen.FBStartAdress == 0) | |
1266 { | |
1267 extern uint8_t bootToBootloader; | |
1268 bootToBootloader = 1; | |
1269 } | |
1270 GFX_fill_buffer(tTestScreen.FBStartAdress, 0xFF, FrameCount); | |
1271 snprintf(text,5,"%u",FrameCount); | |
1272 Gfx_write_label_var(&tTestScreen, 10,100,10,&FontT48,CLUT_Font027,text); | |
1273 GFX_SetFramesTopBottom(tTestScreen.FBStartAdress, NULL,480); | |
1274 FrameCount++; | |
1275 } | |
1276 #endif | |
1277 /* | |
1278 uint8_t OnAction_TestCLog (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1279 { | |
1280 write_label_var( 430, 740, 350, &FontT42, "Wait"); | |
1281 | |
1282 test_log_only(20, 5); | |
1283 test_log_only(30, 10); | |
1284 ext_flash_write_settings(); | |
1285 return EXIT_TO_MENU; | |
1286 } | |
1287 */ | |
1288 |