comparison Discovery/Src/settings.c @ 740:5078da3845c0

Added button lock after wakeup in surface mode: During setup of diveequipment the OSTC4 is sometimes operated unintended (e.g. while equipping the jaket). To avoid this it is now possible to activate a button lock in the button lock sensitivity menu. The OSTC4 will then wakeup as usuall but if the diver wants to oerate the menus he has to press the buttons in a certain order. The button to be pressed is indicated by a blue bar. The button lock is deactivated in dive mode.
author Ideenmodellierer
date Thu, 02 Feb 2023 17:35:38 +0100
parents 7b0e020513e3
children b6d8a6fbf4fd
comparison
equal deleted inserted replaced
739:4a6bffaa38b3 740:5078da3845c0
85 85
86 /* always adjust check_and_correct_settings() accordingly 86 /* always adjust check_and_correct_settings() accordingly
87 * There might even be entries with fixed values that have no range 87 * There might even be entries with fixed values that have no range
88 */ 88 */
89 const SSettings SettingsStandard = { 89 const SSettings SettingsStandard = {
90 .header = 0xFFFF0024, 90 .header = 0xFFFF0025,
91 .warning_blink_dsec = 8 * 2, 91 .warning_blink_dsec = 8 * 2,
92 .lastDiveLogId = 0, 92 .lastDiveLogId = 0,
93 .logFlashNextSampleStartAddress = SAMPLESTART, 93 .logFlashNextSampleStartAddress = SAMPLESTART,
94 94
95 .gas[0].oxygen_percentage = 21, 95 .gas[0].oxygen_percentage = 21,
328 .ext_sensor_map[0] = SENSOR_OPTIC, 328 .ext_sensor_map[0] = SENSOR_OPTIC,
329 .ext_sensor_map[1] = SENSOR_OPTIC, 329 .ext_sensor_map[1] = SENSOR_OPTIC,
330 .ext_sensor_map[2] = SENSOR_OPTIC, 330 .ext_sensor_map[2] = SENSOR_OPTIC,
331 .ext_sensor_map[3] = SENSOR_NONE, 331 .ext_sensor_map[3] = SENSOR_NONE,
332 .ext_sensor_map[4] = SENSOR_NONE, 332 .ext_sensor_map[4] = SENSOR_NONE,
333 .buttonLockActive = 0
333 }; 334 };
334 335
335 /* Private function prototypes -----------------------------------------------*/ 336 /* Private function prototypes -----------------------------------------------*/
336 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to); 337 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to);
337 338
527 pSettings->ext_sensor_map[1] = SENSOR_OPTIC; 528 pSettings->ext_sensor_map[1] = SENSOR_OPTIC;
528 pSettings->ext_sensor_map[2] = SENSOR_OPTIC; 529 pSettings->ext_sensor_map[2] = SENSOR_OPTIC;
529 pSettings->ext_sensor_map[3] = SENSOR_NONE; 530 pSettings->ext_sensor_map[3] = SENSOR_NONE;
530 pSettings->ext_sensor_map[4] = SENSOR_NONE; 531 pSettings->ext_sensor_map[4] = SENSOR_NONE;
531 // no break; 532 // no break;
533 case 0xFFFF0024: pSettings->buttonLockActive = 0;
534 // no break;
532 default: 535 default:
533 pSettings->header = pStandard->header; 536 pSettings->header = pStandard->header;
534 break; // no break before!! 537 break; // no break before!!
535 } 538 }
536 } 539 }
1543 Settings.ext_sensor_map[1] = SENSOR_OPTIC; 1546 Settings.ext_sensor_map[1] = SENSOR_OPTIC;
1544 Settings.ext_sensor_map[2] = SENSOR_OPTIC; 1547 Settings.ext_sensor_map[2] = SENSOR_OPTIC;
1545 Settings.ext_sensor_map[3] = SENSOR_NONE; 1548 Settings.ext_sensor_map[3] = SENSOR_NONE;
1546 Settings.ext_sensor_map[4] = SENSOR_NONE; 1549 Settings.ext_sensor_map[4] = SENSOR_NONE;
1547 corrections++; 1550 corrections++;
1551 }
1552
1553 if(Settings.buttonLockActive > 1)
1554 {
1555 Settings.buttonLockActive = 1;
1556 corrections++;
1548 } 1557 }
1549 1558
1550 if(corrections) 1559 if(corrections)
1551 { 1560 {
1552 settingsWarning = 1; 1561 settingsWarning = 1;