annotate Discovery/Src/tMenuEditDeco.c @ 843:2cab242c9a4a Evo_2_23

Update version number and set beta state
author Ideenmodellierer
date Sat, 20 Jan 2024 19:38:52 +0100
parents e81afd727993
children 608d3e918146
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/tMenuEditDeco.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief Main Template file for Menu Edit Deco Parameters
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 31-July-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 "tMenuEditDeco.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 #include "gfx_fonts.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 #include "tMenuEdit.h"
130
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 38
diff changeset
34 #include "unit.h"
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
35 #include "configuration.h"
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 /* Private variables ---------------------------------------------------------*/
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
38 static uint8_t lineSelected = 0;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 /* Private function prototypes -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
42 static void openEdit_DiveMode(void);
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
43 static void openEdit_ppO2max(void);
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
44 static void openEdit_SafetyStop(void);
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
45 static void openEdit_FutureTTS(void);
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
46 static void openEdit_Salinity(void);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 /* Announced function prototypes -----------------------------------------------*/
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
49 static uint8_t OnAction_setMode (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
50 static uint8_t OnAction_FutureTTS (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
51 static uint8_t OnAction_ppO2Max (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
52 static uint8_t OnAction_SafetyStop (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
53 static uint8_t OnAction_Salinity (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56 void openEdit_Deco(uint8_t line)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 set_globalState_Menu_Line(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 resetMenuEdit(CLUT_MenuPageDeco);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 lineSelected = line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 switch(line)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 case 1:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 openEdit_DiveMode();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 case 2:
707
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
70 openEdit_ppO2max();
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 case 3:
707
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
73 openEdit_SafetyStop();
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 case 4:
707
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
76 openEdit_FutureTTS();
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 case 5:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 openEdit_Salinity();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
87 static void openEdit_DiveMode(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 #define APNEAANDGAUGE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 char text[32];
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
92 uint8_t lineOffset = 0;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 uint8_t actualDiveMode, active;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 actualDiveMode = pSettings->dive_mode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 text[1] = TXT_DiveMode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 text[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
105 #ifdef ENABLE_PSCR_MODE
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
106 lineOffset = ME_Y_LINE_STEP;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
107 #endif
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
108
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 text[0] = TXT_OpenCircuit;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 if(actualDiveMode == DIVEMODE_OC)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 active = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 write_field_on_off(StMDECO1_OC, 30, 500, ME_Y_LINE1, &FontT48, text, active);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 text[0] = TXT_ClosedCircuit;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 if(actualDiveMode == DIVEMODE_CCR)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 active = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 write_field_on_off(StMDECO1_CC, 30, 500, ME_Y_LINE2, &FontT48, text, active);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
123 #ifdef ENABLE_PSCR_MODE
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
124 text[0] = TXT_PSClosedCircuit;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
125 if(actualDiveMode == DIVEMODE_PSCR)
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
126 active = 1;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
127 else
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
128 active = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
129 write_field_on_off(StMDECO1_PSCR, 30, 500, ME_Y_LINE3, &FontT48, text, active);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
130 #endif
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
131 #ifdef APNEAANDGAUGE
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 text[0] = TXT_Apnoe;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 if(actualDiveMode == DIVEMODE_Apnea)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 active = 0;
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
137 write_field_on_off(StMDECO1_Apnea, 30, 500, ME_Y_LINE3 + lineOffset, &FontT48, text, active);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 text[0] = TXT_Gauge;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 if(actualDiveMode == DIVEMODE_Gauge)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 active = 0;
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
144 write_field_on_off(StMDECO1_Gauge, 30, 500, ME_Y_LINE4 + lineOffset, &FontT48, text, active);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
145 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
147 setEvent(StMDECO1_OC, (uint32_t)OnAction_setMode);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
148 setEvent(StMDECO1_CC, (uint32_t)OnAction_setMode);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
149 #ifdef ENABLE_PSCR_MODE
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
150 setEvent(StMDECO1_PSCR, (uint32_t)OnAction_setMode);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
151 #endif
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
152
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
153 #ifdef APNEAANDGAUGE
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
154 setEvent(StMDECO1_Apnea, (uint32_t)OnAction_setMode);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
155 setEvent(StMDECO1_Gauge, (uint32_t)OnAction_setMode);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
156 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
161
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
162 static uint8_t OnAction_setMode (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) //(uint32_t newMode)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 {
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
164 uint32_t modeArray[] = {StMDECO1_OC, StMDECO1_CC, StMDECO1_Gauge, StMDECO1_Apnea /* definition needs to follow order of DIVEMODE (settings.h) */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
165 #ifdef ENABLE_PSCR_MODE
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
166 , StMDECO1_PSCR
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
167 #endif
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
168 };
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
169
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
170 uint8_t index = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
171 SSettings *pSettings = settingsGetPointer();
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
172 uint8_t retVal = EXIT_TO_MENU;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
173 uint8_t lastMode = pSettings->dive_mode;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
176 setActualGasFirst(&stateRealGetPointerWrite()->lifeData);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
177 while(index < sizeof(modeArray) / 4) /* calculate number of items out of array size (bytes) */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
178 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
179 if(editId == modeArray[index])
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
180 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
181 if(pSettings->dive_mode != index)
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
182 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
183 tMenuEdit_set_on_off(modeArray[index], 1);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
184 pSettings->dive_mode = index;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
185 retVal = UPDATE_DIVESETTINGS;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
186 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
187 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
188 else
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
189 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
190 if(lastMode == index) /* reset state of previous mode selection */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
191 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
192 tMenuEdit_set_on_off(modeArray[index], 0);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
193 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
194 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
195 index++;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
196 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
197 return retVal;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
204 static void openEdit_SafetyStop(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 uint32_t safetystopDuration, safetystopDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 char text[64];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 uint16_t y_line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 safetystopDuration = settingsGetPointer()->safetystopDuration;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 safetystopDepth = settingsGetPointer()->safetystopDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 y_line = ME_Y_LINE_BASE + (lineSelected * ME_Y_LINE_STEP);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 text[1] = TXT_SafetyStop;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 write_label_fix( 20, 800, y_line, &FontT48, TXT_SafetyStop);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 strcpy(text,"\016\016");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 text[2] = TXT_Minutes;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 if(settingsGetPointer()->nonMetricalSystem)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 strcpy(&text[3],
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 " @ "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 "\016\016"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 " ft"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 strcpy(&text[3],
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 " @ "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 "\016\016"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 " m"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 write_label_var( 410, 800, y_line, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 if(settingsGetPointer()->nonMetricalSystem)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 write_field_2digit(StMDECO4_SafetyStop, 350, 800, y_line, &FontT48, "## ##", safetystopDuration, unit_depth_integer(safetystopDepth), 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 write_field_udigit(StMDECO4_SafetyStop, 370, 800, y_line, &FontT48, "# #", safetystopDuration, safetystopDepth, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 write_buttonTextline(TXT2BYTE_ButtonMinus,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonPlus);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 setEvent(StMDECO4_SafetyStop, (uint32_t)OnAction_SafetyStop);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 startEdit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
262 static uint8_t OnAction_SafetyStop (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 uint8_t digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 uint32_t newSafetystopDuration, newSafetystopDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 if(action == ACTION_BUTTON_ENTER)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 evaluateNewString(editId, &newSafetystopDuration, &newSafetystopDepth, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 if(settingsGetPointer()->nonMetricalSystem != 0) // new hw 170718
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 newSafetystopDepth += 2; // f�r rundung
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 newSafetystopDepth = (newSafetystopDepth * 3) / 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 settingsGetPointer()->safetystopDuration = newSafetystopDuration;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 settingsGetPointer()->safetystopDepth = newSafetystopDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 tMenuEdit_newInput(editId, newSafetystopDuration, newSafetystopDepth, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 return UPDATE_AND_EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 digitContentNew = digitContent + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 if(blockNumber == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 if(digitContentNew > '5')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 if(settingsGetPointer()->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 if(digitContentNew > '6')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 digitContentNew = '3';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 if(digitContent < 13 + '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 digitContentNew = 13 + '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 else if(digitContent < 16 + '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 digitContentNew = 16 + '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 else if(digitContent < 20 + '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 digitContentNew = 20 + '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 digitContentNew = 10 + '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 digitContentNew = digitContent - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320 if(blockNumber == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322 if(digitContentNew < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 digitContentNew = '5';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 if(settingsGetPointer()->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 if(digitContentNew < '3')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 digitContentNew = '6';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 if(digitContent >= 20 + '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 digitContentNew = 16 + '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 else if(digitContent >= 16 + '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 digitContentNew = 13 + '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 else if(digitContent >= 13 + '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 digitContentNew = 10 + '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 digitContentNew = 20 + '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
350 static void openEdit_Salinity(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 uint16_t y_line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 text[1] = TXT_Salinity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360 y_line = ME_Y_LINE_BASE + (lineSelected * ME_Y_LINE_STEP);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362 write_label_fix( 30, 800, y_line, &FontT48, TXT_Salinity);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363 write_label_var( 400, 800, y_line, &FontT48, "\016\016 %\017");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 write_field_udigit(StMDECO6_SALINITY, 370, 800, y_line, &FontT48, "#", (uint32_t)settingsGetPointer()->salinity, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 write_buttonTextline(TXT2BYTE_ButtonMinus,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonPlus);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369 setEvent(StMDECO6_SALINITY, (uint32_t)OnAction_Salinity);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 startEdit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
374 static uint8_t OnAction_Salinity(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376 SSettings *pSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 uint8_t digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378 uint32_t salinity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 if(action == ACTION_BUTTON_ENTER)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 evaluateNewString(editId, &salinity, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 if(salinity >= 4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389 salinity = 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391 pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 pSettings->salinity = salinity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395 tMenuEdit_newInput(editId, salinity, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396 return UPDATE_AND_EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 digitContentNew = digitContent + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 if(digitContentNew > '4')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 digitContentNew = digitContent - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 if(digitContentNew < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409 digitContentNew = '4';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 return digitContentNew;
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 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
417 static void openEdit_ppO2max(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419 uint8_t maxL_std, maxL_deco;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420 uint16_t y_line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 maxL_std = pSettings->ppO2_max_std - 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 maxL_deco = pSettings->ppO2_max_deco - 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427 y_line = ME_Y_LINE_BASE + (lineSelected * ME_Y_LINE_STEP);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 text[1] = TXT_ppO2Name;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 strcpy(text,"ppO2\016\016max\017");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435 write_label_var( 20, 800, y_line, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436 strcpy(text,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437 "\016\016"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438 " bar "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 " deco "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 " "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442 "\016\016"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 " bar"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 write_label_var( 460, 800, y_line, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 // write_field_udigit(StMDECO4_PPO2Max, 410, 800, y_line, &FontT48, "## ##", (uint32_t)maxL_std, (uint32_t)maxL_deco, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449 write_field_udigit(StMDECO3_PPO2Max, 370, 800, y_line, &FontT48, "1.## 1.##", (uint32_t)maxL_std, (uint32_t)maxL_deco, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 write_buttonTextline(TXT2BYTE_ButtonMinus,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonPlus);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453 setEvent(StMDECO3_PPO2Max, (uint32_t)OnAction_ppO2Max);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 startEdit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
458 static uint8_t OnAction_ppO2Max(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460 SSettings *pSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461 uint8_t digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462 uint32_t newPPO2LStd, newPPO2LDeco;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464 if(action == ACTION_BUTTON_ENTER)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470 evaluateNewString(editId, &newPPO2LStd, &newPPO2LDeco, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472 if(newPPO2LStd > 90)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473 newPPO2LStd = 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475 if(newPPO2LDeco > 90)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476 newPPO2LDeco = 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478 pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 pSettings->ppO2_max_std = 100 + newPPO2LStd;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480 pSettings->ppO2_max_deco = 100 + newPPO2LDeco;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482 tMenuEdit_newInput(editId, newPPO2LStd, newPPO2LDeco, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483 return UPDATE_AND_EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487 digitContentNew = digitContent + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488 if(digitContentNew > '9')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494 digitContentNew = digitContent - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495 if(digitContentNew < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496 digitContentNew = '9';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
501
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
503 static void openEdit_FutureTTS(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505 uint8_t futureTTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 uint16_t y_line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510 futureTTS = pSettings->future_TTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 y_line = ME_Y_LINE_BASE + (lineSelected * ME_Y_LINE_STEP);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
513
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515 text[1] = TXT_FutureTTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519 strcpy(text,"\016\016");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520 text[2] = TXT_Minutes;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
522 write_label_fix( 20, 800, y_line, &FontT48, TXT_FutureTTS);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523 write_label_var( 435, 800, y_line, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524 write_field_2digit(StMDECO5_FUTURE, 370, 500, y_line, &FontT48, "##", (uint32_t)futureTTS, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526 write_buttonTextline(TXT2BYTE_ButtonMinus,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonPlus);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528 setEvent(StMDECO5_FUTURE, (uint32_t)OnAction_FutureTTS);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 startEdit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
533 static uint8_t OnAction_FutureTTS(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 SSettings *pSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536 int8_t digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537 uint32_t newFutureTTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 if(action == ACTION_BUTTON_ENTER)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545 evaluateNewString(editId, &newFutureTTS, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 if(newFutureTTS > 15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548 newFutureTTS = 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551 pSettings->future_TTS = newFutureTTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553 tMenuEdit_newInput(editId, newFutureTTS, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 return UPDATE_AND_EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558 digitContentNew = digitContent + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559 if(digitContentNew > '0'+ 15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
564 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565 digitContentNew = digitContent - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566 if(digitContentNew < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 digitContentNew = '0' + 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 }