comparison Discovery/Src/settings.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 3c3fb9f4edc4
children
comparison
equal deleted inserted replaced
1081:1b38d7b8da35 1082:1aa45000f92c
38 #include "tInfo.h" 38 #include "tInfo.h"
39 #include "tInfoLog.h" 39 #include "tInfoLog.h"
40 #include "motion.h" 40 #include "motion.h"
41 #include "t7.h" 41 #include "t7.h"
42 #include "data_central.h" 42 #include "data_central.h"
43 #include "hud.h"
43 44
44 static uint8_t settingsWarning = 0; /* Active if setting values have been corrected */ 45 static uint8_t settingsWarning = 0; /* Active if setting values have been corrected */
45 static SSettingsStatus SettingsStatus; /* Structure containing number of corrections and first occurrence */ 46 static SSettingsStatus SettingsStatus; /* Structure containing number of corrections and first occurrence */
46 47
47 SSettings Settings; 48 SSettings Settings;
93 94
94 /* always adjust check_and_correct_settings() accordingly 95 /* always adjust check_and_correct_settings() accordingly
95 * There might even be entries with fixed values that have no range 96 * There might even be entries with fixed values that have no range
96 */ 97 */
97 const SSettings SettingsStandard = { 98 const SSettings SettingsStandard = {
98 .header = 0xFFFF002E, 99 .header = 0xFFFF002F,
99 .warning_blink_dsec = 8 * 2, 100 .warning_blink_dsec = 8 * 2,
100 .lastDiveLogId = 0, 101 .lastDiveLogId = 0,
101 .logFlashNextSampleStartAddress = SAMPLESTART, 102 .logFlashNextSampleStartAddress = SAMPLESTART,
102 103
103 .gas[0].oxygen_percentage = 21, 104 .gas[0].oxygen_percentage = 21,
353 .profileName[0] = "STANDARD", 354 .profileName[0] = "STANDARD",
354 .profileName[1] = "OC_TX___", 355 .profileName[1] = "OC_TX___",
355 .profileName[2] = "MCCR____", 356 .profileName[2] = "MCCR____",
356 .profileName[3] = "ECCR____", 357 .profileName[3] = "ECCR____",
357 .activeProfile = 0, 358 .activeProfile = 0,
359 .hudFunction[0] = HUD_FCT_NONE,
360 .hudFunction[1] = HUD_FCT_NONE,
361 .hudFunction[2] = HUD_FCT_NONE,
362 .hudFunction[3] = HUD_FCT_NONE,
363 .hudFunction[4] = HUD_FCT_NONE,
364 .hudFunction[5] = HUD_FCT_NONE
358 }; 365 };
359 366
360 /* Private function prototypes -----------------------------------------------*/ 367 /* Private function prototypes -----------------------------------------------*/
361 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to); 368 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to);
362 369
665 case 0xFFFF002D: 672 case 0xFFFF002D:
666 if(pSettings->tX_userselectedLeftLowerCornerPrimary > LLC_GF) /* GF_Surf was added behind => shift ID of views */ 673 if(pSettings->tX_userselectedLeftLowerCornerPrimary > LLC_GF) /* GF_Surf was added behind => shift ID of views */
667 { 674 {
668 pSettings->tX_userselectedLeftLowerCornerPrimary++; 675 pSettings->tX_userselectedLeftLowerCornerPrimary++;
669 } 676 }
670 677 // no break;
678 case 0xFFFF002E: pSettings->hudFunction[0] = HUD_FCT_NONE; /* todo: define default setup */
679 pSettings->hudFunction[1] = HUD_FCT_NONE;
680 pSettings->hudFunction[2] = HUD_FCT_NONE;
681 pSettings->hudFunction[3] = HUD_FCT_NONE;
682 pSettings->hudFunction[4] = HUD_FCT_NONE;
683 pSettings->hudFunction[5] = HUD_FCT_NONE;
671 // no break; 684 // no break;
672 default: 685 default:
673 pSettings->header = pStandard->header; 686 pSettings->header = pStandard->header;
674 break; // no break before!! 687 break; // no break before!!
675 } 688 }