Mercurial > public > hwos_code
comparison src/options.asm @ 143:be997abd1f73
seperate option table, place in address <0x10000
author | heinrichsweikamp |
---|---|
date | Sun, 03 Aug 2014 10:28:21 +0200 |
parents | 8531f39eb70a |
children | f515712d8cd6 |
comparison
equal
deleted
inserted
replaced
142:8531f39eb70a | 143:be997abd1f73 |
---|---|
22 #include "wait.inc" | 22 #include "wait.inc" |
23 | 23 |
24 extern write_eeprom | 24 extern write_eeprom |
25 extern read_eeprom | 25 extern read_eeprom |
26 extern eeprom_serial_save,eeprom_opt_backup | 26 extern eeprom_serial_save,eeprom_opt_backup |
27 extern option_table_begin,option_table_end | |
27 | 28 |
28 global option_reset_all ; Reset all options to factory default. | 29 global option_reset_all ; Reset all options to factory default. |
29 global option_check_all ; Check all option and reset option if out of min/max boundary | 30 global option_check_all ; Check all option and reset option if out of min/max boundary |
30 global option_reset ; Reset FSR0 option to factory default. | 31 global option_reset ; Reset FSR0 option to factory default. |
31 global option_save_all ; Save options to EEPROM. | 32 global option_save_all ; Save options to EEPROM. |
462 movff POSTINC1,POSTINC2 | 463 movff POSTINC1,POSTINC2 |
463 decfsz opt_max | 464 decfsz opt_max |
464 bra option_draw_string | 465 bra option_draw_string |
465 return | 466 return |
466 | 467 |
467 ;============================================================================= | |
468 ; Options Tables | |
469 | |
470 OPTION_UINT8 MACRO lbl, min, max, default, unit, eeprom, register | |
471 global lbl | |
472 lbl: db 0, default ; Type0 = INT8 | |
473 db 1, min | |
474 db max, eeprom | |
475 dw unit | |
476 dw register | |
477 ENDM | |
478 | |
479 OPTION_UINT8p2 MACRO lbl, min, max, default, unit, eeprom, register | |
480 global lbl | |
481 lbl: db 0, default ; Type0 = INT8 | |
482 db 2, min | |
483 db max, eeprom | |
484 dw unit | |
485 dw register | |
486 ENDM | |
487 | |
488 OPTION_UINT8p3 MACRO lbl, min, max, default, unit, eeprom, register | |
489 global lbl | |
490 lbl: db 0, default ; Type0 = INT8 | |
491 db 3, min | |
492 db max, eeprom | |
493 dw unit | |
494 dw register | |
495 ENDM | |
496 | |
497 OPTION_UINT8p10 MACRO lbl, min, max, default, unit, eeprom, register | |
498 global lbl | |
499 lbl: db 0, default ; Type0 = INT8 | |
500 db .10, min | |
501 db max, eeprom | |
502 dw unit | |
503 dw register | |
504 ENDM | |
505 | |
506 OPTION_ENUM8 MACRO lbl, max, default, tValue, eeprom, register | |
507 global lbl | |
508 extern tValue | |
509 lbl: db 1, default ; Type1 = ENUM | |
510 db LOW(tValue), HIGH(tValue) | |
511 db max, eeprom | |
512 dw 0 ; No unit | |
513 dw register | |
514 ENDM | |
515 | |
516 OPTION_BOOL MACRO lbl, default, eeprom, register | |
517 OPTION_ENUM8 lbl, 2, default, tNo, eeprom, register | |
518 ENDM | |
519 | |
520 | |
521 OPTION_STRING MACRO lbl, length, defText, eeprom, register | |
522 global lbl | |
523 lbl: db 2, LOW(defText) ; Type2 = STRING | |
524 db HIGH(defText), 0 | |
525 db length, eeprom | |
526 dw 0 ; No unit | |
527 dw register | |
528 ENDM | |
529 | |
530 | |
531 ;============================================================================= | |
532 extern tPercent, tMeters, tMinutes, tGasDisabled, tbar, tcharx | |
533 extern char_I_deco_gas_change, char_I_setpoint_change, char_I_setpoint_cbar, char_I_dil_change | |
534 extern char_I_dive_interval, char_I_bottom_time, char_I_bottom_depth | |
535 extern char_I_deco_model, char_I_saturation_multiplier, char_I_desaturation_multiplier | |
536 extern char_I_extra_time | |
537 extern tDefName | |
538 ; Option table | |
539 ; OPTION_UINT8 Label, min, max, default, text-string, EEPROM location (-1 for RAM only), RAM location | |
540 option_table_begin: | |
541 ;============================================================================= | |
542 ; Manage Decoplaner & Dive parameters | |
543 OPTION_UINT8p10 odiveInterval, .0, .240, .0, tMinutes, -1, char_I_dive_interval | |
544 OPTION_UINT8p2 obottomTime, .1, .60, .5, tMinutes, -1, char_I_bottom_time | |
545 OPTION_UINT8p3 obottomDepth, .12,.120, .21, tMeters, -1, char_I_bottom_depth | |
546 OPTION_ENUM8 oDiveMode, 4, 0, tDvOC, .8, opt_dive_mode ; 0=OC, 1=CC, 2=Gauge, 3=Apnea | |
547 OPTION_ENUM8 oDecoMode, 2, 1, tZHL16, .9, char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF | |
548 OPTION_UINT8p10 oPPO2Max, .120, ppo2_warning_high, .160, 0, .10, opt_ppO2_max | |
549 OPTION_UINT8 oLastDeco, .3, .6, .3, tMeters, .11, opt_last_stop | |
550 OPTION_UINT8 oGF_low, .10, .100, .30, tPercent, .12, opt_GF_low | |
551 OPTION_UINT8 oGF_high, .60, .110, .85, tPercent, .13, opt_GF_high | |
552 OPTION_UINT8p10 osatmult, .100, .140, .110,tPercent, .14, char_I_saturation_multiplier | |
553 OPTION_UINT8p10 odesatmult, .60, .100, .90,tPercent, .15, char_I_desaturation_multiplier | |
554 OPTION_UINT8p10 oPPO2Min, .16, ppo2_warning_low, .19, 0, .16, opt_ppO2_min | |
555 OPTION_UINT8 oaGF_low, .60, .100, .60, tPercent, .17, opt_aGF_low | |
556 OPTION_UINT8 oaGF_high, .70, .120, .85, tPercent, .18, opt_aGF_high | |
557 OPTION_BOOL oEnable_aGF, 0, .19, opt_enable_aGF ; =1: aGF can be selected underwater | |
558 OPTION_UINT8 oCompassGain, 0, 7, 6, tcharx, .20, opt_compass_gain ; 0-7 (230LSB/Gauss to 1370LSB/Gauss) | |
559 OPTION_ENUM8 oSamplingRate, 2, 0, tSampling2s, .21, opt_sampling_rate ; =1: 10s, =0: 2s | |
560 | |
561 ;============================================================================= | |
562 ; Managing Settings | |
563 OPTION_UINT8 oExtraTime, 0, .9, 0,tMinutes, .22, char_I_extra_time ; Future TTS | |
564 OPTION_ENUM8 oBrightness, 3, 0, tEco, .23, opt_brightness ; =0: Eco, =1:Medium, =2:Full | |
565 OPTION_UINT8 oDiveSalinity, 0, 4, 0, tPercent, .24, opt_salinity ; 0-5% | |
566 OPTION_ENUM8 oCCRMode, 2, 0, tCCRModeFixedSP, .25, opt_ccr_mode ; =0: Fixed SP, =1: Sensor | |
567 OPTION_ENUM8 oLanguage, 4, 0, tEnglish, .26, opt_language ; 0=EN, 1=DE, 2=FR, 3=SP | |
568 OPTION_ENUM8 oDateFormat, 3, 1, tDateformat,.27, opt_dateformat ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD | |
569 OPTION_ENUM8 oUnits, 2, 0, tMetric, .28, opt_units ; 0=Meters, 1=Feets | |
570 | |
571 ;============================================================================= | |
572 ; Compass calibration data | |
573 OPTION_UINT8 oCalx0, 0,.255,.0, 0, .29, compass_CX_f+0 | |
574 OPTION_UINT8 oCalx1, 0,.255,.0, 0, .30, compass_CX_f+1 | |
575 OPTION_UINT8 oCaly0, 0,.255,.0, 0, .31, compass_CY_f+0 | |
576 OPTION_UINT8 oCaly1, 0,.255,.0, 0, .32, compass_CY_f+1 | |
577 OPTION_UINT8 oCalz0, 0,.255,.0, 0, .33, compass_CZ_f+0 | |
578 OPTION_UINT8 oCalz1, 0,.255,.0, 0, .34, compass_CZ_f+1 | |
579 | |
580 ;============================================================================= | |
581 ; Gas list | |
582 OPTION_ENUM8 oGas1, 3, 1, tGasDisabled, .35, opt_gas_type+0; 0=Disabled, 1=First, 2=Travel, 3=Deco | |
583 OPTION_ENUM8 oGas2, 3, 0, tGasDisabled, .36, opt_gas_type+1 | |
584 OPTION_ENUM8 oGas3, 3, 0, tGasDisabled, .37, opt_gas_type+2 | |
585 OPTION_ENUM8 oGas4, 3, 0, tGasDisabled, .38, opt_gas_type+3 | |
586 OPTION_ENUM8 oGas5, 3, 0, tGasDisabled, .39, opt_gas_type+4 | |
587 OPTION_UINT8 oGas1O2, .21,.100, .21, tPercent, .40, opt_gas_O2_ratio+0 | |
588 OPTION_UINT8 oGas1He, .1, .100, .0, tPercent, .41, opt_gas_He_ratio+0 | |
589 OPTION_UINT8 oGas2O2, .21,.100, .21, tPercent, .42, opt_gas_O2_ratio+1 | |
590 OPTION_UINT8 oGas2He, .1, .100, .0, tPercent, .43, opt_gas_He_ratio+1 | |
591 OPTION_UINT8 oGas3O2, .21,.100, .21, tPercent, .44, opt_gas_O2_ratio+2 | |
592 OPTION_UINT8 oGas3He, .1, .100, .0, tPercent, .45, opt_gas_He_ratio+2 | |
593 OPTION_UINT8 oGas4O2, .21,.100, .21, tPercent, .46, opt_gas_O2_ratio+3 | |
594 OPTION_UINT8 oGas4He, .1, .100, .0, tPercent, .47, opt_gas_He_ratio+3 | |
595 OPTION_UINT8 oGas5O2, .21,.100, .21, tPercent, .48, opt_gas_O2_ratio+4 | |
596 OPTION_UINT8 oGas5He, .1, .100, .0, tPercent, .49, opt_gas_He_ratio+4 | |
597 OPTION_UINT8 oGas1Depth, .0, .100, .0, tMeters, .50, opt_OC_bail_gas_change+0 | |
598 OPTION_UINT8 oGas2Depth, .0, .100, .0, tMeters, .51, opt_OC_bail_gas_change+1 | |
599 OPTION_UINT8 oGas3Depth, .0, .100, .0, tMeters, .52, opt_OC_bail_gas_change+2 | |
600 OPTION_UINT8 oGas4Depth, .0, .100, .0, tMeters, .53, opt_OC_bail_gas_change+3 | |
601 OPTION_UINT8 oGas5Depth, .0, .100, .0, tMeters, .54, opt_OC_bail_gas_change+4 | |
602 OPTION_UINT8 oDil1O2, .21,.100, .21, tPercent, .55, opt_dil_O2_ratio+0 | |
603 OPTION_UINT8 oDil1He, .1, .100, .0, tPercent, .56, opt_dil_He_ratio+0 | |
604 OPTION_UINT8 oDil2O2, .21,.100, .21, tPercent, .57, opt_dil_O2_ratio+1 | |
605 OPTION_UINT8 oDil2He, .1, .100, .0, tPercent, .58, opt_dil_He_ratio+1 | |
606 OPTION_UINT8 oDil3O2, .21,.100, .21, tPercent, .59, opt_dil_O2_ratio+2 | |
607 OPTION_UINT8 oDil3He, .1, .100, .0, tPercent, .60, opt_dil_He_ratio+2 | |
608 OPTION_UINT8 oDil4O2, .21,.100, .21, tPercent, .61, opt_dil_O2_ratio+3 | |
609 OPTION_UINT8 oDil4He, .1, .100, .0, tPercent, .62, opt_dil_He_ratio+3 | |
610 OPTION_UINT8 oDil5O2, .21,.100, .21, tPercent, .63, opt_dil_O2_ratio+4 | |
611 OPTION_UINT8 oDil5He, .1, .100, .0, tPercent, .64, opt_dil_He_ratio+4 | |
612 OPTION_UINT8 oSetPoint1, .20, .160, .70, tbar, .65, char_I_setpoint_cbar+0 | |
613 OPTION_UINT8 oSetPoint2, .20, .160, .90, tbar, .66, char_I_setpoint_cbar+1 | |
614 OPTION_UINT8 oSetPoint3, .20, .160, .100, tbar, .67, char_I_setpoint_cbar+2 | |
615 OPTION_UINT8 oSetPoint4, .20, .160, .120, tbar, .68, char_I_setpoint_cbar+3 | |
616 OPTION_UINT8 oSetPoint5, .20, .160, .140, tbar, .69, char_I_setpoint_cbar+4 | |
617 OPTION_UINT8 oSP1Depth, .0, .100, .0, tMeters, .70, char_I_setpoint_change+0 | |
618 OPTION_UINT8 oSP2Depth, .0, .100, .0, tMeters, .71, char_I_setpoint_change+1 | |
619 OPTION_UINT8 oSP3Depth, .0, .100, .0, tMeters, .72, char_I_setpoint_change+2 | |
620 OPTION_UINT8 oSP4Depth, .0, .100, .0, tMeters, .73, char_I_setpoint_change+3 | |
621 OPTION_UINT8 oSP5Depth, .0, .100, .0, tMeters, .74, char_I_setpoint_change+4 | |
622 OPTION_ENUM8 oDil1, 2, 1, tDilDisabled, .75, opt_dil_type+0 ; 0=Disabled, 1=First, 2=Normal | |
623 OPTION_ENUM8 oDil2, 2, 0, tDilDisabled, .76, opt_dil_type+1 | |
624 OPTION_ENUM8 oDil3, 2, 0, tDilDisabled, .77, opt_dil_type+2 | |
625 OPTION_ENUM8 oDil4, 2, 0, tDilDisabled, .78, opt_dil_type+3 | |
626 OPTION_ENUM8 oDil5, 2, 0, tDilDisabled, .79, opt_dil_type+4 | |
627 OPTION_UINT8 oDil1Depth, .0, .100, .0, tMeters, .80, char_I_dil_change+0 | |
628 OPTION_UINT8 oDil2Depth, .0, .100, .0, tMeters, .81, char_I_dil_change+1 | |
629 OPTION_UINT8 oDil3Depth, .0, .100, .0, tMeters, .82, char_I_dil_change+2 | |
630 OPTION_UINT8 oDil4Depth, .0, .100, .0, tMeters, .83, char_I_dil_change+3 | |
631 OPTION_UINT8 oDil5Depth, .0, .100, .0, tMeters, .84, char_I_dil_change+4 | |
632 | |
633 ;============================================================================= | |
634 ; opt_name from 85 to 145 | |
635 OPTION_STRING oName, opt_name_length, tDefName, .85, opt_name | |
636 | |
637 ;============================================================================= | |
638 ; Misc | |
639 OPTION_ENUM8 oColorSetDive, 4, 0, tColorSetName0, .146, opt_dive_color_scheme ; Color scheme divemode | |
640 OPTION_UINT8 oPressureAdjust, .0,.255, .0, -1, .147, opt_pressure_adjust ; SIGNED int (-20/+20mbar max.) | |
641 OPTION_BOOL oSafetyStop, 0, .148, opt_enable_safetystop ; =1: A safety stop is shown | |
642 OPTION_UINT8 oCalGasO2, .21,.100, .21, tPercent, .149, opt_calibration_O2_ratio ; Calibration gas %O2 | |
643 | |
644 ;============================================================================= | |
645 ; Set Time/Set Date (RAM only) | |
646 OPTION_UINT8 oSetHours, .0, .23, .0, 0, -1, hours | |
647 OPTION_UINT8 oSetMinutes, .0, .59, .0, 0, -1, mins | |
648 OPTION_UINT8 oSetDay, .1, .31, .0, 0, -1, day | |
649 OPTION_UINT8 oSetMonth, .1, .12, .0, 0, -1, month | |
650 OPTION_UINT8 oSetYear, .13,.20, .0, 0, -1, year | |
651 | |
652 option_table_end: | |
653 END | 468 END |