From 87a23f01a1042d8078ca4e6b647554211fc6e01d Mon Sep 17 00:00:00 2001 From: Mathias Rasmussen Date: Tue, 17 Nov 2020 01:56:55 +0100 Subject: [PATCH] refactor: Make DShot commands checking a called routine --- Bluejay.asm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Bluejay.asm b/Bluejay.asm index bcd3052..43551ec 100644 --- a/Bluejay.asm +++ b/Bluejay.asm @@ -3243,9 +3243,10 @@ wait_for_power_on_not_missing: jnb Flag_RCP_STOP, wait_for_power_on_nonzero ; Higher than stop, Yes - proceed mov A, Dshot_Cmd - jnz check_dshot_cmd ; Check DShot command (if not zero) + jz wait_for_power_on_loop ; Check DShot command if not zero, otherwise wait for power - sjmp wait_for_power_on_loop ; If not DShot command - start over + call check_dshot_cmd + sjmp wait_for_power_on_not_missing ; Check dshot command again, in case command needs to be received multiple times wait_for_power_on_nonzero: call wait100ms ; Wait to see if start pulse was only a glitch @@ -3405,7 +3406,7 @@ clear_dshot_cmd: mov Dshot_Cmd_Cnt, #0 dont_clear_dshot_cmd: - ajmp wait_for_power_on_not_missing + ret dshot_direction_normal: ; Change programmed motor direction to that stored in eeprom