Skip to content

Commit

Permalink
Fix error with 3 stepgens skipping a Word
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter-van-Tol committed Jan 13, 2025
1 parent 344a015 commit 287d87b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/litexcnc/driver/modules/litexcnc_stepgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ size_t litexcnc_stepgen_init(litexcnc_module_instance_t **module, litexcnc_t *li
litexcnc_stepgen_instance_t *instance = &(stepgen->instances[i]);

// Set the pick-offs
int8_t shift = *(*config);
int8_t shift = *(*config) & 0xF;
instance->data.pick_off_pos = 32;
instance->data.pick_off_vel = instance->data.pick_off_pos + shift;
instance->data.pick_off_acc = instance->data.pick_off_vel + 16;
Expand Down Expand Up @@ -575,7 +575,8 @@ size_t litexcnc_stepgen_init(litexcnc_module_instance_t **module, litexcnc_t *li
}

// Align config at DWORD boundary
(*config) += 4 - ((1 + stepgen->num_instances) & 0x03);
(*config) += (4 - ((1 + stepgen->num_instances) & 0x03) & 0x03);
LITEXCNC_ERR_NO_DEVICE("%d\n", (4 - ((1 + stepgen->num_instances) & 0x03) & 0x03));

return 0;
}
Expand Down

0 comments on commit 287d87b

Please sign in to comment.