From 1b521c6de071959dc3481da47b947ce174bab487 Mon Sep 17 00:00:00 2001 From: Mathias Rasmussen Date: Thu, 24 Dec 2020 02:11:37 +0100 Subject: [PATCH] refactor: Combine dshot beeps command range check --- Bluejay.asm | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/Bluejay.asm b/Bluejay.asm index 0d361f5..137c714 100644 --- a/Bluejay.asm +++ b/Bluejay.asm @@ -2942,32 +2942,13 @@ led_3_done: ; ;**** **** **** **** **** **** **** **** **** **** **** **** **** dshot_cmd_check: - mov Temp1, Dshot_Cmd - cjne Temp1, #1, dshot_cmd_beep_2 - - call beacon_beep - ajmp dshot_cmd_exit - -dshot_cmd_beep_2: - cjne Temp1, #2, dshot_cmd_beep_3 - - call beacon_beep - ajmp dshot_cmd_exit - -dshot_cmd_beep_3: - cjne Temp1, #3, dshot_cmd_beep_4 - - call beacon_beep - ajmp dshot_cmd_exit - -dshot_cmd_beep_4: - cjne Temp1, #4, dshot_cmd_beep_5 - - call beacon_beep - sjmp dshot_cmd_exit + mov A, Dshot_Cmd + jz dshot_cmd_exit_no_clear -dshot_cmd_beep_5: - cjne Temp1, #5, dshot_cmd_direction_1 + mov Temp1, A + clr C + subb A, #6 ; Beacon beeps for command 1-5 + jnc dshot_cmd_direction_1 call beacon_beep sjmp dshot_cmd_exit