Mercurial > public > ostc4
annotate Discovery/Src/tMenuEditSystem.c @ 425:86fcac4cc43a ImprovmentNVM_2
Added function to analyse the sampel ringbuffer:
The function will show 0 for used sectors, 4 for the sector currently in use and 5 for empty sectors. This allows identification of log sample index position and identification of a buffer corruption (more than 2 sectors have state 4)
The repair function writes dummy bytes to the end of the active buffer with the lower sector number. This decision is based on the fact that corruption results typically in a reset of index to buffer start address. After repair the writing will be continued using the hugher buffer marked as used.
author | ideenmodellierer |
---|---|
date | Sat, 15 Feb 2020 20:50:20 +0100 |
parents | 2b31cf1ebbcc |
children | 8851702173e0 |
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" |
389
ebc2b571a0b9
Fix case for case sensitive OS
Jan Mulder <jan@jlmulder.nl>
parents:
384
diff
changeset
|
41 #include "motion.h" |
343
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
42 #include "t7.h" |
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
43 |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
44 /* Uncomment to activate a menu item in reset menu which provide sample ring analysis / repair functionality */ |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
45 #define ENABLE_ANALYSE_SAMPLES |
379 | 46 |
47 #define CV_SUBPAGE_MAX (2u) /* max number of customer view selection pages */ | |
343
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
48 /*#define HAVE_DEBUG_VIEW */ |
379 | 49 static uint8_t infoPage = 0; |
38 | 50 |
51 /* Private function prototypes -----------------------------------------------*/ | |
52 void openEdit_DateTime(void); | |
53 void openEdit_Language(void); | |
54 void openEdit_Design(void); | |
55 void openEdit_Customview(void); | |
56 void openEdit_Information(void); | |
57 void openEdit_Reset(void); | |
58 void openEdit_CustomviewDivemode(uint8_t line); | |
59 //void openEdit_ShowDebugInfo(void); | |
60 //void openEdit_Salinity(void); | |
61 | |
62 /* Announced function prototypes -----------------------------------------------*/ | |
63 uint8_t OnAction_Date (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
64 uint8_t OnAction_Time (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
65 uint8_t OnAction_DDMMYY (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
66 uint8_t OnAction_MMDDYY (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
67 uint8_t OnAction_YYMMDD (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
68 uint8_t OnAction_DST (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
69 uint8_t OnAction_English (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
70 uint8_t OnAction_German (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
71 uint8_t OnAction_French (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
72 uint8_t OnAction_Italian (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
73 uint8_t OnAction_Espanol (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
74 //uint8_t OnAction_Design_t7 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
75 //uint8_t OnAction_Design_t7ft (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
76 //uint8_t OnAction_Design_t3 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
77 | |
78 uint8_t OnAction_Units (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
79 uint8_t OnAction_Colorscheme (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
80 uint8_t OnAction_DebugInfo (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
81 | |
82 uint8_t OnAction_CViewTimeout (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
83 uint8_t OnAction_CViewStandard (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
84 uint8_t OnAction_CornerTimeout (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
85 uint8_t OnAction_CornerStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
86 uint8_t OnAction_ExtraDisplay (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
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
|
87 uint8_t OnAction_MotionCtrl (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
38 | 88 |
89 uint8_t OnAction_Exit (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
90 uint8_t OnAction_Confirm (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
91 uint8_t OnAction_RebootRTE (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
92 uint8_t OnAction_ResetDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
93 uint8_t OnAction_ResetAll (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
94 uint8_t OnAction_ResetLogbook (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
95 uint8_t OnAction_RebootMainCPU (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
96 uint8_t OnAction_Nothing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
97 uint8_t OnAction_LogbookOffset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
98 uint8_t OnAction_SetFactoryDefaults(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
99 uint8_t OnAction_SetBatteryCharge(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
100 uint8_t OnAction_RecoverSampleIdx(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
38 | 101 #ifdef SCREENTEST |
102 uint8_t OnAction_ScreenTest (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
103 #endif | |
104 uint8_t OnAction_Information (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
105 /* | |
106 uint8_t OnAction_Salinity (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
107 uint8_t OnAction_TestCLog (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
108 */ | |
109 | |
110 /* Exported functions --------------------------------------------------------*/ | |
111 | |
112 void openEdit_System(uint8_t line) | |
113 { | |
114 set_globalState_Menu_Line(line); | |
115 resetMenuEdit(CLUT_MenuPageSystem); | |
116 | |
117 if(actual_menu_content == MENU_SURFACE) | |
118 { | |
119 switch(line) | |
120 { | |
121 case 1: | |
122 default: | |
123 openEdit_DateTime(); | |
124 break; | |
125 case 2: | |
126 openEdit_Language(); | |
127 break; | |
128 case 3: | |
129 openEdit_Design(); | |
130 break; | |
131 case 4: | |
132 openEdit_Customview(); | |
133 break; | |
134 case 5: | |
135 openEdit_Information(); | |
136 break; | |
137 case 6: | |
138 openEdit_Reset(); | |
139 break; | |
140 /* | |
141 case 3: | |
142 openEdit_DecoFutureTTS(); | |
143 break; | |
144 case 4: | |
145 openEdit_DecoLastStop(); | |
146 break; | |
147 */ | |
148 } | |
149 } | |
150 else | |
151 { | |
152 openEdit_CustomviewDivemode(line); | |
153 } | |
154 | |
155 } | |
156 | |
157 /* Private functions ---------------------------------------------------------*/ | |
158 | |
159 void openEdit_CustomviewDivemode(uint8_t line) | |
160 { | |
379 | 161 static uint8_t customviewsSubpage = 0; |
210
b2a9e9b02df0
New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents:
138
diff
changeset
|
162 SSettings *pSettings = settingsGetPointer(); |
b2a9e9b02df0
New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents:
138
diff
changeset
|
163 extern _Bool WriteSettings; |
379 | 164 char text[MAX_PAGE_TEXTSIZE]; |
165 uint16_t tabPosition; | |
166 uint32_t id; | |
210
b2a9e9b02df0
New feature: make selected customviews persistent
Jan Mulder <jlmulder@xs4all.nl>
parents:
138
diff
changeset
|
167 |
379 | 168 |
169 if((line == 6) || (cv_changelist[customviewsSubpage * 5 + line-1] == CVIEW_END)) /* select next set of views */ | |
170 { | |
171 customviewsSubpage++; | |
172 if(customviewsSubpage == CV_SUBPAGE_MAX) | |
173 { | |
174 customviewsSubpage = 0; | |
175 } | |
176 set_CustomsviewsSubpage(customviewsSubpage); | |
177 /* rebuild the selection page with the next set of customer views */ | |
178 id = tMSystem_refresh(0, text, &tabPosition, NULL); | |
179 tM_build_page(id, text, tabPosition, NULL); | |
180 openMenu(0); | |
181 } | |
182 else | |
183 { | |
184 pSettings->cv_configuration ^= 1 << (cv_changelist[customviewsSubpage * 5 + line-1]); | |
185 if(t7_GetEnabled_customviews() == 0) | |
186 { | |
187 pSettings->cv_configuration ^= (1 << CVIEW_noneOrDebug); | |
188 } | |
189 WriteSettings = 1; | |
190 InitMotionDetection(); /* consider new view setup for view selection by motion */ | |
191 exitMenuEdit_to_Menu_with_Menu_Update(); | |
192 } | |
38 | 193 } |
194 | |
195 | |
196 void openEdit_DateTime(void) | |
197 { | |
198 RTC_DateTypeDef Sdate; | |
199 RTC_TimeTypeDef Stime; | |
200 uint8_t day,month,year,hour,minute, dateFormat, ddmmyy, mmddyy, yymmdd; | |
201 char text[32]; | |
202 SSettings *pSettings; | |
203 const SDiveState * pStateReal = stateRealGetPointer(); | |
204 | |
205 pSettings = settingsGetPointer(); | |
206 translateDate(pStateReal->lifeData.dateBinaryFormat, &Sdate); | |
207 translateTime(pStateReal->lifeData.timeBinaryFormat, &Stime); | |
208 year = Sdate.Year; | |
209 month = Sdate.Month; | |
210 day = Sdate.Date; | |
211 hour = Stime.Hours; | |
212 minute= Stime.Minutes; | |
213 | |
214 if(year < 16) | |
215 year = 16; | |
216 | |
217 if(month < 1) | |
218 month = 1; | |
219 | |
220 if(day < 1) | |
221 day = 1; | |
222 | |
223 // daylightsaving = Stime.DayLightSaving; | |
224 dateFormat = pSettings->date_format; | |
225 ddmmyy = 0; | |
226 mmddyy = 0; | |
227 yymmdd = 0; | |
228 | |
229 if(dateFormat == DDMMYY) | |
230 ddmmyy = 1; | |
231 else | |
232 if(dateFormat == MMDDYY) | |
233 mmddyy = 1; | |
234 else | |
235 yymmdd = 1; | |
236 | |
237 text[0] = '\001'; | |
238 text[1] = TXT_DateAndTime; | |
239 text[2] = 0; | |
240 | |
241 write_topline(text); | |
242 | |
243 write_label_fix( 20, 340, ME_Y_LINE1, &FontT42, TXT_TimeConfig); | |
244 write_label_fix( 20, 340, ME_Y_LINE2, &FontT42, TXT_DateConfig); | |
245 write_label_var( 600, 800, ME_Y_LINE2, &FontT48, "\016\016DDMMYY\017"); | |
246 write_label_fix( 20, 790, ME_Y_LINE3, &FontT42, TXT_Format); | |
247 // write_label_fix( 350 ,580, 250, &FontT42, TXT_Daylightsaving); | |
248 | |
249 write_field_2digit(StMSYS1_Time, 320, 780, ME_Y_LINE1, &FontT48, "##:##", (uint32_t)hour, (uint32_t)minute, 0, 0); | |
250 write_field_2digit(StMSYS1_Date, 320, 780, ME_Y_LINE2, &FontT48, "##-##-20##", (uint32_t)day, (uint32_t)month, (uint32_t)year, 0); | |
251 write_field_on_off(StMSYS1_DDMMYY, 320, 790, ME_Y_LINE3, &FontT48, "DDMMYY", ddmmyy); | |
252 write_field_on_off(StMSYS1_MMDDYY, 320, 790, ME_Y_LINE4, &FontT48, "MMDDYY", mmddyy); | |
253 write_field_on_off(StMSYS1_YYMMDD, 320, 790, ME_Y_LINE5, &FontT48, "YYMMDD", yymmdd); | |
254 // write_field_on_off(StMSYS1_DST, 350, 580, 310, &FontT48, "Active", daylightsaving); | |
255 | |
256 setEvent(StMSYS1_Date, (uint32_t)OnAction_Date); | |
257 setEvent(StMSYS1_Time, (uint32_t)OnAction_Time); | |
258 setEvent(StMSYS1_DDMMYY, (uint32_t)OnAction_DDMMYY); | |
259 setEvent(StMSYS1_MMDDYY, (uint32_t)OnAction_MMDDYY); | |
260 setEvent(StMSYS1_YYMMDD, (uint32_t)OnAction_YYMMDD); | |
261 // setEvent(StMSYS1_DST, (uint32_t)OnAction_DST); | |
262 | |
263 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
264 } | |
265 | |
266 | |
267 uint8_t OnAction_Date(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
268 { | |
269 uint8_t digitContentNew; | |
270 uint32_t newDay, newMonth, newYear; | |
271 RTC_DateTypeDef sdatestructure; | |
272 | |
273 | |
274 if(action == ACTION_BUTTON_ENTER) | |
275 { | |
276 return digitContent; | |
277 } | |
278 if(action == ACTION_BUTTON_ENTER_FINAL) | |
279 { | |
280 evaluateNewString(editId, &newDay, &newMonth, &newYear, 0); | |
281 if(newDay == 0) | |
282 newDay = 1; | |
283 if(newDay > 31) | |
284 newDay = 31; | |
285 if(newMonth == 0) | |
286 newMonth = 1; | |
287 if(newMonth > 12) | |
288 newMonth = 12; | |
289 if((newMonth == 2) && (newDay > 29)) | |
290 newDay = 29; | |
291 if((newDay > 30) && ((newMonth == 4) ||(newMonth == 6) ||(newMonth == 9) ||(newMonth == 11))) | |
292 newDay = 30; | |
293 if(newYear < 17) | |
294 newYear = 17; | |
295 if(newYear > 99) | |
296 newYear = 99; | |
297 | |
298 sdatestructure.Date = newDay; | |
299 sdatestructure.Month = newMonth; | |
300 sdatestructure.Year = newYear; | |
301 setWeekday(&sdatestructure); | |
302 | |
303 setDate(sdatestructure); | |
304 | |
305 tMenuEdit_newInput(editId, newDay, newMonth, newYear, 0); | |
306 return UNSPECIFIC_RETURN; | |
307 } | |
308 if(action == ACTION_BUTTON_NEXT) | |
309 { | |
310 digitContentNew = digitContent + 1; | |
311 if((blockNumber == 0) && (digitContentNew > '0' + 31)) | |
312 digitContentNew = '1'; | |
313 if((blockNumber == 1) && (digitContentNew > '0' + 12)) | |
314 digitContentNew = '1'; | |
315 // year range 2017-2018 | |
55
a7683f9765da
Italian activated (needs some fine tuning), special characters (?,?,?,?,? and others) currently not working...
heinrichsweikamp
parents:
38
diff
changeset
|
316 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
|
317 digitContentNew = '0' + 18; |
38 | 318 return digitContentNew; |
319 } | |
320 if(action == ACTION_BUTTON_BACK) | |
321 { | |
322 digitContentNew = digitContent - 1; | |
323 if((blockNumber == 0) && (digitContentNew < '1')) | |
324 digitContentNew = '0' + 31; | |
325 if((blockNumber == 1) && (digitContentNew < '1')) | |
326 digitContentNew = '0' + 12; | |
327 // year range 2016-2018 | |
328 if((blockNumber == 2) && (digitContentNew < '0' + 17)) | |
329 digitContentNew = '0' + 18; | |
330 return digitContentNew; | |
331 } | |
332 /* | |
333 if(action == ACTION_BUTTON_NEXT) | |
334 { | |
335 digitContentNew = digitContent + 1; | |
336 if((blockNumber == 2) && (digitNumber == 0) && (digitContentNew > '2')) | |
337 digitContentNew = '1'; | |
338 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew > '3')) | |
339 digitContentNew = '0'; | |
340 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew > '1')) | |
341 digitContentNew = '0'; | |
342 if(digitContentNew > '9') | |
343 digitContentNew = '0'; | |
344 return digitContentNew; | |
345 } | |
346 if(action == ACTION_BUTTON_BACK) | |
347 { | |
348 digitContentNew = digitContent - 1; | |
349 if((blockNumber == 2) && (digitNumber == 0) && (digitContentNew < '1')) | |
350 digitContentNew = '2'; | |
351 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew < '0')) | |
352 digitContentNew = '3'; | |
353 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew < '0')) | |
354 digitContentNew = '1'; | |
355 if(digitContentNew < '0') | |
356 digitContentNew = '9'; | |
357 return digitContentNew; | |
358 } | |
359 */ | |
360 return UNSPECIFIC_RETURN; | |
361 } | |
362 | |
363 | |
364 uint8_t OnAction_Time(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
365 { | |
366 uint8_t digitContentNew; | |
367 uint32_t newHour, newMinute; | |
368 RTC_TimeTypeDef stimestructure; | |
369 | |
370 if(action == ACTION_BUTTON_ENTER) | |
371 { | |
372 return digitContent; | |
373 } | |
374 if(action == ACTION_BUTTON_ENTER_FINAL) | |
375 { | |
376 evaluateNewString(editId, &newHour, &newMinute, 0, 0); | |
377 if(newHour > 23) | |
378 newHour = 23; | |
379 if(newMinute > 59) | |
380 newMinute = 59; | |
381 | |
382 stimestructure.Hours = newHour; | |
383 stimestructure.Minutes = newMinute; | |
384 stimestructure.Seconds = 0; | |
385 | |
386 setTime(stimestructure); | |
387 | |
388 tMenuEdit_newInput(editId, newHour, newMinute, 0, 0); | |
389 return UNSPECIFIC_RETURN; | |
390 } | |
391 if(action == ACTION_BUTTON_NEXT) | |
392 { | |
393 digitContentNew = digitContent + 1; | |
394 if((blockNumber == 0) && (digitContentNew > '0' + 23)) | |
395 digitContentNew = '0'; | |
396 if((blockNumber == 1) && (digitContentNew > '0' + 59)) | |
397 digitContentNew = '0'; | |
398 return digitContentNew; | |
399 } | |
400 if(action == ACTION_BUTTON_BACK) | |
401 { | |
402 digitContentNew = digitContent - 1; | |
403 if((blockNumber == 0) && (digitContentNew < '0')) | |
404 digitContentNew = '0' + 23; | |
405 if((blockNumber == 1) && (digitContentNew < '0')) | |
406 digitContentNew = '0' + 59; | |
407 return digitContentNew; | |
408 } | |
409 /* | |
410 if(action == ACTION_BUTTON_NEXT) | |
411 { | |
412 digitContentNew = digitContent + 1; | |
413 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew > '2')) | |
414 digitContentNew = '0'; | |
415 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew > '5')) | |
416 digitContentNew = '0'; | |
417 if(digitContentNew > '9') | |
418 digitContentNew = '0'; | |
419 return digitContentNew; | |
420 } | |
421 if(action == ACTION_BUTTON_BACK) | |
422 { | |
423 digitContentNew = digitContent - 1; | |
424 if((blockNumber == 0) && (digitNumber == 0) && (digitContentNew < '0')) | |
425 digitContentNew = '2'; | |
426 if((blockNumber == 1) && (digitNumber == 0) && (digitContentNew < '0')) | |
427 digitContentNew = '5'; | |
428 if(digitContentNew < '0') | |
429 digitContentNew = '9'; | |
430 return digitContentNew; | |
431 } | |
432 */ | |
433 return UNSPECIFIC_RETURN; | |
434 } | |
435 | |
436 | |
437 uint8_t OnAction_DDMMYY(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
438 { | |
439 SSettings *pSettings; | |
440 | |
441 pSettings = settingsGetPointer(); | |
442 pSettings->date_format = DDMMYY; | |
443 | |
444 tMenuEdit_set_on_off(editId, 1); | |
445 tMenuEdit_set_on_off(StMSYS1_MMDDYY, 0); | |
446 tMenuEdit_set_on_off(StMSYS1_YYMMDD, 0); | |
447 | |
448 return UNSPECIFIC_RETURN; | |
449 } | |
450 | |
451 | |
452 uint8_t OnAction_MMDDYY(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
453 { | |
454 SSettings *pSettings; | |
455 | |
456 pSettings = settingsGetPointer(); | |
457 pSettings->date_format = MMDDYY; | |
458 | |
459 tMenuEdit_set_on_off(editId, 1); | |
460 tMenuEdit_set_on_off(StMSYS1_DDMMYY, 0); | |
461 tMenuEdit_set_on_off(StMSYS1_YYMMDD, 0); | |
462 | |
463 return UNSPECIFIC_RETURN; | |
464 } | |
465 | |
466 | |
467 uint8_t OnAction_YYMMDD(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
468 { | |
469 SSettings *pSettings; | |
470 | |
471 pSettings = settingsGetPointer(); | |
472 pSettings->date_format = YYMMDD; | |
473 | |
474 tMenuEdit_set_on_off(editId, 1); | |
475 tMenuEdit_set_on_off(StMSYS1_MMDDYY, 0); | |
476 tMenuEdit_set_on_off(StMSYS1_DDMMYY, 0); | |
477 | |
478 return UNSPECIFIC_RETURN; | |
479 } | |
480 | |
481 | |
482 uint8_t OnAction_DST(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
483 { | |
484 RTC_TimeTypeDef stimestructure; | |
485 uint8_t newDST; | |
486 | |
487 get_RTC_DateTime(0, &stimestructure); | |
488 newDST = stimestructure.DayLightSaving; | |
489 if(newDST) | |
490 newDST = 0; | |
491 else | |
492 newDST = 1; | |
493 stimestructure.DayLightSaving = newDST; | |
494 set_RTC_DateTime(0, &stimestructure); | |
495 | |
496 tMenuEdit_set_on_off(editId, newDST); | |
497 | |
498 return UNSPECIFIC_RETURN; | |
499 } | |
500 | |
501 | |
502 void openEdit_Language(void) | |
503 { | |
504 char text[32]; | |
505 uint8_t actualLanguage, active; | |
506 SSettings *pSettings; | |
507 | |
508 pSettings = settingsGetPointer(); | |
509 actualLanguage = pSettings->selected_language; | |
510 | |
511 text[0] = '\001'; | |
512 text[1] = TXT_Language; | |
513 text[2] = 0; | |
514 write_topline(text); | |
515 | |
516 text[0] = TXT_LanguageName; | |
517 text[1] = 0; | |
518 | |
519 pSettings->selected_language = LANGUAGE_English; | |
520 if( actualLanguage == pSettings->selected_language) | |
521 active = 1; | |
522 else | |
523 active = 0; | |
524 write_field_on_off(StMSYS2_English, 30, 500, ME_Y_LINE1, &FontT48, text, active); | |
525 | |
526 pSettings->selected_language = LANGUAGE_German; | |
527 if( actualLanguage == pSettings->selected_language) | |
528 active = 1; | |
529 else | |
530 active = 0; | |
531 write_field_on_off(StMSYS2_German, 30, 800, ME_Y_LINE2, &FontT48, text, active); | |
532 | |
533 pSettings->selected_language = LANGUAGE_French; | |
534 if( actualLanguage == pSettings->selected_language) | |
535 active = 1; | |
536 else | |
537 active = 0; | |
538 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
|
539 |
38 | 540 |
541 pSettings->selected_language = LANGUAGE_Italian; | |
542 if( actualLanguage == pSettings->selected_language) | |
543 active = 1; | |
544 else | |
545 active = 0; | |
546 write_field_on_off(StMSYS2_Italian, 30, 800, ME_Y_LINE4, &FontT48, text, active); | |
547 | |
102
4276d56eb37c
hPa instead of mbar, enabled Spanish language
heinrichsweikamp
parents:
64
diff
changeset
|
548 |
38 | 549 pSettings->selected_language = LANGUAGE_Espanol; |
550 if( actualLanguage == pSettings->selected_language) | |
551 active = 1; | |
552 else | |
553 active = 0; | |
554 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
|
555 |
38 | 556 pSettings->selected_language = actualLanguage; |
557 | |
558 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
559 | |
560 setEvent(StMSYS2_English, (uint32_t)OnAction_English); | |
561 setEvent(StMSYS2_German, (uint32_t)OnAction_German); | |
562 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
|
563 setEvent(StMSYS2_Italian, (uint32_t)OnAction_Italian); |
102
4276d56eb37c
hPa instead of mbar, enabled Spanish language
heinrichsweikamp
parents:
64
diff
changeset
|
564 setEvent(StMSYS2_Espanol, (uint32_t)OnAction_Espanol); |
38 | 565 } |
566 | |
567 | |
568 uint8_t OnAction_English (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
569 { | |
570 SSettings *pSettings = settingsGetPointer(); | |
571 pSettings->selected_language = LANGUAGE_English; | |
572 return EXIT_TO_MENU_WITH_LOGO; | |
573 } | |
574 | |
575 | |
576 uint8_t OnAction_German (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
577 { | |
578 SSettings *pSettings = settingsGetPointer(); | |
579 pSettings->selected_language = LANGUAGE_German; | |
580 return EXIT_TO_MENU_WITH_LOGO; | |
581 } | |
582 | |
583 | |
584 uint8_t OnAction_French (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
585 { | |
586 SSettings *pSettings = settingsGetPointer(); | |
587 pSettings->selected_language = LANGUAGE_French; | |
588 return EXIT_TO_MENU_WITH_LOGO; | |
589 } | |
590 | |
591 | |
592 uint8_t OnAction_Italian (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
593 { | |
594 SSettings *pSettings = settingsGetPointer(); | |
595 pSettings->selected_language = LANGUAGE_Italian; | |
596 return EXIT_TO_MENU_WITH_LOGO; | |
597 } | |
598 | |
599 | |
600 uint8_t OnAction_Espanol (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
601 { | |
602 SSettings *pSettings = settingsGetPointer(); | |
603 pSettings->selected_language = LANGUAGE_Espanol; | |
604 return EXIT_TO_MENU_WITH_LOGO; | |
605 } | |
606 | |
607 | |
608 void openEdit_Design(void) | |
609 { | |
610 refresh_Design(); | |
611 | |
612 write_field_button(StMSYS3_Units, 400, 700, ME_Y_LINE1, &FontT48, ""); | |
613 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
|
614 #ifdef HAVE_DEBUG_VIEW |
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
615 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
|
616 #endif |
38 | 617 setEvent(StMSYS3_Units, (uint32_t)OnAction_Units); |
618 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
|
619 #ifdef HAVE_DEBUG_VIEW |
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
620 setEvent(StMSYS3_Debug, (uint32_t)OnAction_DebugInfo); |
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
621 #endif |
38 | 622 } |
623 | |
624 | |
625 void refresh_Design(void) | |
626 { | |
627 char text[32]; | |
628 | |
629 // header | |
630 text[0] = '\001'; | |
631 text[1] = TXT_2BYTE; | |
632 text[2] = TXT2BYTE_Layout; | |
633 text[3] = 0; | |
634 write_topline(text); | |
635 | |
636 // units | |
637 text[0] = TXT_2BYTE; | |
638 text[1] = TXT2BYTE_Units; | |
639 text[2] = 0; | |
640 write_label_var( 30, 200, ME_Y_LINE1, &FontT48, text); | |
641 | |
642 if(settingsGetPointer()->nonMetricalSystem) | |
643 { | |
644 text[1] = TXT2BYTE_Units_feet; | |
645 } | |
646 else | |
647 { | |
648 text[1] = TXT2BYTE_Units_metric; | |
649 } | |
650 write_label_var( 400, 700, ME_Y_LINE1, &FontT48, text); | |
651 | |
652 // colorscheme | |
653 text[0] = TXT_2BYTE; | |
654 text[1] = TXT2BYTE_Farbschema; | |
655 text[2] = 0; | |
118
ee7f2cd9b9b4
Enlarge text limits to get string displayed completly
Ideenmodellierer
parents:
103
diff
changeset
|
656 write_label_var( 30, 300, ME_Y_LINE2, &FontT48, text); |
38 | 657 |
658 text[0] = '0' + settingsGetPointer()->tX_colorscheme; | |
659 text[1] = 0; | |
660 write_label_var( 400, 700, ME_Y_LINE2, &FontT48, text); | |
661 | |
343
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
662 #ifdef HAVE_DEBUG_VIEW |
38 | 663 // specials |
664 text[0] = TXT_2BYTE; | |
665 text[1] = TXT2BYTE_ShowDebug; | |
666 text[2] = 0; | |
667 write_label_var( 30, 700, ME_Y_LINE3, &FontT48, text); | |
668 | |
669 if(settingsGetPointer()->showDebugInfo) | |
670 text[0] = '\005'; | |
671 else | |
672 text[0] = '\006'; | |
673 text[1] = 0; | |
674 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
|
675 #endif |
38 | 676 |
677 // design | |
678 text[0] = TXT_Depth; | |
679 text[1] = 0; | |
680 write_content( 30, 700, ME_Y_LINE4, &FontT24, text, CLUT_Font031); | |
681 write_content( 30, 700, ME_Y_LINE4 + 30 + 70, &FontT48, "___________", CLUT_DIVE_FieldSeperatorLines); | |
682 write_content(280, 700, ME_Y_LINE4 + 30 + 70 - 3, &FontT48, "|", CLUT_DIVE_pluginbox); | |
683 write_content(290, 700, ME_Y_LINE4 + 30 + 70 - 37, &FontT48, "_______________", CLUT_DIVE_pluginbox); | |
684 write_content( 30, 700, ME_Y_LINE4 + 30, &FontT144, "24.7", CLUT_Font027); | |
685 | |
686 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
687 } | |
688 | |
689 | |
690 uint8_t OnAction_Units(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
691 { | |
692 settingsGetPointer()->nonMetricalSystem = !(settingsGetPointer()->nonMetricalSystem); | |
693 return EXIT_TO_MENU_WITH_LOGO;//UPDATE_DIVESETTINGS; | |
694 } | |
695 | |
696 | |
697 uint8_t OnAction_Colorscheme(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
698 { | |
699 uint8_t newColorscheme; | |
700 | |
701 newColorscheme = settingsGetPointer()->tX_colorscheme + 1; | |
702 | |
703 if(newColorscheme > 3) | |
704 newColorscheme = 0; | |
705 | |
706 settingsGetPointer()->tX_colorscheme = newColorscheme; | |
707 GFX_use_colorscheme(newColorscheme); | |
708 tHome_init_compass(); | |
709 return UNSPECIFIC_RETURN; | |
710 } | |
711 | |
712 | |
713 uint8_t OnAction_DebugInfo(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
714 { | |
715 settingsGetPointer()->showDebugInfo = !(settingsGetPointer()->showDebugInfo); | |
716 return UPDATE_DIVESETTINGS; | |
717 } | |
718 | |
719 | |
720 | |
721 | |
722 /* | |
723 uint8_t OnAction_Design_t7ft (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
724 { | |
725 SSettings *pSettings = settingsGetPointer(); | |
726 if((pSettings->design == 7) && pSettings->nonMetricalSystem) | |
727 return EXIT_TO_MENU; | |
728 pSettings->design = 7; | |
729 pSettings->nonMetricalSystem = 1; | |
730 tMenuEdit_set_on_off(StMSYS3_t7, 0); | |
731 tMenuEdit_set_on_off(StMSYS3_t7ft, 1); | |
732 tMenuEdit_set_on_off(StMSYS3_t3, 0); | |
733 return UPDATE_DIVESETTINGS; | |
734 } | |
735 | |
736 | |
737 uint8_t OnAction_Design_t7 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
738 { | |
739 SSettings *pSettings = settingsGetPointer(); | |
740 if((pSettings->design == 7) && (pSettings->nonMetricalSystem == 0)) | |
741 return EXIT_TO_MENU; | |
742 pSettings->design = 7; | |
743 pSettings->nonMetricalSystem = 0; | |
744 tMenuEdit_set_on_off(StMSYS3_t7, 1); | |
745 tMenuEdit_set_on_off(StMSYS3_t7ft, 0); | |
746 tMenuEdit_set_on_off(StMSYS3_t3, 0); | |
747 return UPDATE_DIVESETTINGS; | |
748 } | |
749 | |
750 | |
751 uint8_t OnAction_Design_t3 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
752 { | |
753 SSettings *pSettings = settingsGetPointer(); | |
754 if(pSettings->design == 3) | |
755 return EXIT_TO_MENU; | |
756 pSettings->design = 3; | |
757 pSettings->nonMetricalSystem = 0; | |
758 tMenuEdit_set_on_off(StMSYS3_t7, 0); | |
759 tMenuEdit_set_on_off(StMSYS3_t7ft,0); | |
760 tMenuEdit_set_on_off(StMSYS3_t3, 1); | |
761 return UPDATE_DIVESETTINGS; | |
762 } | |
763 */ | |
764 | |
765 | |
766 void openEdit_Customview(void) | |
767 { | |
768 refresh_Customviews(); | |
769 | |
770 write_field_button(StMSYS4_CViewTimeout, 400, 700, ME_Y_LINE1, &FontT48, ""); | |
771 write_field_button(StMSYS4_CViewStandard, 400, 700, ME_Y_LINE2, &FontT48, ""); | |
772 | |
773 write_field_button(StMSYS4_CornerTimeout, 400, 700, ME_Y_LINE3, &FontT48, ""); | |
343
c9d217b110cc
Added compile switch to enable debug view option in system menu
ideenmodellierer
parents:
259
diff
changeset
|
774 write_field_button(StMSYS4_CornerStandard, 400, 700, ME_Y_LINE4, &FontT48, ""); |
38 | 775 |
776 write_field_button(StMSYS4_ExtraDisplay, 400, 700, ME_Y_LINE5, &FontT48, ""); | |
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
|
777 write_field_button(StMSYS4_MotionCtrl, 400, 700, ME_Y_LINE6, &FontT48, ""); |
38 | 778 |
779 setEvent(StMSYS4_CViewTimeout, (uint32_t)OnAction_CViewTimeout); | |
780 setEvent(StMSYS4_CViewStandard, (uint32_t)OnAction_CViewStandard); | |
781 | |
782 setEvent(StMSYS4_CornerTimeout, (uint32_t)OnAction_CornerTimeout); | |
783 setEvent(StMSYS4_CornerStandard, (uint32_t)OnAction_CornerStandard); | |
784 | |
785 setEvent(StMSYS4_ExtraDisplay, (uint32_t)OnAction_ExtraDisplay); | |
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
|
786 setEvent(StMSYS4_MotionCtrl, (uint32_t)OnAction_MotionCtrl); |
38 | 787 } |
788 | |
789 | |
790 void refresh_Customviews(void) | |
791 { | |
792 char text[32]; | |
793 uint8_t textpointer = 0; | |
794 | |
795 // header | |
796 text[0] = '\001'; | |
797 text[1] = TXT_2BYTE; | |
798 text[2] = TXT2BYTE_Customviews; | |
799 text[3] = 0; | |
800 write_topline(text); | |
801 | |
802 // custom view center return | |
803 textpointer = 0; | |
804 text[textpointer++] = TXT_2BYTE; | |
805 text[textpointer++] = TXT2BYTE_CViewTimeout; | |
806 textpointer += snprintf(&text[textpointer],11," %02u\016\016 %c\017",settingsGetPointer()->tX_customViewTimeout,TXT_Seconds); | |
807 write_label_var( 30, 700, ME_Y_LINE1, &FontT48, text); | |
808 | |
809 // custom view center primary | |
810 text[0] = TXT_2BYTE; | |
811 text[1] = TXT2BYTE_CViewStandard; | |
812 text[2] = ' '; | |
813 text[3] = ' '; | |
814 switch(settingsGetPointer()->tX_customViewPrimary) | |
815 { | |
816 case CVIEW_sensors: | |
817 text[4] = TXT_2BYTE; | |
818 text[5] = TXT2BYTE_O2monitor; | |
819 break; | |
820 case CVIEW_sensors_mV: | |
821 text[4] = TXT_2BYTE; | |
822 text[5] = TXT2BYTE_O2voltage; | |
823 break; | |
824 case CVIEW_Compass: | |
825 text[4] = TXT_2BYTE; | |
826 text[5] = TXT2BYTE_Compass; | |
827 break; | |
828 case CVIEW_Decolist: | |
829 text[4] = TXT_2BYTE; | |
830 text[5] = TXT2BYTE_Decolist; | |
831 break; | |
832 case CVIEW_Tissues: | |
833 text[4] = TXT_2BYTE; | |
834 text[5] = TXT2BYTE_Tissues; | |
835 break; | |
836 case CVIEW_Profile: | |
837 text[4] = TXT_2BYTE; | |
838 text[5] = TXT2BYTE_Profile; | |
839 break; | |
840 case CVIEW_Gaslist: | |
841 text[4] = TXT_2BYTE; | |
842 text[5] = TXT2BYTE_Gaslist; | |
843 break; | |
844 case CVIEW_EADTime: | |
845 text[4] = TXT_2BYTE; | |
846 text[5] = TXT2BYTE_Info; | |
847 break; | |
848 case CVIEW_SummaryOfLeftCorner: | |
849 text[4] = TXT_2BYTE; | |
850 text[5] = TXT2BYTE_Summary; | |
851 break; | |
852 case CVIEW_noneOrDebug: | |
853 text[4] = ' '; | |
854 text[5] = '-'; | |
855 break; | |
856 default: | |
857 snprintf(&text[4],3,"%02u",settingsGetPointer()->tX_customViewPrimary); | |
858 break; | |
859 } | |
860 text[6] = 0; | |
861 write_label_var( 30, 700, ME_Y_LINE2, &FontT48, text); | |
862 | |
863 | |
864 // field corner return | |
865 textpointer = 0; | |
866 text[textpointer++] = TXT_2BYTE; | |
867 text[textpointer++] = TXT2BYTE_CornerTimeout; | |
868 textpointer += snprintf(&text[textpointer],11," %02u\016\016 %c\017",settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout,TXT_Seconds); | |
869 write_label_var( 30, 700, ME_Y_LINE3, &FontT48, text); | |
870 | |
871 // field corner primary | |
872 text[0] = TXT_2BYTE; | |
873 text[1] = TXT2BYTE_CornerStandard; | |
874 text[2] = ' '; | |
875 text[3] = ' '; | |
876 switch(settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary) | |
877 { | |
878 /* Temperature */ | |
879 case 1: | |
880 text[4] = TXT_Temperature; | |
881 break; | |
882 /* Average Depth */ | |
883 case 2: | |
884 text[4] = TXT_AvgDepth; | |
885 break; | |
886 /* ppO2 */ | |
887 case 3: | |
888 text[4] = TXT_ppO2; | |
889 break; | |
890 /* Stop Uhr */ | |
891 case 4: | |
892 text[4] = TXT_Stopwatch; | |
893 break; | |
894 /* Ceiling */ | |
895 case 5: | |
896 text[4] = TXT_Ceiling; | |
897 break; | |
898 /* Future TTS */ | |
899 case 6: | |
900 text[4] = TXT_FutureTTS; | |
901 break; | |
902 /* CNS */ | |
903 case 7: | |
904 text[4] = TXT_CNS; | |
905 break; | |
259
26c874cdde0d
feature: allow new saturation to be set in lower left corner
Jan Mulder <jlmulder@xs4all.nl>
parents:
210
diff
changeset
|
906 case 8: |
26c874cdde0d
feature: allow new saturation to be set in lower left corner
Jan Mulder <jlmulder@xs4all.nl>
parents:
210
diff
changeset
|
907 text[4] = TXT_ActualGradient; |
26c874cdde0d
feature: allow new saturation to be set in lower left corner
Jan Mulder <jlmulder@xs4all.nl>
parents:
210
diff
changeset
|
908 break; |
38 | 909 /* none */ |
910 case 0: | |
911 text[4] = '-'; | |
912 break; | |
913 default: | |
914 snprintf(&text[4],2,"%u",settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary); | |
915 break; | |
916 } | |
917 text[5] = 0; | |
918 write_label_var( 30, 700, ME_Y_LINE4, &FontT48, text); | |
919 | |
920 | |
921 // extra display | |
922 text[0] = TXT_2BYTE; | |
923 text[1] = TXT2BYTE_ExtraDisplay; | |
924 text[2] = ' '; | |
925 text[3] = ' '; | |
926 text[4] = TXT_2BYTE; | |
927 switch(settingsGetPointer()->extraDisplay) | |
928 { | |
929 /* BigFont */ | |
930 case EXTRADISPLAY_BIGFONT: | |
931 text[5] = TXT2BYTE_ExtraBigFont; | |
932 break; | |
933 /* DecoGame */ | |
934 case EXTRADISPLAY_DECOGAME: | |
935 text[5] = TXT2BYTE_ExtraDecoGame; | |
936 break; | |
937 /* none */ | |
938 case EXTRADISPLAY_none: | |
939 text[5] = TXT2BYTE_ExtraNone; | |
940 break; | |
941 default: | |
942 snprintf(&text[4],2,"%u",settingsGetPointer()->extraDisplay); | |
943 break; | |
944 } | |
945 text[6] = 0; | |
946 write_label_var( 30, 700, ME_Y_LINE5, &FontT48, text); | |
947 | |
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
|
948 |
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
|
949 /* MotionCtrl */ |
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
|
950 text[0] = TXT_2BYTE; |
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
|
951 text[1] = TXT2BYTE_MotionCtrl; |
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
|
952 text[2] = ' '; |
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
|
953 text[3] = ' '; |
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
|
954 text[4] = TXT_2BYTE; |
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
|
955 switch(settingsGetPointer()->MotionDetection) |
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
|
956 { |
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
|
957 case MOTION_DETECT_OFF: |
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
|
958 text[5] = TXT2BYTE_MoCtrlNone; |
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
|
959 break; |
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
|
960 case MOTION_DETECT_MOVE: |
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
|
961 text[5] = TXT2BYTE_MoCtrlPitch; |
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
|
962 break; |
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
|
963 case MOTION_DETECT_SECTOR: |
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
|
964 text[5] = TXT2BYTE_MoCtrlSector; |
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
|
965 break; |
373
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
966 case MOTION_DETECT_SCROLL: |
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
967 text[5] = TXT2BYTE_MoCtrlScroll; |
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
968 break; |
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
|
969 default: |
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
|
970 snprintf(&text[4],2,"%u",settingsGetPointer()->MotionDetection); |
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
|
971 break; |
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
|
972 } |
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
|
973 text[6] = 0; |
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
|
974 write_label_var( 30, 700, ME_Y_LINE6, &FontT48, text); |
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
|
975 |
38 | 976 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); |
977 } | |
978 | |
979 | |
980 uint8_t OnAction_CViewTimeout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
981 { | |
982 uint8_t value; | |
983 value = settingsGetPointer()->tX_customViewTimeout; | |
984 | |
985 if(value < 5) | |
986 value = 5; | |
987 else if(value < 10) | |
988 value = 10; | |
989 else if(value < 15) | |
990 value = 15; | |
991 else if(value < 20) | |
992 value = 20; | |
993 else if(value < 30) | |
994 value = 30; | |
995 else if(value < 45) | |
996 value = 45; | |
997 else if(value < 60) | |
998 value = 60; | |
999 else | |
1000 value = 0; | |
1001 | |
1002 settingsGetPointer()->tX_customViewTimeout = value; | |
1003 return UPDATE_DIVESETTINGS; | |
1004 } | |
1005 | |
1006 | |
1007 uint8_t OnAction_CViewStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1008 { | |
1009 uint8_t newValue; | |
1010 switch(settingsGetPointer()->tX_customViewPrimary) | |
1011 { | |
1012 case CVIEW_sensors: | |
1013 newValue = CVIEW_sensors_mV; | |
1014 break; | |
1015 case CVIEW_sensors_mV: | |
1016 newValue = CVIEW_Compass; | |
1017 break; | |
1018 case CVIEW_Compass: | |
1019 newValue = CVIEW_Decolist; | |
1020 break; | |
1021 case CVIEW_Decolist: | |
1022 newValue = CVIEW_Tissues; | |
1023 break; | |
1024 case CVIEW_Tissues: | |
1025 newValue = CVIEW_Profile; | |
1026 break; | |
1027 case CVIEW_Profile: | |
1028 newValue = CVIEW_Gaslist; | |
1029 break; | |
1030 case CVIEW_Gaslist: | |
1031 newValue = CVIEW_EADTime; | |
1032 break; | |
1033 case CVIEW_EADTime: | |
1034 newValue = CVIEW_SummaryOfLeftCorner; | |
1035 break; | |
1036 case CVIEW_SummaryOfLeftCorner: | |
1037 newValue = CVIEW_noneOrDebug; | |
1038 break; | |
1039 case CVIEW_noneOrDebug: | |
1040 default: | |
138 | 1041 newValue = CVIEW_sensors; |
38 | 1042 break; |
1043 } | |
1044 settingsGetPointer()->tX_customViewPrimary = newValue; | |
1045 return UPDATE_DIVESETTINGS; | |
1046 } | |
1047 | |
1048 | |
1049 uint8_t OnAction_CornerTimeout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1050 { | |
1051 uint8_t value; | |
1052 value = settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout; | |
1053 | |
1054 if(value < 5) | |
1055 value = 5; | |
1056 else if(value < 10) | |
1057 value = 10; | |
1058 else if(value < 15) | |
1059 value = 15; | |
1060 else if(value < 20) | |
1061 value = 20; | |
1062 else if(value < 30) | |
1063 value = 30; | |
1064 else if(value < 45) | |
1065 value = 45; | |
1066 else if(value < 60) | |
1067 value = 60; | |
1068 else | |
1069 value = 0; | |
1070 | |
1071 settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout = value; | |
1072 return UPDATE_DIVESETTINGS; | |
1073 } | |
1074 | |
1075 | |
1076 uint8_t OnAction_CornerStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1077 { | |
1078 uint8_t value; | |
1079 value = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary; | |
1080 | |
1081 value += 1; | |
1082 | |
259
26c874cdde0d
feature: allow new saturation to be set in lower left corner
Jan Mulder <jlmulder@xs4all.nl>
parents:
210
diff
changeset
|
1083 if(value > 8) |
38 | 1084 value = 0; |
1085 | |
1086 settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary = value; | |
1087 return UPDATE_DIVESETTINGS; | |
1088 } | |
1089 | |
1090 | |
1091 uint8_t OnAction_ExtraDisplay (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1092 { | |
1093 uint8_t newValue; | |
1094 switch(settingsGetPointer()->extraDisplay) | |
1095 { | |
1096 case EXTRADISPLAY_BIGFONT: | |
1097 newValue = EXTRADISPLAY_none; | |
1098 break; | |
1099 case EXTRADISPLAY_DECOGAME: | |
1100 newValue = EXTRADISPLAY_BIGFONT; | |
1101 break; | |
1102 case EXTRADISPLAY_none: | |
1103 newValue = EXTRADISPLAY_BIGFONT; | |
1104 break; | |
1105 default: | |
1106 newValue = EXTRADISPLAY_BIGFONT; | |
1107 break; | |
1108 } | |
1109 settingsGetPointer()->extraDisplay = newValue; | |
1110 return UNSPECIFIC_RETURN; | |
1111 } | |
1112 | |
1113 | |
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
|
1114 uint8_t OnAction_MotionCtrl (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
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
|
1115 { |
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
|
1116 uint8_t newValue; |
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
|
1117 switch(settingsGetPointer()->MotionDetection) |
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
|
1118 { |
373
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1119 case MOTION_DETECT_OFF: |
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1120 newValue = MOTION_DETECT_MOVE; |
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
|
1121 break; |
373
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1122 case MOTION_DETECT_MOVE: |
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1123 newValue = MOTION_DETECT_SECTOR; |
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
|
1124 break; |
373
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1125 case MOTION_DETECT_SECTOR: |
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1126 newValue = MOTION_DETECT_SCROLL; |
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
|
1127 break; |
373
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1128 case MOTION_DETECT_SCROLL: |
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1129 newValue = MOTION_DETECT_OFF; |
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1130 break; |
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
|
1131 default: |
373
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1132 newValue = MOTION_DETECT_OFF; |
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
|
1133 break; |
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
|
1134 } |
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
|
1135 settingsGetPointer()->MotionDetection = newValue; |
373
7b981f8bdd41
Add scroll event by pitch angle detection:
ideenmodellierer
parents:
368
diff
changeset
|
1136 InitMotionDetection(); |
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
|
1137 return UNSPECIFIC_RETURN; |
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
|
1138 } |
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
|
1139 |
38 | 1140 void openEdit_Information(void) |
1141 { | |
1142 char text[70]; | |
1143 | |
1144 infoPage = 0; | |
1145 | |
1146 text[0] = '\001'; | |
1147 text[1] = TXT_Information; | |
1148 text[2] = 0; | |
1149 write_topline(text); | |
1150 | |
1151 text[0] = TXT_2BYTE; | |
1152 text[1] = TXT2BYTE_ButtonNext; | |
1153 text[2] = 0; | |
1154 | |
1155 write_field_button(StMSYS5_Info, 30, 800, ME_Y_LINE6, &FontT48, text); | |
1156 | |
1157 setEvent(StMSYS5_Info, (uint32_t)OnAction_Information); | |
1158 } | |
1159 | |
1160 | |
1161 uint8_t OnAction_Information (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1162 { | |
1163 resetEnterPressedToStateBeforeButtonAction(); | |
1164 | |
1165 infoPage++; | |
1166 if(infoPage > 3) | |
1167 return EXIT_TO_MENU; | |
1168 else | |
1169 return UNSPECIFIC_RETURN; | |
1170 } | |
1171 | |
1172 | |
1173 void refresh_InformationPage(void) | |
1174 { | |
1175 char text_header[5]; | |
1176 char text_button[5]; | |
1177 char text_content[256]; | |
1178 uint8_t date[3], year,month,day; | |
1179 | |
1180 RTC_DateTypeDef Sdate, Sdate2; | |
1181 float temperature1, temperature2, voltage, offsetTemperature; | |
1182 | |
1183 //RTC_TimeTypeDef Stime; | |
1184 | |
1185 /* | |
1186 SDeviceLine batteryChargeCycles; | |
1187 SDeviceLine batteryChargeCompleteCycles; | |
1188 SDeviceLine temperatureMinimum; | |
1189 SDeviceLine temperatureMaximum; | |
1190 SDeviceLine depthMaximum; | |
1191 SDeviceLine diveCycles; | |
1192 SDeviceLine voltageMinimum; | |
1193 */ | |
1194 | |
1195 switch(infoPage) | |
1196 { | |
1197 case 0: | |
1198 text_header[0] = '\001'; | |
1199 text_header[1] = TXT_Information; | |
1200 text_header[2] = 0; | |
1201 | |
1202 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, "Dive Computer OSTC4"); | |
1203 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, "Design heinrichs/weikamp"); | |
1204 | |
1205 Sdate.Year = firmwareDataGetPointer()->release_year; | |
1206 Sdate.Month = firmwareDataGetPointer()->release_month; | |
1207 Sdate.Date = firmwareDataGetPointer()->release_day; | |
1208 | |
1209 if(settingsGetPointer()->date_format == DDMMYY) | |
1210 { | |
1211 day = 0; | |
1212 month = 1; | |
1213 year = 2; | |
1214 } | |
1215 else | |
1216 if(settingsGetPointer()->date_format == MMDDYY) | |
1217 { | |
1218 day = 1; | |
1219 month = 0; | |
1220 year = 2; | |
1221 } | |
1222 else | |
1223 { | |
1224 day = 2; | |
1225 month = 1; | |
1226 year = 0; | |
1227 } | |
1228 date[day] = Sdate.Date; | |
1229 date[month] = Sdate.Month; | |
1230 date[year] = Sdate.Year; | |
1231 snprintf(text_content,40,"Firmware release date: %02d.%02d.%02d",date[0],date[1],date[2]); | |
1232 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content); | |
1233 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, "for more information"); | |
64 | 1234 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, "info@heinrichsweikamp.com"); |
38 | 1235 |
1236 text_button[0] = TXT_2BYTE; | |
1237 text_button[1] = TXT2BYTE_ButtonNext; | |
1238 text_button[2] = 0; | |
1239 break; | |
1240 | |
1241 case 1: | |
1242 text_header[0] = '\001'; | |
1243 text_header[1] = TXT_2BYTE; | |
1244 text_header[2] = TXT2BYTE_Usage_Battery; | |
1245 text_header[3] = 0; | |
1246 | |
1247 text_content[0] = TXT_2BYTE; | |
1248 text_content[1] = TXT2BYTE_ChargeCycles; | |
1249 text_content[2] = 0; | |
1250 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content); | |
57 | 1251 snprintf(text_content,80,"%ld (%ld)",stateDeviceGetPointer()->batteryChargeCycles.value_int32,stateDeviceGetPointer()->batteryChargeCompleteCycles.value_int32); |
38 | 1252 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content); |
1253 | |
1254 translateDate(stateDeviceGetPointer()->batteryChargeCycles.date_rtc_dr, &Sdate); | |
1255 translateDate(stateDeviceGetPointer()->batteryChargeCompleteCycles.date_rtc_dr, &Sdate2); | |
1256 snprintf(text_content,80,"%u.%u.20%02u (%u.%u.20%02u)",Sdate.Date,Sdate.Month,Sdate.Year, Sdate2.Date,Sdate2.Month,Sdate2.Year); | |
1257 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content); | |
1258 | |
1259 text_content[0] = TXT_2BYTE; | |
1260 text_content[1] = TXT2BYTE_LowestVoltage; | |
1261 text_content[2] = 0; | |
1262 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content); | |
1263 | |
404
e729b8e7654d
Bugfix: display of time of minimum voltag:
ideenmodellierer
parents:
389
diff
changeset
|
1264 translateDate(stateDeviceGetPointer()->voltageMinimum.date_rtc_dr, &Sdate); |
38 | 1265 voltage = ((float)stateDeviceGetPointer()->voltageMinimum.value_int32) / 1000; |
1266 snprintf(text_content,80,"%0.3fV (%u.%u.20%02u)",voltage, Sdate.Date,Sdate.Month,Sdate.Year); | |
1267 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content); | |
1268 | |
1269 text_button[0] = TXT_2BYTE; | |
1270 text_button[1] = TXT2BYTE_ButtonNext; | |
1271 text_button[2] = 0; | |
1272 break; | |
1273 | |
1274 case 2: | |
1275 text_header[0] = '\001'; | |
1276 text_header[1] = TXT_2BYTE; | |
1277 text_header[2] = TXT2BYTE_Usage_Dives; | |
1278 text_header[3] = 0; | |
1279 | |
1280 text_content[0] = TXT_2BYTE; | |
1281 text_content[1] = TXT2BYTE_NumberOfDives; | |
1282 text_content[2] = 0; | |
1283 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content); | |
1284 | |
57 | 1285 snprintf(text_content,80,"%ld (%ld)",stateDeviceGetPointer()->diveCycles.value_int32,(stateDeviceGetPointer()->depthMaximum.value_int32 - 1000) / 100); |
38 | 1286 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content); |
1287 | |
1288 translateDate(stateDeviceGetPointer()->diveCycles.date_rtc_dr, &Sdate); | |
1289 translateDate(stateDeviceGetPointer()->depthMaximum.date_rtc_dr, &Sdate2); | |
1290 snprintf(text_content,80,"%u.%u.20%02u (%u.%u.20%02u)",Sdate.Date,Sdate.Month,Sdate.Year, Sdate2.Date,Sdate2.Month,Sdate2.Year); | |
1291 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content); | |
1292 | |
1293 text_content[0] = TXT_2BYTE; | |
1294 text_content[1] = TXT2BYTE_HoursOfOperation; | |
1295 text_content[2] = 0; | |
1296 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content); | |
1297 | |
57 | 1298 snprintf(text_content,80,"%ld",(stateDeviceGetPointer()->hoursOfOperation.value_int32)/3600); |
38 | 1299 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content); |
1300 | |
1301 text_button[0] = TXT_2BYTE; | |
1302 text_button[1] = TXT2BYTE_ButtonNext; | |
1303 text_button[2] = 0; | |
1304 break; | |
1305 | |
1306 case 3: | |
1307 text_header[0] = '\001'; | |
1308 text_header[1] = TXT_2BYTE; | |
1309 text_header[2] = TXT2BYTE_Usage_Environment; | |
1310 text_header[3] = 0; | |
1311 | |
1312 text_content[0] = TXT_2BYTE; | |
1313 text_content[1] = TXT2BYTE_AmbientTemperature; | |
1314 text_content[2] = 0; | |
1315 write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content); | |
1316 | |
1317 temperature1 = ((float)stateDeviceGetPointer()->temperatureMinimum.value_int32) / 100; | |
1318 temperature2 = ((float)stateDeviceGetPointer()->temperatureMaximum.value_int32) / 100; | |
1319 snprintf(text_content,80,"%0.2f\140C / %0.2f\140C",temperature1,temperature2); | |
1320 write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content); | |
1321 | |
1322 translateDate(stateDeviceGetPointer()->temperatureMinimum.date_rtc_dr, &Sdate); | |
1323 translateDate(stateDeviceGetPointer()->temperatureMaximum.date_rtc_dr, &Sdate2); | |
1324 snprintf(text_content,80,"(%u.%u.20%02u / %u.%u.20%02u)",Sdate.Date,Sdate.Month,Sdate.Year, Sdate2.Date,Sdate2.Month,Sdate2.Year); | |
1325 write_label_var( 20, 800, ME_Y_LINE3, &FontT42, text_content); | |
1326 | |
1327 text_content[0] = TXT_2BYTE; | |
1328 text_content[1] = TXT2BYTE_Korrekturwerte; | |
1329 text_content[2] = 0; | |
1330 write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content); | |
1331 | |
1332 offsetTemperature = ((float)settingsGetPointer()->offsetTemperature_centigrad) / 10; | |
103
f5d2f02dc73f
Generalize TEXT of pressure unit
Dmitry Romanov <kitt@bk.ru>
parents:
102
diff
changeset
|
1333 snprintf(text_content,80,"%i %s / %0.2f\140C",settingsGetPointer()->offsetPressure_mbar, TEXT_PRESSURE_UNIT, offsetTemperature); |
38 | 1334 write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content); |
1335 | |
1336 text_button[0] = TXT_2BYTE; | |
1337 text_button[1] = TXT2BYTE_Exit; | |
1338 text_button[2] = 0; | |
1339 break; | |
1340 } | |
1341 | |
1342 write_topline(text_header); | |
1343 tMenuEdit_newButtonText(StMSYS5_Info, text_button); | |
1344 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonNext,0); | |
1345 } | |
1346 | |
1347 | |
1348 void openEdit_Reset(void) | |
1349 { | |
1350 char text[32]; | |
1351 | |
1352 text[0] = '\001'; | |
1353 text[1] = TXT_2BYTE; | |
1354 text[2] = TXT2BYTE_ResetMenu; | |
1355 text[3] = 0; | |
1356 write_topline(text); | |
1357 | |
1358 text[0] = TXT_2BYTE; | |
1359 text[1] = TXT2BYTE_LogbookOffset; | |
1360 text[7] = 0; | |
1361 | |
1362 write_label_var( 30, 400, ME_Y_LINE1, &FontT48, text); | |
1363 | |
1364 write_field_udigit(StMSYS6_LogbookOffset,420, 800, ME_Y_LINE1, &FontT48, "####", settingsGetPointer()->logbookOffset,0,0,0); | |
1365 | |
1366 text[0] = TXT_2BYTE; | |
1367 text[2] = 0; | |
1368 | |
1369 text[1] = TXT2BYTE_ResetAll; | |
1370 write_field_button(StMSYS6_ResetAll, 30, 800, ME_Y_LINE2, &FontT48, text); | |
1371 | |
1372 text[1] = TXT2BYTE_ResetDeco; | |
1373 write_field_button(StMSYS6_ResetDeco, 30, 800, ME_Y_LINE3, &FontT48, text); | |
1374 | |
1375 text[1] = TXT2BYTE_Reboot; | |
1376 write_field_button(StMSYS6_Reboot, 30, 800, ME_Y_LINE4, &FontT48, text); | |
1377 | |
1378 text[1] = TXT2BYTE_Maintenance; | |
1379 write_field_button(StMSYS6_Maintenance, 30, 800, ME_Y_LINE5, &FontT48, text); | |
1380 | |
1381 #ifndef RESETLOGBLOCK | |
1382 text[1] = TXT2BYTE_ResetLogbook; | |
1383 write_field_button(StMSYS6_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text); | |
1384 #else | |
1385 text[0] = '\021'; | |
1386 text[1] = TXT_2BYTE; | |
1387 text[2] = TXT2BYTE_ResetLogbook; | |
1388 text[3] = 0; | |
1389 write_field_button(StMSYS6_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text); | |
1390 text[0] = TXT_2BYTE; | |
1391 text[2] = 0; | |
1392 #endif | |
1393 | |
1394 setEvent(StMSYS6_LogbookOffset, (uint32_t)OnAction_LogbookOffset); | |
1395 setEvent(StMSYS6_ResetAll, (uint32_t)OnAction_Confirm); | |
1396 setEvent(StMSYS6_ResetDeco, (uint32_t)OnAction_Confirm); | |
1397 setEvent(StMSYS6_Reboot, (uint32_t)OnAction_Confirm); | |
1398 setEvent(StMSYS6_Maintenance, (uint32_t)OnAction_Confirm); | |
1399 #ifndef RESETLOGBLOCK | |
1400 setEvent(StMSYS6_ResetLogbook, (uint32_t)OnAction_Confirm); | |
1401 #else | |
1402 setEvent(StMSYS6_ResetLogbook, (uint32_t)OnAction_Nothing); | |
1403 #endif | |
1404 | |
1405 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
1406 } | |
1407 | |
1408 | |
1409 void openEdit_ResetConfirmation(uint32_t editIdOfCaller) | |
1410 { | |
1411 char text[32]; | |
1412 | |
1413 resetMenuEdit(CLUT_MenuPageSystem); | |
1414 | |
1415 text[0] = '\001'; | |
1416 text[1] = TXT_2BYTE; | |
1417 text[2] = TXT2BYTE_AreYouSure; | |
1418 text[3] = 0; | |
1419 write_topline(text); | |
1420 | |
1421 text[0] = TXT_2BYTE; | |
1422 text[2] = 0; | |
1423 text[1] = TXT2BYTE_Abort; | |
1424 | |
1425 write_field_button(StMSYS6_Exit, 30, 800, ME_Y_LINE1, &FontT48, text); | |
1426 | |
1427 text[2] = 0; | |
1428 text[3] = 0; | |
1429 switch(editIdOfCaller) | |
1430 { | |
1431 case StMSYS6_Reboot: | |
1432 case StMSYS6_RebootRTE: | |
1433 case StMSYS6_RebootMainCPU: | |
1434 text[1] = TXT2BYTE_RebootMainCPU; | |
1435 write_field_button(StMSYS6_RebootMainCPU, 30, 800, ME_Y_LINE2, &FontT48, text); | |
1436 text[1] = TXT2BYTE_RebootRTE; | |
1437 write_field_button(StMSYS6_RebootRTE, 30, 800, ME_Y_LINE3, &FontT48, text); | |
1438 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); | |
1439 setEvent(StMSYS6_RebootMainCPU, (uint32_t)OnAction_RebootMainCPU); | |
1440 setEvent(StMSYS6_RebootRTE, (uint32_t)OnAction_RebootRTE); | |
1441 text[0] = '\025'; | |
1442 text[1] = TXT_2BYTE; | |
1443 text[2] = TXT2BYTE_DecoDataLost; | |
1444 text[3] = 0; | |
1445 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text); | |
1446 break; | |
1447 | |
1448 case StMSYS6_ResetDeco: | |
1449 text[1] = TXT2BYTE_ResetDeco; | |
1450 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); | |
1451 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); | |
1452 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetDeco); | |
1453 text[0] = '\025'; | |
1454 text[1] = TXT_2BYTE; | |
1455 text[2] = TXT2BYTE_DecoDataLost; | |
1456 text[3] = 0; | |
1457 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text); | |
1458 break; | |
1459 | |
1460 case StMSYS6_ResetAll: | |
1461 text[1] = TXT2BYTE_ResetAll; | |
1462 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); | |
1463 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); | |
1464 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetAll); | |
1465 break; | |
1466 | |
1467 case StMSYS6_ResetLogbook: | |
1468 text[1] = TXT2BYTE_ResetLogbook; | |
1469 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); | |
1470 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); | |
1471 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetLogbook); | |
1472 break; | |
1473 | |
1474 case StMSYS6_Maintenance: | |
1475 case StMSYS6_SetBattCharge: | |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1476 case StMSYS6_SetSampleIndx: |
38 | 1477 text[0] = TXT_2BYTE; |
1478 text[1] = TXT2BYTE_SetFactoryDefaults; | |
1479 text[2] = 0; | |
1480 write_field_button(StMSYS6_SetFactoryBC, 30, 800, ME_Y_LINE2, &FontT48, text); | |
1481 | |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1482 #ifdef ENABLE_ANALYSE_SAMPLES |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1483 text[0] = TXT_2BYTE; |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1484 text[1] = TXT2BYTE_SetSampleIndex; |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1485 text[2] = 0; |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1486 write_field_button(StMSYS6_SetSampleIndx, 30, 800, ME_Y_LINE3, &FontT48, text); |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1487 #endif |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1488 |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1489 |
38 | 1490 if(stateRealGetPointer()->lifeData.battery_charge == 0) |
1491 { | |
1492 text[0] = TXT_2BYTE; | |
1493 text[1] = TXT2BYTE_SetBatteryCharge; | |
1494 text[2] = 0; | |
1495 snprintf(&text[2],10,": %u%%",settingsGetPointer()->lastKnownBatteryPercentage); | |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1496 #ifdef ENABLE_ANALYSE_SAMPLES |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1497 write_field_button(StMSYS6_SetBattCharge, 30, 800, ME_Y_LINE4, &FontT48, text); |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1498 #else |
38 | 1499 write_field_button(StMSYS6_SetBattCharge, 30, 800, ME_Y_LINE3, &FontT48, text); |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1500 #endif |
38 | 1501 |
1502 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); | |
1503 setEvent(StMSYS6_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); | |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1504 #ifdef ENABLE_ANALYSE_SAMPLES |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1505 setEvent(StMSYS6_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1506 #endif |
38 | 1507 setEvent(StMSYS6_SetBattCharge, (uint32_t)OnAction_SetBatteryCharge); |
1508 } | |
1509 else | |
1510 { | |
1511 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); | |
1512 setEvent(StMSYS6_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); | |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1513 #ifdef ENABLE_ANALYSE_SAMPLES |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1514 setEvent(StMSYS6_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1515 #endif |
38 | 1516 } |
1517 // write_field_button(StMSYS6_ScreenTest, 30, 800, ME_Y_LINE3, &FontT48, "Screen Test"); | |
1518 // setEvent(StMSYS6_ScreenTest, (uint32_t)OnAction_ScreenTest); | |
1519 | |
1520 text[0] = TXT_2BYTE; | |
1521 text[1] = TXT2BYTE_WarnBatteryLow; | |
1522 text[2] = 0; | |
1523 snprintf(&text[2],10,": %01.2fV",stateRealGetPointer()->lifeData.battery_voltage); | |
1524 write_label_var( 30, 800, ME_Y_LINE4, &FontT42, text); | |
1525 | |
1526 snprintf(&text[0],30,"Code: %X",getLicence()); | |
1527 write_label_var( 30, 800, ME_Y_LINE6, &FontT42, text); | |
1528 break; | |
1529 | |
1530 } | |
1531 | |
1532 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | |
1533 } | |
1534 | |
1535 uint8_t OnAction_LogbookOffset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1536 { | |
1537 uint8_t digitContentNew; | |
1538 uint32_t newOffset; | |
1539 | |
1540 if(action == ACTION_BUTTON_ENTER) | |
1541 return digitContent; | |
1542 | |
1543 if(action == ACTION_BUTTON_ENTER_FINAL) | |
1544 { | |
1545 evaluateNewString(editId, &newOffset, 0, 0, 0); | |
1546 if(newOffset > 9000) | |
1547 newOffset = 0; | |
1548 tMenuEdit_newInput(editId, newOffset, 0, 0, 0); | |
1549 settingsGetPointer()->logbookOffset = (uint16_t)newOffset; | |
1550 return UPDATE_DIVESETTINGS; | |
1551 } | |
1552 | |
1553 if(action == ACTION_BUTTON_NEXT) | |
1554 { | |
1555 digitContentNew = digitContent + 1; | |
1556 if(digitContentNew > '9') | |
1557 digitContentNew = '0'; | |
1558 return digitContentNew; | |
1559 } | |
1560 | |
1561 if(action == ACTION_BUTTON_BACK) | |
1562 { | |
1563 digitContentNew = digitContent - 1; | |
1564 if(digitContentNew < '0') | |
1565 digitContentNew = '9'; | |
1566 return digitContentNew; | |
1567 } | |
1568 return UNSPECIFIC_RETURN; | |
1569 } | |
1570 | |
1571 uint8_t OnAction_Nothing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1572 { | |
1573 return UNSPECIFIC_RETURN; | |
1574 } | |
1575 | |
1576 uint8_t OnAction_Exit (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1577 { | |
1578 return EXIT_TO_MENU; | |
1579 } | |
1580 uint8_t OnAction_Confirm (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1581 { | |
1582 openEdit_ResetConfirmation(editId); | |
1583 return UNSPECIFIC_RETURN; | |
1584 } | |
1585 | |
1586 uint8_t OnAction_RebootRTE (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1587 { | |
1588 MX_SmallCPU_Reset_To_Standard(); | |
1589 return EXIT_TO_MENU; | |
1590 } | |
1591 | |
1592 uint8_t OnAction_ResetDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1593 { | |
1594 clearDeco(); | |
1595 return EXIT_TO_MENU; | |
1596 } | |
1597 | |
1598 uint8_t OnAction_ResetAll (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1599 { | |
1600 set_settings_to_Standard(); | |
1601 check_and_correct_settings(); | |
1602 | |
1603 return UPDATE_AND_EXIT_TO_HOME; | |
1604 } | |
1605 | |
1606 uint8_t OnAction_ResetLogbook (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1607 { | |
1608 write_label_var( 430, 740, 350, &FontT42, "Wait"); | |
1609 ext_flash_erase_logbook(); | |
1610 | |
1611 SSettings * pSettings = settingsGetPointer(); | |
1612 pSettings->lastDiveLogId = 255; | |
1613 pSettings->logFlashNextSampleStartAddress = 0; | |
1614 | |
1615 return EXIT_TO_MENU; | |
1616 } | |
1617 | |
1618 uint8_t OnAction_RebootMainCPU (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1619 { | |
1620 settingsGetPointer()->showDebugInfo = 0; | |
1621 extern uint8_t bootToBootloader; | |
1622 bootToBootloader = 1; | |
1623 return UNSPECIFIC_RETURN; | |
1624 } | |
1625 | |
1626 | |
1627 uint8_t OnAction_SetFactoryDefaults(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1628 { | |
1629 settingsWriteFactoryDefaults(settingsGetPointer()->ButtonResponsiveness[3], settingsGetPointer()->buttonBalance); | |
1630 return EXIT_TO_MENU; | |
1631 } | |
1632 | |
1633 | |
424
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1634 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
|
1635 { |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1636 char text[32]; |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1637 char strResult[20]; |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1638 |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1639 |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1640 ext_flash_AnalyseSampleBuffer(strResult); |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1641 snprintf(&text[0],30,"Ring: %s",strResult); //"Code: %X",settingsGetPointer()->logFlashNextSampleStartAddress); //getLicence()); |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1642 write_label_var( 30, 800, ME_Y_LINE6, &FontT42, text); |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1643 return UNSPECIFIC_RETURN; |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1644 } |
2b31cf1ebbcc
Added (optional) menu item to analyse log sample buffer:
ideenmodellierer
parents:
404
diff
changeset
|
1645 |
38 | 1646 uint8_t OnAction_SetBatteryCharge(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
1647 { | |
1648 setBatteryPercentage(settingsGetPointer()->lastKnownBatteryPercentage); | |
1649 // setBatteryPercentage(100); | |
1650 return EXIT_TO_MENU; | |
1651 } | |
1652 | |
1653 #ifdef SCREENTEST | |
1654 uint8_t OnAction_ScreenTest (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1655 { | |
1656 static uint8_t FrameCount = 1; // 0 is invisible frame | |
1657 char text[5]; | |
1658 GFX_DrawCfgScreen tTestScreen; | |
1659 tTestScreen.FBStartAdress = 0; | |
1660 tTestScreen.ImageHeight = 480; | |
1661 tTestScreen.ImageWidth = 800; | |
1662 tTestScreen.LayerIndex = 1; | |
1663 | |
1664 set_globalState(StMSYS6_ScreenTest); | |
1665 tTestScreen.FBStartAdress = getFrameByNumber(FrameCount); | |
1666 if(tTestScreen.FBStartAdress == 0) | |
1667 { | |
1668 extern uint8_t bootToBootloader; | |
1669 bootToBootloader = 1; | |
1670 } | |
1671 GFX_fill_buffer(tTestScreen.FBStartAdress, 0xFF, FrameCount); | |
1672 snprintf(text,5,"%u",FrameCount); | |
1673 Gfx_write_label_var(&tTestScreen, 10,100,10,&FontT48,CLUT_Font027,text); | |
1674 GFX_SetFramesTopBottom(tTestScreen.FBStartAdress, NULL,480); | |
1675 FrameCount++; | |
1676 } | |
1677 #endif | |
1678 /* | |
1679 uint8_t OnAction_TestCLog (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1680 { | |
1681 write_label_var( 430, 740, 350, &FontT42, "Wait"); | |
1682 | |
1683 test_log_only(20, 5); | |
1684 test_log_only(30, 10); | |
1685 ext_flash_write_settings(); | |
1686 return EXIT_TO_MENU; | |
1687 } | |
1688 */ | |
1689 |