Skip to content

Commit

Permalink
perf: Set max commutation period directly for startup phase
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasvr committed Jul 10, 2021
1 parent a668872 commit f4c918f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Bluejay.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1748,9 +1748,9 @@ ENDIF
jz calc_next_comm_startup_no_X

; Extended byte is not zero, so commutation time is above 0xFFFF
mov Temp1, #0FFh
mov Temp2, #0FFh
sjmp calc_next_comm_startup_average
mov Comm_Period4x_L, #0FFh
mov Comm_Period4x_H, #0FFh
sjmp calc_new_wait_times_setup

calc_next_comm_startup_no_X:
; Extended byte = 0, so commutation time fits within two bytes
Expand All @@ -1768,14 +1768,12 @@ calc_next_comm_startup_no_X:
subb A, Temp8
mov Temp2, A

calc_next_comm_startup_average:
mov Temp3, Comm_Period4x_L ; Comm_Period4x holds the time of 4 commutations
mov Temp4, Comm_Period4x_H
mov Temp7, #2
mov Temp8, #0
sjmp calc_next_comm_avg_period_div


calc_next_comm_normal:
; Prepare averaging by dividing Comm_Period4x and current commutation period (Temp2/1) according to speed.
mov Temp3, Comm_Period4x_L ; Comm_Period4x holds the time of 4 commutations
Expand Down

0 comments on commit f4c918f

Please sign in to comment.