comparison Discovery/Src/settings.c @ 560:5d80bb8d22cb

Added O2 sensor source and calibration parameters to setting structure
author Ideenmodellierer
date Sun, 15 Nov 2020 19:53:09 +0100
parents af1c3e3abd5f
children 1c95f811967c
comparison
equal deleted inserted replaced
559:84a4e1200726 560:5d80bb8d22cb
83 83
84 /* always adjust check_and_correct_settings() accordingly 84 /* always adjust check_and_correct_settings() accordingly
85 * There might even be entries with fixed values that have no range 85 * There might even be entries with fixed values that have no range
86 */ 86 */
87 const SSettings SettingsStandard = { 87 const SSettings SettingsStandard = {
88 .header = 0xFFFF001D, 88 .header = 0xFFFF001E,
89 .warning_blink_dsec = 8 * 2, 89 .warning_blink_dsec = 8 * 2,
90 .lastDiveLogId = 0, 90 .lastDiveLogId = 0,
91 .logFlashNextSampleStartAddress = 0, 91 .logFlashNextSampleStartAddress = 0,
92 92
93 .gas[0].oxygen_percentage = 21, 93 .gas[0].oxygen_percentage = 21,
316 .tX_customViewPrimaryBF = CVIEW_T3_Decostop, 316 .tX_customViewPrimaryBF = CVIEW_T3_Decostop,
317 .viewPortMode = 0, 317 .viewPortMode = 0,
318 .viewRoll = 0, 318 .viewRoll = 0,
319 .viewPitch = 0, 319 .viewPitch = 0,
320 .viewYaw = 0, 320 .viewYaw = 0,
321 .ppo2sensors_source = 0,
322 .ppo2sensors_calibCoeff[0] = 0.0,
323 .ppo2sensors_calibCoeff[1] = 0.0,
324 .ppo2sensors_calibCoeff[2] = 0.0,
321 }; 325 };
322 326
323 /* Private function prototypes -----------------------------------------------*/ 327 /* Private function prototypes -----------------------------------------------*/
324 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to); 328 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to);
325 329
480 pSettings->viewPortMode = 0; 484 pSettings->viewPortMode = 0;
481 pSettings->viewRoll = 0; 485 pSettings->viewRoll = 0;
482 pSettings->viewPitch = 0; 486 pSettings->viewPitch = 0;
483 pSettings->viewYaw = 0; 487 pSettings->viewYaw = 0;
484 // no break 488 // no break
489 case 0xFFFF001D:
490 pSettings->ppo2sensors_source = O2_SENSOR_SOURCE_OPTIC;
491 pSettings->ppo2sensors_calibCoeff[0] = 0.0;
492 pSettings->ppo2sensors_calibCoeff[1] = 0.0;
493 pSettings->ppo2sensors_calibCoeff[2] = 0.0;
494 // no break
485 default: 495 default:
486 pSettings->header = pStandard->header; 496 pSettings->header = pStandard->header;
487 break; // no break before!! 497 break; // no break before!!
488 } 498 }
489 } 499 }
1411 } 1421 }
1412 if(Settings.viewPortMode > MAX_VIEWPORT_MODE) 1422 if(Settings.viewPortMode > MAX_VIEWPORT_MODE)
1413 { 1423 {
1414 Settings.viewPortMode = 0; 1424 Settings.viewPortMode = 0;
1415 corrections++; 1425 corrections++;
1426 }
1427 if(Settings.ppo2sensors_source >= O2_SENSOR_SOURCE_MAX)
1428 {
1429 Settings.ppo2sensors_source = O2_SENSOR_SOURCE_OPTIC;
1430 Settings.ppo2sensors_calibCoeff[0] = 0.0;
1431 Settings.ppo2sensors_calibCoeff[1] = 0.0;
1432 Settings.ppo2sensors_calibCoeff[2] = 0.0;
1433 corrections++;
1416 } 1434 }
1417 1435
1418 if(corrections > 255) 1436 if(corrections > 255)
1419 return 255; 1437 return 255;
1420 else 1438 else