Browse Source

refactor: DShot detection with no outside range pulses

main
Mathias Rasmussen 4 years ago
parent
commit
7cf6a9368c
  1. 8
      Bluejay.asm

8
Bluejay.asm

@ -3355,12 +3355,10 @@ ENDIF
mov Rcp_Outside_Range_Cnt, #10 ; Set out of range counter mov Rcp_Outside_Range_Cnt, #10 ; Set out of range counter
call wait100ms ; Wait for new RC pulse call wait100ms ; Wait for new RC pulse
mov DShot_Pwm_Thr, #16 ; Load DShot regular pwm threshold mov DShot_Pwm_Thr, #16 ; Load DShot regular pwm threshold
clr C
mov A, Rcp_Outside_Range_Cnt ; Check if pulses were accepted mov A, Rcp_Outside_Range_Cnt ; Check if pulses were accepted
subb A, #10
mov DShot_Cmd, #0 mov DShot_Cmd, #0
mov DShot_Cmd_Cnt, #0 mov DShot_Cmd_Cnt, #0
jc arming_begin
jz arming_begin
; Setup variables for DShot600 ; Setup variables for DShot600
IF MCU_48MHZ == 1 IF MCU_48MHZ == 1
@ -3378,12 +3376,10 @@ ENDIF
mov Rcp_Outside_Range_Cnt, #10 ; Set out of range counter mov Rcp_Outside_Range_Cnt, #10 ; Set out of range counter
call wait100ms ; Wait for new RC pulse call wait100ms ; Wait for new RC pulse
mov DShot_Pwm_Thr, #8 ; Load DShot regular pwm threshold mov DShot_Pwm_Thr, #8 ; Load DShot regular pwm threshold
clr C
mov A, Rcp_Outside_Range_Cnt ; Check if pulses were accepted mov A, Rcp_Outside_Range_Cnt ; Check if pulses were accepted
subb A, #10
mov DShot_Cmd, #0 mov DShot_Cmd, #0
mov DShot_Cmd_Cnt, #0 mov DShot_Cmd_Cnt, #0
jc arming_begin
jz arming_begin
ajmp init_no_signal ajmp init_no_signal

Loading…
Cancel
Save