comparison Discovery/Src/settings.c @ 1027:158100a84ebd GasConsumption

New profile feature: In the past the OSTC provide just one instance for settings. If for example a diver switched from OC to CCR configuration several settings had to be modified. To improve this and to be more flexible in adapting the OSTC to differend dive scenarions the usage of up to 4 profiles has beem introduced. The profiles are copies of the common settings but stored in a separate, previously not used, flash section => no impact to existings settings handling. For access to the profiles the existing setting flash functions are reused. To enable this a parameter war introduced which defines the target of the operation (common settings or profiles).
author Ideenmodellierer
date Sun, 07 Sep 2025 19:03:44 +0200
parents 92d5e07d1a05
children 6fb16ca39125
comparison
equal deleted inserted replaced
1026:5fedf7ba2392 1027:158100a84ebd
44 static uint8_t settingsWarning = 0; /* Active if setting values have been corrected */ 44 static uint8_t settingsWarning = 0; /* Active if setting values have been corrected */
45 static SSettingsStatus SettingsStatus; /* Structure containing number of corrections and first occurrence */ 45 static SSettingsStatus SettingsStatus; /* Structure containing number of corrections and first occurrence */
46 46
47 SSettings Settings; 47 SSettings Settings;
48 48
49 SSettings Profile[NUMBER_OF_PROFILES]; /* may be optimized if RAM is getting short. profile copies are only used by profile dialog */
50 /* static structure is used to keep things simple avoiding larger code changes */
49 const uint8_t RTErequiredHigh = 3; 51 const uint8_t RTErequiredHigh = 3;
50 const uint8_t RTErequiredLow = 6; 52 const uint8_t RTErequiredLow = 6;
51 53
52 const uint8_t FONTrequiredHigh = 1; 54 const uint8_t FONTrequiredHigh = 1;
53 const uint8_t FONTrequiredLow = 0; 55 const uint8_t FONTrequiredLow = 0;
91 93
92 /* always adjust check_and_correct_settings() accordingly 94 /* always adjust check_and_correct_settings() accordingly
93 * There might even be entries with fixed values that have no range 95 * There might even be entries with fixed values that have no range
94 */ 96 */
95 const SSettings SettingsStandard = { 97 const SSettings SettingsStandard = {
96 .header = 0xFFFF002C, 98 .header = 0xFFFF002D,
97 .warning_blink_dsec = 8 * 2, 99 .warning_blink_dsec = 8 * 2,
98 .lastDiveLogId = 0, 100 .lastDiveLogId = 0,
99 .logFlashNextSampleStartAddress = SAMPLESTART, 101 .logFlashNextSampleStartAddress = SAMPLESTART,
100 102
101 .gas[0].oxygen_percentage = 21, 103 .gas[0].oxygen_percentage = 21,
345 .timerDurationS = 180, 347 .timerDurationS = 180,
346 .cvAutofocus = 0, 348 .cvAutofocus = 0,
347 .slowExitTime = 0, 349 .slowExitTime = 0,
348 .timeZone.hours = 0, 350 .timeZone.hours = 0,
349 .timeZone.minutes = 0, 351 .timeZone.minutes = 0,
350 .warningBuzzer = 0 352 .warningBuzzer = 0,
353 .profileName[0] = "STANDARD",
354 .profileName[1] = "OC_TX___",
355 .profileName[2] = "MCCR____",
356 .profileName[3] = "ECCR____",
357 .activeProfile = 0,
351 }; 358 };
352 359
353 /* Private function prototypes -----------------------------------------------*/ 360 /* Private function prototypes -----------------------------------------------*/
354 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to); 361 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to);
355 362
363 /* The profiles are store in a 4k flash block => make sure that size does not violate the size of the flash block (settings * 4) */
364 _Static_assert(sizeof(Settings) < 1000, "To much settings to support multiple profiles");
365
366
356 /* Functions -----------------------------------------------------------------*/ 367 /* Functions -----------------------------------------------------------------*/
368
369
370 uint16_t settingsGetSize()
371 {
372 return sizeof (Settings);
373 }
374
357 375
358 void setFlipDisplay(uint8_t flipDisplay) 376 void setFlipDisplay(uint8_t flipDisplay)
359 { 377 {
360 bool settingChanged = flipDisplay != Settings.FlipDisplay; 378 bool settingChanged = flipDisplay != Settings.FlipDisplay;
361 Settings.FlipDisplay = flipDisplay; 379 Settings.FlipDisplay = flipDisplay;
380 /// 398 ///
381 /// Additionally update the serial number if written via bluetooth 399 /// Additionally update the serial number if written via bluetooth
382 /// 400 ///
383 // =============================================================================== 401 // ===============================================================================
384 SSettings* pSettings; 402 SSettings* pSettings;
385 void set_new_settings_missing_in_ext_flash(void) 403 void set_new_settings_missing_in_ext_flash(uint8_t whichSettings)
386 { 404 {
387 uint32_t tmp = 0; 405 uint32_t tmp = 0;
388 406 pSettings = settingsGetPointer();
407
408 switch(whichSettings)
409 {
410 default:
411 case EF_SETTINGS:
412 break;
413 case EF_PROFILE0: pSettings = profileGetPointer(0);
414 break;
415 case EF_PROFILE1: pSettings = profileGetPointer(1);
416 break;
417 case EF_PROFILE2: pSettings = profileGetPointer(2);
418 break;
419 case EF_PROFILE3: pSettings = profileGetPointer(3);
420 break;
421 }
389 // never delete this part setting the serial 422 // never delete this part setting the serial
390 if(hardwareDataGetPointer()->secondarySerial != 0xFFFF) 423 if(hardwareDataGetPointer()->secondarySerial != 0xFFFF)
391 { 424 {
392 settingsGetPointer()->serialHigh = (hardwareDataGetPointer()->secondarySerial / 256); 425 pSettings->serialHigh = (hardwareDataGetPointer()->secondarySerial / 256);
393 settingsGetPointer()->serialLow = (hardwareDataGetPointer()->secondarySerial & 0xFF); 426 pSettings->serialLow = (hardwareDataGetPointer()->secondarySerial & 0xFF);
394 } 427 }
395 else 428 else
396 if(hardwareDataGetPointer()->primarySerial != 0xFFFF) 429 if(hardwareDataGetPointer()->primarySerial != 0xFFFF)
397 { 430 {
398 settingsGetPointer()->serialHigh = (hardwareDataGetPointer()->primarySerial / 256); 431 pSettings->serialHigh = (hardwareDataGetPointer()->primarySerial / 256);
399 settingsGetPointer()->serialLow = (hardwareDataGetPointer()->primarySerial & 0xFF); 432 pSettings->serialLow = (hardwareDataGetPointer()->primarySerial & 0xFF);
400 } 433 }
401 else 434 else
402 { 435 {
403 settingsGetPointer()->serialHigh = 0; 436 pSettings->serialHigh = 0;
404 settingsGetPointer()->serialLow = 0; 437 pSettings->serialLow = 0;
405 } 438 }
406 439
407 settingsGetPointer()->firmwareVersion[0] = firmware_FirmwareData.versionFirst; 440 pSettings->firmwareVersion[0] = firmware_FirmwareData.versionFirst;
408 settingsGetPointer()->firmwareVersion[1] = firmware_FirmwareData.versionSecond; 441 pSettings->firmwareVersion[1] = firmware_FirmwareData.versionSecond;
409 settingsGetPointer()->firmwareVersion[2] = firmware_FirmwareData.versionThird; 442 pSettings->firmwareVersion[2] = firmware_FirmwareData.versionThird;
410 settingsGetPointer()->firmwareVersion[3] = firmware_FirmwareData.versionBeta; 443 pSettings->firmwareVersion[3] = firmware_FirmwareData.versionBeta;
411 444
412 pSettings = settingsGetPointer(); 445
413 const SSettings* pStandard = settingsGetPointerStandard(); 446 const SSettings* pStandard = settingsGetPointerStandard();
414 447
415 /* Pointing to the old header data => set new data depending on what had been added since last version */ 448 /* Pointing to the old header data => set new data depending on what had been added since last version */
416 switch(pSettings->header) 449 switch(pSettings->header)
417 { 450 {
610 pSettings->cv_config_BigScreen |= tmp; 643 pSettings->cv_config_BigScreen |= tmp;
611 // no break; 644 // no break;
612 case 0xFFFF0028: 645 case 0xFFFF0028:
613 // no break; 646 // no break;
614 case 0xFFFF0029: 647 case 0xFFFF0029:
615 Settings.cvAutofocus = 0; 648 pSettings->cvAutofocus = 0;
616 // no break; 649 // no break;
617 case 0xFFFF002A: 650 case 0xFFFF002A:
618 Settings.slowExitTime = 0; 651 pSettings->slowExitTime = 0;
619 // no break; 652 // no break;
620 case 0xFFFF002B: 653 case 0xFFFF002B:
621 Settings.timeZone.hours = 0; 654 pSettings->timeZone.hours = 0;
622 Settings.timeZone.minutes = 0; 655 pSettings->timeZone.minutes = 0;
623 Settings.warningBuzzer = 0; 656 pSettings->warningBuzzer = 0;
657 // no break;
658 case 0xFFFF002C:
659 sprintf((char*)pSettings->profileName[0],"STANDARD");
660 sprintf((char*)pSettings->profileName[1],"OC_TX___");
661 sprintf((char*)pSettings->profileName[2],"MCCR____");
662 sprintf((char*)pSettings->profileName[3],"ECCR____");
663 pSettings->activeProfile = 0;
664
624 // no break; 665 // no break;
625 default: 666 default:
626 pSettings->header = pStandard->header; 667 pSettings->header = pStandard->header;
627 break; // no break before!! 668 break; // no break before!!
628 } 669 }
734 { 775 {
735 memcpy(Status, &SettingsStatus,2); 776 memcpy(Status, &SettingsStatus,2);
736 } 777 }
737 } 778 }
738 779
739 uint8_t check_and_correct_settings(void) 780 uint8_t check_and_correct_settings(uint8_t whichSettings)
740 { 781 {
741 uint32_t corrections = 0; 782 uint32_t corrections = 0;
742 uint8_t firstGasFoundOC = 0; 783 uint8_t firstGasFoundOC = 0;
743 uint8_t firstGasFoundCCR = 0; 784 uint8_t firstGasFoundCCR = 0;
744 uint8_t parameterId = 0; 785 uint8_t parameterId = 0;
745 786
746 787
747 settingsWarning = 0; /* reset warning indicator */ 788 settingsWarning = 0; /* reset warning indicator */
748 SettingsStatus.FirstCorrection = 0xFF; 789 SettingsStatus.FirstCorrection = 0xFF;
749 790
791 pSettings = settingsGetPointer();
792
793 switch(whichSettings)
794 {
795 default:
796 case EF_SETTINGS:
797 break;
798 case EF_PROFILE0: pSettings = profileGetPointer(0);
799 break;
800 case EF_PROFILE1: pSettings = profileGetPointer(1);
801 break;
802 case EF_PROFILE2: pSettings = profileGetPointer(2);
803 break;
804 case EF_PROFILE3: pSettings = profileGetPointer(3);
805 break;
806 }
807
808
809
750 /* uint32_t header; 810 /* uint32_t header;
751 */ 811 */
752 812
753 /* uint8_t warning_blink_dsec; 1/10 seconds 813 /* uint8_t warning_blink_dsec; 1/10 seconds
754 */ 814 */
755 if((Settings.warning_blink_dsec < 1) || (Settings.warning_blink_dsec > 100)) 815 if((pSettings->warning_blink_dsec < 1) || (pSettings->warning_blink_dsec > 100))
756 { 816 {
757 Settings.warning_blink_dsec = SettingsStandard.warning_blink_dsec; 817 pSettings->warning_blink_dsec = SettingsStandard.warning_blink_dsec;
758 corrections++; 818 corrections++;
759 setFirstCorrection(parameterId); 819 setFirstCorrection(parameterId);
760 } 820 }
761 parameterId++; /* 1 */ 821 parameterId++; /* 1 */
762 /* uint8_t lastDiveLogId; 822 /* uint8_t lastDiveLogId;
763 */ 823 */
764 824
765 /* uint32_t logFlashNextSampleStartAddress; 825 /* uint32_t logFlashNextSampleStartAddress;
766 */ 826 */
767 if((Settings.logFlashNextSampleStartAddress < SAMPLESTART) || (Settings.logFlashNextSampleStartAddress > SAMPLESTOP)) 827 if((pSettings->logFlashNextSampleStartAddress < SAMPLESTART) || (pSettings->logFlashNextSampleStartAddress > SAMPLESTOP))
768 { 828 {
769 Settings.logFlashNextSampleStartAddress = SAMPLESTART; 829 pSettings->logFlashNextSampleStartAddress = SAMPLESTART;
770 corrections++; 830 corrections++;
771 setFirstCorrection(parameterId); 831 setFirstCorrection(parameterId);
772 } 832 }
773 parameterId++; /* 2 */ 833 parameterId++; /* 2 */
774 834
775 /* uint8_t dive_mode; has to before the gases 835 /* uint8_t dive_mode; has to before the gases
776 */ 836 */
777 if( (Settings.dive_mode != DIVEMODE_OC) && 837 if( (pSettings->dive_mode != DIVEMODE_OC) &&
778 (Settings.dive_mode != DIVEMODE_CCR) && 838 (pSettings->dive_mode != DIVEMODE_CCR) &&
779 (Settings.dive_mode != DIVEMODE_Gauge) && 839 (pSettings->dive_mode != DIVEMODE_Gauge) &&
780 (Settings.dive_mode != DIVEMODE_Apnea) && 840 (pSettings->dive_mode != DIVEMODE_Apnea) &&
781 (Settings.dive_mode != DIVEMODE_PSCR)) 841 (pSettings->dive_mode != DIVEMODE_PSCR))
782 { 842 {
783 Settings.dive_mode = DIVEMODE_OC; 843 pSettings->dive_mode = DIVEMODE_OC;
784 corrections++; 844 corrections++;
785 setFirstCorrection(parameterId); 845 setFirstCorrection(parameterId);
786 } 846 }
787 parameterId++;/* 3 */ 847 parameterId++;/* 3 */
788 848
789 /* SGasLine gas[1 + (2*NUM_GASES)]; 849 /* SGasLine gas[1 + (2*NUM_GASES)];
790 */ 850 */
791 for(int i=1; i<=2*NUM_GASES;i++) 851 for(int i=1; i<=2*NUM_GASES;i++)
792 { 852 {
793 if(Settings.gas[i].oxygen_percentage < 4) 853 if(pSettings->gas[i].oxygen_percentage < 4)
794 { 854 {
795 Settings.gas[i].oxygen_percentage = 4; 855 pSettings->gas[i].oxygen_percentage = 4;
796 corrections++; 856 corrections++;
797 setFirstCorrection(parameterId); 857 setFirstCorrection(parameterId);
798 } 858 }
799 if(Settings.gas[i].oxygen_percentage > 100) 859 if(pSettings->gas[i].oxygen_percentage > 100)
800 { 860 {
801 Settings.gas[i].oxygen_percentage = 100; 861 pSettings->gas[i].oxygen_percentage = 100;
802 corrections++; 862 corrections++;
803 setFirstCorrection(parameterId); 863 setFirstCorrection(parameterId);
804 } 864 }
805 if((Settings.gas[i].oxygen_percentage + Settings.gas[i].helium_percentage) > 100) 865 if((pSettings->gas[i].oxygen_percentage + pSettings->gas[i].helium_percentage) > 100)
806 { 866 {
807 Settings.gas[i].helium_percentage = 100 - Settings.gas[i].oxygen_percentage; 867 pSettings->gas[i].helium_percentage = 100 - pSettings->gas[i].oxygen_percentage;
808 corrections++; 868 corrections++;
809 setFirstCorrection(parameterId); 869 setFirstCorrection(parameterId);
810 } 870 }
811 if(Settings.gas[i].note.ub.deco) 871 if(pSettings->gas[i].note.ub.deco)
812 { 872 {
813 if(Settings.gas[i].note.ub.active != 1) 873 if(pSettings->gas[i].note.ub.active != 1)
814 { 874 {
815 Settings.gas[i].note.ub.active = 1; 875 pSettings->gas[i].note.ub.active = 1;
816 corrections++; 876 corrections++;
817 setFirstCorrection(parameterId); 877 setFirstCorrection(parameterId);
818 } 878 }
819 if(Settings.gas[i].note.ub.travel == 1) 879 if(pSettings->gas[i].note.ub.travel == 1)
820 { 880 {
821 Settings.gas[i].note.ub.travel = 0; 881 pSettings->gas[i].note.ub.travel = 0;
822 corrections++; 882 corrections++;
823 setFirstCorrection(parameterId); 883 setFirstCorrection(parameterId);
824 } 884 }
825 } 885 }
826 if(Settings.gas[i].note.ub.travel) 886 if(pSettings->gas[i].note.ub.travel)
827 { 887 {
828 if(Settings.gas[i].note.ub.active != 1) 888 if(pSettings->gas[i].note.ub.active != 1)
829 { 889 {
830 Settings.gas[i].note.ub.active = 1; 890 pSettings->gas[i].note.ub.active = 1;
831 corrections++; 891 corrections++;
832 setFirstCorrection(parameterId); 892 setFirstCorrection(parameterId);
833 } 893 }
834 if(Settings.gas[i].note.ub.deco == 1) 894 if(pSettings->gas[i].note.ub.deco == 1)
835 { 895 {
836 Settings.gas[i].note.ub.deco = 0; 896 pSettings->gas[i].note.ub.deco = 0;
837 corrections++; 897 corrections++;
838 setFirstCorrection(parameterId); 898 setFirstCorrection(parameterId);
839 } 899 }
840 } 900 }
841 if(Settings.gas[i].note.ub.first) 901 if(pSettings->gas[i].note.ub.first)
842 { 902 {
843 if(Settings.gas[i].note.ub.active != 1) 903 if(pSettings->gas[i].note.ub.active != 1)
844 { 904 {
845 Settings.gas[i].note.ub.active = 1; 905 pSettings->gas[i].note.ub.active = 1;
846 corrections++; 906 corrections++;
847 setFirstCorrection(parameterId); 907 setFirstCorrection(parameterId);
848 } 908 }
849 if(Settings.gas[i].note.ub.travel == 1) 909 if(pSettings->gas[i].note.ub.travel == 1)
850 { 910 {
851 Settings.gas[i].note.ub.travel = 0; 911 pSettings->gas[i].note.ub.travel = 0;
852 corrections++; 912 corrections++;
853 setFirstCorrection(parameterId); 913 setFirstCorrection(parameterId);
854 } 914 }
855 if(Settings.gas[i].note.ub.deco == 1) 915 if(pSettings->gas[i].note.ub.deco == 1)
856 { 916 {
857 Settings.gas[i].note.ub.deco = 0; 917 pSettings->gas[i].note.ub.deco = 0;
858 corrections++; 918 corrections++;
859 setFirstCorrection(parameterId); 919 setFirstCorrection(parameterId);
860 } 920 }
861 if((i<=NUM_GASES) && (!firstGasFoundOC)) 921 if((i<=NUM_GASES) && (!firstGasFoundOC))
862 firstGasFoundOC = 1; 922 firstGasFoundOC = 1;
863 else 923 else
864 if((i>NUM_GASES) && (!firstGasFoundCCR)) 924 if((i>NUM_GASES) && (!firstGasFoundCCR))
865 firstGasFoundCCR = 1; 925 firstGasFoundCCR = 1;
866 else 926 else
867 Settings.gas[i].note.ub.first = 0; 927 pSettings->gas[i].note.ub.first = 0;
868 } 928 }
869 if(Settings.gas[i].bottle_size_liter > 40) 929 if(pSettings->gas[i].bottle_size_liter > 40)
870 { 930 {
871 Settings.gas[i].bottle_size_liter = 40; 931 pSettings->gas[i].bottle_size_liter = 40;
872 corrections++; 932 corrections++;
873 setFirstCorrection(parameterId); 933 setFirstCorrection(parameterId);
874 } 934 }
875 if(Settings.gas[i].depth_meter > 250) 935 if(pSettings->gas[i].depth_meter > 250)
876 { 936 {
877 Settings.gas[i].depth_meter = 250; 937 pSettings->gas[i].depth_meter = 250;
878 corrections++; 938 corrections++;
879 setFirstCorrection(parameterId); 939 setFirstCorrection(parameterId);
880 } 940 }
881 if(Settings.gas[i].depth_meter_travel > 250) 941 if(pSettings->gas[i].depth_meter_travel > 250)
882 { 942 {
883 Settings.gas[i].depth_meter_travel = 250; 943 pSettings->gas[i].depth_meter_travel = 250;
884 corrections++; 944 corrections++;
885 setFirstCorrection(parameterId); 945 setFirstCorrection(parameterId);
886 } 946 }
887 /*if(Settings.gas[i].note.ub.senderCode) 947 /*if(pSettings->gas[i].note.ub.senderCode)
888 { 948 {
889 } 949 }
890 if(Settings.gas[i].bottle_wireless_id) 950 if(pSettings->gas[i].bottle_wireless_id)
891 { 951 {
892 } 952 }
893 */ 953 */
894 } // for(int i=1; i<=2*NUM_GASES;i++) 954 } // for(int i=1; i<=2*NUM_GASES;i++)
895 parameterId++; /* 4 */ 955 parameterId++; /* 4 */
896 if(!firstGasFoundOC) 956 if(!firstGasFoundOC)
897 { 957 {
898 Settings.gas[1].note.ub.active = 1; 958 pSettings->gas[1].note.ub.active = 1;
899 Settings.gas[1].note.ub.first = 1; 959 pSettings->gas[1].note.ub.first = 1;
900 Settings.gas[1].note.ub.travel = 0; 960 pSettings->gas[1].note.ub.travel = 0;
901 Settings.gas[1].note.ub.deco = 0; 961 pSettings->gas[1].note.ub.deco = 0;
902 corrections++; 962 corrections++;
903 setFirstCorrection(parameterId); 963 setFirstCorrection(parameterId);
904 } 964 }
905 parameterId++; /* 5 */ 965 parameterId++; /* 5 */
906 if(!firstGasFoundCCR) 966 if(!firstGasFoundCCR)
907 { 967 {
908 Settings.gas[1 + NUM_GASES].note.ub.active = 1; 968 pSettings->gas[1 + NUM_GASES].note.ub.active = 1;
909 Settings.gas[1 + NUM_GASES].note.ub.first = 1; 969 pSettings->gas[1 + NUM_GASES].note.ub.first = 1;
910 Settings.gas[1 + NUM_GASES].note.ub.travel = 0; 970 pSettings->gas[1 + NUM_GASES].note.ub.travel = 0;
911 Settings.gas[1 + NUM_GASES].note.ub.deco = 0; 971 pSettings->gas[1 + NUM_GASES].note.ub.deco = 0;
912 corrections++; 972 corrections++;
913 setFirstCorrection(parameterId); 973 setFirstCorrection(parameterId);
914 } 974 }
915 parameterId++; /* 6 */ 975 parameterId++; /* 6 */
916 /* SSetpointLine setpoint[1 + NUM_GASES]; 976 /* SSetpointLine setpoint[1 + NUM_GASES];
917 */ 977 */
918 for(int i=1; i<=NUM_GASES;i++) 978 for(int i=1; i<=NUM_GASES;i++)
919 { 979 {
920 if(Settings.setpoint[i].setpoint_cbar < MIN_PPO2_SP_CBAR) 980 if(pSettings->setpoint[i].setpoint_cbar < MIN_PPO2_SP_CBAR)
921 { 981 {
922 Settings.setpoint[i].setpoint_cbar = MIN_PPO2_SP_CBAR; 982 pSettings->setpoint[i].setpoint_cbar = MIN_PPO2_SP_CBAR;
923 corrections++; 983 corrections++;
924 setFirstCorrection(parameterId); 984 setFirstCorrection(parameterId);
925 } 985 }
926 if(Settings.setpoint[i].setpoint_cbar > 160) 986 if(pSettings->setpoint[i].setpoint_cbar > 160)
927 { 987 {
928 Settings.setpoint[i].setpoint_cbar = 160; 988 pSettings->setpoint[i].setpoint_cbar = 160;
929 corrections++; 989 corrections++;
930 setFirstCorrection(parameterId); 990 setFirstCorrection(parameterId);
931 } 991 }
932 if(Settings.setpoint[i].depth_meter > 250) 992 if(pSettings->setpoint[i].depth_meter > 250)
933 { 993 {
934 Settings.setpoint[i].depth_meter = 250; 994 pSettings->setpoint[i].depth_meter = 250;
935 corrections++; 995 corrections++;
936 setFirstCorrection(parameterId); 996 setFirstCorrection(parameterId);
937 } 997 }
938 } // for(int i=1; i<=NUM_GASES;i++) 998 } // for(int i=1; i<=NUM_GASES;i++)
939 parameterId++; /* 7 */ 999 parameterId++; /* 7 */
942 setFirstCorrection(parameterId); 1002 setFirstCorrection(parameterId);
943 } 1003 }
944 parameterId++; /* 8 */ 1004 parameterId++; /* 8 */
945 /* uint8_t CCR_Mode; 1005 /* uint8_t CCR_Mode;
946 */ 1006 */
947 if( (Settings.CCR_Mode != CCRMODE_Sensors) && 1007 if( (pSettings->CCR_Mode != CCRMODE_Sensors) &&
948 (Settings.CCR_Mode != CCRMODE_Simulation) && 1008 (pSettings->CCR_Mode != CCRMODE_Simulation) &&
949 (Settings.CCR_Mode != CCRMODE_FixedSetpoint)) 1009 (pSettings->CCR_Mode != CCRMODE_FixedSetpoint))
950 { 1010 {
951 Settings.CCR_Mode = CCRMODE_FixedSetpoint; 1011 pSettings->CCR_Mode = CCRMODE_FixedSetpoint;
952 corrections++; 1012 corrections++;
953 setFirstCorrection(parameterId); 1013 setFirstCorrection(parameterId);
954 } 1014 }
955 parameterId++; /* 9 */ 1015 parameterId++; /* 9 */
956 /* split2x4_Type deco_type; 1016 /* split2x4_Type deco_type;
957 */ 1017 */
958 if( (Settings.deco_type.ub.standard != GF_MODE) && 1018 if( (pSettings->deco_type.ub.standard != GF_MODE) &&
959 (Settings.deco_type.ub.standard != VPM_MODE)) 1019 (pSettings->deco_type.ub.standard != VPM_MODE))
960 { 1020 {
961 Settings.deco_type.ub.standard = VPM_MODE; 1021 pSettings->deco_type.ub.standard = VPM_MODE;
962 corrections++; 1022 corrections++;
963 setFirstCorrection(parameterId); 1023 setFirstCorrection(parameterId);
964 } 1024 }
965 parameterId++; /* 10 */ 1025 parameterId++; /* 10 */
966 if(Settings.deco_type.ub.alternative != GF_MODE) 1026 if(pSettings->deco_type.ub.alternative != GF_MODE)
967 { 1027 {
968 Settings.deco_type.ub.alternative = GF_MODE; 1028 pSettings->deco_type.ub.alternative = GF_MODE;
969 corrections++; 1029 corrections++;
970 setFirstCorrection(parameterId); 1030 setFirstCorrection(parameterId);
971 } 1031 }
972 parameterId++; /* 11 */ 1032 parameterId++; /* 11 */
973 /* uint8_t ppO2_max_deco; 1033 /* uint8_t ppO2_max_deco;
974 */ 1034 */
975 if(Settings.ppO2_max_deco > 190) 1035 if(pSettings->ppO2_max_deco > 190)
976 { 1036 {
977 Settings.ppO2_max_deco = 190; 1037 pSettings->ppO2_max_deco = 190;
978 corrections++; 1038 corrections++;
979 setFirstCorrection(parameterId); 1039 setFirstCorrection(parameterId);
980 } 1040 }
981 parameterId++; /* 12 */ 1041 parameterId++; /* 12 */
982 if(Settings.ppO2_max_deco < 100) 1042 if(pSettings->ppO2_max_deco < 100)
983 { 1043 {
984 Settings.ppO2_max_deco = 100; 1044 pSettings->ppO2_max_deco = 100;
985 corrections++; 1045 corrections++;
986 setFirstCorrection(parameterId); 1046 setFirstCorrection(parameterId);
987 } 1047 }
988 parameterId++; /* 13 */ 1048 parameterId++; /* 13 */
989 1049
990 /* uint8_t ppO2_max_std; 1050 /* uint8_t ppO2_max_std;
991 */ 1051 */
992 if(Settings.ppO2_max_std > 190) 1052 if(pSettings->ppO2_max_std > 190)
993 { 1053 {
994 Settings.ppO2_max_std = 190; 1054 pSettings->ppO2_max_std = 190;
995 corrections++; 1055 corrections++;
996 setFirstCorrection(parameterId); 1056 setFirstCorrection(parameterId);
997 } 1057 }
998 parameterId++; /* 14 */ 1058 parameterId++; /* 14 */
999 if(Settings.ppO2_max_std < 100) 1059 if(pSettings->ppO2_max_std < 100)
1000 { 1060 {
1001 Settings.ppO2_max_std = 100; 1061 pSettings->ppO2_max_std = 100;
1002 corrections++; 1062 corrections++;
1003 setFirstCorrection(parameterId); 1063 setFirstCorrection(parameterId);
1004 } 1064 }
1005 parameterId++; /* 15 */ 1065 parameterId++; /* 15 */
1006 /* uint8_t ppO2_min; 1066 /* uint8_t ppO2_min;
1007 */ 1067 */
1008 if(Settings.ppO2_min != 15) 1068 if(pSettings->ppO2_min != 15)
1009 { 1069 {
1010 Settings.ppO2_min = 15; 1070 pSettings->ppO2_min = 15;
1011 corrections++; 1071 corrections++;
1012 setFirstCorrection(parameterId); 1072 setFirstCorrection(parameterId);
1013 } 1073 }
1014 parameterId++; /* 16 */ 1074 parameterId++; /* 16 */
1015 /* uint8_t CNS_max; 1075 /* uint8_t CNS_max;
1016 */ 1076 */
1017 if(Settings.CNS_max != 90) 1077 if(pSettings->CNS_max != 90)
1018 { 1078 {
1019 Settings.CNS_max = 90; 1079 pSettings->CNS_max = 90;
1020 corrections++; 1080 corrections++;
1021 setFirstCorrection(parameterId); 1081 setFirstCorrection(parameterId);
1022 } 1082 }
1023 parameterId++; /* 17 */ 1083 parameterId++; /* 17 */
1024 /* uint8_t ascent_MeterPerMinute_max; 1084 /* uint8_t ascent_MeterPerMinute_max;
1025 */ 1085 */
1026 if(Settings.ascent_MeterPerMinute_max != 30) 1086 if(pSettings->ascent_MeterPerMinute_max != 30)
1027 { 1087 {
1028 Settings.ascent_MeterPerMinute_max = 30; 1088 pSettings->ascent_MeterPerMinute_max = 30;
1029 corrections++; 1089 corrections++;
1030 setFirstCorrection(parameterId); 1090 setFirstCorrection(parameterId);
1031 } 1091 }
1032 parameterId++; /* 18 */ 1092 parameterId++; /* 18 */
1033 /* uint8_t ascent_MeterPerMinute_showGraph; 1093 /* uint8_t ascent_MeterPerMinute_showGraph;
1034 */ 1094 */
1035 if(Settings.ascent_MeterPerMinute_showGraph != 30) 1095 if(pSettings->ascent_MeterPerMinute_showGraph != 30)
1036 { 1096 {
1037 Settings.ascent_MeterPerMinute_showGraph = 30; 1097 pSettings->ascent_MeterPerMinute_showGraph = 30;
1038 corrections++; 1098 corrections++;
1039 setFirstCorrection(parameterId); 1099 setFirstCorrection(parameterId);
1040 } 1100 }
1041 parameterId++; /* 19 */ 1101 parameterId++; /* 19 */
1042 /* uint8_t future_TTS; 1102 /* uint8_t future_TTS;
1043 */ 1103 */
1044 if(Settings.future_TTS > 15) 1104 if(pSettings->future_TTS > 15)
1045 { 1105 {
1046 Settings.future_TTS = 15; 1106 pSettings->future_TTS = 15;
1047 corrections++; 1107 corrections++;
1048 setFirstCorrection(parameterId); 1108 setFirstCorrection(parameterId);
1049 } 1109 }
1050 parameterId++; /* 20 */ 1110 parameterId++; /* 20 */
1051 /* uint8_t GF_high; 1111 /* uint8_t GF_high;
1052 */ 1112 */
1053 if(Settings.GF_high > 99) 1113 if(pSettings->GF_high > 99)
1054 { 1114 {
1055 Settings.GF_high = 99; 1115 pSettings->GF_high = 99;
1056 corrections++; 1116 corrections++;
1057 setFirstCorrection(parameterId); 1117 setFirstCorrection(parameterId);
1058 } 1118 }
1059 parameterId++; /* 21 */ 1119 parameterId++; /* 21 */
1060 if(Settings.GF_high < 45) 1120 if(pSettings->GF_high < 45)
1061 { 1121 {
1062 Settings.GF_high = 45; 1122 pSettings->GF_high = 45;
1063 corrections++; 1123 corrections++;
1064 setFirstCorrection(parameterId); 1124 setFirstCorrection(parameterId);
1065 } 1125 }
1066 parameterId++; /* 22 */ 1126 parameterId++; /* 22 */
1067 /* uint8_t GF_low; 1127 /* uint8_t GF_low;
1068 */ 1128 */
1069 if(Settings.GF_low > 99) 1129 if(pSettings->GF_low > 99)
1070 { 1130 {
1071 Settings.GF_low = 99; 1131 pSettings->GF_low = 99;
1072 corrections++; 1132 corrections++;
1073 setFirstCorrection(parameterId); 1133 setFirstCorrection(parameterId);
1074 } 1134 }
1075 parameterId++; /* 23 */ 1135 parameterId++; /* 23 */
1076 if(Settings.GF_low < 10) 1136 if(pSettings->GF_low < 10)
1077 { 1137 {
1078 Settings.GF_low = 10; 1138 pSettings->GF_low = 10;
1079 corrections++; 1139 corrections++;
1080 setFirstCorrection(parameterId); 1140 setFirstCorrection(parameterId);
1081 } 1141 }
1082 parameterId++; /* 24 */ 1142 parameterId++; /* 24 */
1083 if(Settings.GF_low > Settings.GF_high) 1143 if(pSettings->GF_low > pSettings->GF_high)
1084 { 1144 {
1085 Settings.GF_low = Settings.GF_high; 1145 pSettings->GF_low = pSettings->GF_high;
1086 corrections++; 1146 corrections++;
1087 setFirstCorrection(parameterId); 1147 setFirstCorrection(parameterId);
1088 } 1148 }
1089 parameterId++; /* 25 */ 1149 parameterId++; /* 25 */
1090 /* uint8_t aGF_high; 1150 /* uint8_t aGF_high;
1091 */ 1151 */
1092 if(Settings.aGF_high > 99) 1152 if(pSettings->aGF_high > 99)
1093 { 1153 {
1094 Settings.aGF_high = 99; 1154 pSettings->aGF_high = 99;
1095 corrections++; 1155 corrections++;
1096 setFirstCorrection(parameterId); 1156 setFirstCorrection(parameterId);
1097 } 1157 }
1098 parameterId++; /* 26 */ 1158 parameterId++; /* 26 */
1099 if(Settings.aGF_high < 45) 1159 if(pSettings->aGF_high < 45)
1100 { 1160 {
1101 Settings.aGF_high = 45; 1161 pSettings->aGF_high = 45;
1102 corrections++; 1162 corrections++;
1103 setFirstCorrection(parameterId); 1163 setFirstCorrection(parameterId);
1104 } 1164 }
1105 parameterId++; /* 27 */ 1165 parameterId++; /* 27 */
1106 /* uint8_t aGF_low; 1166 /* uint8_t aGF_low;
1107 */ 1167 */
1108 if(Settings.aGF_low > 99) 1168 if(pSettings->aGF_low > 99)
1109 { 1169 {
1110 Settings.aGF_low = 99; 1170 pSettings->aGF_low = 99;
1111 corrections++; 1171 corrections++;
1112 setFirstCorrection(parameterId); 1172 setFirstCorrection(parameterId);
1113 } 1173 }
1114 parameterId++; /* 28 */ 1174 parameterId++; /* 28 */
1115 if(Settings.aGF_low < 10) 1175 if(pSettings->aGF_low < 10)
1116 { 1176 {
1117 Settings.aGF_low = 10; 1177 pSettings->aGF_low = 10;
1118 corrections++; 1178 corrections++;
1119 setFirstCorrection(parameterId); 1179 setFirstCorrection(parameterId);
1120 } 1180 }
1121 parameterId++; /* 29 */ 1181 parameterId++; /* 29 */
1122 if(Settings.aGF_low > Settings.aGF_high) 1182 if(pSettings->aGF_low > pSettings->aGF_high)
1123 { 1183 {
1124 Settings.aGF_low = Settings.aGF_high; 1184 pSettings->aGF_low = pSettings->aGF_high;
1125 corrections++; 1185 corrections++;
1126 setFirstCorrection(parameterId); 1186 setFirstCorrection(parameterId);
1127 } 1187 }
1128 parameterId++; /* 30 */ 1188 parameterId++; /* 30 */
1129 /* split2x4_Type VPM_conservatism; 1189 /* split2x4_Type VPM_conservatism;
1130 */ 1190 */
1131 if(Settings.VPM_conservatism.ub.standard > 5) 1191 if(pSettings->VPM_conservatism.ub.standard > 5)
1132 { 1192 {
1133 Settings.VPM_conservatism.ub.standard = 5; 1193 pSettings->VPM_conservatism.ub.standard = 5;
1134 corrections++; 1194 corrections++;
1135 setFirstCorrection(parameterId); 1195 setFirstCorrection(parameterId);
1136 } 1196 }
1137 parameterId++; /* 31 */ 1197 parameterId++; /* 31 */
1138 if(Settings.VPM_conservatism.ub.alternative > 5) 1198 if(pSettings->VPM_conservatism.ub.alternative > 5)
1139 { 1199 {
1140 Settings.VPM_conservatism.ub.alternative = 5; 1200 pSettings->VPM_conservatism.ub.alternative = 5;
1141 corrections++; 1201 corrections++;
1142 setFirstCorrection(parameterId); 1202 setFirstCorrection(parameterId);
1143 } 1203 }
1144 parameterId++; /* 32 */ 1204 parameterId++; /* 32 */
1145 /* uint8_t safetystopDuration; 1205 /* uint8_t safetystopDuration;
1146 */ 1206 */
1147 if(Settings.safetystopDuration > 5) 1207 if(pSettings->safetystopDuration > 5)
1148 { 1208 {
1149 Settings.safetystopDuration = 5; 1209 pSettings->safetystopDuration = 5;
1150 corrections++; 1210 corrections++;
1151 setFirstCorrection(parameterId); 1211 setFirstCorrection(parameterId);
1152 } 1212 }
1153 parameterId++; /* 33 */ 1213 parameterId++; /* 33 */
1154 /* uint8_t AtemMinutenVolumenLiter; 1214 /* uint8_t AtemMinutenVolumenLiter;
1155 */ 1215 */
1156 if(Settings.AtemMinutenVolumenLiter != 25) 1216 if(pSettings->AtemMinutenVolumenLiter != 25)
1157 { 1217 {
1158 Settings.AtemMinutenVolumenLiter = 25; 1218 pSettings->AtemMinutenVolumenLiter = 25;
1159 corrections++; 1219 corrections++;
1160 setFirstCorrection(parameterId); 1220 setFirstCorrection(parameterId);
1161 } 1221 }
1162 parameterId++; /* 34 */ 1222 parameterId++; /* 34 */
1163 /* uint8_t ReserveFractionDenominator; 1223 /* uint8_t ReserveFractionDenominator;
1164 */ 1224 */
1165 if(Settings.ReserveFractionDenominator != 4) 1225 if(pSettings->ReserveFractionDenominator != 4)
1166 { 1226 {
1167 Settings.ReserveFractionDenominator = 4; 1227 pSettings->ReserveFractionDenominator = 4;
1168 corrections++; 1228 corrections++;
1169 setFirstCorrection(parameterId); 1229 setFirstCorrection(parameterId);
1170 } 1230 }
1171 parameterId++; /* 35 */ 1231 parameterId++; /* 35 */
1172 /* uint8_t salinity; 1232 /* uint8_t salinity;
1173 */ 1233 */
1174 if(Settings.salinity > 4) 1234 if(pSettings->salinity > 4)
1175 { 1235 {
1176 Settings.salinity = 4; 1236 pSettings->salinity = 4;
1177 corrections++; 1237 corrections++;
1178 setFirstCorrection(parameterId); 1238 setFirstCorrection(parameterId);
1179 } 1239 }
1180 parameterId++; /* 36 */ 1240 parameterId++; /* 36 */
1181 /* uint8_t last_stop_depth_meter; 1241 /* uint8_t last_stop_depth_meter;
1182 */ 1242 */
1183 if(Settings.last_stop_depth_meter > 9) 1243 if(pSettings->last_stop_depth_meter > 9)
1184 { 1244 {
1185 Settings.last_stop_depth_meter = 9; 1245 pSettings->last_stop_depth_meter = 9;
1186 corrections++; 1246 corrections++;
1187 setFirstCorrection(parameterId); 1247 setFirstCorrection(parameterId);
1188 } 1248 }
1189 parameterId++; /* 37 */ 1249 parameterId++; /* 37 */
1190 if(Settings.last_stop_depth_meter < 3) 1250 if(pSettings->last_stop_depth_meter < 3)
1191 { 1251 {
1192 Settings.last_stop_depth_meter = 3; 1252 pSettings->last_stop_depth_meter = 3;
1193 corrections++; 1253 corrections++;
1194 setFirstCorrection(parameterId); 1254 setFirstCorrection(parameterId);
1195 } 1255 }
1196 parameterId++; /* 38 */ 1256 parameterId++; /* 38 */
1197 /* uint8_t stop_increment_depth_meter; 1257 /* uint8_t stop_increment_depth_meter;
1198 */ 1258 */
1199 if(Settings.stop_increment_depth_meter != 3) 1259 if(pSettings->stop_increment_depth_meter != 3)
1200 { 1260 {
1201 Settings.stop_increment_depth_meter = 3; 1261 pSettings->stop_increment_depth_meter = 3;
1202 corrections++; 1262 corrections++;
1203 setFirstCorrection(parameterId); 1263 setFirstCorrection(parameterId);
1204 } 1264 }
1205 parameterId++; /* 39 */ 1265 parameterId++; /* 39 */
1206 /* uint8_t brightness; 1266 /* uint8_t brightness;
1207 */ 1267 */
1208 if(Settings.brightness > 4) 1268 if(pSettings->brightness > 4)
1209 { 1269 {
1210 Settings.brightness = 4; 1270 pSettings->brightness = 4;
1211 corrections++; 1271 corrections++;
1212 setFirstCorrection(parameterId); 1272 setFirstCorrection(parameterId);
1213 } 1273 }
1214 parameterId++; /* 40 */ 1274 parameterId++; /* 40 */
1215 /* uint8_t date_format; 1275 /* uint8_t date_format;
1216 */ 1276 */
1217 if( (Settings.date_format != DDMMYY) && 1277 if( (pSettings->date_format != DDMMYY) &&
1218 (Settings.date_format != MMDDYY) && 1278 (pSettings->date_format != MMDDYY) &&
1219 (Settings.date_format != YYMMDD)) 1279 (pSettings->date_format != YYMMDD))
1220 { 1280 {
1221 Settings.date_format = DDMMYY; 1281 pSettings->date_format = DDMMYY;
1222 corrections++; 1282 corrections++;
1223 setFirstCorrection(parameterId); 1283 setFirstCorrection(parameterId);
1224 } 1284 }
1225 parameterId++; /* 41 */ 1285 parameterId++; /* 41 */
1226 /* uint8_t selected_language; 1286 /* uint8_t selected_language;
1227 */ 1287 */
1228 if(Settings.selected_language >= LANGUAGE_END) 1288 if(pSettings->selected_language >= LANGUAGE_END)
1229 { 1289 {
1230 Settings.selected_language = LANGUAGE_English; 1290 pSettings->selected_language = LANGUAGE_English;
1231 corrections++; 1291 corrections++;
1232 setFirstCorrection(parameterId); 1292 setFirstCorrection(parameterId);
1233 } 1293 }
1234 parameterId++; /* 42 */ 1294 parameterId++; /* 42 */
1235 /* char customtext[60]; 1295 /* char customtext[60];
1236 */ 1296 */
1237 if(Settings.customtext[59] != 0) 1297 if(pSettings->customtext[59] != 0)
1238 { 1298 {
1239 Settings.customtext[59] = 0; 1299 pSettings->customtext[59] = 0;
1240 corrections++; 1300 corrections++;
1241 setFirstCorrection(parameterId); 1301 setFirstCorrection(parameterId);
1242 } 1302 }
1243 parameterId++; /* 43 */ 1303 parameterId++; /* 43 */
1244 /* uint16_t timeoutSurfacemode; 1304 /* uint16_t timeoutSurfacemode;
1245 */ 1305 */
1246 if( (Settings.timeoutSurfacemode != 20) && // Quick Sleep Option 1306 if( (pSettings->timeoutSurfacemode != 20) && // Quick Sleep Option
1247 (Settings.timeoutSurfacemode != 120)) 1307 (pSettings->timeoutSurfacemode != 120))
1248 { 1308 {
1249 Settings.timeoutSurfacemode = 120; 1309 pSettings->timeoutSurfacemode = 120;
1250 corrections++; 1310 corrections++;
1251 setFirstCorrection(parameterId); 1311 setFirstCorrection(parameterId);
1252 } 1312 }
1253 parameterId++; /* 44 */ 1313 parameterId++; /* 44 */
1254 /* uint8_t timeoutMenuSurface; 1314 /* uint8_t timeoutMenuSurface;
1255 */ 1315 */
1256 if(Settings.timeoutMenuSurface != 120) 1316 if(pSettings->timeoutMenuSurface != 120)
1257 { 1317 {
1258 Settings.timeoutMenuSurface = 120; 1318 pSettings->timeoutMenuSurface = 120;
1259 corrections++; 1319 corrections++;
1260 setFirstCorrection(parameterId); 1320 setFirstCorrection(parameterId);
1261 } 1321 }
1262 parameterId++; /* 45 */ 1322 parameterId++; /* 45 */
1263 /* uint8_t timeoutMenuDive; 1323 /* uint8_t timeoutMenuDive;
1264 */ 1324 */
1265 if(Settings.timeoutMenuDive != 120) 1325 if(pSettings->timeoutMenuDive != 120)
1266 { 1326 {
1267 Settings.timeoutMenuDive = 120; 1327 pSettings->timeoutMenuDive = 120;
1268 corrections++; 1328 corrections++;
1269 setFirstCorrection(parameterId); 1329 setFirstCorrection(parameterId);
1270 } 1330 }
1271 parameterId++; /* 46 */ 1331 parameterId++; /* 46 */
1272 /* uint8_t timeoutMenuEdit; 1332 /* uint8_t timeoutMenuEdit;
1273 */ 1333 */
1274 if(Settings.timeoutMenuEdit != 120) 1334 if(pSettings->timeoutMenuEdit != 120)
1275 { 1335 {
1276 Settings.timeoutMenuEdit = 120; 1336 pSettings->timeoutMenuEdit = 120;
1277 corrections++; 1337 corrections++;
1278 setFirstCorrection(parameterId); 1338 setFirstCorrection(parameterId);
1279 } 1339 }
1280 parameterId++; /* 47 */ 1340 parameterId++; /* 47 */
1281 /* uint8_t timeoutInfo; 1341 /* uint8_t timeoutInfo;
1282 */ 1342 */
1283 if(Settings.timeoutInfo != 120) 1343 if(pSettings->timeoutInfo != 120)
1284 { 1344 {
1285 Settings.timeoutInfo = 120; 1345 pSettings->timeoutInfo = 120;
1286 corrections++; 1346 corrections++;
1287 setFirstCorrection(parameterId); 1347 setFirstCorrection(parameterId);
1288 } 1348 }
1289 parameterId++; /* 48 */ 1349 parameterId++; /* 48 */
1290 /* uint8_t timeoutInfoCompass; 1350 /* uint8_t timeoutInfoCompass;
1291 */ 1351 */
1292 if(Settings.timeoutInfoCompass != 60) 1352 if(pSettings->timeoutInfoCompass != 60)
1293 { 1353 {
1294 Settings.timeoutInfoCompass = 60; 1354 pSettings->timeoutInfoCompass = 60;
1295 corrections++; 1355 corrections++;
1296 setFirstCorrection(parameterId); 1356 setFirstCorrection(parameterId);
1297 } 1357 }
1298 parameterId++; /* 49 */ 1358 parameterId++; /* 49 */
1299 /* uint8_t design; 1359 /* uint8_t design;
1300 */ 1360 */
1301 if(Settings.design != 7) 1361 if(pSettings->design != 7)
1302 { 1362 {
1303 Settings.design = 7; 1363 pSettings->design = 7;
1304 corrections++; 1364 corrections++;
1305 setFirstCorrection(parameterId); 1365 setFirstCorrection(parameterId);
1306 } 1366 }
1307 parameterId++; /* 50 */ 1367 parameterId++; /* 50 */
1308 /* uint16_t timeoutDiveReachedZeroDepth; 1368 /* uint16_t timeoutDiveReachedZeroDepth;
1309 */ 1369 */
1310 if(Settings.timeoutDiveReachedZeroDepth != 300) 1370 if(pSettings->timeoutDiveReachedZeroDepth != 300)
1311 { 1371 {
1312 Settings.timeoutDiveReachedZeroDepth = 300; 1372 pSettings->timeoutDiveReachedZeroDepth = 300;
1313 corrections++; 1373 corrections++;
1314 setFirstCorrection(parameterId); 1374 setFirstCorrection(parameterId);
1315 } 1375 }
1316 parameterId++; /* 51 */ 1376 parameterId++; /* 51 */
1317 /* uint16_t divetimeToCreateLogbook; 1377 /* uint16_t divetimeToCreateLogbook;
1318 */ 1378 */
1319 if(Settings.divetimeToCreateLogbook != 60) 1379 if(pSettings->divetimeToCreateLogbook != 60)
1320 { 1380 {
1321 Settings.divetimeToCreateLogbook = 60; 1381 pSettings->divetimeToCreateLogbook = 60;
1322 corrections++; 1382 corrections++;
1323 setFirstCorrection(parameterId); 1383 setFirstCorrection(parameterId);
1324 } 1384 }
1325 parameterId++; /* 52 */ 1385 parameterId++; /* 52 */
1326 if(Settings.slowExitTime > 9) 1386 if(pSettings->slowExitTime > 9)
1327 { 1387 {
1328 Settings.divetimeToCreateLogbook = 0; 1388 pSettings->divetimeToCreateLogbook = 0;
1329 corrections++; 1389 corrections++;
1330 setFirstCorrection(parameterId); 1390 setFirstCorrection(parameterId);
1331 } 1391 }
1332 parameterId++; /* 53 */ 1392 parameterId++; /* 53 */
1333 1393
1334 if(Settings.warningBuzzer > 1) 1394 if(pSettings->warningBuzzer > 1)
1335 { 1395 {
1336 Settings.warningBuzzer = 0; 1396 pSettings->warningBuzzer = 0;
1337 corrections++; 1397 corrections++;
1338 setFirstCorrection(parameterId); 1398 setFirstCorrection(parameterId);
1339 } 1399 }
1340 parameterId++; /* 54 */ 1400 parameterId++; /* 54 */
1341 1401
1363 1423
1364 /* uint8_t showDebugInfo; 1424 /* uint8_t showDebugInfo;
1365 */ 1425 */
1366 1426
1367 #ifdef HAVE_DEBUG_VIEW 1427 #ifdef HAVE_DEBUG_VIEW
1368 if(Settings.showDebugInfo > 1) 1428 if(pSettings->showDebugInfo > 1)
1369 { 1429 {
1370 Settings.showDebugInfo = 0; 1430 pSettings->showDebugInfo = 0;
1371 corrections++; 1431 corrections++;
1372 } 1432 }
1373 #else 1433 #else
1374 Settings.showDebugInfo = 0; 1434 pSettings->showDebugInfo = 0;
1375 #endif 1435 #endif
1376 1436
1377 /* uint8_t ButtonResponsiveness[4]; 1437 /* uint8_t ButtonResponsiveness[4];
1378 */ 1438 */
1379 // Base value, index 3 1439 // Base value, index 3
1380 if(Settings.ButtonResponsiveness[3] < MIN_BUTTONRESPONSIVENESS_GUI) 1440 if(pSettings->ButtonResponsiveness[3] < MIN_BUTTONRESPONSIVENESS_GUI)
1381 { 1441 {
1382 Settings.ButtonResponsiveness[3] = MIN_BUTTONRESPONSIVENESS_GUI; 1442 pSettings->ButtonResponsiveness[3] = MIN_BUTTONRESPONSIVENESS_GUI;
1383 corrections++; 1443 corrections++;
1384 setFirstCorrection(parameterId); 1444 setFirstCorrection(parameterId);
1385 } 1445 }
1386 else 1446 else
1387 if(Settings.ButtonResponsiveness[3] > MAX_BUTTONRESPONSIVENESS_GUI) 1447 if(pSettings->ButtonResponsiveness[3] > MAX_BUTTONRESPONSIVENESS_GUI)
1388 { 1448 {
1389 Settings.ButtonResponsiveness[3] = MAX_BUTTONRESPONSIVENESS_GUI; 1449 pSettings->ButtonResponsiveness[3] = MAX_BUTTONRESPONSIVENESS_GUI;
1390 corrections++; 1450 corrections++;
1391 setFirstCorrection(parameterId); 1451 setFirstCorrection(parameterId);
1392 } 1452 }
1393 parameterId++; /* 55 */ 1453 parameterId++; /* 55 */
1394 // flex values 0, 1, 2 1454 // flex values 0, 1, 2
1395 for(int i=0; i<3;i++) 1455 for(int i=0; i<3;i++)
1396 { 1456 {
1397 if(Settings.ButtonResponsiveness[i] < MIN_BUTTONRESPONSIVENESS) // 50-10 //Fix for broken buttons. :) 1457 if(pSettings->ButtonResponsiveness[i] < MIN_BUTTONRESPONSIVENESS) // 50-10 //Fix for broken buttons. :)
1398 { 1458 {
1399 Settings.ButtonResponsiveness[i] = MIN_BUTTONRESPONSIVENESS; 1459 pSettings->ButtonResponsiveness[i] = MIN_BUTTONRESPONSIVENESS;
1400 corrections++; 1460 corrections++;
1401 setFirstCorrection(parameterId); 1461 setFirstCorrection(parameterId);
1402 } 1462 }
1403 else 1463 else
1404 if(Settings.ButtonResponsiveness[i] > MAX_BUTTONRESPONSIVENESS) // 110+20 1464 if(pSettings->ButtonResponsiveness[i] > MAX_BUTTONRESPONSIVENESS) // 110+20
1405 { 1465 {
1406 Settings.ButtonResponsiveness[i] = MAX_BUTTONRESPONSIVENESS; 1466 pSettings->ButtonResponsiveness[i] = MAX_BUTTONRESPONSIVENESS;
1407 corrections++; 1467 corrections++;
1408 setFirstCorrection(parameterId); 1468 setFirstCorrection(parameterId);
1409 } 1469 }
1410 } 1470 }
1411 parameterId++; /* 56 */ 1471 parameterId++; /* 56 */
1412 /* uint8_t buttonBalance[3]; 1472 /* uint8_t buttonBalance[3];
1413 */ 1473 */
1414 for(int i=0; i<3;i++) 1474 for(int i=0; i<3;i++)
1415 { 1475 {
1416 if(Settings.buttonBalance[i] < 2) // 2 = -10 1476 if(pSettings->buttonBalance[i] < 2) // 2 = -10
1417 { 1477 {
1418 Settings.buttonBalance[i] = 2; 1478 pSettings->buttonBalance[i] = 2;
1419 corrections++; 1479 corrections++;
1420 setFirstCorrection(parameterId); 1480 setFirstCorrection(parameterId);
1421 } 1481 }
1422 else 1482 else
1423 if(Settings.buttonBalance[i] > 5) // 3 = 0, 4 = +10, 5 = +20 1483 if(pSettings->buttonBalance[i] > 5) // 3 = 0, 4 = +10, 5 = +20
1424 { 1484 {
1425 Settings.buttonBalance[i] = 5; 1485 pSettings->buttonBalance[i] = 5;
1426 corrections++; 1486 corrections++;
1427 setFirstCorrection(parameterId); 1487 setFirstCorrection(parameterId);
1428 } 1488 }
1429 } 1489 }
1430 parameterId++; /* 57 */ 1490 parameterId++; /* 57 */
1431 /* uint8_t nonMetricalSystem; 1491 /* uint8_t nonMetricalSystem;
1432 */ 1492 */
1433 if(Settings.nonMetricalSystem > 1) 1493 if(pSettings->nonMetricalSystem > 1)
1434 { 1494 {
1435 Settings.nonMetricalSystem = 1; 1495 pSettings->nonMetricalSystem = 1;
1436 corrections++; 1496 corrections++;
1437 setFirstCorrection(parameterId); 1497 setFirstCorrection(parameterId);
1438 } 1498 }
1439 parameterId++; /* 58 */ 1499 parameterId++; /* 58 */
1440 /* uint8_t fallbackToFixedSetpoint; 1500 /* uint8_t fallbackToFixedSetpoint;
1441 */ 1501 */
1442 if(Settings.fallbackToFixedSetpoint > 1) 1502 if(pSettings->fallbackToFixedSetpoint > 1)
1443 { 1503 {
1444 Settings.fallbackToFixedSetpoint = 1; 1504 pSettings->fallbackToFixedSetpoint = 1;
1445 corrections++; 1505 corrections++;
1446 setFirstCorrection(parameterId); 1506 setFirstCorrection(parameterId);
1447 } 1507 }
1448 parameterId++; /* 59 */ 1508 parameterId++; /* 59 */
1449 /* uint8_t bluetoothActive; 1509 /* uint8_t bluetoothActive;
1450 */ 1510 */
1451 if(Settings.bluetoothActive > 1) 1511 if(pSettings->bluetoothActive > 1)
1452 { 1512 {
1453 Settings.bluetoothActive = 1; 1513 pSettings->bluetoothActive = 1;
1454 corrections++; 1514 corrections++;
1455 setFirstCorrection(parameterId); 1515 setFirstCorrection(parameterId);
1456 } 1516 }
1457 parameterId++; /* 60 */ 1517 parameterId++; /* 60 */
1458 /* uint8_t safetystopDepth; 1518 /* uint8_t safetystopDepth;
1459 */ 1519 */
1460 if(Settings.safetystopDepth > 6) 1520 if(pSettings->safetystopDepth > 6)
1461 { 1521 {
1462 Settings.safetystopDepth = 6; 1522 pSettings->safetystopDepth = 6;
1463 corrections++; 1523 corrections++;
1464 setFirstCorrection(parameterId); 1524 setFirstCorrection(parameterId);
1465 } 1525 }
1466 parameterId++; /* 61 */ 1526 parameterId++; /* 61 */
1467 if(Settings.safetystopDepth < 3) 1527 if(pSettings->safetystopDepth < 3)
1468 { 1528 {
1469 Settings.safetystopDepth = 3; 1529 pSettings->safetystopDepth = 3;
1470 corrections++; 1530 corrections++;
1471 setFirstCorrection(parameterId); 1531 setFirstCorrection(parameterId);
1472 } 1532 }
1473 parameterId++; /* 62 */ 1533 parameterId++; /* 62 */
1474 /* uint32_t updateSettingsAllowedFromHeader; 1534 /* uint32_t updateSettingsAllowedFromHeader;
1475 */ 1535 */
1476 1536
1477 /* uint8_t ppo2sensors_deactivated; 1537 /* uint8_t ppo2sensors_deactivated;
1478 */ 1538 */
1479 if(Settings.ppo2sensors_deactivated > (1+2+4)) 1539 if(pSettings->ppo2sensors_deactivated > (1+2+4))
1480 { 1540 {
1481 Settings.ppo2sensors_deactivated = 0; 1541 pSettings->ppo2sensors_deactivated = 0;
1482 corrections++; 1542 corrections++;
1483 setFirstCorrection(parameterId); 1543 setFirstCorrection(parameterId);
1484 } 1544 }
1485 parameterId++; /* 63 */ 1545 parameterId++; /* 63 */
1486 /* uint8_t tX_colorscheme; 1546 /* uint8_t tX_colorscheme;
1487 */ 1547 */
1488 if(Settings.tX_colorscheme > 3) 1548 if(pSettings->tX_colorscheme > 3)
1489 { 1549 {
1490 Settings.tX_colorscheme = 0; 1550 pSettings->tX_colorscheme = 0;
1491 corrections++; 1551 corrections++;
1492 setFirstCorrection(parameterId); 1552 setFirstCorrection(parameterId);
1493 } 1553 }
1494 parameterId++; /* 64 */ 1554 parameterId++; /* 64 */
1495 /* uint8_t tX_userselectedLeftLowerCornerPrimary; 1555 /* uint8_t tX_userselectedLeftLowerCornerPrimary;
1496 */ 1556 */
1497 if(Settings.tX_userselectedLeftLowerCornerPrimary >= LLC_END) 1557 if(pSettings->tX_userselectedLeftLowerCornerPrimary >= LLC_END)
1498 { 1558 {
1499 Settings.tX_userselectedLeftLowerCornerPrimary = LLC_Temperature; 1559 pSettings->tX_userselectedLeftLowerCornerPrimary = LLC_Temperature;
1500 corrections++; 1560 corrections++;
1501 setFirstCorrection(parameterId); 1561 setFirstCorrection(parameterId);
1502 } 1562 }
1503 parameterId++; /* 65 */ 1563 parameterId++; /* 65 */
1504 /* uint8_t tX_userselectedLeftLowerCornerTimeout; 1564 /* uint8_t tX_userselectedLeftLowerCornerTimeout;
1505 */ 1565 */
1506 if(Settings.tX_userselectedLeftLowerCornerTimeout > 60) 1566 if(pSettings->tX_userselectedLeftLowerCornerTimeout > 60)
1507 { 1567 {
1508 Settings.tX_userselectedLeftLowerCornerTimeout = 0; 1568 pSettings->tX_userselectedLeftLowerCornerTimeout = 0;
1509 corrections++; 1569 corrections++;
1510 setFirstCorrection(parameterId); 1570 setFirstCorrection(parameterId);
1511 } 1571 }
1512 parameterId++; /* 66 */ 1572 parameterId++; /* 66 */
1513 /* uint8_t tX_customViewPrimary; 1573 /* uint8_t tX_customViewPrimary;
1514 */ 1574 */
1515 if(Settings.tX_customViewPrimary >= CVIEW_END) 1575 if(pSettings->tX_customViewPrimary >= CVIEW_END)
1516 { 1576 {
1517 Settings.tX_customViewPrimary = 1; 1577 pSettings->tX_customViewPrimary = 1;
1518 corrections++; 1578 corrections++;
1519 setFirstCorrection(parameterId); 1579 setFirstCorrection(parameterId);
1520 } 1580 }
1521 parameterId++; /* 67 */ 1581 parameterId++; /* 67 */
1522 /* uint8_t tX_customViewTimeout; 1582 /* uint8_t tX_customViewTimeout;
1523 */ 1583 */
1524 if(Settings.tX_customViewTimeout > 60) 1584 if(pSettings->tX_customViewTimeout > 60)
1525 { 1585 {
1526 Settings.tX_customViewTimeout = 0; 1586 pSettings->tX_customViewTimeout = 0;
1527 corrections++; 1587 corrections++;
1528 setFirstCorrection(parameterId); 1588 setFirstCorrection(parameterId);
1529 } 1589 }
1530 parameterId++; /* 68 */ 1590 parameterId++; /* 68 */
1531 /* uint8_t timeoutEnterButtonSelectDive; 1591 /* uint8_t timeoutEnterButtonSelectDive;
1532 */ 1592 */
1533 if(Settings.timeoutEnterButtonSelectDive != 10) 1593 if(pSettings->timeoutEnterButtonSelectDive != 10)
1534 { 1594 {
1535 Settings.timeoutEnterButtonSelectDive = 10; 1595 pSettings->timeoutEnterButtonSelectDive = 10;
1536 corrections++; 1596 corrections++;
1537 setFirstCorrection(parameterId); 1597 setFirstCorrection(parameterId);
1538 } 1598 }
1539 parameterId++; /* 69 */ 1599 parameterId++; /* 69 */
1540 /* uint8_t logbookOffset; 1600 /* uint8_t logbookOffset;
1541 */ 1601 */
1542 if(Settings.logbookOffset > 9000) 1602 if(pSettings->logbookOffset > 9000)
1543 { 1603 {
1544 Settings.logbookOffset = 0; 1604 pSettings->logbookOffset = 0;
1545 corrections++; 1605 corrections++;
1546 setFirstCorrection(parameterId); 1606 setFirstCorrection(parameterId);
1547 } 1607 }
1548 parameterId++; /* 70 */ 1608 parameterId++; /* 70 */
1549 /* uint8_t alwaysShowPPO2; 1609 /* uint8_t alwaysShowPPO2;
1550 */ 1610 */
1551 if(Settings.alwaysShowPPO2 > 1) 1611 if(pSettings->alwaysShowPPO2 > 1)
1552 { 1612 {
1553 Settings.alwaysShowPPO2 = 0; 1613 pSettings->alwaysShowPPO2 = 0;
1554 corrections++; 1614 corrections++;
1555 setFirstCorrection(parameterId); 1615 setFirstCorrection(parameterId);
1556 } 1616 }
1557 parameterId++; /* 71 */ 1617 parameterId++; /* 71 */
1558 /* uint8_t extraDisplay; 1618 /* uint8_t extraDisplay;
1559 */ 1619 */
1560 if(Settings.extraDisplay >= EXTRADISPLAY_END) 1620 if(pSettings->extraDisplay >= EXTRADISPLAY_END)
1561 { 1621 {
1562 Settings.extraDisplay = EXTRADISPLAY_BIGFONT; 1622 pSettings->extraDisplay = EXTRADISPLAY_BIGFONT;
1563 corrections++; 1623 corrections++;
1564 setFirstCorrection(parameterId); 1624 setFirstCorrection(parameterId);
1565 } 1625 }
1566 parameterId++; /* 72 */ 1626 parameterId++; /* 72 */
1567 /* int8_t offsetPressure_mbar; 1627 /* int8_t offsetPressure_mbar;
1568 */ 1628 */
1569 if((Settings.offsetPressure_mbar > PRESSURE_OFFSET_LIMIT_MBAR) || 1629 if((pSettings->offsetPressure_mbar > PRESSURE_OFFSET_LIMIT_MBAR) ||
1570 (Settings.offsetPressure_mbar < -1 * PRESSURE_OFFSET_LIMIT_MBAR)) 1630 (pSettings->offsetPressure_mbar < -1 * PRESSURE_OFFSET_LIMIT_MBAR))
1571 { 1631 {
1572 Settings.offsetPressure_mbar = 0; 1632 pSettings->offsetPressure_mbar = 0;
1573 corrections++; 1633 corrections++;
1574 setFirstCorrection(parameterId); 1634 setFirstCorrection(parameterId);
1575 } 1635 }
1576 parameterId++; /* 73 */ 1636 parameterId++; /* 73 */
1577 /* int8_t offsetTemperature_centigrad; 1637 /* int8_t offsetTemperature_centigrad;
1578 */ 1638 */
1579 if((Settings.offsetTemperature_centigrad > 20) || 1639 if((pSettings->offsetTemperature_centigrad > 20) ||
1580 (Settings.offsetTemperature_centigrad < -20)) 1640 (pSettings->offsetTemperature_centigrad < -20))
1581 { 1641 {
1582 Settings.offsetTemperature_centigrad = 0; 1642 pSettings->offsetTemperature_centigrad = 0;
1583 corrections++; 1643 corrections++;
1584 setFirstCorrection(parameterId); 1644 setFirstCorrection(parameterId);
1585 } 1645 }
1586 parameterId++; /* 74 */ 1646 parameterId++; /* 74 */
1587 /* uint8_t gasConsumption_travel_l_min; 1647 /* uint8_t gasConsumption_travel_l_min;
1588 */ 1648 */
1589 if((Settings.gasConsumption_travel_l_min < 5) || 1649 if((pSettings->gasConsumption_travel_l_min < 5) ||
1590 (Settings.gasConsumption_travel_l_min > 50)) 1650 (pSettings->gasConsumption_travel_l_min > 50))
1591 { 1651 {
1592 Settings.gasConsumption_travel_l_min = 20; 1652 pSettings->gasConsumption_travel_l_min = 20;
1593 corrections++; 1653 corrections++;
1594 setFirstCorrection(parameterId); 1654 setFirstCorrection(parameterId);
1595 } 1655 }
1596 parameterId++; /* 75 */ 1656 parameterId++; /* 75 */
1597 /* uint8_t gasConsumption_bottom_l_min; 1657 /* uint8_t gasConsumption_bottom_l_min;
1598 */ 1658 */
1599 if((Settings.gasConsumption_bottom_l_min < 5) || 1659 if((pSettings->gasConsumption_bottom_l_min < 5) ||
1600 (Settings.gasConsumption_bottom_l_min > 50)) 1660 (pSettings->gasConsumption_bottom_l_min > 50))
1601 { 1661 {
1602 Settings.gasConsumption_bottom_l_min = 20; 1662 pSettings->gasConsumption_bottom_l_min = 20;
1603 corrections++; 1663 corrections++;
1604 setFirstCorrection(parameterId); 1664 setFirstCorrection(parameterId);
1605 } 1665 }
1606 parameterId++; /* 76 */ 1666 parameterId++; /* 76 */
1607 /* uint8_t gasConsumption_deco_l_min; 1667 /* uint8_t gasConsumption_deco_l_min;
1608 */ 1668 */
1609 if((Settings.gasConsumption_deco_l_min < 5) || 1669 if((pSettings->gasConsumption_deco_l_min < 5) ||
1610 (Settings.gasConsumption_deco_l_min > 50)) 1670 (pSettings->gasConsumption_deco_l_min > 50))
1611 { 1671 {
1612 Settings.gasConsumption_deco_l_min = 20; 1672 pSettings->gasConsumption_deco_l_min = 20;
1613 corrections++; 1673 corrections++;
1614 setFirstCorrection(parameterId); 1674 setFirstCorrection(parameterId);
1615 } 1675 }
1616 parameterId++; /* 77 */ 1676 parameterId++; /* 77 */
1617 /* uint8_t showDebugInfo; 1677 /* uint8_t showDebugInfo;
1618 */ 1678 */
1619 #ifdef BOOT16 1679 #ifdef BOOT16
1620 Settings.showDebugInfo = 0; 1680 pSettings->showDebugInfo = 0;
1621 #else 1681 #else
1622 if(Settings.showDebugInfo > 1) 1682 if(pSettings->showDebugInfo > 1)
1623 Settings.showDebugInfo = 0; 1683 pSettings->showDebugInfo = 0;
1624 1684
1625 #endif 1685 #endif
1626 1686
1627 /* uint8_t selected_language; 1687 /* uint8_t selected_language;
1628 */ 1688 */
1629 #ifdef BOOT16 1689 #ifdef BOOT16
1630 if(Settings.selected_language > 1) 1690 if(pSettings->selected_language > 1)
1631 Settings.selected_language = 0; 1691 pSettings->selected_language = 0;
1632 #else 1692 #else
1633 if(Settings.selected_language > 4) 1693 if(pSettings->selected_language > 4)
1634 Settings.selected_language = 0; 1694 pSettings->selected_language = 0;
1635 #endif 1695 #endif
1636 1696
1637 1697
1638 /* uint8_t display_toogle_desc; 1/10 seconds 1698 /* uint8_t display_toogle_desc; 1/10 seconds
1639 */ 1699 */
1640 if((Settings.display_toogle_desc < 20) || (Settings.display_toogle_desc > 600)) 1700 if((pSettings->display_toogle_desc < 20) || (pSettings->display_toogle_desc > 600))
1641 { 1701 {
1642 Settings.display_toogle_desc = SettingsStandard.display_toogle_desc; 1702 pSettings->display_toogle_desc = SettingsStandard.display_toogle_desc;
1643 corrections++; 1703 corrections++;
1644 setFirstCorrection(parameterId); 1704 setFirstCorrection(parameterId);
1645 } 1705 }
1646 parameterId++; /* 78 */ 1706 parameterId++; /* 78 */
1647 /* uint8_t debugModeOnStart; 1707 /* uint8_t debugModeOnStart;
1648 */ 1708 */
1649 if(Settings.debugModeOnStart > 1) 1709 if(pSettings->debugModeOnStart > 1)
1650 { 1710 {
1651 Settings.debugModeOnStart = 0; 1711 pSettings->debugModeOnStart = 0;
1652 corrections++; 1712 corrections++;
1653 setFirstCorrection(parameterId); 1713 setFirstCorrection(parameterId);
1654 } 1714 }
1655 parameterId++; /* 79 */ 1715 parameterId++; /* 79 */
1656 1716
1657 /* uint8_t IAmStolenPleaseKillMe; 1717 /* uint8_t IAmStolenPleaseKillMe;
1658 */ 1718 */
1659 1719
1660 if(hardwareDataGetPointer()->primarySerial == 90) 1720 if(hardwareDataGetPointer()->primarySerial == 90)
1661 Settings.IAmStolenPleaseKillMe++; 1721 pSettings->IAmStolenPleaseKillMe++;
1662 else 1722 else
1663 Settings.IAmStolenPleaseKillMe = 0; 1723 pSettings->IAmStolenPleaseKillMe = 0;
1664 1724
1665 1725
1666 /* uint8_t debugModeOnStart; 1726 /* uint8_t debugModeOnStart;
1667 */ 1727 */
1668 if(Settings.compassBearing > 360) 1728 if(pSettings->compassBearing > 360)
1669 { 1729 {
1670 Settings.compassBearing = 0; 1730 pSettings->compassBearing = 0;
1671 corrections++; 1731 corrections++;
1672 setFirstCorrection(parameterId); 1732 setFirstCorrection(parameterId);
1673 } 1733 }
1674 1734
1675 parameterId++; /* 80 */ 1735 parameterId++; /* 80 */
1676 /* uint8_t lastKnownBatteryPercentage; 1736 /* uint8_t lastKnownBatteryPercentage;
1677 */ 1737 */
1678 if(Settings.lastKnownBatteryPercentage > 100) 1738 if(pSettings->lastKnownBatteryPercentage > 100)
1679 { 1739 {
1680 Settings.lastKnownBatteryPercentage = 100; 1740 pSettings->lastKnownBatteryPercentage = 100;
1681 corrections++; 1741 corrections++;
1682 setFirstCorrection(parameterId); 1742 setFirstCorrection(parameterId);
1683 } 1743 }
1684 parameterId++; /* 81 */ 1744 parameterId++; /* 81 */
1685 /* uint8_t VPM_model 1745 /* uint8_t VPM_model
1686 */ 1746 */
1687 if((Settings.VPM_model != VPM_FROM_FORTRAN) && (Settings.VPM_model != VPM_BACHELORWORK)) 1747 if((pSettings->VPM_model != VPM_FROM_FORTRAN) && (pSettings->VPM_model != VPM_BACHELORWORK))
1688 { 1748 {
1689 Settings.VPM_model = VPM_FROM_FORTRAN; 1749 pSettings->VPM_model = VPM_FROM_FORTRAN;
1690 corrections++; 1750 corrections++;
1691 setFirstCorrection(parameterId); 1751 setFirstCorrection(parameterId);
1692 } 1752 }
1693 parameterId++; /* 82 */ 1753 parameterId++; /* 82 */
1694 /* uint8_t Buehlmann_model 1754 /* uint8_t Buehlmann_model
1695 */ 1755 */
1696 if((Settings.GF_model != BUEHLMANN_OSTC4) && (Settings.GF_model != BUEHLMANN_hwOS)) 1756 if((pSettings->GF_model != BUEHLMANN_OSTC4) && (pSettings->GF_model != BUEHLMANN_hwOS))
1697 { 1757 {
1698 Settings.GF_model = BUEHLMANN_OSTC4; 1758 pSettings->GF_model = BUEHLMANN_OSTC4;
1699 corrections++; 1759 corrections++;
1700 setFirstCorrection(parameterId); 1760 setFirstCorrection(parameterId);
1701 } 1761 }
1702 parameterId++; /* 83 */ 1762 parameterId++; /* 83 */
1703 if(Settings.FlipDisplay > 1) /* only boolean values allowed */ 1763 if(pSettings->FlipDisplay > 1) /* only boolean values allowed */
1704 { 1764 {
1705 setFlipDisplay(1); 1765 setFlipDisplay(1);
1706 corrections++; 1766 corrections++;
1707 setFirstCorrection(parameterId); 1767 setFirstCorrection(parameterId);
1708 } 1768 }
1709 parameterId++; /* 84 */ 1769 parameterId++; /* 84 */
1710 #ifdef ENABLE_MOTION_CONTROL 1770 #ifdef ENABLE_MOTION_CONTROL
1711 if(Settings.MotionDetection >= MOTION_DETECT_END) 1771 if(pSettings->MotionDetection >= MOTION_DETECT_END)
1712 { 1772 {
1713 Settings.MotionDetection = MOTION_DETECT_OFF; 1773 pSettings->MotionDetection = MOTION_DETECT_OFF;
1714 corrections++; 1774 corrections++;
1715 setFirstCorrection(parameterId); 1775 setFirstCorrection(parameterId);
1716 } 1776 }
1717 #else 1777 #else
1718 Settings.MotionDetection = MOTION_DETECT_OFF; 1778 pSettings->MotionDetection = MOTION_DETECT_OFF;
1719 Settings.viewPortMode = 0; 1779 pSettings->viewPortMode = 0;
1720 Settings.viewRoll = 0.0; 1780 pSettings->viewRoll = 0.0;
1721 Settings.viewPitch = 0.0; 1781 pSettings->viewPitch = 0.0;
1722 Settings.viewYaw = 0.0; 1782 pSettings->viewYaw = 0.0;
1723 #endif 1783 #endif
1724 parameterId++; /* 85 */ 1784 parameterId++; /* 85 */
1725 if(Settings.compassInertia > MAX_COMPASS_COMP) 1785 if(pSettings->compassInertia > MAX_COMPASS_COMP)
1726 { 1786 {
1727 Settings.compassInertia = 0; 1787 pSettings->compassInertia = 0;
1728 corrections++; 1788 corrections++;
1729 setFirstCorrection(parameterId); 1789 setFirstCorrection(parameterId);
1730 } 1790 }
1731 parameterId++; /* 86 */ 1791 parameterId++; /* 86 */
1732 if(Settings.tX_customViewPrimaryBF > CVIEW_T3_END) 1792 if(pSettings->tX_customViewPrimaryBF > CVIEW_T3_END)
1733 { 1793 {
1734 Settings.tX_customViewPrimaryBF = CVIEW_T3_Decostop; 1794 pSettings->tX_customViewPrimaryBF = CVIEW_T3_Decostop;
1735 corrections++; 1795 corrections++;
1736 setFirstCorrection(parameterId); 1796 setFirstCorrection(parameterId);
1737 } 1797 }
1738 parameterId++; /* 87 */ 1798 parameterId++; /* 87 */
1739 if(Settings.viewPortMode > MAX_VIEWPORT_MODE) 1799 if(pSettings->viewPortMode > MAX_VIEWPORT_MODE)
1740 { 1800 {
1741 Settings.viewPortMode = 0; 1801 pSettings->viewPortMode = 0;
1742 corrections++; 1802 corrections++;
1743 setFirstCorrection(parameterId); 1803 setFirstCorrection(parameterId);
1744 } 1804 }
1745 parameterId++; /* 88 */ 1805 parameterId++; /* 88 */
1746 if(Settings.ppo2sensors_source >= O2_SENSOR_SOURCE_MAX) 1806 if(pSettings->ppo2sensors_source >= O2_SENSOR_SOURCE_MAX)
1747 { 1807 {
1748 Settings.ppo2sensors_source = O2_SENSOR_SOURCE_OPTIC; 1808 pSettings->ppo2sensors_source = O2_SENSOR_SOURCE_OPTIC;
1749 Settings.ppo2sensors_calibCoeff[0] = 0.0; 1809 pSettings->ppo2sensors_calibCoeff[0] = 0.0;
1750 Settings.ppo2sensors_calibCoeff[1] = 0.0; 1810 pSettings->ppo2sensors_calibCoeff[1] = 0.0;
1751 Settings.ppo2sensors_calibCoeff[2] = 0.0; 1811 pSettings->ppo2sensors_calibCoeff[2] = 0.0;
1752 corrections++; 1812 corrections++;
1753 setFirstCorrection(parameterId); 1813 setFirstCorrection(parameterId);
1754 } 1814 }
1755 parameterId++; /* 89 */ 1815 parameterId++; /* 89 */
1756 if(Settings.amPMTime > 1) /* only boolean values allowed */ 1816 if(pSettings->amPMTime > 1) /* only boolean values allowed */
1757 { 1817 {
1758 Settings.amPMTime = 0; 1818 pSettings->amPMTime = 0;
1759 corrections++; 1819 corrections++;
1760 setFirstCorrection(parameterId); 1820 setFirstCorrection(parameterId);
1761 } 1821 }
1762 parameterId++; /* 90 */ 1822 parameterId++; /* 90 */
1763 if(Settings.autoSetpoint > 1) /* only boolean values allowed */ 1823 if(pSettings->autoSetpoint > 1) /* only boolean values allowed */
1764 { 1824 {
1765 Settings.autoSetpoint = 0; 1825 pSettings->autoSetpoint = 0;
1766 corrections++; 1826 corrections++;
1767 setFirstCorrection(parameterId); 1827 setFirstCorrection(parameterId);
1768 } 1828 }
1769 parameterId++; /* 91 */ 1829 parameterId++; /* 91 */
1770 if (Settings.scrubberActiveId > 0x03) { 1830 if (pSettings->scrubberActiveId > 0x03) {
1771 /* scrubber active is used as bitfield => two timer => 2 bits in use */ 1831 /* scrubber active is used as bitfield => two timer => 2 bits in use */
1772 Settings.scrubberActiveId = 0x00; 1832 pSettings->scrubberActiveId = 0x00;
1773 corrections++; 1833 corrections++;
1774 setFirstCorrection(parameterId); 1834 setFirstCorrection(parameterId);
1775 } 1835 }
1776 parameterId++; /* 92 */ 1836 parameterId++; /* 92 */
1777 if((Settings.scrubberData[0].TimerMax > MAX_SCRUBBER_TIME) || Settings.scrubberData[0].TimerCur < MIN_SCRUBBER_TIME || Settings.scrubberData[0].TimerCur > (int16_t)MAX_SCRUBBER_TIME) 1837 if((pSettings->scrubberData[0].TimerMax > MAX_SCRUBBER_TIME) || pSettings->scrubberData[0].TimerCur < MIN_SCRUBBER_TIME || pSettings->scrubberData[0].TimerCur > (int16_t)MAX_SCRUBBER_TIME)
1778 { 1838 {
1779 Settings.scrubberData[0].TimerMax = 0; 1839 pSettings->scrubberData[0].TimerMax = 0;
1780 Settings.scrubberData[0].TimerCur = 0; 1840 pSettings->scrubberData[0].TimerCur = 0;
1781 corrections++; 1841 corrections++;
1782 setFirstCorrection(parameterId); 1842 setFirstCorrection(parameterId);
1783 } 1843 }
1784 parameterId++; /* 93 */ 1844 parameterId++; /* 93 */
1785 if((Settings.scrubberData[1].TimerMax > MAX_SCRUBBER_TIME) || Settings.scrubberData[1].TimerCur < MIN_SCRUBBER_TIME || Settings.scrubberData[1].TimerCur > (int16_t)MAX_SCRUBBER_TIME) 1845 if((pSettings->scrubberData[1].TimerMax > MAX_SCRUBBER_TIME) || pSettings->scrubberData[1].TimerCur < MIN_SCRUBBER_TIME || pSettings->scrubberData[1].TimerCur > (int16_t)MAX_SCRUBBER_TIME)
1786 { 1846 {
1787 Settings.scrubberData[1].TimerMax = 0; 1847 pSettings->scrubberData[1].TimerMax = 0;
1788 Settings.scrubberData[1].TimerCur = 0; 1848 pSettings->scrubberData[1].TimerCur = 0;
1789 corrections++; 1849 corrections++;
1790 setFirstCorrection(parameterId); 1850 setFirstCorrection(parameterId);
1791 } 1851 }
1792 parameterId++; /* 94 */ 1852 parameterId++; /* 94 */
1793 if (Settings.scrubTimerMode == INVALID_SCRUB_TIMER_OFF || Settings.scrubTimerMode > SCRUB_TIMER_END) { 1853 if (pSettings->scrubTimerMode == INVALID_SCRUB_TIMER_OFF || pSettings->scrubTimerMode > SCRUB_TIMER_END) {
1794 Settings.scrubTimerMode = SCRUB_TIMER_MINUTES; 1854 pSettings->scrubTimerMode = SCRUB_TIMER_MINUTES;
1795 corrections++; 1855 corrections++;
1796 setFirstCorrection(parameterId); 1856 setFirstCorrection(parameterId);
1797 } 1857 }
1798 parameterId++; /* 95 */ 1858 parameterId++; /* 95 */
1799 if((Settings.pscr_lung_ratio > PSCR_MAX_LUNG_RATIO) || (Settings.pscr_lung_ratio < PSCR_MIN_LUNG_RATIO)) 1859 if((pSettings->pscr_lung_ratio > PSCR_MAX_LUNG_RATIO) || (pSettings->pscr_lung_ratio < PSCR_MIN_LUNG_RATIO))
1800 { 1860 {
1801 Settings.pscr_lung_ratio = 10; 1861 pSettings->pscr_lung_ratio = 10;
1802 corrections++; 1862 corrections++;
1803 setFirstCorrection(parameterId); 1863 setFirstCorrection(parameterId);
1804 } 1864 }
1805 parameterId++; /* 96 */ 1865 parameterId++; /* 96 */
1806 if(Settings.pscr_o2_drop > PSCR_MAX_O2_DROP) 1866 if(pSettings->pscr_o2_drop > PSCR_MAX_O2_DROP)
1807 { 1867 {
1808 Settings.pscr_o2_drop = 4; 1868 pSettings->pscr_o2_drop = 4;
1809 corrections++; 1869 corrections++;
1810 setFirstCorrection(parameterId); 1870 setFirstCorrection(parameterId);
1811 } 1871 }
1812 parameterId++; /* 97 */ 1872 parameterId++; /* 97 */
1813 if(Settings.co2_sensor_active > 1) 1873 if(pSettings->co2_sensor_active > 1)
1814 { 1874 {
1815 Settings.co2_sensor_active = 0; 1875 pSettings->co2_sensor_active = 0;
1816 corrections++; 1876 corrections++;
1817 setFirstCorrection(parameterId); 1877 setFirstCorrection(parameterId);
1818 } 1878 }
1819 parameterId++; /* 98 */ 1879 parameterId++; /* 98 */
1820 if(Settings.ext_uart_protocol > UART_MAX_PROTOCOL) 1880 if(pSettings->ext_uart_protocol > UART_MAX_PROTOCOL)
1821 { 1881 {
1822 Settings.ext_uart_protocol = 0; 1882 pSettings->ext_uart_protocol = 0;
1823 corrections++; 1883 corrections++;
1824 setFirstCorrection(parameterId); 1884 setFirstCorrection(parameterId);
1825 } 1885 }
1826 parameterId++; /* 99 */ 1886 parameterId++; /* 99 */
1827 if((Settings.ext_sensor_map[0] >= SENSOR_END) 1887 if((pSettings->ext_sensor_map[0] >= SENSOR_END)
1828 || (Settings.ext_sensor_map[1] >= SENSOR_END) 1888 || (pSettings->ext_sensor_map[1] >= SENSOR_END)
1829 || (Settings.ext_sensor_map[2] >= SENSOR_END) 1889 || (pSettings->ext_sensor_map[2] >= SENSOR_END)
1830 || (Settings.ext_sensor_map[3] >= SENSOR_END) 1890 || (pSettings->ext_sensor_map[3] >= SENSOR_END)
1831 || (Settings.ext_sensor_map[4] >= SENSOR_END) 1891 || (pSettings->ext_sensor_map[4] >= SENSOR_END)
1832 || (Settings.ext_sensor_map[5] >= SENSOR_END) 1892 || (pSettings->ext_sensor_map[5] >= SENSOR_END)
1833 || (Settings.ext_sensor_map[6] >= SENSOR_END) 1893 || (pSettings->ext_sensor_map[6] >= SENSOR_END)
1834 || (Settings.ext_sensor_map[7] >= SENSOR_END)) 1894 || (pSettings->ext_sensor_map[7] >= SENSOR_END))
1835 { 1895 {
1836 Settings.ext_sensor_map[0] = SENSOR_OPTIC; 1896 pSettings->ext_sensor_map[0] = SENSOR_OPTIC;
1837 Settings.ext_sensor_map[1] = SENSOR_OPTIC; 1897 pSettings->ext_sensor_map[1] = SENSOR_OPTIC;
1838 Settings.ext_sensor_map[2] = SENSOR_OPTIC; 1898 pSettings->ext_sensor_map[2] = SENSOR_OPTIC;
1839 Settings.ext_sensor_map[3] = SENSOR_NONE; 1899 pSettings->ext_sensor_map[3] = SENSOR_NONE;
1840 Settings.ext_sensor_map[4] = SENSOR_NONE; 1900 pSettings->ext_sensor_map[4] = SENSOR_NONE;
1841 Settings.ext_sensor_map[5] = SENSOR_NONE; 1901 pSettings->ext_sensor_map[5] = SENSOR_NONE;
1842 Settings.ext_sensor_map[6] = SENSOR_NONE; 1902 pSettings->ext_sensor_map[6] = SENSOR_NONE;
1843 Settings.ext_sensor_map[7] = SENSOR_NONE; 1903 pSettings->ext_sensor_map[7] = SENSOR_NONE;
1844 corrections++; 1904 corrections++;
1845 setFirstCorrection(parameterId); 1905 setFirstCorrection(parameterId);
1846 } 1906 }
1847 parameterId++; /* 100 */ 1907 parameterId++; /* 100 */
1848 if(Settings.buttonLockActive > 1) 1908 if(pSettings->buttonLockActive > 1)
1849 { 1909 {
1850 Settings.buttonLockActive = 1; 1910 pSettings->buttonLockActive = 1;
1851 corrections++; 1911 corrections++;
1852 setFirstCorrection(parameterId); 1912 setFirstCorrection(parameterId);
1853 } 1913 }
1854 parameterId++; /* 101 */ 1914 parameterId++; /* 101 */
1855 if (Settings.compassDeclinationDeg > MAX_COMPASS_DECLINATION_DEG) { 1915 if (pSettings->compassDeclinationDeg > MAX_COMPASS_DECLINATION_DEG) {
1856 Settings.compassDeclinationDeg = MAX_COMPASS_DECLINATION_DEG; 1916 pSettings->compassDeclinationDeg = MAX_COMPASS_DECLINATION_DEG;
1857 1917
1858 corrections++; 1918 corrections++;
1859 setFirstCorrection(parameterId); 1919 setFirstCorrection(parameterId);
1860 } else if (Settings.compassDeclinationDeg < -MAX_COMPASS_DECLINATION_DEG) { 1920 } else if (pSettings->compassDeclinationDeg < -MAX_COMPASS_DECLINATION_DEG) {
1861 Settings.compassDeclinationDeg = -MAX_COMPASS_DECLINATION_DEG; 1921 pSettings->compassDeclinationDeg = -MAX_COMPASS_DECLINATION_DEG;
1862 1922
1863 corrections++; 1923 corrections++;
1864 setFirstCorrection(parameterId); 1924 setFirstCorrection(parameterId);
1865 } 1925 }
1866 parameterId++; /* 102 */ 1926 parameterId++; /* 102 */
1867 if (Settings.timerDurationS > 599) { 1927 if (pSettings->timerDurationS > 599) {
1868 Settings.timerDurationS = 599; 1928 pSettings->timerDurationS = 599;
1869 1929
1870 corrections++; 1930 corrections++;
1871 setFirstCorrection(parameterId); 1931 setFirstCorrection(parameterId);
1872 } else if (Settings.timerDurationS < 1) { 1932 } else if (pSettings->timerDurationS < 1) {
1873 Settings.timerDurationS = 1; 1933 pSettings->timerDurationS = 1;
1874 1934
1875 corrections++; 1935 corrections++;
1876 setFirstCorrection(parameterId); 1936 setFirstCorrection(parameterId);
1877 } 1937 }
1878 parameterId++; /* 103 */ 1938 parameterId++; /* 103 */
1879 if(Settings.cvAutofocus > 1) 1939 if(pSettings->cvAutofocus > 1)
1880 { 1940 {
1881 corrections++; 1941 corrections++;
1882 Settings.cvAutofocus = 0; 1942 pSettings->cvAutofocus = 0;
1883 } 1943 }
1884 parameterId++; /* 104 */ 1944 parameterId++; /* 104 */
1885 if((Settings.timeZone.hours > 14) 1945 if((pSettings->timeZone.hours > 14)
1886 || (Settings.timeZone.hours < -12) 1946 || (pSettings->timeZone.hours < -12)
1887 || (Settings.timeZone.minutes > 45)) 1947 || (pSettings->timeZone.minutes > 45))
1888 { 1948 {
1889 Settings.timeZone.hours = 0; 1949 pSettings->timeZone.hours = 0;
1890 Settings.timeZone.minutes = 0; 1950 pSettings->timeZone.minutes = 0;
1891 corrections++; 1951 corrections++;
1892 } 1952 }
1893 parameterId++; /* 105 */ 1953 parameterId++; /* 105 */
1894 if(corrections) 1954 if(corrections)
1895 { 1955 {
1955 2015
1956 inline SSettings* settingsGetPointer(void) 2016 inline SSettings* settingsGetPointer(void)
1957 { 2017 {
1958 return &Settings; 2018 return &Settings;
1959 } 2019 }
1960 2020 SSettings* profileGetPointer(uint8_t number)
2021 {
2022 SSettings* returnPointer = NULL;
2023
2024 if(number < NUMBER_OF_PROFILES)
2025 {
2026 returnPointer = &Profile[number];
2027 }
2028
2029 return returnPointer;
2030 }
1961 2031
1962 // =============================================================================== 2032 // ===============================================================================
1963 // set_settings_to_Standard 2033 // set_settings_to_Standard
1964 /// @brief This function overwrites the current settings of the system 2034 /// @brief This function overwrites the current settings of the system
1965 /// with the EXCEPTION of the personalDiveCount 2035 /// with the EXCEPTION of the personalDiveCount
1969 /// It is called on every start and from Reset All. 2039 /// It is called on every start and from Reset All.
1970 /// 2040 ///
1971 /// 160622 added lastDiveLogIdBackup 2041 /// 160622 added lastDiveLogIdBackup
1972 /// 2042 ///
1973 // =============================================================================== 2043 // ===============================================================================
1974 void set_settings_to_Standard(void) 2044 void set_settings_to_Standard(uint8_t whichSettings)
1975 { 2045 {
1976 SSettings *pSettings; 2046 SSettings *pSettings;
1977 const SSettings *pSettingsStandard; 2047 const SSettings *pSettingsStandard;
1978 uint16_t personalDiveCountBackup; 2048 uint16_t personalDiveCountBackup;
1979 uint8_t lastDiveLogIdBackup; 2049 uint8_t lastDiveLogIdBackup;
1980 uint32_t sampleStartBackup; 2050 uint32_t sampleStartBackup;
1981 pSettings = settingsGetPointer(); 2051 pSettings = settingsGetPointer();
1982 pSettingsStandard = settingsGetPointerStandard(); 2052 pSettingsStandard = settingsGetPointerStandard();
2053 uint8_t profileBackup = pSettings->activeProfile;
2054
2055 switch(whichSettings)
2056 {
2057 default:
2058 case EF_SETTINGS:
2059 break;
2060 case EF_PROFILE0: pSettings = profileGetPointer(0);
2061 break;
2062 case EF_PROFILE1: pSettings = profileGetPointer(1);
2063 break;
2064 case EF_PROFILE2: pSettings = profileGetPointer(2);
2065 break;
2066 case EF_PROFILE3: pSettings = profileGetPointer(3);
2067 break;
2068 }
1983 2069
1984 personalDiveCountBackup = pSettings->personalDiveCount; 2070 personalDiveCountBackup = pSettings->personalDiveCount;
1985 lastDiveLogIdBackup = pSettings->lastDiveLogId; 2071 lastDiveLogIdBackup = pSettings->lastDiveLogId;
1986 sampleStartBackup = pSettings->logFlashNextSampleStartAddress; 2072 sampleStartBackup = pSettings->logFlashNextSampleStartAddress;
1987 2073
1997 2083
1998 memset(pSettings->customtext,0,60); 2084 memset(pSettings->customtext,0,60);
1999 sprintf(pSettings->customtext," <your name>\n <address>"); 2085 sprintf(pSettings->customtext," <your name>\n <address>");
2000 pSettings->cv_configuration &= ~(1 << CVIEW_sensors | 1 << CVIEW_sensors_mV | 1 << CVIEW_Timer); 2086 pSettings->cv_configuration &= ~(1 << CVIEW_sensors | 1 << CVIEW_sensors_mV | 1 << CVIEW_Timer);
2001 2087
2002 set_new_settings_missing_in_ext_flash(); 2088 switch(whichSettings) /* some default data may be dependend on the default value => adapt setting */
2003 check_and_correct_settings(); 2089 {
2090 default:
2091 case EF_SETTINGS: pSettings->activeProfile = profileBackup;
2092 break;
2093 case EF_PROFILE0: pSettings = profileGetPointer(0);
2094 break;
2095 case EF_PROFILE1: pSettings = profileGetPointer(1);
2096 break;
2097 case EF_PROFILE2: pSettings = profileGetPointer(2); /* MCCR */
2098 pSettings->dive_mode = DIVEMODE_CCR;
2099 break;
2100 case EF_PROFILE3: pSettings = profileGetPointer(3); /* ECCR */
2101 pSettings->dive_mode = DIVEMODE_CCR;
2102 pSettings->CCR_Mode = CCRMODE_Sensors;
2103 break;
2104 }
2105
2106 set_new_settings_missing_in_ext_flash(whichSettings);
2107 check_and_correct_settings(whichSettings);
2004 // has to be called too: createDiveSettings(); 2108 // has to be called too: createDiveSettings();
2005 } 2109 }
2006 2110
2007 2111
2008 // =============================================================================== 2112 // ===============================================================================
3411 return true; 3515 return true;
3412 } 3516 }
3413 3517
3414 return false; 3518 return false;
3415 } 3519 }
3520