comparison Discovery/Src/tInfo.c @ 718:b9f699d2e3d0

Updated menu structure to support new sensor information page: The sensor information page has been added to the sensor submenu of the hardware menu. It will be shown dynamically in case a smart sensor is detected. In order to have this dynamic visualization some new functions had to be added to the general menu file. The information page returns to the sensor menu, for this behavior also a new function had to be added.
author Ideenmodellierer
date Sun, 20 Nov 2022 20:49:41 +0100
parents 01f40cb1057e
children a370741a743b
comparison
equal deleted inserted replaced
717:88f73b05d45c 718:b9f699d2e3d0
34 #include "gfx_fonts.h" 34 #include "gfx_fonts.h"
35 #include "tHome.h" 35 #include "tHome.h"
36 //#include "tInfoDive.h" 36 //#include "tInfoDive.h"
37 //#include "tInfoSurface.h" 37 //#include "tInfoSurface.h"
38 #include "tInfoCompass.h" 38 #include "tInfoCompass.h"
39 #include "tInfoSensor.h"
39 #include "tMenu.h" 40 #include "tMenu.h"
41 #include "tMenuEdit.h"
40 42
41 #include <string.h> 43 #include <string.h>
42 44
43 /* Private types -------------------------------------------------------------*/ 45 /* Private types -------------------------------------------------------------*/
44 46
196 } 198 }
197 */ 199 */
198 200
199 void tInfo_refresh(void) 201 void tInfo_refresh(void)
200 { 202 {
201 if(!inDebugMode() && (get_globalState() != StICOMPASS))
202 return;
203
204 uint32_t oldIscreen; 203 uint32_t oldIscreen;
205 204 uint32_t globalState = get_globalState();
206 oldIscreen = tIscreen.FBStartAdress; 205 oldIscreen = tIscreen.FBStartAdress;
207 tIscreen.FBStartAdress = getFrame(14); 206
208 infoColor = CLUT_InfoCompass;
209
210 if(inDebugMode()) 207 if(inDebugMode())
211 tDebug_refresh(); 208 {
212 else 209 tIscreen.FBStartAdress = getFrame(14);
213 refreshInfo_Compass(tIscreen); 210 infoColor = CLUT_InfoCompass;
214 211 tDebug_refresh();
215 if(inDebugMode() || (get_globalState() == StICOMPASS)) /* could be timeout and exitInfo */ 212 }
216 GFX_SetFramesTopBottom(tIscreen.FBStartAdress, 0,480); 213 else
217 214 {
218 if(oldIscreen) 215 switch(globalState)
219 releaseFrame(14,oldIscreen); 216 {
217 case StICOMPASS: tIscreen.FBStartAdress = getFrame(14);
218 infoColor = CLUT_InfoCompass;
219 refreshInfo_Compass(tIscreen);
220 break;
221 case StISENINFO: tIscreen.FBStartAdress = getFrame(14);
222 infoColor = CLUT_MenuPageHardware;
223 refreshInfo_Sensor(tIscreen);
224 break;
225 default:
226 break;
227 }
228 }
229 if(oldIscreen != tIscreen.FBStartAdress)
230 {
231 GFX_SetFramesTopBottom(tIscreen.FBStartAdress, 0,480);
232 if(oldIscreen)
233 {
234 releaseFrame(14,oldIscreen);
235 }
236 }
220 } 237 }
221 238
222 239
223 void exitInfo(void) 240 void exitInfo(void)
224 { 241 {
225 set_globalState_tHome(); 242 set_globalState_tHome();
226 releaseFrame(14,tIscreen.FBStartAdress); 243 releaseFrame(14,tIscreen.FBStartAdress);
227 exitDebugMode(); 244 exitDebugMode();
245 }
246
247 void exitInfoToBack(void)
248 {
249 releaseFrame(14,tIscreen.FBStartAdress);
250 exitMenuEdit_to_BackMenu();
228 } 251 }
229 252
230 253
231 void sendActionToInfo(uint8_t sendAction) 254 void sendActionToInfo(uint8_t sendAction)
232 { 255 {