From ab829ed15763226a4c7988a06a3b73735b198ee4 Mon Sep 17 00:00:00 2001 From: Mathias Rasmussen Date: Mon, 9 Nov 2020 02:26:41 +0100 Subject: [PATCH] perf: Optimize startup boost handling --- Bluejay.asm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Bluejay.asm b/Bluejay.asm index 32a42c5..4e686fb 100644 --- a/Bluejay.asm +++ b/Bluejay.asm @@ -661,19 +661,17 @@ t1_int_not_bidir: jb Flag_MOTOR_STARTED, t1_int_startup_boosted ; Do not boost when changing direction in bidirectional mode - mov A, Pwm_Limit_Beg ; Set 25% of max startup power as minimum power - rlc A - mov Temp3, A mov A, Temp5 jnz t1_int_startup_boost_stall + mov A, Pwm_Limit_Beg ; Set 25% of max startup power as minimum power + rlc A + mov B, A clr C - mov A, Temp3 subb A, Temp4 jc t1_int_startup_boost_stall - mov A, Temp3 - mov Temp4, A + mov Temp4, B t1_int_startup_boost_stall: mov A, Stall_Cnt ; Add an extra power boost during start