Mercurial > public > ostc4
annotate Discovery/Src/tMenuXtra.c @ 563:d97f0e395058
Refine o2 sensor diagnostic functions:
Changed implementation to ignore connection errors if analog interface is selected. Because the HUD is using cBars, the code has been modified to be compatible with the Bar units provided by the analog interface. Behavior (outofbounds) should be identical to the previous implementation.
author | Ideenmodellierer |
---|---|
date | Sun, 15 Nov 2020 20:01:56 +0100 |
parents | 12f8745c8a94 |
children | 1b243c6c7067 |
rev | line source |
---|---|
38 | 1 /////////////////////////////////////////////////////////////////////////////// |
2 /// -*- coding: UTF-8 -*- | |
3 /// | |
4 /// \file Discovery/Src/tMenuXtra.c | |
5 /// \brief Menu Xtra - Specials in Divemode like Reset Stopwatch | |
6 /// \author heinrichs weikamp gmbh | |
7 /// \date 02-Mar-2015 | |
8 /// | |
9 /// \details | |
10 /// | |
11 /// $Id$ | |
12 /////////////////////////////////////////////////////////////////////////////// | |
13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh | |
14 /// | |
15 /// This program is free software: you can redistribute it and/or modify | |
16 /// it under the terms of the GNU General Public License as published by | |
17 /// the Free Software Foundation, either version 3 of the License, or | |
18 /// (at your option) any later version. | |
19 /// | |
20 /// This program is distributed in the hope that it will be useful, | |
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
23 /// GNU General Public License for more details. | |
24 /// | |
25 /// You should have received a copy of the GNU General Public License | |
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
27 ////////////////////////////////////////////////////////////////////////////// | |
28 | |
29 /* Includes ------------------------------------------------------------------*/ | |
30 #include <stdio.h> | |
31 #include <string.h> | |
32 #include "tMenu.h" | |
33 #include "tStructure.h" | |
34 #include "tMenuXtra.h" | |
35 #include "text_multilanguage.h" | |
36 #include "data_central.h" | |
37 #include "simulation.h" | |
38 | |
39 /* Exported functions --------------------------------------------------------*/ | |
40 | |
41 uint32_t tMXtra_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext) | |
42 { | |
43 uint8_t textPointer; | |
44 | |
45 textPointer = 0; | |
46 *tab = 500; | |
47 *subtext = 0; | |
48 | |
49 if((line == 0) || (line == 1)) | |
50 { | |
51 text[textPointer++] = TXT_2BYTE; | |
52 text[textPointer++] = TXT2BYTE_ResetStopwatch; | |
53 } | |
54 strcpy(&text[textPointer],"\n\r"); | |
55 textPointer += 2; | |
56 /* | |
57 if((line == 0) || (line == 2)) | |
58 { | |
59 text[textPointer++] = TXT_2BYTE; | |
60 text[textPointer++] = TXT2BYTE_ResetAvgDepth; | |
61 } | |
62 strcpy(&text[textPointer],"\n\r"); | |
63 textPointer += 2; | |
64 */ | |
65 if((line == 0) || (line == 2)) | |
66 { | |
67 text[textPointer++] = TXT_2BYTE; | |
68 text[textPointer++] = TXT2BYTE_CompassHeading; | |
69 } | |
70 strcpy(&text[textPointer],"\n\r"); | |
71 textPointer += 2; | |
72 | |
73 if((line == 0) || (line == 3)) | |
74 { | |
75 text[textPointer++] = TXT_2BYTE; | |
76 text[textPointer++] = TXT2BYTE_SetMarker; | |
77 } | |
78 strcpy(&text[textPointer],"\n\r"); | |
79 textPointer += 2; | |
80 | |
547 | 81 if((line == 0) || (line == 4)) |
82 { | |
83 text[textPointer++] = TXT_2BYTE; | |
84 text[textPointer++] = TXT2BYTE_CalibView; | |
85 } | |
86 strcpy(&text[textPointer],"\n\r"); | |
87 textPointer += 2; | |
88 | |
38 | 89 if(is_stateUsedSetToSim()) |
90 { | |
547 | 91 if((line == 0) || (line == 5)) |
38 | 92 { |
93 text[textPointer++] = TXT_2BYTE; | |
94 text[textPointer++] = TXT2BYTE_SimFollowDecoStops; | |
95 text[textPointer++] = ' '; | |
96 text[textPointer++] = ' '; | |
97 if(simulation_get_heed_decostops()) | |
98 text[textPointer++] = '\005'; | |
99 else | |
100 text[textPointer++] = '\006'; | |
101 } | |
102 strcpy(&text[textPointer],"\n\r"); | |
103 textPointer += 2; | |
104 } | |
347
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
105 else |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
106 { |
547 | 107 if((line == 0) || (line == 5)) /* end dive mode only used during real dives */ |
347
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
108 { |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
109 text[textPointer++] = TXT_2BYTE; |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
110 text[textPointer++] = TXT2BYTE_EndDiveMode; |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
111 } |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
112 strcpy(&text[textPointer],"\n\r"); |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
113 textPointer += 2; |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
114 } |
38 | 115 |
116 return StMXTRA; | |
117 } | |
118 |