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