|
|
@ -388,6 +388,36 @@ IF MCU_48MHZ < 2 AND PWM_FREQ < 3 |
|
|
|
PWM_BITS_H EQU (2 + MCU_48MHZ - PWM_CENTERED - PWM_FREQ) |
|
|
|
ENDIF |
|
|
|
|
|
|
|
Decode_DShot_2Bit MACRO dest, decode_fail |
|
|
|
movx A, @Temp1 |
|
|
|
mov Temp7, A |
|
|
|
clr C |
|
|
|
subb A, Temp6 ; Subtract previous timestamp |
|
|
|
clr C |
|
|
|
subb A, Temp2 |
|
|
|
jc decode_fail ; Check that bit is longer than minimum |
|
|
|
|
|
|
|
subb A, Temp2 ; Check if bit is zero or one |
|
|
|
mov A, dest ; Shift bit into data byte |
|
|
|
rlc A |
|
|
|
mov dest, A |
|
|
|
inc Temp1 ; Next bit |
|
|
|
|
|
|
|
movx A, @Temp1 |
|
|
|
mov Temp6, A |
|
|
|
clr C |
|
|
|
subb A, Temp7 |
|
|
|
clr C |
|
|
|
subb A, Temp2 |
|
|
|
jc decode_fail |
|
|
|
|
|
|
|
subb A, Temp2 |
|
|
|
mov A, dest |
|
|
|
rlc A |
|
|
|
mov dest, A |
|
|
|
inc Temp1 |
|
|
|
ENDM |
|
|
|
|
|
|
|
;**** **** **** **** **** |
|
|
|
Interrupt_Table_Definition ; SiLabs interrupts |
|
|
|
CSEG AT 80h ; Code segment after interrupt vectors |
|
|
|