annotate Discovery/Src/t6_apnea.c @ 42:2d99d9290a22

Force reset in case of a hard fault
author Ideenmodellierer
date Sun, 29 Jul 2018 16:46:31 +0200
parents 5f11787b4f42
children cc9c18075e00
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/t6_apnea.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief dive screen for Gauge mode
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 1-Feb-2017
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 "t6_apnea.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 #include "data_exchange_main.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 #include "decom.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 #include "gfx_fonts.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 #include "math.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 #include "tHome.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 #include "simulation.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 #include "timer.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 #include "unit.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41 /* Private variables ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 GFX_DrawCfgScreen t6screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 GFX_DrawCfgWindow t6l1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 GFX_DrawCfgWindow t6r1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 GFX_DrawCfgWindow t6c1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 GFX_DrawCfgWindow t6c2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 GFX_DrawCfgWindow t6c3; // for menu text
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 extern float depthLastCall[9];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 extern uint8_t idDepthLastCall;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 extern float temperatureLastCall[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 extern uint8_t idTemperatureLastCall;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 uint8_t t6_selection_customview = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56 /* Importend function prototypes ---------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 extern uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 /* Private types -------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 #define CUSTOMBOX_LINE_LEFT (250)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 #define CUSTOMBOX_LINE_RIGHT (549)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 #define CUSTOMBOX_INSIDE_OFFSET (2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 #define CUSTOMBOX_OUTSIDE_OFFSET (2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 #define TEXTSIZE 16
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 const uint8_t t6_customviewsStandard[] =
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 CVIEW_noneOrDebug,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 CVIEW_T3_Temperature,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 CVIEW_T3_END
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 const uint8_t *t6_customviews = t6_customviewsStandard;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 const uint8_t t6_customviewSurfaceMode = CVIEW_T3_ApnoeSurfaceInfo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 /* Private function prototypes -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 void t6_refresh_divemode(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 void t6_refresh_customview(float depth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 uint8_t t6_test_customview_warnings(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 void t6_show_customview_warnings(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 void t6_compass(uint16_t ActualHeading, uint16_t UserSetHeading);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 // for tHomeDiveMenuControl() in tHome.c and t6_refresh_customview
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 uint8_t t6_getCustomView(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 if(stateUsed->lifeData.counterSecondsShallowDepth)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 return t6_customviewSurfaceMode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94 return t6_selection_customview;
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 void t6_init(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 t6_selection_customview = t6_customviewsStandard[0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 t6screen.FBStartAdress = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 t6screen.ImageHeight = 480;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 t6screen.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 t6screen.LayerIndex = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 t6l1.Image = &t6screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 t6l1.WindowNumberOfTextLines = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 t6l1.WindowLineSpacing = 19; // Abstand von Y0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 t6l1.WindowTab = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 t6l1.WindowX0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 t6l1.WindowX1 = BigFontSeperationLeftRight - 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 t6l1.WindowY0 = BigFontSeperationTopBottom + 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 t6l1.WindowY1 = 479;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 t6r1.Image = &t6screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 t6r1.WindowNumberOfTextLines = t6l1.WindowNumberOfTextLines;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 t6r1.WindowLineSpacing = t6l1.WindowLineSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 t6r1.WindowTab = t6l1.WindowTab;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 t6r1.WindowX0 = BigFontSeperationLeftRight + 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 t6r1.WindowX1 = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 t6r1.WindowY0 = t6l1.WindowY0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 t6r1.WindowY1 = t6l1.WindowY1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 t6c1.Image = &t6screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 t6c1.WindowNumberOfTextLines = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 t6c1.WindowLineSpacing = t6l1.WindowLineSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 t6c1.WindowX0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 t6c1.WindowX1 = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 t6c1.WindowY0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 t6c1.WindowY1 = BigFontSeperationTopBottom - 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 t6c2.Image = &t6screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 t6c2.WindowNumberOfTextLines = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 t6c2.WindowLineSpacing = 58;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 t6c2.WindowX0 = 370;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 t6c2.WindowX1 = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 t6c2.WindowY0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 t6c2.WindowY1 = BigFontSeperationTopBottom - 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 t6c2.WindowTab = 600;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 t6c3.Image = &t6screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 t6c3.WindowNumberOfTextLines = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 t6c3.WindowLineSpacing = 0; // Abstand von Y0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 t6c3.WindowTab = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 t6c3.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 t6c3.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 t6c3.WindowY0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 t6c3.WindowY1 = 69;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 void t6_refresh(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 static uint8_t last_mode = MODE_SURFACE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 SStateList status;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 get_globalStateList(&status);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 if(stateUsed->mode != MODE_DIVE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 last_mode = MODE_SURFACE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 settingsGetPointer()->design = 7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 if(t6screen.FBStartAdress)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 releaseFrame(24,t6screen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 t6screen.FBStartAdress = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 if(status.base != BaseHome)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 t6screen.FBStartAdress = getFrame(24);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 if(last_mode != MODE_DIVE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 last_mode = MODE_DIVE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 t6_selection_customview = *t6_customviews;
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(status.page == PageSurface)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 set_globalState(StD);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 t6_refresh_divemode();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 GFX_SetFramesTopBottom(t6screen.FBStartAdress, NULL,480);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 releaseAllFramesExcept(24,t6screen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 void t6_refresh_divemode(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 char text[512];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195 uint8_t customview_warnings = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 float depth_meter = 0.0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 // everything like lines, depth, ascent graph and divetime or counterSecondsShallowDepth
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 depth_meter = t3_basics_lines_depth_and_divetime(&t6screen, &t6l1, &t6r1, DIVEMODE_Apnea);
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 // customview
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 if(stateUsed->warnings.numWarnings)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 customview_warnings = t6_test_customview_warnings();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 if(customview_warnings && warning_count_high_time)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 t3_basics_show_customview_warnings(&t6c1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 t6_refresh_customview(depth_meter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 if(stateUsed->warnings.lowBattery)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 t3_basics_battery_low_customview_extra(&t6c1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 /* Menu Selection (and gas mix) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 if(get_globalState() == StDBEAR)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 snprintf(text,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveBearingQ);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 GFX_write_string_color(&FontT48,&t6c3,text,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 else if(get_globalState() == StDRAVG)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 snprintf(text,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveResetAvgQ);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 GFX_write_string_color(&FontT48,&t6c3,text,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 else if(get_globalState() == StDQUIT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 snprintf(text,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveQuitQ);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 GFX_write_string_color(&FontT48,&t6c3,text,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 else if(get_globalState() == StDSIM1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 snprintf(text,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveQuitQ);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 GFX_write_string_color(&FontT48,&t6c3,text,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 else if(get_globalState() == StDSIM2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 if(settingsGetPointer()->nonMetricalSystem)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 snprintf(text,TEXTSIZE,"\a\001" " Sim:-3.33ft ");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 snprintf(text,TEXTSIZE,"\a\001" " Sim:-1m ");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 GFX_write_string_color(&FontT48,&t6c3,text,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 snprintf(text,TEXTSIZE,"\a\f %u %c%c"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 , unit_depth_integer(simulation_get_aim_depth())
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 , unit_depth_char1()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 , unit_depth_char2()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 GFX_write_string_color(&FontT42,&t6l1,text,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 else if(get_globalState() == StDSIM3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 if(settingsGetPointer()->nonMetricalSystem)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 snprintf(text,TEXTSIZE,"\a\001" " Sim:+3.33ft ");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 snprintf(text,TEXTSIZE,"\a\001" " Sim:+1m ");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 GFX_write_string_color(&FontT48,&t6c3,text,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 snprintf(text,TEXTSIZE,"\a\f %u %c%c"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 , unit_depth_integer(simulation_get_aim_depth())
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 , unit_depth_char1()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 , unit_depth_char2()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 GFX_write_string_color(&FontT42,&t6l1,text,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 else if(get_globalState() == StDSIM4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 snprintf(text,TEXTSIZE,"\a\001" " Sim:+5' ");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 GFX_write_string_color(&FontT48,&t6c3,text,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 snprintf(text,TEXTSIZE,"\a\f %u %c%c"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 , unit_depth_integer(simulation_get_aim_depth())
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 , unit_depth_char1()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 , unit_depth_char2()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 GFX_write_string_color(&FontT42,&t6l1,text,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 // keep empty
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 void t6_battery_low_customview_extra(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 char TextC1[256];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 TextC1[0] = '\002';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 TextC1[1] = '\f';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 TextC1[2] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 TextC1[3] = '3';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 TextC1[4] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 TextC1[5] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 TextC1[6] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 TextC1[7] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 TextC1[8] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 TextC1[9] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 TextC1[10] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 TextC1[11] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 TextC1[12] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 TextC1[13] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 TextC1[14] = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 TextC1[15] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 if(!warning_count_high_time)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 TextC1[4] = '2';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 GFX_write_string(&Batt24,&t6c1,TextC1,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 void t6_battery_scooter_customview_extra(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 char TextC1[256];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 TextC1[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 TextC1[1] = '\f';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 TextC1[2] = '\032';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 TextC1[3] = '3';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 TextC1[4] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320 TextC1[5] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 TextC1[6] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322 TextC1[7] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 TextC1[8] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 TextC1[9] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 TextC1[10] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326 TextC1[11] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 TextC1[12] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 TextC1[13] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 TextC1[14] = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 TextC1[15] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 for(int i=1;i<=10;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 if( stateUsed_scooterRemainingBattCapacity() > (9 * i))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 TextC1[i+3] += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 if(stateUsed_scooterRemainingBattCapacity() < 10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 TextC1[2] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 if(!warning_count_high_time)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 TextC1[4] = '2';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 if(stateUsed->lifeData.scooterAgeInMilliSeconds > 1500)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 TextC1[2] = '\031';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347 GFX_write_string(&Batt24,&t6c1,TextC1,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 void t6_change_customview(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 t3_basics_change_customview(&t6_selection_customview, t6_customviews);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357 void t6_refresh_customview(float depth)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359 uint8_t customViewLeftSide = CVIEW_T3_MaxDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 if((t6_selection_customview == CVIEW_sensors) &&(stateUsed->diveSettings.ccrOption == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362 t6_change_customview();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 if(t6_getCustomView() == CVIEW_T3_ApnoeSurfaceInfo)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 customViewLeftSide = CVIEW_T3_ApnoeSurfaceInfo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 t3_basics_refresh_customview(depth, customViewLeftSide, &t6screen, &t6c1, &t6c2, DIVEMODE_Apnea);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368 t3_basics_refresh_apnoeRight(depth, t6_getCustomView(), &t6screen, &t6c1, &t6c2, DIVEMODE_Apnea);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372 uint8_t t6_test_customview_warnings(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374 uint8_t count = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376 count = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 return count;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382 char text[512];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383 uint16_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 // CVIEW_T3_Temperature
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387 float temperatureThisCall;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 float temperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391 // CVIEW_T3_StopWatch
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392 SDivetime Stopwatch = {0,0,0,0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 float fAverageDepth, fAverageDepthAbsolute;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 uint16_t tempWinX0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395 uint16_t tempWinY0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397 switch(t6_selection_customview)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 case CVIEW_T3_ApnoeTimes:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 case CVIEW_T3_StopWatch:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 Stopwatch.Total = timer_Stopwatch_GetTime();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 Stopwatch.Minutes = Stopwatch.Total / 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 Stopwatch.Seconds = Stopwatch.Total - ( Stopwatch.Minutes * 60 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406 fAverageDepth = timer_Stopwatch_GetAvarageDepth_Meter();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 fAverageDepthAbsolute = stateUsed->lifeData.average_depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409 snprintf(text,TEXTSIZE,"\032\f%c",TXT_AvgDepth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 GFX_write_string(&FontT42,&t6c1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 snprintf(text,TEXTSIZE,"\030\003\016%01.1f",fAverageDepthAbsolute);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412 GFX_write_string(&FontT105,&t6c1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414 tempWinX0 = t6c1.WindowX0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415 tempWinY0 = t6c1.WindowY0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 t6c1.WindowX0 = 480;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 // snprintf(text,TEXTSIZE,"\032\f%c%c - %c",TXT_2BYTE, TXT2BYTE_Clock, TXT_AvgDepth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 snprintf(text,TEXTSIZE,"\032\f%c", TXT_Stopwatch);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419 GFX_write_string(&FontT42,&t6c1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420 snprintf(text,TEXTSIZE,"\030\016%01.1f",fAverageDepth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 GFX_write_string(&FontT105,&t6c1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 t6c1.WindowY0 = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423 snprintf(text,TEXTSIZE,"\030%u:\016\016%02u",Stopwatch.Minutes, Stopwatch.Seconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 GFX_write_string(&FontT105,&t6c1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 t6c1.WindowX0 = tempWinX0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426 t6c1.WindowY0 = tempWinY0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429 case CVIEW_T3_Temperature:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Temperature);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431 GFX_write_string(&FontT42,&t6c1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432 // mean value
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 temperatureThisCall = unit_temperature_float(stateUsed->lifeData.temperature_celsius);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 temperature = (temperatureThisCall + temperatureLastCall[0] + temperatureLastCall[1] + temperatureLastCall[2]) / 4.0f;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435 idTemperatureLastCall++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436 if(idTemperatureLastCall >= 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437 idTemperatureLastCall = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438 temperatureLastCall[idTemperatureLastCall] = temperatureThisCall;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 textpointer = snprintf(text,TEXTSIZE,"\030\003\016%01.1f \140",temperature); // "\016\016%01.1f `" + C or F
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440 if(settingsGetPointer()->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 text[textpointer++] = 'C';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 text[textpointer++] = 'F';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 text[textpointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 GFX_write_string(&FontT105,&t6c1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 case CVIEW_Compass:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE, TXT2BYTE_Compass);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450 GFX_write_string(&FontT42,&t6c1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 snprintf(text,100,"\030\003%03i`",(uint16_t)stateUsed->lifeData.compass_heading);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452 GFX_write_string(&FontT105,&t6c1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453 t6_compass((uint16_t)stateUsed->lifeData.compass_heading, stateUsed->diveSettings.compassHeading);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456 case CVIEW_T3_MaxDepth:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458 snprintf(text,TEXTSIZE,"\032\f%c",TXT_MaxDepth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459 GFX_write_string(&FontT42,&t6c1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460 snprintf(text,TEXTSIZE,"\020\003\016%01.1f",unit_depth_float(stateUsed->lifeData.max_depth_meter));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461 t3_basics_colorscheme_mod(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462 GFX_write_string(&FontT105,&t6c1,text,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468 void t6_show_customview_warnings(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470 char text[256], textMain[256];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471 uint8_t textpointer, textpointerMain, lineFree, more;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473 snprintf(text,TEXTSIZE,"\025\f%c",TXT_Warning);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474 GFX_write_string(&FontT42,&t6c1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476 lineFree = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477 more = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 textpointerMain = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480 textMain[textpointerMain++] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481 textMain[textpointerMain++] = '\003';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 text[textpointer++] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487 text[textpointer++] = TXT2BYTE_WarnDecoMissed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488 if(stateUsed->warnings.decoMissed)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490 text[textpointer - 3] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491 if(lineFree)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493 textMain[textpointerMain++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494 textMain[textpointerMain++] = text[textpointer - 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495 textMain[textpointerMain] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496 lineFree--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500 more++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
501 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
503
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505 text[textpointer++] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507 text[textpointer++] = TXT2BYTE_WarnPPO2Low;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508 if(stateUsed->warnings.ppO2Low)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510 text[textpointer - 3] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511 if(lineFree)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
513 textMain[textpointerMain++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514 textMain[textpointerMain++] = text[textpointer - 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515 textMain[textpointerMain] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 lineFree--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520 more++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
522 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526 text[textpointer++] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528 text[textpointer++] = TXT2BYTE_WarnPPO2High;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 if(stateUsed->warnings.ppO2High)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 text[textpointer - 3] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532 if(lineFree)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534 textMain[textpointerMain++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 textMain[textpointerMain++] = text[textpointer - 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536 textMain[textpointerMain] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537 lineFree--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541 more++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546 text[textpointer++] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548 text[textpointer++] = TXT2BYTE_WarnFallback;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549 if(stateUsed->warnings.fallback)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551 text[textpointer - 3] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552 if(lineFree)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 textMain[textpointerMain++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555 textMain[textpointerMain++] = text[textpointer - 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556 textMain[textpointerMain] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557 lineFree--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561 more++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
564
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 text[textpointer++] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 text[textpointer++] = TXT2BYTE_WarnSensorLinkLost;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 if(stateUsed->warnings.sensorLinkLost)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572 text[textpointer - 3] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 if(lineFree)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575 textMain[textpointerMain++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576 textMain[textpointerMain++] = text[textpointer - 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577 textMain[textpointerMain] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 lineFree--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582 more++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587 GFX_write_string(&FontT48,&t6c1,textMain,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
588 if(more)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
589 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590 GFX_write_string(&FontT48,&t6c2,text,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
591 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
592 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
593
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595 void t6_change_customview(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597 const uint8_t *pViews;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598 pViews = t6_customviews;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600 while((*pViews != CVIEW_T3_END) && (*pViews != t6_selection_customview))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601 {pViews++;}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
603 if(*pViews < CVIEW_T3_END)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
604 pViews++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
606 if(*pViews == CVIEW_T3_END)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608 t6_selection_customview = t6_customviews[0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
610 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
611 t6_selection_customview = *pViews;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
612 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
613
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
614
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
615 void t3_basics_colorscheme_mod(char *text)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
616 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
617 if((text[0] == '\020') && !GFX_is_colorschemeDiveStandard())
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
618 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
619 text[0] = '\027';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
620 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
621 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
622
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
623 point_t t6_compass_circle(uint8_t id, uint16_t degree)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625 float fCos, fSin;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
626 const float piMult = ((2 * 3.14159) / 360);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
627 // const int radius[4] = {95,105,115,60};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628 const int radius[4] = {85,95,105,90};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
629 const point_t offset = {.x = 600, .y = 116};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631 static point_t r[4][360] = { 0 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633 if(r[0][0].y == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
635 for(int i=0;i<360;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637 fCos = cos(i * piMult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638 fSin = sin(i * piMult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639 for(int j=0;j<4;j++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
641 r[j][i].x = offset.x + (int)(fSin * radius[j]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 r[j][i].y = offset.y + (int)(fCos * radius[j]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646 if(id > 3) id = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
647 if(degree > 359) degree = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
648 return r[id][degree];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652 void t6_compass(uint16_t ActualHeading, uint16_t UserSetHeading)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
653 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 uint16_t LineHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
655 point_t center;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
656 static int32_t LastHeading = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
657 int32_t newHeading = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
658 int32_t diff = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
659 int32_t diff2 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
660
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
661 int32_t diffAbs = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
662 int32_t diffAbs2 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664 newHeading = ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
666 diff = newHeading - LastHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
667
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668 if(newHeading < LastHeading)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669 diff2 = newHeading + 360 - LastHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671 diff2 = newHeading - 360 - LastHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
673 diffAbs = diff;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
674 if(diffAbs < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
675 diffAbs *= -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
676
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
677 diffAbs2 = diff2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
678 if(diffAbs2 < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
679 diffAbs2 *= -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
680
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
681
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
682 if(diffAbs <= diffAbs2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
683 newHeading = LastHeading + (diff / 2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
684 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
685 newHeading = LastHeading + (diff2 / 2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
686
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
687 if(newHeading < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
688 newHeading += 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
689 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
690 if(newHeading >= 360)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
691 newHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
692
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
693 LastHeading = newHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
694 ActualHeading = newHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
695
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
696 if (ActualHeading < 90)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
697 ActualHeading += 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
698
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
699 while(ActualHeading > 359) ActualHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
700
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701 LineHeading = 360 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
702 GFX_draw_thick_line(9,&t6screen, t6_compass_circle(0,LineHeading), t6_compass_circle(2,LineHeading), CLUT_Font030); // North
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703 LineHeading += 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
704 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705 GFX_draw_thick_line(9,&t6screen, t6_compass_circle(1,LineHeading), t6_compass_circle(2,LineHeading), CLUT_Font031); // Maintick
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
706 LineHeading += 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
707 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
708 GFX_draw_thick_line(9,&t6screen, t6_compass_circle(1,LineHeading), t6_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
709 LineHeading += 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
710 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
711 GFX_draw_thick_line(9,&t6screen, t6_compass_circle(1,LineHeading), t6_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
712
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
713 LineHeading = 360 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
714 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
715 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716 GFX_draw_thick_line(5,&t6screen, t6_compass_circle(1,LineHeading), t6_compass_circle(2,LineHeading), CLUT_Font031); // Subtick
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717 LineHeading += 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
718 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
719 GFX_draw_thick_line(5,&t6screen, t6_compass_circle(1,LineHeading), t6_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
720 LineHeading += 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
721 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
722 GFX_draw_thick_line(5,&t6screen, t6_compass_circle(1,LineHeading), t6_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
723 LineHeading += 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
724 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
725 GFX_draw_thick_line(5,&t6screen, t6_compass_circle(1,LineHeading), t6_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
727 LineHeading = 360 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728 LineHeading += 22;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730 GFX_draw_thick_line(3,&t6screen, t6_compass_circle(1,LineHeading), t6_compass_circle(2,LineHeading), CLUT_Font031); // Subtick
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733 GFX_draw_thick_line(3,&t6screen, t6_compass_circle(1,LineHeading), t6_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736 GFX_draw_thick_line(3,&t6screen, t6_compass_circle(1,LineHeading), t6_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739 GFX_draw_thick_line(3,&t6screen, t6_compass_circle(1,LineHeading), t6_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742 GFX_draw_thick_line(3,&t6screen, t6_compass_circle(1,LineHeading), t6_compass_circle(2,LineHeading), CLUT_Font031); // Subtick
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745 GFX_draw_thick_line(3,&t6screen, t6_compass_circle(1,LineHeading), t6_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748 GFX_draw_thick_line(3,&t6screen, t6_compass_circle(1,LineHeading), t6_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751 GFX_draw_thick_line(3,&t6screen, t6_compass_circle(1,LineHeading), t6_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753 if(UserSetHeading)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755 LineHeading = UserSetHeading + 360 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
756 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
757 GFX_draw_thick_line(9,&t6screen, t6_compass_circle(3,LineHeading), t6_compass_circle(2,LineHeading), CLUT_CompassUserHeadingTick);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
758
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
759 // R�ckpeilung, User Back Heading
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
760 LineHeading = UserSetHeading + 360 + 180 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
761 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
762 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
763 GFX_draw_thick_line(9,&t6screen, t6_compass_circle(3,LineHeading), t6_compass_circle(2,LineHeading), CLUT_CompassUserBackHeadingTick);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
764 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
765
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766 center.x = 600;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
767 center.y = 116;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
768 GFX_draw_circle(&t6screen, center, 106, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
769 GFX_draw_circle(&t6screen, center, 107, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
770 GFX_draw_circle(&t6screen, center, 108, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
771 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
772 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
773