# HG changeset patch # User Ideenmodellierer # Date 1604348142 -3600 # Node ID daa8d4474ba02724477e6f65a421ecaf081f89e7 # Parent e595d2d1f77f50f666bdb168d7a2ffbb88c77db9 Added new settings for Viewport: A parameter for enabling/disabling is needed as well as the angle values used to define the viewport diff -r e595d2d1f77f -r daa8d4474ba0 Common/Inc/settings.h --- a/Common/Inc/settings.h Tue Nov 03 12:47:51 2020 +0100 +++ b/Common/Inc/settings.h Mon Nov 02 21:15:42 2020 +0100 @@ -70,6 +70,8 @@ #define MAX_COMPASS_COMP (2u) +#define MAX_VIEWPORT_MODE (2u) + /* 2015 Jan 30, hw, deco and travel added for MenuEditGas * can be used for buehlmann, vpm, etc. later but be carefull * with current implemenation */ @@ -228,6 +230,11 @@ /* new in 0xFFFF001C */ uint8_t compassInertia; uint8_t tX_customViewPrimaryBF; + /* new in 0xFFFF001D */ + uint8_t viewPortMode; + uint16_t viewRoll; + uint16_t viewPitch; + uint16_t viewYaw; } SSettings; typedef struct diff -r e595d2d1f77f -r daa8d4474ba0 Discovery/Src/settings.c --- a/Discovery/Src/settings.c Tue Nov 03 12:47:51 2020 +0100 +++ b/Discovery/Src/settings.c Mon Nov 02 21:15:42 2020 +0100 @@ -85,7 +85,7 @@ * There might even be entries with fixed values that have no range */ const SSettings SettingsStandard = { - .header = 0xFFFF001C, + .header = 0xFFFF001D, .warning_blink_dsec = 8 * 2, .lastDiveLogId = 0, .logFlashNextSampleStartAddress = 0, @@ -314,6 +314,10 @@ .cv_config_BigScreen = 0xFFFFFFFF, .compassInertia = 0, .tX_customViewPrimaryBF = CVIEW_T3_Decostop, + .viewPortMode = 0, + .viewRoll = 0, + .viewPitch = 0, + .viewYaw = 0, }; /* Private function prototypes -----------------------------------------------*/ @@ -472,6 +476,12 @@ pSettings->tX_customViewPrimaryBF = CVIEW_T3_Decostop; pSettings->cv_config_BigScreen &= pSettings->cv_configuration ^= 1 << CVIEW_T3_DecoTTS; // no break + case 0xFFFF001C: + pSettings->viewPortMode = 0; + pSettings->viewRoll = 0; + pSettings->viewPitch = 0; + pSettings->viewYaw = 0; + // no break default: pSettings->header = pStandard->header; break; // no break before!! @@ -1395,6 +1405,11 @@ Settings.tX_customViewPrimaryBF = CVIEW_T3_Decostop; corrections++; } + if(Settings.viewPortMode > MAX_VIEWPORT_MODE) + { + Settings.viewPortMode = 0; + corrections++; + } if(corrections > 255) return 255;