comparison src/options.asm @ 139:e0b758865e91

some cleanup
author heinrichsweikamp
date Thu, 17 Jul 2014 17:56:09 +0200
parents 939f1e83c4c2
children 8531f39eb70a
comparison
equal deleted inserted replaced
138:2852b0bd6391 139:e0b758865e91
56 ; TRASH: TBLPTR, TABLAT, WREG, FSR0, FSR1, FSR2 56 ; TRASH: TBLPTR, TABLAT, WREG, FSR0, FSR1, FSR2
57 57
58 option_reset_all: 58 option_reset_all:
59 clrf EEADRH 59 clrf EEADRH
60 read_int_eeprom .2 60 read_int_eeprom .2
61 movff EEDATA,lo 61 tstfsz EEDATA ; Total dives=0?
62 bra option_reset_all2 ; No, skip resetting logbook
62 read_int_eeprom .3 63 read_int_eeprom .3
63 movff EEDATA,hi 64 tstfsz EEDATA ; Total dives=0?
64 tstfsz lo ; Total dives=0?
65 bra option_reset_all2 ; No, skip resetting logbook 65 bra option_reset_all2 ; No, skip resetting logbook
66 tstfsz hi ; Total dives=0? 66
67 bra option_reset_all2 ; No, skip resetting logbook
68
69 clrf EEADRH ; Make sure to select eeprom bank 0
70 clrf EEDATA 67 clrf EEDATA
71 write_int_eeprom .4 68 write_int_eeprom .4
72 write_int_eeprom .5 69 write_int_eeprom .5
73 write_int_eeprom .6 70 write_int_eeprom .6
74 write_int_eeprom .2 ; Also, delete total dive counter 71 write_int_eeprom .2 ; Also, delete total dive counter
524 db length, eeprom 521 db length, eeprom
525 dw 0 ; No unit 522 dw 0 ; No unit
526 dw register 523 dw register
527 ENDM 524 ENDM
528 525
529 ;============================================================================= 526
527 ;=============================================================================
528 extern tPercent, tMeters, tMinutes, tGasDisabled, tbar, tcharx
529 extern char_I_deco_gas_change, char_I_setpoint_change, char_I_setpoint_cbar, char_I_dil_change
530 extern char_I_dive_interval, char_I_bottom_time, char_I_bottom_depth
531 extern char_I_deco_model, char_I_saturation_multiplier, char_I_desaturation_multiplier
532 extern char_I_extra_time
533 extern tDefName
530 ; Option table 534 ; Option table
531 ; OPTION_UINT8 Label, min, max, default, text-string, EEPROM location (-1 for RAM only), RAM location 535 ; OPTION_UINT8 Label, min, max, default, text-string, EEPROM location (-1 for RAM only), RAM location
532
533 ; Manage Gas List.
534 extern tPercent, tMeters, tMinutes, tGasDisabled, tbar, tcharx
535
536 option_table_begin: 536 option_table_begin:
537 extern char_I_deco_gas_change, char_I_setpoint_change, char_I_setpoint_cbar, char_I_dil_change
538 ;============================================================================= 537 ;=============================================================================
539 ; Manage Decoplaner & Dive parameters 538 ; Manage Decoplaner & Dive parameters
540
541 extern char_I_dive_interval, char_I_bottom_time, char_I_bottom_depth
542 OPTION_UINT8p10 odiveInterval, .0, .240, .0, tMinutes, -1, char_I_dive_interval 539 OPTION_UINT8p10 odiveInterval, .0, .240, .0, tMinutes, -1, char_I_dive_interval
543 OPTION_UINT8p2 obottomTime, .1, .60, .5, tMinutes, -1, char_I_bottom_time 540 OPTION_UINT8p2 obottomTime, .1, .60, .5, tMinutes, -1, char_I_bottom_time
544 OPTION_UINT8p3 obottomDepth, .12,.120, .21, tMeters, -1, char_I_bottom_depth 541 OPTION_UINT8p3 obottomDepth, .12,.120, .21, tMeters, -1, char_I_bottom_depth
545
546 extern char_I_deco_model, char_I_saturation_multiplier, char_I_desaturation_multiplier
547 OPTION_ENUM8 oDiveMode, 4, 0, tDvOC, .8, opt_dive_mode ; 0=OC, 1=CC, 2=Gauge, 3=Apnea 542 OPTION_ENUM8 oDiveMode, 4, 0, tDvOC, .8, opt_dive_mode ; 0=OC, 1=CC, 2=Gauge, 3=Apnea
548 OPTION_ENUM8 oDecoMode, 2, 1, tZHL16, .9, char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF 543 OPTION_ENUM8 oDecoMode, 2, 1, tZHL16, .9, char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF
549 OPTION_UINT8p10 oPPO2Max, .120, ppo2_warning_high, .160, 0, .10, opt_ppO2_max 544 OPTION_UINT8p10 oPPO2Max, .120, ppo2_warning_high, .160, 0, .10, opt_ppO2_max
550 OPTION_UINT8 oLastDeco, .3, .6, .3, tMeters, .11, opt_last_stop 545 OPTION_UINT8 oLastDeco, .3, .6, .3, tMeters, .11, opt_last_stop
551 OPTION_UINT8 oGF_low, .10, .100, .30, tPercent, .12, opt_GF_low 546 OPTION_UINT8 oGF_low, .10, .100, .30, tPercent, .12, opt_GF_low
559 OPTION_UINT8 oCompassGain, 0, 7, 6, tcharx, .20, opt_compass_gain ; 0-7 (230LSB/Gauss to 1370LSB/Gauss) 554 OPTION_UINT8 oCompassGain, 0, 7, 6, tcharx, .20, opt_compass_gain ; 0-7 (230LSB/Gauss to 1370LSB/Gauss)
560 OPTION_ENUM8 oSamplingRate, 2, 0, tSampling2s, .21, opt_sampling_rate ; =1: 10s, =0: 2s 555 OPTION_ENUM8 oSamplingRate, 2, 0, tSampling2s, .21, opt_sampling_rate ; =1: 10s, =0: 2s
561 556
562 ;============================================================================= 557 ;=============================================================================
563 ; Managing Settings 558 ; Managing Settings
564 extern char_I_extra_time
565 OPTION_UINT8 oExtraTime, 0, .9, 0,tMinutes, .22, char_I_extra_time ; Future TTS 559 OPTION_UINT8 oExtraTime, 0, .9, 0,tMinutes, .22, char_I_extra_time ; Future TTS
566 OPTION_ENUM8 oBrightness, 3, 0, tEco, .23, opt_brightness ; =0: Eco, =1:Medium, =2:Full 560 OPTION_ENUM8 oBrightness, 3, 0, tEco, .23, opt_brightness ; =0: Eco, =1:Medium, =2:Full
567 OPTION_UINT8 oDiveSalinity, 0, 4, 0, tPercent, .24, opt_salinity ; 0-5% 561 OPTION_UINT8 oDiveSalinity, 0, 4, 0, tPercent, .24, opt_salinity ; 0-5%
568 OPTION_ENUM8 oCCRMode, 2, 0, tCCRModeFixedSP, .25, opt_ccr_mode ; =0: Fixed SP, =1: Sensor 562 OPTION_ENUM8 oCCRMode, 2, 0, tCCRModeFixedSP, .25, opt_ccr_mode ; =0: Fixed SP, =1: Sensor
569 extern tDefName
570 OPTION_ENUM8 oLanguage, 4, 0, tEnglish, .26, opt_language ; 0=EN, 1=DE, 2=FR, 3=SP 563 OPTION_ENUM8 oLanguage, 4, 0, tEnglish, .26, opt_language ; 0=EN, 1=DE, 2=FR, 3=SP
571 OPTION_ENUM8 oDateFormat, 3, 1, tDateformat,.27, opt_dateformat ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD 564 OPTION_ENUM8 oDateFormat, 3, 1, tDateformat,.27, opt_dateformat ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD
572 OPTION_ENUM8 oUnits, 2, 0, tMetric, .28, opt_units ; 0=Meters, 1=Feets 565 OPTION_ENUM8 oUnits, 2, 0, tMetric, .28, opt_units ; 0=Meters, 1=Feets
573 566
574 ;============================================================================= 567 ;=============================================================================
578 OPTION_UINT8 oCaly0, 0,.255,.0, 0, .31, compass_CY_f+0 571 OPTION_UINT8 oCaly0, 0,.255,.0, 0, .31, compass_CY_f+0
579 OPTION_UINT8 oCaly1, 0,.255,.0, 0, .32, compass_CY_f+1 572 OPTION_UINT8 oCaly1, 0,.255,.0, 0, .32, compass_CY_f+1
580 OPTION_UINT8 oCalz0, 0,.255,.0, 0, .33, compass_CZ_f+0 573 OPTION_UINT8 oCalz0, 0,.255,.0, 0, .33, compass_CZ_f+0
581 OPTION_UINT8 oCalz1, 0,.255,.0, 0, .34, compass_CZ_f+1 574 OPTION_UINT8 oCalz1, 0,.255,.0, 0, .34, compass_CZ_f+1
582 575
576 ;=============================================================================
577 ; Gas list
583 OPTION_ENUM8 oGas1, 3, 1, tGasDisabled, .35, opt_gas_type+0; 0=Disabled, 1=First, 2=Travel, 3=Deco 578 OPTION_ENUM8 oGas1, 3, 1, tGasDisabled, .35, opt_gas_type+0; 0=Disabled, 1=First, 2=Travel, 3=Deco
584 OPTION_ENUM8 oGas2, 3, 0, tGasDisabled, .36, opt_gas_type+1 579 OPTION_ENUM8 oGas2, 3, 0, tGasDisabled, .36, opt_gas_type+1
585 OPTION_ENUM8 oGas3, 3, 0, tGasDisabled, .37, opt_gas_type+2 580 OPTION_ENUM8 oGas3, 3, 0, tGasDisabled, .37, opt_gas_type+2
586 OPTION_ENUM8 oGas4, 3, 0, tGasDisabled, .38, opt_gas_type+3 581 OPTION_ENUM8 oGas4, 3, 0, tGasDisabled, .38, opt_gas_type+3
587 OPTION_ENUM8 oGas5, 3, 0, tGasDisabled, .39, opt_gas_type+4 582 OPTION_ENUM8 oGas5, 3, 0, tGasDisabled, .39, opt_gas_type+4
628 OPTION_UINT8 oDil1Depth, .0, .100, .0, tMeters, .80, char_I_dil_change+0 623 OPTION_UINT8 oDil1Depth, .0, .100, .0, tMeters, .80, char_I_dil_change+0
629 OPTION_UINT8 oDil2Depth, .0, .100, .0, tMeters, .81, char_I_dil_change+1 624 OPTION_UINT8 oDil2Depth, .0, .100, .0, tMeters, .81, char_I_dil_change+1
630 OPTION_UINT8 oDil3Depth, .0, .100, .0, tMeters, .82, char_I_dil_change+2 625 OPTION_UINT8 oDil3Depth, .0, .100, .0, tMeters, .82, char_I_dil_change+2
631 OPTION_UINT8 oDil4Depth, .0, .100, .0, tMeters, .83, char_I_dil_change+3 626 OPTION_UINT8 oDil4Depth, .0, .100, .0, tMeters, .83, char_I_dil_change+3
632 OPTION_UINT8 oDil5Depth, .0, .100, .0, tMeters, .84, char_I_dil_change+4 627 OPTION_UINT8 oDil5Depth, .0, .100, .0, tMeters, .84, char_I_dil_change+4
628
629 ;=============================================================================
630 ; opt_name from 85 to 145
633 OPTION_STRING oName, opt_name_length, tDefName, .85, opt_name 631 OPTION_STRING oName, opt_name_length, tDefName, .85, opt_name
634 ; opt_name from 85 to 145 632
633 ;=============================================================================
634 ; Misc
635 OPTION_ENUM8 oColorSetDive, 4, 0, tColorSetName0, .146, opt_dive_color_scheme ; Color scheme divemode 635 OPTION_ENUM8 oColorSetDive, 4, 0, tColorSetName0, .146, opt_dive_color_scheme ; Color scheme divemode
636 OPTION_UINT8 oPressureAdjust, .0,.255, .0, -1, .147, opt_pressure_adjust ; SIGNED int (-20/+20mbar max.) 636 OPTION_UINT8 oPressureAdjust, .0,.255, .0, -1, .147, opt_pressure_adjust ; SIGNED int (-20/+20mbar max.)
637 OPTION_BOOL oSafetyStop, 0, .148, opt_enable_safetystop ; =1: A safety stop is shown 637 OPTION_BOOL oSafetyStop, 0, .148, opt_enable_safetystop ; =1: A safety stop is shown
638 OPTION_UINT8 oCalGasO2, .21,.100, .21, tPercent, .149, opt_calibration_O2_ratio ; Calibration gas %O2 638 OPTION_UINT8 oCalGasO2, .21,.100, .21, tPercent, .149, opt_calibration_O2_ratio ; Calibration gas %O2
639 639
640 ; Set Time/Set Date 640 ;=============================================================================
641 ; Set Time/Set Date (RAM only)
641 OPTION_UINT8 oSetHours, .0, .23, .0, 0, -1, hours 642 OPTION_UINT8 oSetHours, .0, .23, .0, 0, -1, hours
642 OPTION_UINT8 oSetMinutes, .0, .59, .0, 0, -1, mins 643 OPTION_UINT8 oSetMinutes, .0, .59, .0, 0, -1, mins
643 OPTION_UINT8 oSetDay, .1, .31, .0, 0, -1, day 644 OPTION_UINT8 oSetDay, .1, .31, .0, 0, -1, day
644 OPTION_UINT8 oSetMonth, .1, .12, .0, 0, -1, month 645 OPTION_UINT8 oSetMonth, .1, .12, .0, 0, -1, month
645 OPTION_UINT8 oSetYear, .13,.20, .0, 0, -1, year 646 OPTION_UINT8 oSetYear, .13,.20, .0, 0, -1, year