# HG changeset patch # User JeanDo # Date 1298739223 -3600 # Node ID f4b79292e31f03d41c51f52585200f50e86b57dc # Parent ce6f16711567686ce696d3f409b637ebc9c5764a BUGFIX NoFly time Bug in char-to-float promotion ??? diff -r ce6f16711567 -r f4b79292e31f code_part1/OSTC_code_asm_part1/divemode.asm --- a/code_part1/OSTC_code_asm_part1/divemode.asm Thu Feb 24 23:22:32 2011 +0100 +++ b/code_part1/OSTC_code_asm_part1/divemode.asm Sat Feb 26 17:53:43 2011 +0100 @@ -978,13 +978,12 @@ clrf nofly_time+1 ; Clear nofly time bcf nofly_active ; Clear flag return - + calculate_noflytime2: movff xA+0,int_I_temp+0 movff xA+1,int_I_temp+1 GETCUSTOM8 .13 ; nofly_time_ratio - movwf xB+0 - movff xB,char_I_temp + movff WREG,char_I_temp ostc_debug 'K' ; Sends debug-information to screen if debugmode active call deco_calc_percentage movlb b'00000001' ; select ram bank 1 diff -r ce6f16711567 -r f4b79292e31f code_part1/OSTC_code_c_part2/p2_deco.c --- a/code_part1/OSTC_code_c_part2/p2_deco.c Thu Feb 24 23:22:32 2011 +0100 +++ b/code_part1/OSTC_code_c_part2/p2_deco.c Sat Feb 26 17:53:43 2011 +0100 @@ -2169,7 +2169,7 @@ void deco_calc_percentage(void) { RESET_C_STACK - int_I_temp = (short)(int_I_temp * (char_I_temp / 100.0)); + int_I_temp = (unsigned short)(((float)int_I_temp * (float)char_I_temp) / 100.0); } ////////////////////////////////////////////////////////////////////////////// diff -r ce6f16711567 -r f4b79292e31f code_part1/OSTC_code_c_part2/p2_deco.o Binary file code_part1/OSTC_code_c_part2/p2_deco.o has changed