# HG changeset patch # User JeanDo # Date 1303409349 -7200 # Node ID 6d8a2550c9ea5eb1e064ae5df57ed31a6e0fb886 # Parent 9feb224f68710b294a2fc61229de3fa44c62a79c Fix zero-depth gas color in de-activation menu. diff -r 9feb224f6871 -r 6d8a2550c9ea code_part1/OSTC_code_asm_part1/ms5535.asm --- a/code_part1/OSTC_code_asm_part1/ms5535.asm Thu Apr 21 04:54:12 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/ms5535.asm Thu Apr 21 20:09:09 2011 +0200 @@ -26,8 +26,8 @@ ;============================================================================= ; Expose internal variables, to ease debug: global D1, D2 - global C1, C2, C3, C4, C5 - global xdT, xdT2, OFF, SENS, amb_pressure + global C1, C2, C3, C4, C5, C6 + global xdT, xdT2, OFF, SENS, amb_pressure, temperature ;============================================================================= calculate_compensation: @@ -242,8 +242,16 @@ movwf isr1_temp rcall send_data_MS55535A rcall get_2bytes_MS5535A + +#ifdef TESTING + movlw LOW(.18556) + movff WREG,W1+0 + movlw HIGH(.18556) + movff WREG,W1+1 +#else movff dMSB,W1+1 movff dLSB,W1+0 +#endif movlw d'13' movwf clock_count @@ -251,8 +259,15 @@ movwf isr1_temp rcall send_data_MS55535A rcall get_2bytes_MS5535A +#ifdef TESTING + movlw LOW(.49183) + movff WREG,W2+0 + movlw HIGH(.49183) + movff WREG,W2+1 +#else movff dMSB,W2+1 movff dLSB,W2+0 +#endif movlw d'13' movwf clock_count @@ -260,8 +275,15 @@ movwf isr1_temp rcall send_data_MS55535A rcall get_2bytes_MS5535A +#ifdef TESTING + movlw LOW(.22354) + movff WREG,W3+0 + movlw HIGH(.22354) + movff WREG,W3+1 +#else movff dMSB,W3+1 movff dLSB,W3+0 +#endif movlw d'13' movwf clock_count @@ -269,8 +291,15 @@ movwf isr1_temp rcall send_data_MS55535A rcall get_2bytes_MS5535A +#ifdef TESTING + movlw LOW(.28083) + movff WREG,W4+0 + movlw HIGH(.28083) + movff WREG,W4+1 +#else movff dMSB,W4+1 movff dLSB,W4+0 +#endif ; calculate C1 (16Bit) movff W1+1, C1+1 diff -r 9feb224f6871 -r 6d8a2550c9ea code_part1/OSTC_code_asm_part1/pled_outputs.asm --- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm Thu Apr 21 04:54:12 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm Thu Apr 21 20:09:09 2011 +0200 @@ -2532,7 +2532,16 @@ rcall PLED_decoplan_clear_bottom ; Clear from next line return ;----------------------------------------------------------------------------- - +; Toggle gas activity flag during dive. +; +; Input: sorted_gaslist_active +; Gaslist from eeprom[2...] +; +; Output: sorted_gaslist_active +; +; Note: Gas with a zero depth cannot be used in deco simulation, hence +; should not be displayed as selected here... +; PLED_de_activelist: ; show (de)active gaslist call PLED_standard_color DISPLAYTEXT .254 ; Close @@ -2576,6 +2585,9 @@ movff EEDATA,lo ; copy to lo output_8 ; outputs into Postinc2! + movf lo,w ; Gas with a zero depth + bz PLED_de_activelist_grey ; should be displayed inactive. + ; Check if gas needs to be greyed-out (inactive) movff sorted_gaslist_active,EEDATA ; Get flag register movff hi,lo ; copy gas number @@ -2583,11 +2595,13 @@ rrcf EEDATA ; roll flags into carry decfsz lo,F ; max. 5 times... bra PLED_de_activelist_loop1 - + bc PLED_de_activelist_white + +PLED_de_activelist_grey: ; grey out inactive gases! movlw color_grey - btfss STATUS,C ; test carry - call PLED_set_color ; grey out inactive gases! - + call PLED_set_color + +PLED_de_activelist_white: call word_processor call PLED_standard_color