Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 71:6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
author | heinrichsweikamp |
---|---|
date | Wed, 10 Nov 2010 14:59:09 +0100 |
parents | 8d8e753d72e3 |
children | 2227459e8ef2 |
comparison
equal
deleted
inserted
replaced
70:8d8e753d72e3 | 71:6beb680a6130 |
---|---|
90 bra PLED_color_code_ppo2 ; CF46 [cBar] | 90 bra PLED_color_code_ppo2 ; CF46 [cBar] |
91 dcfsnz debug_temp,F | 91 dcfsnz debug_temp,F |
92 bra PLED_color_code_velocity ; CF47 [m/min] | 92 bra PLED_color_code_velocity ; CF47 [m/min] |
93 dcfsnz debug_temp,F | 93 dcfsnz debug_temp,F |
94 bra PLED_color_code_ceiling ; Show warning if CF41=1 and current depth>shown ceiling | 94 bra PLED_color_code_ceiling ; Show warning if CF41=1 and current depth>shown ceiling |
95 dcfsnz debug_temp,F | |
96 bra PLED_color_code_gaslist ; Color-code current row in Gaslist (%O2 in "EEDATA") | |
97 | |
98 | |
99 PLED_color_code_gaslist: ; %O2 in "EEDATA" | |
100 movff amb_pressure+0,xA+0 | |
101 movff amb_pressure+1,xA+1 | |
102 movlw d'10' | |
103 movwf xB+0 | |
104 clrf xB+1 | |
105 call div16x16 ; xC=p_amb/10 | |
106 movff xC+0,xA+0 | |
107 movff xC+1,xA+1 | |
108 movff EEDATA,xB+0 | |
109 clrf xB+1 | |
110 call mult16x16 ; EEDATA * p_amb/10 | |
111 | |
112 movff xC+0,sub_b+0 | |
113 movff xC+1,sub_b+1 | |
114 GETCUSTOM8 d'18' ; ppo2_warning_high | |
115 mullw d'100' ; ppo2_warning_high*100 | |
116 movff PRODL,sub_a+0 | |
117 movff PRODH,sub_a+1 | |
118 call sub16 | |
119 btfss neg_flag | |
120 bra PLED_color_code_gaslist2; Not too high -> Standard Color! | |
121 | |
122 call PLED_warnings_color | |
123 return | |
124 PLED_color_code_gaslist2: | |
125 call PLED_standard_color | |
126 return | |
127 | |
95 | 128 |
96 PLED_color_code_ceiling: | 129 PLED_color_code_ceiling: |
97 GETCUSTOM8 d'40' ; =1: Warn at all? | 130 GETCUSTOM8 d'40' ; =1: Warn at all? |
98 movwf lo | 131 movwf lo |
99 movlw d'1' | 132 movlw d'1' |
2646 bsf leftbind | 2679 bsf leftbind |
2647 | 2680 |
2648 movlw d'2' | 2681 movlw d'2' |
2649 movwf wait_temp ; here: stores eeprom address for gas list | 2682 movwf wait_temp ; here: stores eeprom address for gas list |
2650 movlw d'231' | 2683 movlw d'231' |
2651 movwf waitms_temp ; here: stores row for gas list | 2684 movwf waitms_temp ; here: stores row for gas list |
2652 clrf hi ; here: Gas counter | 2685 clrf hi ; here: Gas counter |
2653 | 2686 |
2654 PLED_gas_list_loop: | 2687 PLED_gas_list_loop: |
2655 incf hi,F ; Increase Gas | 2688 incf hi,F ; Increase Gas |
2656 movlw d'4' | 2689 movlw d'4' |
2675 movwf POSTINC2 | 2708 movwf POSTINC2 |
2676 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM | 2709 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM |
2677 call read_eeprom ; get byte (stored in EEDATA) | 2710 call read_eeprom ; get byte (stored in EEDATA) |
2678 movff EEDATA,lo ; copy to lo | 2711 movff EEDATA,lo ; copy to lo |
2679 output_8 ; outputs into Postinc2! | 2712 output_8 ; outputs into Postinc2! |
2680 | 2713 |
2681 | 2714 decf EEADR,F ; Gas #hi: %O2 - Set address in internal EEPROM |
2715 call read_eeprom ; get byte (stored in EEDATA) | |
2716 PLED_color_code warn_gas_in_gaslist ; Color-code output (%O2 in "EEDATA") | |
2717 ; Check if gas needs to be greyed-out (inactive) | |
2682 read_int_eeprom d'27' ; read flag register | 2718 read_int_eeprom d'27' ; read flag register |
2683 movff hi,lo ; copy gas number | 2719 movff hi,lo ; copy gas number |
2684 PLED_gas_list_loop1: | 2720 PLED_gas_list_loop1: |
2685 rrcf EEDATA ; roll flags into carry | 2721 rrcf EEDATA ; roll flags into carry |
2686 decfsz lo,F ; max. 5 times... | 2722 decfsz lo,F ; max. 5 times... |