itersolve: Add ability to query the active_flags state
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
8bf3e56301
commit
d1972b1e9c
|
@ -48,6 +48,7 @@ defs_itersolve = """
|
||||||
, double flush_time);
|
, double flush_time);
|
||||||
double itersolve_check_active(struct stepper_kinematics *sk
|
double itersolve_check_active(struct stepper_kinematics *sk
|
||||||
, double flush_time);
|
, double flush_time);
|
||||||
|
int32_t itersolve_is_active_axis(struct stepper_kinematics *sk, char axis);
|
||||||
void itersolve_set_trapq(struct stepper_kinematics *sk, struct trapq *tq);
|
void itersolve_set_trapq(struct stepper_kinematics *sk, struct trapq *tq);
|
||||||
void itersolve_set_stepcompress(struct stepper_kinematics *sk
|
void itersolve_set_stepcompress(struct stepper_kinematics *sk
|
||||||
, struct stepcompress *sc, double step_dist);
|
, struct stepcompress *sc, double step_dist);
|
||||||
|
|
|
@ -212,6 +212,15 @@ itersolve_check_active(struct stepper_kinematics *sk, double flush_time)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Report if the given stepper is registered for the given axis
|
||||||
|
int32_t __visible
|
||||||
|
itersolve_is_active_axis(struct stepper_kinematics *sk, char axis)
|
||||||
|
{
|
||||||
|
if (axis < 'x' || axis > 'z')
|
||||||
|
return 0;
|
||||||
|
return (sk->active_flags & (AF_X << (axis - 'x'))) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
void __visible
|
void __visible
|
||||||
itersolve_set_trapq(struct stepper_kinematics *sk, struct trapq *tq)
|
itersolve_set_trapq(struct stepper_kinematics *sk, struct trapq *tq)
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,6 +28,7 @@ struct stepper_kinematics {
|
||||||
int32_t itersolve_generate_steps(struct stepper_kinematics *sk
|
int32_t itersolve_generate_steps(struct stepper_kinematics *sk
|
||||||
, double flush_time);
|
, double flush_time);
|
||||||
double itersolve_check_active(struct stepper_kinematics *sk, double flush_time);
|
double itersolve_check_active(struct stepper_kinematics *sk, double flush_time);
|
||||||
|
int32_t itersolve_is_active_axis(struct stepper_kinematics *sk, char axis);
|
||||||
void itersolve_set_trapq(struct stepper_kinematics *sk, struct trapq *tq);
|
void itersolve_set_trapq(struct stepper_kinematics *sk, struct trapq *tq);
|
||||||
void itersolve_set_stepcompress(struct stepper_kinematics *sk
|
void itersolve_set_stepcompress(struct stepper_kinematics *sk
|
||||||
, struct stepcompress *sc, double step_dist);
|
, struct stepcompress *sc, double step_dist);
|
||||||
|
|
|
@ -165,6 +165,9 @@ class MCU_stepper:
|
||||||
flush_time)
|
flush_time)
|
||||||
if ret:
|
if ret:
|
||||||
raise error("Internal error in stepcompress")
|
raise error("Internal error in stepcompress")
|
||||||
|
def is_active_axis(self, axis):
|
||||||
|
return self._ffi_lib.itersolve_is_active_axis(
|
||||||
|
self._stepper_kinematics, axis)
|
||||||
|
|
||||||
# Helper code to build a stepper object from a config section
|
# Helper code to build a stepper object from a config section
|
||||||
def PrinterStepper(config, units_in_radians=False):
|
def PrinterStepper(config, units_in_radians=False):
|
||||||
|
|
Loading…
Reference in New Issue