Skip to content

Commit dac1257

Browse files
attempt fix state change
1 parent a8ebecb commit dac1257

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pd.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
from functools import reduce
2525
from enum import Enum
2626
from dshot.protoDshot import DshotCmd, DshotTelem, BitDshot, DshotSettings, Bit_DshotTelem
27+
import pydevd
28+
29+
pydevd.settrace('127.0.0.1')
2730

2831

2932

@@ -173,8 +176,8 @@ def decode(self):
173176
case State.CMD:
174177
match self.state_dshot:
175178
case State_Dshot.RESET:
176-
if dshot_value.crc_ok:
177-
last_dshot_value = dshot_value
179+
#if dshot_value.crc_ok:
180+
last_dshot_value = dshot_value
178181
dshot_value = DshotCmd(self.dshot_cfg)
179182
self.state_dshot = State_Dshot.START
180183

@@ -239,7 +242,7 @@ def decode(self):
239242
if self.samplenum >= last_dshot_value.packet.es + max_samples_before_telem:
240243
self.state_telem = State_Dshot.RESET
241244
self.state = State.CMD
242-
continue
245+
break
243246
# First wait for falling edge (idle high)
244247
pins = self.wait([{0: 'f'}])
245248
# Save start pulse

0 commit comments

Comments
 (0)