annotate Discovery/Src/tMenuEditSystem.c @ 746:7e84ae1513b6

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