From 1a0783973211622edcf21a59676954ef656fbe3f Mon Sep 17 00:00:00 2001 From: Joseph Coffland Date: Sat, 21 Jan 2017 19:38:39 -0800 Subject: [PATCH] Fixed motor reverse config --- avr/src/motor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/avr/src/motor.c b/avr/src/motor.c index 69a9de4..44789a1 100644 --- a/avr/src/motor.c +++ b/avr/src/motor.c @@ -455,8 +455,8 @@ stat_t motor_prep_move(int motor, int32_t clocks, float target, int32_t error, // Setup the direction, compensating for polarity. m->negative = travel < 0; - if (m->negative) m->direction = DIRECTION_CCW ^ m->reverse; - else m->direction = DIRECTION_CW ^ m->reverse; + if (m->negative ^ m->reverse) m->direction = DIRECTION_CCW; + else m->direction = DIRECTION_CW; // Find the clock rate that will fit the required number of steps if (ticks_per_step <= 0xffff) m->timer_clock = TC_CLKSEL_DIV1_gc; -- 2.27.0