X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Fstepper.c;h=7586cf87b07bcc5a825fc575546f9252b98ebf10;hb=9d38debd0d2b2eaeeeec7f82d7c39e749ac729e5;hp=57ac7fc4057a5b010ca9d25e38f147790bcef230;hpb=57b276690a570cd37b2f2448249e1558cafbd369;p=bertos.git diff --git a/bertos/drv/stepper.c b/bertos/drv/stepper.c index 57ac7fc4..7586cf87 100644 --- a/bertos/drv/stepper.c +++ b/bertos/drv/stepper.c @@ -1,17 +1,40 @@ /** * \file * * * \brief Driver to control stepper motor * * \version $Id$ - * * \author Francesco Michelini * \author Giovanni Bajo - * \author Bernardo Innocenti + * \author Bernie Innocenti * \author Simone Zinanni * \author Daniele Basile */ @@ -25,8 +48,8 @@ #include // Define logging setting (for cfg/log.h module). -#define LOG_LEVEL STEPPER_LOG_LEVEL -#define LOG_VERBOSITY STEPPER_LOG_VERBOSITY +#define LOG_LEVEL STEPPER_LOG_LEVEL +#define LOG_FORMAT STEPPER_LOG_FORMAT #include #include @@ -313,7 +336,7 @@ static enum StepperState FAST_FUNC FSM_run(struct Stepper *motor) //motor->rampValue = 0; //motor->rampClock = motor->rampValue = motor->ramp->clocksMaxWL; - else if (distance <= motor->rampStep) + else if (distance <= (uint16_t)motor->rampStep) stepper_decel(motor); // check whether the velocity must be changed