annotate Discovery/Src/tMenuSystem.c @ 453:1c0b911c367f minor_improvments

Added compile variant enabling the reset of profile sample information: In case the sample ring has an overrun prior to the header ring then header will point to no longer available sample locations causing problems when the no longer existing samples are read. To avoid this also in earlier versions a variant has been added which enables the user to reset the invalid sample information by selecting the problematic dive in the infolog menu and pressing the middle button. Added function which confirms consistency of dive log settings: Meaning last dive and dive header are valid at startup. Repair and find lastDiveID are only called in case a inconsistency is detected
author ideenmodellierer
date Tue, 24 Mar 2020 21:59:38 +0100
parents 0dbf550dc743
children 3485360c5db0
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()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
34 static uint8_t customviewsSubpage = 0;
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
35
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 /* Private function prototypes -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 char customview_TXT2BYTE_helper(uint8_t customViewId);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
39 void set_CustomsviewsSubpage(uint8_t page)
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
40 {
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
41 customviewsSubpage = page;
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
42 }
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
43
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 uint32_t tMSystem_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 SSettings *data;
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
49 int i;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 uint8_t textPointer;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 uint8_t dateFormat;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 uint8_t RTEhigh, RTElow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 RTC_DateTypeDef Sdate;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 RTC_TimeTypeDef Stime;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 const SDiveState * pStateReal = stateRealGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 data = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 textPointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 *tab = 300;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 *subtext = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 // dive mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 if(actual_menu_content != MENU_SURFACE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 uint8_t id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
67 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
68 {
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
69 id = cv_changelist[customviewsSubpage * 5 + i];
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
70 if(id == CVIEW_END) /* last list item? */
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
71 {
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
72 break;
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
73 }
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
74 else
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
75 {
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
76 text[textPointer++] = '\006' - CHECK_BIT_THOME(data->cv_configuration,id);
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
77 text[textPointer++] = ' ';
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
78 textPointer += snprintf(&text[textPointer], 60,
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
79 "%c%c\n\r",
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
80 TXT_2BYTE, customview_TXT2BYTE_helper(id));
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
81 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 }
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
83 text[textPointer++] = TXT_2BYTE;
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
84 text[textPointer++] = TXT2BYTE_ButtonNext;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 text[textPointer] = 0;
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;
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
92 }
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
93
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94 return StMSYS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 // surface mode
139
decb0461302a Get version from local memory instead from incoming data
Ideenmodellierer
parents: 138
diff changeset
98 getActualRTEandFONTversion(&RTEhigh,&RTElow,NULL,NULL);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 if((RTEhigh == 0xFF) || (RTElow == 0xFF))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 RTEhigh = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 RTElow = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 if((line == 0) || (line == 1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 translateDate(pStateReal->lifeData.dateBinaryFormat, &Sdate);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 translateTime(pStateReal->lifeData.timeBinaryFormat, &Stime);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 dateFormat = data->date_format;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 textPointer += snprintf(&text[textPointer], 40,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 "Date"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 "\016\016"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 " "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 if(dateFormat == DDMMYY)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 textPointer += snprintf(&text[textPointer], 40,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 "DDMMYY"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 "\t"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 "%02d-%02d-%02d"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 " "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 , Sdate.Date, Sdate.Month, 2000 + Sdate.Year
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 if(dateFormat == MMDDYY)
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 "MMDDYY"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 "\t"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 "%02d-%02d-%02d"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 " "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 ,Sdate.Month, Sdate.Date, 2000 + Sdate.Year
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 if(dateFormat == YYMMDD)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 textPointer += snprintf(&text[textPointer], 40,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 "YYMMDD"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 "\t"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 "%02d-%02d-%02d"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 " "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 , 2000 + Sdate.Year, Sdate.Month, Sdate.Date
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 textPointer += snprintf(&text[textPointer], 60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 "%02d:%02d:%02d"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 ,Stime.Hours, Stime.Minutes, Stime.Seconds
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 strcpy(&text[textPointer],"\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 textPointer += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 if((line == 0) || (line == 2))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 text[textPointer++] = TXT_Language;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 text[textPointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 text[textPointer++] = TXT_LanguageName;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 text[textPointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 text[textPointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 text[textPointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 strcpy(&text[textPointer],"\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 textPointer += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 if((line == 0) || (line == 3))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 text[textPointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 text[textPointer++] = TXT2BYTE_Layout;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 text[textPointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 if(!data->showDebugInfo)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 text[textPointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 if(data->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 text[textPointer++] = TXT2BYTE_Units_metric;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 text[textPointer++] = TXT2BYTE_Units_feet;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 if(data->tX_colorscheme != 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 text[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 text[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 text[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 text[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 text[textPointer++] = '\027';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 text[textPointer++] = '/';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 text[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 text[textPointer++] = '0' + data->tX_colorscheme;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 text[textPointer++] = '\020';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 if(data->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 text[textPointer++] = 'm';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 text[textPointer++] = '/';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 text[textPointer++] = 'C';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 text[textPointer++] = 'f';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 text[textPointer++] = 't';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 text[textPointer++] = '/';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 text[textPointer++] = 'F';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 text[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 text[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 text[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 text[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 text[textPointer++] = '\027';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 text[textPointer++] = '/';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 text[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 text[textPointer++] = '0' + data->tX_colorscheme;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 text[textPointer++] = '\020';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 text[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 text[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 text[textPointer++] = 'd';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 text[textPointer++] = 'e';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 text[textPointer++] = 'b';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 text[textPointer++] = 'u';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 text[textPointer++] = 'g';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 text[textPointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 text[textPointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 text[textPointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 strcpy(&text[textPointer],"\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 textPointer += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 if((line == 0) || (line == 4))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 text[textPointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 text[textPointer++] = TXT2BYTE_Customviews;//TXT2BYTE_ShowDebug;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 text[textPointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 text[textPointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 text[textPointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 if((line == 0) || (line == 5))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 text[textPointer++] = TXT_Information;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 text[textPointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 textPointer += snprintf(&text[textPointer],29,"RTE %u.%u OS %i.%i.%i"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 ,RTEhigh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 ,RTElow
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 ,firmwareDataGetPointer()->versionFirst
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 ,firmwareDataGetPointer()->versionSecond
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 ,firmwareDataGetPointer()->versionThird
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 strcpy(&text[textPointer],"\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 textPointer += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 if((line == 0) || (line == 6))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 text[textPointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 text[textPointer++] = TXT2BYTE_ResetMenu;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 text[textPointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 strcpy(&text[textPointer],"\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 textPointer += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 return StMSYS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 char customview_TXT2BYTE_helper(uint8_t customViewId)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 char text = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 switch(customViewId)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 case CVIEW_sensors:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 text = TXT2BYTE_O2monitor;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 case CVIEW_sensors_mV:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 text = TXT2BYTE_O2voltage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 case CVIEW_Compass:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 text = TXT2BYTE_Compass;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 case CVIEW_Decolist:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 text = TXT2BYTE_Decolist;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 case CVIEW_Tissues:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 text = TXT2BYTE_Tissues;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 case CVIEW_Profile:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 text = TXT2BYTE_Profile;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 case CVIEW_Gaslist:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 text = TXT2BYTE_Gaslist;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 case CVIEW_EADTime:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320 text = TXT2BYTE_Info;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322 case CVIEW_SummaryOfLeftCorner:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 text = TXT2BYTE_Summary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 case CVIEW_noneOrDebug:
379
0dbf550dc743 Added missing customerview selection
ideenmodellierer
parents: 210
diff changeset
326 text = TXT2BYTE_DispNoneDbg;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 return text;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 }