# HG changeset patch # User janos_kovacs # Date 1434026414 -3600 # Node ID 7b64c0ba6a7e536cf29e0e2a82a59f03acdced2d # Parent c6c934f05b425f700dea4cee4e5de5c6b3bf5736 VSIbar #3c: extra steps to keep calculation clear diff -r c6c934f05b42 -r 7b64c0ba6a7e src/tft_outputs.asm --- a/src/tft_outputs.asm Wed Jun 10 22:47:38 2015 +0100 +++ b/src/tft_outputs.asm Thu Jun 11 13:40:14 2015 +0100 @@ -1005,6 +1005,7 @@ ;bra TFT_velocity_VSIbar_com TFT_velocity_VSIbar_com: + clrf divB ; multiply movff divA+0,xA+0 clrf xA+1 @@ -1014,8 +1015,10 @@ movlw .1 cpfslt xC+3 bra TFT_velocity_VSIbar_max + movlw .1 cpfslt xC+2 bra TFT_velocity_VSIbar_max + movlw .1 cpfslt xC+1 bra TFT_velocity_VSIbar_max ; add offset @@ -1097,6 +1100,7 @@ cpfsgt divA+0 bra TFT_velocity_VSIbar_desc_clr + clrf divB ; Desc uses a single multiplier/offset value: *1 / +3 movlw .1 movff WREG,sub_b+0 ; multiplier @@ -1111,8 +1115,10 @@ movlw .1 cpfslt xC+3 bra TFT_velocity_VSIbar_desc_max + movlw .1 cpfslt xC+2 bra TFT_velocity_VSIbar_desc_max + movlw .1 cpfslt xC+1 bra TFT_velocity_VSIbar_desc_max ; add offset