annotate Discovery/Src/tMenu.c @ 118:ee7f2cd9b9b4 FlipDisplay

Enlarge text limits to get string displayed completly
author Ideenmodellierer
date Sun, 06 Jan 2019 22:31:45 +0100
parents cc8e24374b83
children 871baf20776b
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/tMenu.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief Major menu with extra page 0 for edit functionality since V0.0.2
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 30-April-2014
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 /// \details
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 /// $Id$
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 /// This program is free software: you can redistribute it and/or modify
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 /// it under the terms of the GNU General Public License as published by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 /// the Free Software Foundation, either version 3 of the License, or
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 /// (at your option) any later version.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 /// This program is distributed in the hope that it will be useful,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 /// GNU General Public License for more details.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 /// You should have received a copy of the GNU General Public License
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 //////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 #include "tMenu.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 #include "gfx_fonts.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 #include "tHome.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 #include "tMenuDeco.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 #include "tMenuDecoParameter.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 #include "tMenuEditDeco.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 #include "tMenuEditDecoParameter.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 #include "tMenuEditGasOC.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 #include "tMenuEditHardware.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 #include "tMenuEditPlanner.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41 #include "tMenuEditSetpoint.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 #include "tMenuEditSystem.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 #include "tMenuEditXtra.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 #include "tMenuGas.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 #include "tMenuHardware.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 #include "tMenuPlanner.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 #include "tMenuSetpoint.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 #include "tMenuSystem.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 #include "tMenuXtra.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 /* Private types -------------------------------------------------------------*/
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
52 #define MAXPAGES 10
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
53 #define CURSOR_HIGH 25
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
54 #define TAB_HEADER_HIGH 25
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
55 #define TAB_BAR_HIGH 5
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
56 #define MENU_WDW_HIGH 390
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
57 #define KEY_LABEL_HIGH 25 /* Height of the label used for the the user keys */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 uint32_t StartAddressForPage[MAXPAGES+1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 uint8_t lineMemoryForNavigationForPage[MAXPAGES+1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 uint8_t pageMemoryForNavigation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 uint8_t linesAvailableForPage[MAXPAGES+1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 uint8_t pagesAvailable;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 uint8_t pageCountNumber[MAXPAGES+1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 uint8_t pageCountTotal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 uint8_t modeFlipPages;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 } SMenuMemory;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 /* Exported variables --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 /* Announced Private variables -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 GFX_DrawCfgScreen tMdesignSolo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 GFX_DrawCfgScreen tMdesignCursor;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 /* Private variables ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 GFX_DrawCfgWindow tMwindow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 GFX_DrawCfgScreen tMscreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 uint32_t FramebufferStartAddressForPage[10];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 SMenuMemory menu;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 uint32_t callerID;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 uint8_t actual_menu_content = MENU_UNDEFINED;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 /* TEM HAS TO MOVE TO GLOBAL--------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 /* Private function prototypes -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 void draw_tMheader(uint8_t page);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 void draw_tMcursorDesign(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 void draw_tMdesignSubUnselected(uint32_t *ppDestination);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 void draw_tMdesignSubSelected(uint32_t *ppDestination);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 void draw_tMdesignSubSelectedBorder(uint32_t *ppDestination);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 void tMenu_write(uint8_t page, char *text, char *subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 void clean_line_actual_page(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 void tM_build_pages(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 void gotoMenuEdit(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 GFX_DrawCfgScreen * get_PointerMenuCursorScreen(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 return &tMdesignCursor;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 GFX_DrawCfgScreen * get_PointerMenuCursorDesignSoloScreen(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 return &tMdesignSolo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 void nextline(char * text, uint8_t *textPointer)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 text[(*textPointer)++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 text[(*textPointer)++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 text[*textPointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 void tM_init(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 uint8_t i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
131 SSettings* pSettings;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
132 pSettings = settingsGetPointer();
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
133
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 tMdesignCursor.FBStartAdress = getFrame(3);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 tMdesignCursor.ImageHeight = 390;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 tMdesignCursor.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 tMdesignCursor.LayerIndex = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 tMdesignSolo.FBStartAdress = getFrame(4);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 tMdesignSolo.ImageHeight = 390;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 tMdesignSolo.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 tMdesignSolo.LayerIndex = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 menu.pagesAvailable = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 menu.pageMemoryForNavigation = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 for(i=0;i<=MAXPAGES;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 menu.lineMemoryForNavigationForPage[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 menu.StartAddressForPage[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 menu.linesAvailableForPage[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 tMscreen.FBStartAdress = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 tMscreen.ImageHeight = 480;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 tMscreen.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 tMscreen.LayerIndex = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 draw_tMcursorDesign();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 tMwindow.Image = &tMscreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 tMwindow.WindowNumberOfTextLines = 6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 tMwindow.WindowLineSpacing = 65;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 tMwindow.WindowTab = 400;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 tMwindow.WindowX0 = 20;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 tMwindow.WindowX1 = 779;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
167 if(!pSettings->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
168 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
169 tMwindow.WindowY0 = 4 + KEY_LABEL_HIGH;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
170 tMwindow.WindowY1 = 390 + KEY_LABEL_HIGH;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
171 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
172 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
173 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
174 tMwindow.WindowY0 = 480 - MENU_WDW_HIGH - TAB_HEADER_HIGH;// - TAB_BAR_HIGH;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
175 tMwindow.WindowY1 = 480 - TAB_HEADER_HIGH - TAB_BAR_HIGH;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
176 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 actual_menu_content = MENU_UNDEFINED;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 void tM_refresh(char *text, uint8_t *textPointer, uint8_t line, const char content[6])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 for(uint8_t i=0; i<6; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 if(((line == 0) || (line == i)) && content[i])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 text[(*textPointer)++] = content[i];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 text[(*textPointer)++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 text[(*textPointer)++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 text[*textPointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195 void tM_rebuild_pages(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 menu.pagesAvailable = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 // menu.pageMemoryForNavigation = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 for(int i=0;i<=MAXPAGES;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 menu.lineMemoryForNavigationForPage[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 menu.linesAvailableForPage[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 menu.StartAddressForPage[i] = 0; // only with GFX_forceReleaseFramesWithId(5); !!!!!
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 GFX_forceReleaseFramesWithId(5);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 tM_build_pages();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 void tM_rebuild_menu_after_tComm(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 tM_rebuild_pages();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
215 void tM_check_content(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 uint8_t mode = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 if(stateUsed->mode == MODE_DIVE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 if(stateUsed == stateRealGetPointer())
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 mode = MENU_DIVE_REAL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 mode = MENU_DIVE_SIM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 mode = MENU_SURFACE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 if(actual_menu_content != mode)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 actual_menu_content = mode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 tM_rebuild_pages();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 void clean_line_actual_page(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 uint8_t line, page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 page = menu.pageMemoryForNavigation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 line = menu.lineMemoryForNavigationForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 tMscreen.FBStartAdress = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 GFX_clean_line(&tMwindow, line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 void update_content_actual_page(char *text, uint16_t tab, char *subtext)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 uint8_t page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 page = menu.pageMemoryForNavigation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 tMscreen.FBStartAdress = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 if(tab == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 tMwindow.WindowTab = 400;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 tMwindow.WindowTab = tab;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 tMenu_write(page, text, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 void clean_line(uint8_t page, uint8_t line)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 tMscreen.FBStartAdress = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 GFX_clean_line(&tMwindow, line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 void update_content_with_new_frame(uint8_t page, char *text, uint16_t tab, char *subtext)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 char localtext[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 uint32_t rememberPage = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 menu.StartAddressForPage[page] = getFrame(5);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 tMscreen.FBStartAdress = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 if(tab == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 tMwindow.WindowTab = 400;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 tMwindow.WindowTab = tab;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 draw_tMheader(page);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 tMenu_write(page, text, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 localtext[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 localtext[1] = TXT2BYTE_ButtonBack;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 localtext[2] = 0;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
290 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 localtext[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 localtext[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 localtext[2] = TXT2BYTE_ButtonEnter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 localtext[3] = 0;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
296 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 localtext[0] = '\002';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 localtext[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 localtext[2] = TXT2BYTE_ButtonNext;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 localtext[3] = 0;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
302 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 // gfx_write_page_number(&tMscreen ,menu.pageCountNumber[page],menu.pageCountTotal,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 if(page == menu.pageMemoryForNavigation)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 GFX_SetFrameTop(tMscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 releaseFrame(5,rememberPage);
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 update_content(uint8_t page, char *text, uint16_t tab, char *subtext)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 tMscreen.FBStartAdress = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 if(tab == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 tMwindow.WindowTab = 400;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 tMwindow.WindowTab = tab;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 tMenu_write(page, text, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 void tM_create_pagenumbering(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 menu.pageCountTotal = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 for(int i=0;i<=MAXPAGES;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 if(menu.pageCountNumber[i])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 menu.pageCountTotal++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 menu.pageCountNumber[i] = menu.pageCountTotal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 }
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 void tM_build_page(uint32_t id, char *text, uint16_t tab, char *subtext)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340 uint8_t linesFound;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 uint16_t i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 SStateList idList;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 uint8_t page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 char localtext[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347 if(menu.pagesAvailable > MAXPAGES)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350 get_idSpecificStateList(id, &idList);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 if(idList.base != BaseMenu)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 if(idList.page == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 if(idList.page > MAXPAGES)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 page = idList.page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363 if(!menu.pageCountNumber[page])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 if(menu.pagesAvailable == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 tM_create_pagenumbering();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369 if(*text == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372 linesFound = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374 if(menu.StartAddressForPage[page])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375 releaseFrame(5,menu.StartAddressForPage[page]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 menu.StartAddressForPage[page] = getFrame(5);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379 if(menu.StartAddressForPage[page] == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382 i = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383 while((i < MAX_PAGE_TEXTSIZE) && text[i])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385 if((text[i] == '\n') && ((i + 2) < MAX_PAGE_TEXTSIZE) && text[i+1] && text[i+2])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 linesFound += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387 i++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390 menu.linesAvailableForPage[page] = linesFound;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391 menu.pagesAvailable++; /* even if it was used before */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 tMscreen.FBStartAdress = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 if(tab == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395 tMwindow.WindowTab = 400;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397 tMwindow.WindowTab = tab;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 draw_tMheader(page);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 tMenu_write(page, text, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 localtext[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 localtext[1] = TXT2BYTE_ButtonBack;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 localtext[2] = 0;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
406 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 localtext[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409 localtext[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 localtext[2] = TXT2BYTE_ButtonEnter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 localtext[3] = 0;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
412 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414 localtext[0] = '\002';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415 localtext[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 localtext[2] = TXT2BYTE_ButtonNext;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 localtext[3] = 0;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
418 write_content_simple(&tMscreen, 0, 800, 480-KEY_LABEL_HIGH, &FontT24,localtext,CLUT_ButtonSurfaceScreen);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 _Bool skipCCRpage(uint8_t page)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 if(menu.ccrOnlyContentForPage[page])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426 if(actual_menu_content == MENU_SURFACE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 SSettings *data = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429 if((data->dive_mode != DIVEMODE_CCR) && data->hideCCRinOCmode)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 return 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 return 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437 void findValidPosition(uint8_t *pageOuput, uint8_t *lineOutput)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438 {
51
8f8ea3a32e82 Resolved warnings pointing to possible invalid memory access
Ideenmodellierer
parents: 38
diff changeset
439 uint8_t page = 0;
8f8ea3a32e82 Resolved warnings pointing to possible invalid memory access
Ideenmodellierer
parents: 38
diff changeset
440 uint8_t line = 0;
8f8ea3a32e82 Resolved warnings pointing to possible invalid memory access
Ideenmodellierer
parents: 38
diff changeset
441 uint8_t first = 0;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 *pageOuput = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 *lineOutput = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 /* test */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447 if(menu.pagesAvailable == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450 for(int i=1;i<=MAXPAGES;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452 if((menu.pageCountNumber[i] != 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453 && (menu.linesAvailableForPage[i] != 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 && (menu.StartAddressForPage[i] != 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456 first = i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461 /* select */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462 if(menu.pageMemoryForNavigation > MAXPAGES)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463 menu.pageMemoryForNavigation = first;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465 page = menu.pageMemoryForNavigation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 if(page == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468 page = first;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470 while((page <= MAXPAGES) && ((menu.linesAvailableForPage[page] == 0) || (menu.StartAddressForPage[page] == 0) || (menu.pageCountNumber[page] == 0)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471 page += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473 if(page > MAXPAGES)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474 page = first;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476 line = menu.lineMemoryForNavigationForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478 if(line == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 line = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481 if(line > menu.linesAvailableForPage[page])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482 line = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484 *pageOuput = page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 *lineOutput = line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489 void tM_insert_page_numbers(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491 uint8_t page, line, pageMemoryBackup, pageFirst, total;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492 GFX_DrawCfgScreen tTscreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494 tTscreen.FBStartAdress = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495 tTscreen.ImageHeight = 480;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496 tTscreen.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497 tTscreen.LayerIndex = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 pageMemoryBackup = menu.pageMemoryForNavigation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
501 menu.pageMemoryForNavigation = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502 findValidPosition(&page, &line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
503 pageFirst = page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504 total = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 do
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508 total++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509 menu.pageMemoryForNavigation += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510 findValidPosition(&page, &line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 while((pageFirst != page) && (total < MAXPAGES));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
513
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514 menu.pageCountTotal = total;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515 menu.pageMemoryForNavigation = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 for(int i = 1; i<= total; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518 menu.pageMemoryForNavigation += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519 findValidPosition(&page, &line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520 tTscreen.FBStartAdress = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521 menu.pageCountNumber[page] = i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
522 gfx_write_page_number(&tTscreen ,i,total,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525 menu.pageMemoryForNavigation = pageMemoryBackup;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 void tM_add(uint32_t id)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 SStateList idList;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532 uint8_t page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534 get_idSpecificStateList(id, &idList);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536 page = idList.page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538 if(page > MAXPAGES)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541 menu.pageCountNumber[page] = 1;
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 void tM_build_pages(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 char text[MAX_PAGE_TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548 char subtext[MAX_PAGE_TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549 uint32_t id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 uint16_t tabPosition;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553 menu.pagesAvailable = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 for(int i=0;i<=MAXPAGES;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555 menu.pageCountNumber[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557 tabPosition = 400;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558 *text = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559 *subtext = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561 /* 2015 Feb 02, hw
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562 * max 8 Menu Pages
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566 tM_add(StMSYS); //now in both modes
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 if(actual_menu_content == MENU_SURFACE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 tM_add(StMDECO);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 tM_add(StMHARD);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 // tM_add(StMSYS); now in both modes
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575 tM_add(StMXTRA);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577 if(actual_menu_content == MENU_SURFACE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579 tM_add(StMPLAN);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581 // if((pSettings->dive_mode != DIVEMODE_Gauge) && (pSettings->dive_mode != DIVEMODE_Apnea))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582 // {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583 tM_add(StMOG);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 tM_add(StMDECOP);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585 // }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 if((pSettings->dive_mode == DIVEMODE_CCR) || (stateUsed->diveSettings.ccrOption == 1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
588 tM_add(StMCG);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
589 tM_add(StMSP);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
591
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
592 id = tMOG_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
593 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595 id = tMCG_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598 id = tMSP_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601 id = tMXtra_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
603
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
604 id = tMPlanner_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
606
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607 id = tMDeco_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
610 id = tMDecoParameters_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
611 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
612
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
613 id = tMPlanner_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
614 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
615
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
616 id = tMHardware_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
617 tM_build_page(id, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
618
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
619 id = tMSystem_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
620 tM_build_page(id, text, tabPosition, subtext);
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624 void tM_refresh_live_content(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625 {
51
8f8ea3a32e82 Resolved warnings pointing to possible invalid memory access
Ideenmodellierer
parents: 38
diff changeset
626 uint8_t page = 0;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
627 char text[MAX_PAGE_TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628 char subtext[MAX_PAGE_TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
629 uint16_t tabPosition;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631 // if(menu.modeFlipPages == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632 // return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634 if((get_globalState() == StMSYS) && (actual_menu_content == MENU_SURFACE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
635 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 page = menu.pageMemoryForNavigation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637 tMSystem_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
641 if(get_globalState() == StMHARD)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643 page = menu.pageMemoryForNavigation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644 tMHardware_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
647
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
648 tMscreen.FBStartAdress = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649 tHome_show_lost_connection_count(&tMscreen);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651 SStateList idList;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652 if(actual_menu_content == MENU_SURFACE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
653 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 page = menu.pageMemoryForNavigation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
655 get_idSpecificStateList(StMSYS, &idList);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
656 if(page == idList.page)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
657 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
658 tMSystem_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
659 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
660 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
661 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
662 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
666 /* new frame only! */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
667 void updateSpecificMenu(uint32_t id)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669 uint8_t page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670 SStateList idList;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672 char text[MAX_PAGE_TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
673 char subtext[MAX_PAGE_TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
674 uint16_t tabPosition;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
675
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
676 *subtext = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
677 *text = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
678 tabPosition = 400;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
679
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
680 get_idSpecificStateList(id, &idList);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
681 page = idList.page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
682
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
683 switch(id)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
684 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
685 case StMOG:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
686 tMOG_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
687 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
688 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
689 case StMCG:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
690 tMCG_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
691 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
692 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
693 case StMSP:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
694 tMSP_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
695 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
696 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
697 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
698 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
699 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
700 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
702
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703 void updateMenu(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
704 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705 uint8_t page, line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
706
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
707 char text[MAX_PAGE_TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
708 char subtext[MAX_PAGE_TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
709 uint16_t tabPosition;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
710
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
711 *subtext = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
712 *text = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
713 tabPosition = 400;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
714
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
715 page = menu.pageMemoryForNavigation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716 line = menu.lineMemoryForNavigationForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
718 switch(get_globalState())
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
719 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
720 case StMOG:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
721 tMOG_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
722 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
723 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
724 case StMCG:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
725 tMCG_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
727 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728 case StMSP:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729 tMSP_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732 case StMXTRA:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733 tMXtra_refresh(0, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734 update_content_with_new_frame(page, text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736 case StMDECO:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737 if((line == 1) || (line == 3)) // dive mode or ppO2 limits (the later for correct MOD in gaslists)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739 tM_rebuild_pages();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740 menu.lineMemoryForNavigationForPage[page] = line; // fix 160623
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741 GFX_SetFrameTop(menu.StartAddressForPage[page]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745 tMDeco_refresh(line, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 clean_line_actual_page();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747 update_content_actual_page(text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750 case StMDECOP:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751 tMDecoParameters_refresh(line, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752 clean_line_actual_page();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753 update_content_actual_page(text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755 case StMPLAN:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
756 tMPlanner_refresh(line, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
757 clean_line_actual_page();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
758 update_content_actual_page(text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
759 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
760 case StMHARD:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
761 tMHardware_refresh(line, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
762 clean_line_actual_page();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
763 update_content_actual_page(text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
764 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
765 case StMSYS:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766 if((line == 2) || (line == 3) || (line == 6))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
767 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
768 tM_rebuild_pages();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
769 menu.lineMemoryForNavigationForPage[page] = line; // fix 160623
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
770 GFX_SetFrameTop(menu.StartAddressForPage[page]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
771 menu.lineMemoryForNavigationForPage[page] = line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
772 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
773 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
774 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
775 tMSystem_refresh(line, text, &tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
776 clean_line_actual_page();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
777 update_content_actual_page(text, tabPosition, subtext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
778 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
779 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
780 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
781 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
782 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
783 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
784
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
785 void openMenu_first_page_with_OC_gas_update(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
786 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
787 menu.pageMemoryForNavigation = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
788 for(int i=0;i<=MAXPAGES;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
789 menu.lineMemoryForNavigationForPage[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
790
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
791 set_globalState(StMOG);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
792 updateMenu();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
793 openMenu(1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
794 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
795
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
796
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
797 void openMenu(uint8_t freshWithFlipPages)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
798 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
799 uint8_t page, line;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
800 SSettings* pSettings;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
801 pSettings = settingsGetPointer();
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
802
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
803 callerID = get_globalState();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
804
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
805 findValidPosition(&page, &line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
806 if((page == 0) || (line == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
807 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
808
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
809 menu.pageMemoryForNavigation = page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
810 /* new test for 3button design */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
811 if(freshWithFlipPages)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
812 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
813 menu.lineMemoryForNavigationForPage[page] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
814 menu.modeFlipPages = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
815 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
816 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
817 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
818 menu.lineMemoryForNavigationForPage[page] = line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
819 menu.modeFlipPages = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
820 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
821
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
822 set_globalState_Menu_Page(page);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
823
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
824
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
825 change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 1));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
826 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 1));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
827
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
828
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
829 if(((page == 6) || (page == 8)) && (menu.pageCountNumber[page-1] == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
830 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
831 change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 2));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
832 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 2));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
833
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
834 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
835
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
836 GFX_SetFrameTop(menu.StartAddressForPage[page]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
837 /* new test for 3button design */
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
838
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
839 if(!pSettings->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
840 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
841 if(freshWithFlipPages)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
842 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 25, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
843 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
844 GFX_SetFrameBottom((tMdesignCursor.FBStartAdress) + 65*2*(line - 1), 0, 25, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
845 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
846 else
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
847 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
848 if(freshWithFlipPages)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
849 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
850 GFX_SetFrameBottom((tMdesignSolo.FBStartAdress), 0, 480-390-KEY_LABEL_HIGH, 800, 390); //- (25 * 2 * 800), 0, 25, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
851 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
852 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
853 GFX_SetFrameBottom((tMdesignCursor.FBStartAdress + (390 - 65 *(line)) *2), 0,480-390-KEY_LABEL_HIGH, 800, 390); //480-390-KEY_LABEL_HIGH + 65*2*(line - 1)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
854 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
855
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
856 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
857
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
858 void block_diluent_handler(_Bool Unblock)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
859 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
860 SStateList list;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
861 static uint8_t linesAvailableForPageDiluent = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
862 get_idSpecificStateList(StMCG, &list);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
863
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
864 if(Unblock && linesAvailableForPageDiluent)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
865 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
866 menu.linesAvailableForPage[list.page] = linesAvailableForPageDiluent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
867 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
868 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
869 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
870 linesAvailableForPageDiluent = menu.linesAvailableForPage[list.page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
871 menu.linesAvailableForPage[list.page] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
872 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
873 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
874
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
875 void block_diluent_page(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
876 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
877 block_diluent_handler(0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
878 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
879
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
880
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
881 void unblock_diluent_page(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
882 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
883 block_diluent_handler(1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
884 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
885
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
886
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
887 void nextPage(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
888 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
889 uint8_t page, line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
890
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
891 SSettings* pSettings;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
892 pSettings = settingsGetPointer();
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
893
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
894 menu.pageMemoryForNavigation += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
895
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
896 findValidPosition(&page, &line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
897 menu.pageMemoryForNavigation = page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
898 /* new test for 3button design */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
899 //menu.lineMemoryForNavigationForPage[page] = line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
900 menu.lineMemoryForNavigationForPage[page] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
901 menu.modeFlipPages = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
902
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
903 set_globalState_Menu_Page(page);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
904
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
905 change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 1));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
906 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 1));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
907
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
908 GFX_SetFrameTop(menu.StartAddressForPage[page]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
909 /* new test for 3button design */
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
910 //GFX_SetFrameBottom((.FBStartAdress) + 65*2*(line - 1), 0, 25, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
911 if(!pSettings->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
912 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
913 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 25, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
914 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
915 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
916 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
917 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 65, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
918 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
919 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
920
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
921
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
922 void nextLine(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
923 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
924 uint8_t page, line;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
925 SSettings* pSettings;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
926 pSettings = settingsGetPointer();
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
927
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
928 page = menu.pageMemoryForNavigation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
929 menu.lineMemoryForNavigationForPage[page] += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
930
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
931 findValidPosition(&page, &line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
932 menu.lineMemoryForNavigationForPage[page] = line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
933
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
934 /* new test for 3button design */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
935 menu.modeFlipPages = 0;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
936 if(!pSettings->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
937 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
938 GFX_SetFrameBottom((tMdesignCursor.FBStartAdress) + 65*2*(line - 1), 0, 25, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
939 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
940 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
941 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
942 GFX_SetFrameBottom((tMdesignCursor.FBStartAdress)+ (390 - 65 *(line)) *2, 0, 480-390-KEY_LABEL_HIGH, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
943 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
944 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
945
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
946
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
947 void stepBackMenu(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
948 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
949 if(menu.modeFlipPages == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
950 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
951 menu.lineMemoryForNavigationForPage[menu.pageMemoryForNavigation] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
952 menu.modeFlipPages = 1;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
953 if(!settingsGetPointer()->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
954 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
955 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 25, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
956 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
957 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
958 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
959 GFX_SetFrameBottom(tMdesignSolo.FBStartAdress, 0, 480-390-KEY_LABEL_HIGH, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
960 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
961 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
962 else
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
963 {
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
964 exitMenu();
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
965 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
966 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
967
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
968
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
969 void exitMenu(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
970 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
971 set_globalState_tHome();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
972 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
973
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
974
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
975 void stepForwardMenu(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
976 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
977 if(menu.modeFlipPages == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
978 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
979 nextLine();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
980 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
981 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
982 gotoMenuEdit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
983 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
984
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
985 void gotoMenuEdit(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
986 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
987 uint8_t line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
988
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
989 line = menu.lineMemoryForNavigationForPage[menu.pageMemoryForNavigation];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
990
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
991 switch(get_globalState())
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
992 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
993 case StMOG:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
994 openEdit_GasOC(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
995 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
996 case StMCG:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
997 openEdit_GasCC(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
998 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
999 case StMSP:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1000 openEdit_Setpoint(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1001 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1002 case StMXTRA:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1003 openEdit_Xtra(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1004 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1005 case StMDECO:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1006 openEdit_Deco(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1007 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1008 case StMDECOP:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1009 openEdit_DecoParameter(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1010 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1011 case StMPLAN:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1012 openEdit_Planner(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1013 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1014 case StMHARD:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1015 openEdit_Hardware(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1016 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1017 case StMSYS:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1018 openEdit_System(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1019 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1020 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1021 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1022 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1023 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1024
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1025
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1026 void sendActionToMenu(uint8_t sendAction)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1027 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1028 switch(sendAction)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1029 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1030 case ACTION_BUTTON_ENTER:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1031 stepForwardMenu();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1032 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1033 case ACTION_BUTTON_NEXT:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1034 if(menu.modeFlipPages)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1035 nextPage();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1036 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1037 nextLine();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1038 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1039 case ACTION_TIMEOUT:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1040 case ACTION_MODE_CHANGE:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1041 case ACTION_BUTTON_BACK:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1042 /* new test for 3button design */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1043 stepBackMenu();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1044 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1045 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1046 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1047 case ACTION_IDLE_TICK:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1048 case ACTION_IDLE_SECOND:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1049 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1050 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1051 /* tMC_OC_Gas(StMOG1, pSettings); */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1052 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1053
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1054 void timeoutTestMenu(uint32_t seconds_since_last_button_press)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1055 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1056 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1057
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1058 void tMenu_write(uint8_t page, char *text, char *subtext)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1059 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1060 if(page > MAXPAGES)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1061 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1062 if(menu.linesAvailableForPage[page] == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1063 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1064
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1065 tMscreen.FBStartAdress = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1066 GFX_write_string(&FontT48, &tMwindow, text,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1067 if((*subtext) && (menu.linesAvailableForPage[page] < 6))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1068 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1069 GFX_write_string(&FontT42, &tMwindow, subtext, (menu.linesAvailableForPage[page] + 1));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1070 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1071 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1072
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1073
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1074 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1075
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1076 void draw_tMdesignSubUnselected(uint32_t *ppDestination)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1077 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1078 union al88_u
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1079 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1080 uint8_t al8[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1081 uint16_t al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1082 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1083
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1084 uint16_t* prunning = *ppDestination;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1085
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1086 union al88_u color_seperator;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1087 union al88_u color_unselected;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1088 int i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1089
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1090 color_seperator.al8[0] = CLUT_MenuLineUnselectedSeperator;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1091 color_unselected.al8[0] = CLUT_MenuLineUnselected;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1092
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1093 color_seperator.al8[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1094 color_unselected.al8[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1095
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1096 *(__IO uint16_t*)prunning++ = color_seperator.al88;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1097 *(__IO uint16_t*)prunning++ = color_seperator.al88;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1098
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1099 for(i = 61; i > 0; i--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1100 {
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1101 *(__IO uint16_t*)prunning++ = color_unselected.al88;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1102 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1103
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1104 *(__IO uint16_t*)prunning++ = color_seperator.al88;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1105 *(__IO uint16_t*)prunning++ = color_seperator.al88;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1106
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1107 *ppDestination = prunning;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1108 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1109
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1110
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1111 void draw_tMdesignSubSelected(uint32_t *ppDestination)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1112 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1113 union al88_u
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1114 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1115 uint8_t al8[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1116 uint16_t al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1117 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1118
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1119 union al88_u color_selected;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1120 union al88_u color_seperator;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1121 int i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1122
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1123 color_selected.al8[0] = CLUT_MenuLineSelected;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1124 color_selected.al8[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1125
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1126 color_seperator.al8[0] = CLUT_MenuLineSelectedSeperator;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1127 color_seperator.al8[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1128
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1129 *(__IO uint16_t*)*ppDestination = color_seperator.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1130 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1131 *(__IO uint16_t*)*ppDestination = color_seperator.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1132 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1133
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1134 for(i = 61; i > 0; i--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1135 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1136 *(__IO uint16_t*)*ppDestination = color_selected.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1137 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1138 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1139
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1140 *(__IO uint16_t*)*ppDestination = color_seperator.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1141 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1142 *(__IO uint16_t*)*ppDestination = color_seperator.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1143 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1144 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1145
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1146
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1147 void draw_tMdesignSubSelectedBorder(uint32_t *ppDestination)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1148 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1149 union al88_u
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1150 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1151 uint8_t al8[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1152 uint16_t al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1153 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1154
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1155 union al88_u color_selected_sides;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1156
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1157 int i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1158
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1159 color_selected_sides.al8[0] = CLUT_MenuLineSelectedSides;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1160 color_selected_sides.al8[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1161
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1162 for(i = 65; i > 0; i--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1163 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1164 *(__IO uint16_t*)*ppDestination = color_selected_sides.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1165 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1166 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1167 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1168
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1169
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1170 void draw_tMcursorDesign(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1171 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1172 int i,j;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1173 uint32_t pDestination;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1174
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1175 pDestination = tMdesignCursor.FBStartAdress;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1176
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1177 for(j = 801; j > 0; j--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1178 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1179 for(i = 5; i > 0; i--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1180 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1181 draw_tMdesignSubUnselected(&pDestination);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1182 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1183 if((j > 787) || (j < 17))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1184 draw_tMdesignSubSelectedBorder(&pDestination);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1185 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1186 draw_tMdesignSubSelected(&pDestination);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1187 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1188
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1189 /* Draw menu background boxes which are visible if nothing is selected */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1190 pDestination = tMdesignSolo.FBStartAdress;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1191
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1192 for(j = 801; j > 0; j--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1193 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1194 for(i = 6; i > 0; i--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1195 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1196 draw_tMdesignSubUnselected(&pDestination);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1197 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1198 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1199 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1200
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1201
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1202 void draw_tMheader(uint8_t page)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1203 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1204 union al88_u
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1205 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1206 uint8_t al8[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1207 uint16_t al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1208 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1209 union al88_u color_top;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1210 int i,j, k, k4text;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1211 uint32_t pBackup;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1212 uint16_t* pDestination;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1213 uint8_t colorText;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1214 uint16_t positionText;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1215 uint8_t pageText;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1216
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1217 const char text8max[MAXPAGES+1][8] =
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1218 { "",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1219 "OC",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1220 "CC",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1221 "SP",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1222 "DATA",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1223 "DECO",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1224 "",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1225 "SYS",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1226 "",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1227 "SIM",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1228 ""
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1229 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1230
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1231 const _Bool spacing[MAXPAGES+1] =
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1232 { 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1233 0, // behind OC
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1234 0, // behind CC
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1235 1, // behind SP
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1236 1, // behind DATA
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1237 0, // behind DECO1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1238 1, // behind DECO2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1239 0, // behind SYS1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1240 1, // behind SYS2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1241 1, // behind SIM
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1242 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1243 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1244
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1245 pBackup = tMscreen.FBStartAdress;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1246 tMscreen.FBStartAdress = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1247 pDestination = menu.StartAddressForPage[page];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1248 positionText = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1249 pageText = page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1250
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1251 gfx_write_page_number(&tMscreen ,menu.pageCountNumber[page],menu.pageCountTotal,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1252
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1253 while((text8max[pageText][0] == 0) && (pageText > 1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1254 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1255 pageText--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1256 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1257
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1258 for(k = 1; k <= MAXPAGES; k++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1259 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1260 if(menu.pageCountNumber[k] != 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1261 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1262 k4text = k; // new hw 170522
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1263 if((text8max[k][0] == 0) && (menu.pageCountNumber[k-1] == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1264 k4text = k-1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1265
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1266 color_top.al8[0] = CLUT_MenuPageGasOC + k - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1267 if(k4text == page)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1268 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1269 color_top.al8[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1270 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1271 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1272 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1273 color_top.al8[1] = 0x50;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1274 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1275
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1276 if(k4text == pageText)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1277 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1278 colorText = CLUT_Font020;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1279 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1280 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1281 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1282 colorText = CLUT_Font021;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1283 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1284
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1285 write_content_simple(&tMscreen,positionText,775,0,&FontT42,text8max[k4text],colorText);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1286 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1287 write_content_simple(&tMscreen,positionText,775,0,&FontT42,text8max[k],colorText);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1288 if((text8max[k][0] == 0) && (menu.pageCountNumber[k-1] == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1289 write_content_simple(&tMscreen,positionText,775,0,&FontT42,text8max[k-1],colorText);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1290 */
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1291 /* Draw color bars */
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1292 if(!settingsGetPointer()->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1293 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1294 pDestination += 5 * 480;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1295
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1296 for(j = 60; j > 0; j--)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1297 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1298 pDestination += (390 + 26);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1299
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1300 for(i = 16; i > 0; i--)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1301 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1302 *(__IO uint16_t*)pDestination++ = color_top.al88;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1303 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1304 pDestination += 48;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1305 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1306
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1307 pDestination += 5 * 480;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1308 positionText += 70;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1309
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1310 if((k == 4) || ((k == 6) && (menu.pageCountNumber[5] == 0)))
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1311 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1312 pDestination += 70 * 480;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1313 positionText += 70;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1314 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1315
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1316 if(spacing[k])
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1317 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1318 pDestination += 35 * 480;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1319 positionText += 35;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1320 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1321 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1322 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1323 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1324 pDestination += (800 - 5)* 480;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1325
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1326 for(j = 60; j > 0; j--)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1327 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1328 pDestination -= (390 + 26);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1329
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1330 for(i = 16; i > 0; i--)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1331 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1332 *(__IO uint16_t*)pDestination-- = color_top.al88;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1333 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1334 pDestination -= 48;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1335 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1336
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1337 pDestination -= (800) * 480;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1338 positionText += 70;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1339
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1340 if((k == 4) || ((k == 6) && (menu.pageCountNumber[5] == 0)))
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1341 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1342 pDestination -= 70 * 480;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1343 positionText += 70;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1344 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1345
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1346 if(spacing[k])
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1347 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1348 pDestination -= 35 * 480;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1349 positionText += 35;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1350 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 51
diff changeset
1351 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1352 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1353 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1354 tMscreen.FBStartAdress = pBackup;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1355 }