fix external interrupts, step dir now working

This commit is contained in:
Oskar Weigl
2018-04-17 03:21:03 -07:00
parent 9593ee4f4a
commit 8407721744
6 changed files with 20 additions and 9 deletions
+4 -4
View File
@@ -25,6 +25,10 @@ Axis::Axis(const AxisHardwareConfig_t& hw_config,
motor_.axis_ = this;
}
static void step_cb_wrapper(void* ctx) {
reinterpret_cast<Axis*>(ctx)->step_cb();
}
// @brief Sets up all components of the axis,
// such as gate driver and encoder hardware.
void Axis::setup() {
@@ -56,10 +60,6 @@ bool Axis::wait_for_current_meas() {
return osSignalWait(M_SIGNAL_PH_CURRENT_MEAS, PH_CURRENT_MEAS_TIMEOUT).status == osEventSignal;
}
static void step_cb_wrapper(void* ctx) {
reinterpret_cast<Axis*>(ctx)->step_cb();
}
// step/direction interface
void Axis::step_cb() {
if (enable_step_dir_) {