Mercurial > public > ostc4
comparison Discovery/Src/tInfoSensor.c @ 1082:1aa45000f92c Icon_Integration tip
Added configuration menu for HUD functions:
The V1 HUD has 4 functions (holes) which may be realized by one or two LEDs. The functions (like ppo2 monitoring or ascent speed) may be configurated by the diver using the HUD menu. The functions which may be selected depend on the HW configuration (e.g. the connected sensors) and the number of LEDs which are needed to realize the function. The previous HUD test implementation may still be activate usind the compile switch ENABLE_HUD_TESTING
| author | Ideenmodellierer |
|---|---|
| date | Sun, 15 Mar 2026 21:40:35 +0100 |
| parents | 082825daccb5 |
| children |
comparison
equal
deleted
inserted
replaced
| 1081:1b38d7b8da35 | 1082:1aa45000f92c |
|---|---|
| 33 #include "tHome.h" | 33 #include "tHome.h" |
| 34 #include "tInfo.h" | 34 #include "tInfo.h" |
| 35 #include "tInfoSensor.h" | 35 #include "tInfoSensor.h" |
| 36 #include "tMenuEdit.h" | 36 #include "tMenuEdit.h" |
| 37 #include "data_exchange_main.h" | 37 #include "data_exchange_main.h" |
| 38 #include "hud.h" | |
| 38 | 39 |
| 39 #include <string.h> | 40 #include <string.h> |
| 40 #include <inttypes.h> | 41 #include <inttypes.h> |
| 41 | 42 |
| 42 extern void openEdit_Sensors(uint8_t filter); | 43 extern void openEdit_Sensors(uint8_t filter); |
| 205 | 206 |
| 206 static void refreshInfo_SensorHUD(GFX_DrawCfgScreen s) | 207 static void refreshInfo_SensorHUD(GFX_DrawCfgScreen s) |
| 207 { | 208 { |
| 208 const SDiveState *pStateReal = stateRealGetPointer(); | 209 const SDiveState *pStateReal = stateRealGetPointer(); |
| 209 char text[50]; | 210 char text[50]; |
| 210 | 211 char infostr[HUD_INFO_INFOSTR_LENGTH + 1]; |
| 211 snprintf(text,50,"%s",pStateReal->lifeData.extIf_sensor_data[activeSensorId]); | 212 |
| 212 tInfo_write_content_simple( 30, 770, ME_Y_LINE1, &FontT48, text, CLUT_Font020); | 213 uint8_t hudAddress = hud_GetAddress(); |
| 213 | 214 |
| 215 if(hudAddress < EXT_INTERFACE_SENSOR_CNT) | |
| 216 { | |
| 217 memcpy(infostr, (char*)&pStateReal->lifeData.extIf_sensor_data[hudAddress][HUD_INFO_INFOSTR_OFFSET], HUD_INFO_INFOSTR_LENGTH); | |
| 218 infostr[HUD_INFO_INFOSTR_LENGTH] = 0; | |
| 219 | |
| 220 snprintf(text,50,"%s",infostr); | |
| 221 tInfo_write_content_simple( 30, 770, ME_Y_LINE1, &FontT48, text, CLUT_Font020); | |
| 222 } | |
| 214 tInfo_write_buttonTextline_simple(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,0); | 223 tInfo_write_buttonTextline_simple(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,0); |
| 215 } | 224 } |
| 216 | 225 |
| 217 | 226 |
| 218 | 227 |
