Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 659:ef198c1669f1
minor, docu update
author | heinrichsweikamp |
---|---|
date | Thu, 08 Nov 2012 08:40:13 +0100 |
parents | 5063fb9f07db |
children | 259e4c1bf3c2 |
comparison
equal
deleted
inserted
replaced
658:75dc320f4681 | 659:ef198c1669f1 |
---|---|
284 cpfslt lo ; Lower then actual warning? | 284 cpfslt lo ; Lower then actual warning? |
285 rcall warn_gf1 ; No, show warning and set flags | 285 rcall warn_gf1 ; No, show warning and set flags |
286 return ; Yes, return | 286 return ; Yes, return |
287 | 287 |
288 warn_gf1: | 288 warn_gf1: |
289 movlw d'2' ; Type of Alarm | 289 movlw d'2' ; Type of alarm (Deco Stop missed/GF violated) |
290 movwf AlarmType ; Copy to Alarm Register | 290 movwf AlarmType ; Copy to alarm Register |
291 bsf event_occured ; Set Event Flag | 291 bsf event_occured ; Set Event Flag |
292 return | 292 return |
293 | 293 |
294 calc_deko_divemode: | 294 calc_deko_divemode: |
295 btfsc twosecupdate ; two seconds after the last call | 295 btfsc twosecupdate ; two seconds after the last call |
730 movlw d'1' | 730 movlw d'1' |
731 addwf ProfileFlagByte,F ; add one byte (The EventByte) | 731 addwf ProfileFlagByte,F ; add one byte (The EventByte) |
732 | 732 |
733 clrf EventByte ; reset EventByte | 733 clrf EventByte ; reset EventByte |
734 | 734 |
735 movf AlarmType,W ; Type of Alarm Bit 0-3 | 735 movf AlarmType,W ; Type of alarm Bit 0-3 |
736 addwf EventByte,F ; Copy to EventByte Bit 0-3 | 736 addwf EventByte,F ; Copy to EventByte Bit 0-3 |
737 clrf AlarmType ; Reset AlarmType | 737 clrf AlarmType ; Reset AlarmType |
738 | 738 |
739 ; Third, check events and add aditional bytes | 739 ; Third, check events and add aditional bytes |
740 btfss manual_gas_changed ; Check flag | 740 btfss manual_gas_changed ; Check flag |
1050 btfss neg_flag | 1050 btfss neg_flag |
1051 bra check_ppO2_0 ; Not too high | 1051 bra check_ppO2_0 ; Not too high |
1052 | 1052 |
1053 check_ppO2_bail2: | 1053 check_ppO2_bail2: |
1054 bsf ppO2_show_value ; set flag if required | 1054 bsf ppO2_show_value ; set flag if required |
1055 movlw d'5' ; Type of Alarm | 1055 movlw d'5' ; Type of alarm (ppO High Warning) |
1056 movwf AlarmType ; Copy to Alarm Register | 1056 movwf AlarmType ; Copy to alarm Register |
1057 bsf event_occured ; Set Event Flag | 1057 bsf event_occured ; Set Event Flag |
1058 | 1058 |
1059 check_ppO2_0: | 1059 check_ppO2_0: |
1060 movff xC+0,sub_b+0 | 1060 movff xC+0,sub_b+0 |
1061 movff xC+1,sub_b+1 | 1061 movff xC+1,sub_b+1 |
1066 call sub16 | 1066 call sub16 |
1067 btfsc neg_flag | 1067 btfsc neg_flag |
1068 bra check_ppO2_1 ; Not too low | 1068 bra check_ppO2_1 ; Not too low |
1069 | 1069 |
1070 bsf ppO2_show_value ; show ppO2 if below threshold! | 1070 bsf ppO2_show_value ; show ppO2 if below threshold! |
1071 movlw d'4' ; Type of Alarm | 1071 movlw d'4' ; Type of alarm (ppO Low Warning) |
1072 movwf AlarmType ; Copy to Alarm Register | 1072 movwf AlarmType ; Copy to alarm Register |
1073 bsf event_occured ; Set Event Flag | 1073 bsf event_occured ; Set Event Flag |
1074 | 1074 |
1075 check_ppO2_1: | 1075 check_ppO2_1: |
1076 btfsc ppO2_show_value ; show value? | 1076 btfsc ppO2_show_value ; show value? |
1077 bra check_ppO2_2 ; yes! | 1077 bra check_ppO2_2 ; yes! |
1840 cpfsgt batt_voltage+1 | 1840 cpfsgt batt_voltage+1 |
1841 bra set_powersafe1 | 1841 bra set_powersafe1 |
1842 return | 1842 return |
1843 | 1843 |
1844 set_powersafe1: | 1844 set_powersafe1: |
1845 movlw d'7' ; Type of Alarm (Battery Low) | 1845 movlw d'7' ; Type of alarm (Battery Low) |
1846 movwf AlarmType ; Copy to Alarm Register | 1846 movwf AlarmType ; Copy to alarm Register |
1847 bsf event_occured ; Set Event Flag | 1847 bsf event_occured ; Set Event Flag |
1848 bsf low_battery_state ; set flag for battery warning | 1848 bsf low_battery_state ; set flag for battery warning |
1849 return ; return | 1849 return ; return |
1850 | 1850 |
1851 set_powersafe2: | 1851 set_powersafe2: |