annotate Discovery/Src/tMenuEditSystem.c @ 73:06cfc7457c9e

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