annotate Discovery/Src/tMenuSystem.c @ 851:9f487ad38170 Evo_2_23

Added line checks for System Menu: In the previous version the Timer options were always active even if the view was disabled. It is now disabled (grey) in case the view is disabled.
author Ideenmodellierer
date Thu, 07 Mar 2024 21:42:23 +0100
parents ce8f71217f45
children 44599695df41
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/tMenuSystem.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief Main Template file for Menu Page 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 "tMenu.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 #include "tMenuSystem.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass()
851
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
33 #include "t7.h"
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
35 static uint8_t customviewsSubpage = 0;
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
36
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 /* Private function prototypes -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 char customview_TXT2BYTE_helper(uint8_t customViewId);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
40 void set_CustomsviewsSubpage(uint8_t page)
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
41 {
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
42 customviewsSubpage = page;
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
43 }
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
44
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 uint32_t tMSystem_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 SSettings *data;
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
50 int i;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 uint8_t textPointer;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 uint8_t dateFormat;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 uint8_t RTEhigh, RTElow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 RTC_DateTypeDef Sdate;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 RTC_TimeTypeDef Stime;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56 const SDiveState * pStateReal = stateRealGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 data = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 textPointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 *tab = 300;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 *subtext = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62
815
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
63 resetLineMask(StMSYS);
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
64
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 // dive mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 if(actual_menu_content != MENU_SURFACE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 uint8_t id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
70 for(i=0; i<5;i++) /* fill maximum 5 items and leave last one for sub page selection */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 {
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
72 id = cv_changelist[customviewsSubpage * 5 + i];
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
73 if(id == CVIEW_END) /* last list item? */
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
74 {
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
75 break;
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
76 }
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
77 else
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
78 {
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
79 text[textPointer++] = '\006' - CHECK_BIT_THOME(data->cv_configuration,id);
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
80 text[textPointer++] = ' ';
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
81 textPointer += snprintf(&text[textPointer], 60,
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
82 "%c%c\n\r",
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
83 TXT_2BYTE, customview_TXT2BYTE_helper(id));
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
84 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
87 for(;i<5;i++) /* clear empty lines in case menu shows less than 5 entries */
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
88 {
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
89 text[textPointer++]='\n';
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
90 text[textPointer++]='\r';
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
91 text[textPointer] = 0;
815
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
92 switch(i)
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
93 {
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
94 case 0: disableLine(StMSYS_Custom0);
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
95 break;
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
96 case 1: disableLine(StMSYS_Custom1);
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
97 break;
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
98 case 2: disableLine(StMSYS_Custom2);
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
99 break;
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
100 case 3: disableLine(StMSYS_Custom3);
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
101 break;
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
102 case 4: disableLine(StMSYS_Custom4);
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
103 break;
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
104 default:
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
105 case 5: disableLine(StMSYS_Custom5);
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
106 break;
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
107 }
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
108 }
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
109
815
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
110 text[textPointer++] = TXT_2BYTE;
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
111 text[textPointer++] = TXT2BYTE_ButtonNext;
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
112 text[textPointer] = 0;
ce8f71217f45 Bugfix CustomView selection during dive mode:
Ideenmodellierer
parents: 805
diff changeset
113
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 return StMSYS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 // surface mode
139
decb0461302a Get version from local memory instead from incoming data
Ideenmodellierer
parents: 138
diff changeset
118 getActualRTEandFONTversion(&RTEhigh,&RTElow,NULL,NULL);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 if((RTEhigh == 0xFF) || (RTElow == 0xFF))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 RTEhigh = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 RTElow = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 if((line == 0) || (line == 1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 translateDate(pStateReal->lifeData.dateBinaryFormat, &Sdate);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 translateTime(pStateReal->lifeData.timeBinaryFormat, &Stime);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 dateFormat = data->date_format;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 textPointer += snprintf(&text[textPointer], 40,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 "Date"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 "\016\016"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 " "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 if(dateFormat == DDMMYY)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 textPointer += snprintf(&text[textPointer], 40,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 "DDMMYY"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 "\t"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 "%02d-%02d-%02d"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 " "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 , Sdate.Date, Sdate.Month, 2000 + Sdate.Year
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 if(dateFormat == MMDDYY)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 textPointer += snprintf(&text[textPointer], 40,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 "MMDDYY"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 "\t"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 "%02d-%02d-%02d"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 " "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 ,Sdate.Month, Sdate.Date, 2000 + Sdate.Year
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 if(dateFormat == YYMMDD)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 textPointer += snprintf(&text[textPointer], 40,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 "YYMMDD"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 "\t"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 "%02d-%02d-%02d"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 " "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 , 2000 + Sdate.Year, Sdate.Month, Sdate.Date
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 textPointer += snprintf(&text[textPointer], 60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 "%02d:%02d:%02d"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 ,Stime.Hours, Stime.Minutes, Stime.Seconds
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 strcpy(&text[textPointer],"\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 textPointer += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186
851
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
187 if (line == 0 || line == 2)
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
188 {
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
189 if(t7_customview_disabled(CVIEW_Timer))
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
190 {
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
191 text[textPointer++] = '\031'; /* change text color */
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
192 textPointer += snprintf(&text[textPointer], 21, "%c%c\t%u:%02u \016\016[m:ss]\017\n\r", TXT_2BYTE, TXT2BYTE_Timer, data->timerDurationS / 60, data->timerDurationS % 60);
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
193 disableLine(StMSYS_Timer);
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
194 text[textPointer++] = '\020'; /* restore text color */
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
195 }
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
196 else
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
197 {
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
198 textPointer += snprintf(&text[textPointer], 21, "%c%c\t%u:%02u \016\016[m:ss]\017\n\r", TXT_2BYTE, TXT2BYTE_Timer, data->timerDurationS / 60, data->timerDurationS % 60);
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
199 }
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
200 } else
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
201 {
805
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 536
diff changeset
202 textPointer += snprintf(&text[textPointer], 3, "\n\r");
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 536
diff changeset
203 }
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 536
diff changeset
204
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 536
diff changeset
205 if((line == 0) || (line == 3))
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 text[textPointer++] = TXT_Language;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 text[textPointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 text[textPointer++] = TXT_LanguageName;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 text[textPointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 text[textPointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 text[textPointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 strcpy(&text[textPointer],"\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 textPointer += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219
805
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 536
diff changeset
220 if((line == 0) || (line == 4))
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 text[textPointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 text[textPointer++] = TXT2BYTE_Layout;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 text[textPointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 if(!data->showDebugInfo)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 text[textPointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 if(data->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 text[textPointer++] = TXT2BYTE_Units_metric;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 text[textPointer++] = TXT2BYTE_Units_feet;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 if(data->tX_colorscheme != 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 {
536
54c5ec8416c4 Changed visualization of Depth / temperatur / debugview entry
Ideenmodellierer
parents: 520
diff changeset
236 text[textPointer++] = ' ';
54c5ec8416c4 Changed visualization of Depth / temperatur / debugview entry
Ideenmodellierer
parents: 520
diff changeset
237 text[textPointer++] = '/';
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 text[textPointer++] = '\027';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 text[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 text[textPointer++] = '0' + data->tX_colorscheme;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 text[textPointer++] = '\020';
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 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 if(data->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 text[textPointer++] = 'm';
536
54c5ec8416c4 Changed visualization of Depth / temperatur / debugview entry
Ideenmodellierer
parents: 520
diff changeset
249 text[textPointer++] = ' ';
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 text[textPointer++] = '/';
536
54c5ec8416c4 Changed visualization of Depth / temperatur / debugview entry
Ideenmodellierer
parents: 520
diff changeset
251 text[textPointer++] = ' ';
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 text[textPointer++] = 'C';
536
54c5ec8416c4 Changed visualization of Depth / temperatur / debugview entry
Ideenmodellierer
parents: 520
diff changeset
253 text[textPointer++] = ' ';
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 text[textPointer++] = 'f';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 text[textPointer++] = 't';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 text[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 text[textPointer++] = '/';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 text[textPointer++] = ' ';
536
54c5ec8416c4 Changed visualization of Depth / temperatur / debugview entry
Ideenmodellierer
parents: 520
diff changeset
262 text[textPointer++] = 'F';
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 text[textPointer++] = ' ';
536
54c5ec8416c4 Changed visualization of Depth / temperatur / debugview entry
Ideenmodellierer
parents: 520
diff changeset
264 }
54c5ec8416c4 Changed visualization of Depth / temperatur / debugview entry
Ideenmodellierer
parents: 520
diff changeset
265 if(data->tX_colorscheme != 0)
54c5ec8416c4 Changed visualization of Depth / temperatur / debugview entry
Ideenmodellierer
parents: 520
diff changeset
266 {
54c5ec8416c4 Changed visualization of Depth / temperatur / debugview entry
Ideenmodellierer
parents: 520
diff changeset
267 text[textPointer++] = '/';
54c5ec8416c4 Changed visualization of Depth / temperatur / debugview entry
Ideenmodellierer
parents: 520
diff changeset
268 text[textPointer++] = '\027';
54c5ec8416c4 Changed visualization of Depth / temperatur / debugview entry
Ideenmodellierer
parents: 520
diff changeset
269 text[textPointer++] = ' ';
54c5ec8416c4 Changed visualization of Depth / temperatur / debugview entry
Ideenmodellierer
parents: 520
diff changeset
270 text[textPointer++] = '0' + data->tX_colorscheme;
54c5ec8416c4 Changed visualization of Depth / temperatur / debugview entry
Ideenmodellierer
parents: 520
diff changeset
271 text[textPointer++] = ' ';
54c5ec8416c4 Changed visualization of Depth / temperatur / debugview entry
Ideenmodellierer
parents: 520
diff changeset
272 text[textPointer++] = '\020';
54c5ec8416c4 Changed visualization of Depth / temperatur / debugview entry
Ideenmodellierer
parents: 520
diff changeset
273 }
54c5ec8416c4 Changed visualization of Depth / temperatur / debugview entry
Ideenmodellierer
parents: 520
diff changeset
274 text[textPointer++] = '/';
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 text[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 text[textPointer++] = 'd';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 text[textPointer++] = 'e';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 text[textPointer++] = 'b';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 text[textPointer++] = 'u';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 text[textPointer++] = 'g';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 text[textPointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 text[textPointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 text[textPointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 strcpy(&text[textPointer],"\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 textPointer += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292
805
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 536
diff changeset
293 if((line == 0) || (line == 5))
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 text[textPointer++] = TXT_Information;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 text[textPointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 textPointer += snprintf(&text[textPointer],29,"RTE %u.%u OS %i.%i.%i"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 ,RTEhigh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 ,RTElow
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 ,firmwareDataGetPointer()->versionFirst
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 ,firmwareDataGetPointer()->versionSecond
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 ,firmwareDataGetPointer()->versionThird
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 strcpy(&text[textPointer],"\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 textPointer += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307
805
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 536
diff changeset
308 if((line == 0) || (line == 6))
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 text[textPointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 text[textPointer++] = TXT2BYTE_ResetMenu;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 text[textPointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 strcpy(&text[textPointer],"\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 textPointer += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 return StMSYS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 }
851
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
319 void tMSystem_checkLineStatus(void)
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
320 {
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
321 uint8_t localLineMask = 0;
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
322 uint8_t lineMask = getLineMask(StMSYS);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323
851
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
324 if(t7_customview_disabled(CVIEW_Timer))
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
325 {
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
326 localLineMask |= 1 << 2;
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
327 }
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
328 if(lineMask != localLineMask)
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
329 {
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
330 updateMenu();
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
331 }
9f487ad38170 Added line checks for System Menu:
Ideenmodellierer
parents: 815
diff changeset
332 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 /* Private functions ---------------------------------------------------------*/