[tuxdroid-svn] r755 - firmware/tuxcore/trunk
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2007-12-06 15:58:47
|
Author: Paul_R Date: 2007-12-06 16:58:49 +0100 (Thu, 06 Dec 2007) New Revision: 755 Modified: firmware/tuxcore/trunk/motors.c Log: * Fixed a bug when the spin direction change. Modified: firmware/tuxcore/trunk/motors.c =================================================================== --- firmware/tuxcore/trunk/motors.c 2007-12-06 15:51:41 UTC (rev 754) +++ firmware/tuxcore/trunk/motors.c 2007-12-06 15:58:49 UTC (rev 755) @@ -679,7 +679,6 @@ void spin_left(uint8_t const angle, uint8_t const pwm) { gStatus.mot |= GSTATUS_MOT_SPIN; - spin_direction = LEFT; spin_move_counter = angle; /* If the rotation direction is changing and we are not stopped exactly on * the switch (position switch not pressed), we need to increment the angle @@ -687,6 +686,7 @@ * soon as the rotation starts. */ if ((spin_direction == RIGHT) && (PSW_SPIN_PIN & PSW_SPIN_MK)) spin_move_counter++; + spin_direction = LEFT; spin_PWM = pwm; spin_PWM_mask &= ~MOT_SPIN_R_MK; spin_PWM_mask |= MOT_SPIN_L_MK; @@ -701,7 +701,6 @@ void spin_right(uint8_t const angle, uint8_t const pwm) { gStatus.mot |= GSTATUS_MOT_SPIN; - spin_direction = RIGHT; spin_move_counter = angle; /* If the rotation direction is changing and we are not stopped exactly on * the switch (position switch not pressed), we need to increment the angle @@ -709,6 +708,7 @@ * soon as the rotation starts. */ if ((spin_direction == LEFT) && (PSW_SPIN_PIN & PSW_SPIN_MK)) spin_move_counter++; + spin_direction = RIGHT; spin_PWM = pwm; spin_PWM_mask &= ~MOT_SPIN_L_MK; spin_PWM_mask |= MOT_SPIN_R_MK; |