comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 303:9c39cedb662b

disabled live END and EAD (Need some debug work)
author heinrichsweikamp
date Sat, 30 Apr 2011 14:07:44 +0200
parents a5fd8777a598
children ed08d441ed26
comparison
equal deleted inserted replaced
302:36cc8f0c1d73 303:9c39cedb662b
3080 ; We are in CCR mode... 3080 ; We are in CCR mode...
3081 btfss is_bailout ; In bailout mode? 3081 btfss is_bailout ; In bailout mode?
3082 bra PLED_show_end_ead_divemode3 ; No, show CC EAD and END 3082 bra PLED_show_end_ead_divemode3 ; No, show CC EAD and END
3083 3083
3084 PLED_show_end_ead_divemode2: ; Show OC EAD and END 3084 PLED_show_end_ead_divemode2: ; Show OC EAD and END
3085 ; Show EAD: char_I_N2_ratio/0.79*rel_pressure:2*10 -> char_I_N2_ratio*rel_pressure:2/7900 -> EAD in m 3085 ; EAD and END: ToDo...
3086
3087 ; Show EAD
3086 WIN_LEFT .125 3088 WIN_LEFT .125
3087 WIN_TOP .192 3089 WIN_TOP .192
3088 movff char_I_N2_ratio,xA+0 3090
3089 clrf xA+1 3091 ; Show END
3090 movff rel_pressure+0,xB+0
3091 movff rel_pressure+1,xB+1
3092 call mult16x16 ; xA*xB=xC
3093 movlw LOW d'7900'
3094 movwf xB+0
3095 movlw HIGH d'7900'
3096 movwf xB+1
3097 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
3098 movff xC+0,lo
3099 movff xC+1,hi ; lo:hi now hold EAD in m
3100 lfsr FSR2,letter
3101 output_16_3 ; Display only full meters
3102 STRCAT_PRINT "m" ; Display EAD
3103
3104 WIN_LEFT .125 3092 WIN_LEFT .125
3105 WIN_TOP .216 3093 WIN_TOP .216
3106 ; Show END = rel_pressure × (100 - char_I_He_ratio)/10000 -> Result in m
3107 movff char_I_He_ratio,lo ; temp
3108 movlw d'100'
3109 bsf STATUS,C
3110 subfwb lo,W
3111 movwf xA+0
3112 clrf xA+1
3113 movff rel_pressure+0,xB+0
3114 movff rel_pressure+1,xB+1
3115 call mult16x16 ; xA*xB=xC
3116 movlw LOW d'10000'
3117 movwf xB+0
3118 movlw HIGH d'10000'
3119 movwf xB+1
3120 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
3121 movff xC+0,lo
3122 movff xC+1,hi ; lo:hi now hold END in m
3123 lfsr FSR2,letter
3124 output_16_3
3125 STRCAT_PRINT "m" ; Display END
3126 return 3094 return
3127 3095
3128 PLED_show_end_ead_divemode3: ; Show CC EAD, END and pO2[Diluent] 3096 PLED_show_end_ead_divemode3: ; Show CC EAD, END and pO2[Diluent]
3129 ; Show ppO2[Diluent] 3097 ; Show ppO2[Diluent]
3130 WIN_LEFT .95 3098 WIN_LEFT .95
3168 bcf ignore_digit4 3136 bcf ignore_digit4
3169 bcf leftbind 3137 bcf leftbind
3170 STRCAT_PRINT " " ; Display ppO2[Diluent] 3138 STRCAT_PRINT " " ; Display ppO2[Diluent]
3171 3139
3172 ; EAD and END: ToDo... 3140 ; EAD and END: ToDo...
3141
3142 ; Show EAD
3143 WIN_LEFT .125
3144 WIN_TOP .192
3145
3146 ; Show END
3147 WIN_LEFT .125
3148 WIN_TOP .216
3173 return 3149 return
3174 3150
3175 3151
3176 PLED_show_leading_tissue: 3152 PLED_show_leading_tissue:
3177 call PLED_divemask_color ; Set Color for Divemode mask 3153 call PLED_divemask_color ; Set Color for Divemode mask