forked from Klipper3d/klipper
-
Notifications
You must be signed in to change notification settings - Fork 0
[Go Migration] Fix out_of_bounds.test enable pin ordering #3
Copy link
Copy link
Open
Description
Problem
+queue_digital_out oid=12 clock=4032000 on_ticks=0
set_next_step_dir oid=2 dir=0
queue_step oid=2 interval=4065333 count=1 add=0
-queue_digital_out oid=12 clock=4032000 on_ticks=0Stepper enable pin command appears BEFORE step commands when it should appear AFTER.
Root Cause
In advanceFlushTime() (runtime.go:308-365):
- Callbacks are invoked FIRST (line 326-334)
GenSteps()is called AFTER (line 346)
When stepper.checkActive() callback detects step activity and calls motorEnable(), the enable pin command is sent BEFORE GenSteps() completes.
Proposed Fix
Option A: Enable deferEnablePins mechanism (Recommended)
- Set
mq.deferEnablePins = trueduring drip/homing moves - Enable pins will be flushed after step generation via
flushPendingEnablePins()
Option B: Change callback order
- Move
GenSteps()call before callback invocation - Risk: May break other callback dependencies
Files:
go/pkg/hosth4/runtime.go- Line ~308:
advanceFlushTime()- modify to defer enable pins - Line ~1380:
setEnable()- checkdeferEnablePinsflag
- Line ~308:
Verification
./scripts/go_migration_golden.py compare --only out_of_bounds --mode strictEstimate
~2-3 hours
Parent Issue
Part of #1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels