X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Fstepper.c;h=a7320794c40ff53f09a336d2e70a54f66f63e1cd;hb=e8b0472be10fba4ca6baa62d8d483db90e28c06e;hp=57ac7fc4057a5b010ca9d25e38f147790bcef230;hpb=57b276690a570cd37b2f2448249e1558cafbd369;p=bertos.git diff --git a/bertos/drv/stepper.c b/bertos/drv/stepper.c index 57ac7fc4..a7320794 100644 --- a/bertos/drv/stepper.c +++ b/bertos/drv/stepper.c @@ -1,17 +1,39 @@ /** * \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 +47,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 +335,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