Skip to content

Commit

Permalink
perf: Reduce DShot invert code
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasvr committed Oct 18, 2020
1 parent 3b37b60 commit ac6b456
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions BLHeli_S.asm
Expand Up @@ -557,22 +557,16 @@ t1_int_decode_checksum:
anl A, #0Fh
jnz t1_int_decode_fail ; XOR check

; Invert DShot data
mov A, Temp4
cpl A
anl A, #0Fh
mov Temp4, A
mov A, Temp3
cpl A
mov Temp3, A

; Subtract 96 (still 12 bits)
; Invert DShot data and subtract 96 (still 12 bits)
clr C
mov A, Temp3
cpl A
mov Temp2, A
subb A, #96
mov Temp3, A
mov A, Temp4
cpl A
anl A, #0Fh
subb A, #0
mov Temp4, A
jnc t1_normal_range
Expand Down

0 comments on commit ac6b456

Please sign in to comment.