On Apr 2, 2012, at 17:15 , Sebastian Kuzminsky wrote:

> This broke the realtime build.  limit.h is not available.
> 
> http://buildbot.linuxcnc.org/buildbot-admin/builders/hardy-i386-realtime-rip/builds/380/steps/compile/logs/stdio

Sorry, here's the public link:

http://buildbot.linuxcnc.org/buildbot/builders/hardy-i386-realtime-rip/builds/380/steps/compile/logs/stdio


> 
> 
> 
> On Apr 2, 2012, at 16:44 , Michael Haberler wrote:
> 
>> motion,tp: dont treat motion id zero special
>> 
>> this defines a motion id value MOTION_INVALID_ID which shall never be used
>> when generating a motion. When comparing motion id's, one should first
>> test whether the motion id is valid with MOTION_ID_VALID(id),
>> and only then for equality.
>> 
>> This patch removes the anomaly with motion id zero, which gave cause to
>> several workarounds, like negative MDI line numbers.
>> 
>> 
>> http://git.linuxcnc.org/?p=emc2.git;a=commitdiff;h=cfd174a
>> 
>> ---
>> src/emc/kinematics/tp.c |   20 ++++++++++----------
>> src/emc/motion/motion.h |    9 +++++++++
>> 2 files changed, 19 insertions(+), 10 deletions(-)
>> 
>> diff --git a/src/emc/kinematics/tp.c b/src/emc/kinematics/tp.c
>> index d1f2f44..d80e23d 100644
>> --- a/src/emc/kinematics/tp.c
>> +++ b/src/emc/kinematics/tp.c
>> @@ -670,8 +670,8 @@ int tpRunCycle(TP_STRUCT * tp, long period)
>>    EmcPose secondary_before, secondary_after;
>>    EmcPose primary_displacement, secondary_displacement;
>>    static double spindleoffset;
>> -    static int waiting_for_index = 0;
>> -    static int waiting_for_atspeed = 0;
>> +    static int waiting_for_index = MOTION_INVALID_ID;
>> +    static int waiting_for_atspeed = MOTION_INVALID_ID;
>>    double save_vel;
>>    static double revs;
>>    EmcPose target;
>> @@ -763,8 +763,8 @@ int tpRunCycle(TP_STRUCT * tp, long period)
>>            tp->execId = 0;
>>            tp->motionType = 0;
>>            tp->synchronized = 0;
>> -            waiting_for_index = 0;
>> -            waiting_for_atspeed = 0;
>> +            waiting_for_index = MOTION_INVALID_ID;
>> +            waiting_for_atspeed = MOTION_INVALID_ID;
>>            emcmotStatus->spindleSync = 0;
>>            tpResume(tp);
>>            return 0;
>> @@ -775,20 +775,20 @@ int tpRunCycle(TP_STRUCT * tp, long period)
>>    }
>> 
>>    // this is no longer the segment we were waiting_for_index for
>> -    if(waiting_for_index && waiting_for_index != tc->id) 
>> +    if (MOTION_ID_VALID(waiting_for_index) && waiting_for_index != tc->id) 
>>    {
>>        rtapi_print_msg(RTAPI_MSG_ERR,
>>                "Was waiting for index on motion id %d, but reached id %d\n",
>>                waiting_for_index, tc->id);
>> -        waiting_for_index = 0;
>> +        waiting_for_index = MOTION_INVALID_ID;
>>    }
>> -    if(waiting_for_atspeed && waiting_for_atspeed != tc->id)  
>> +    if (MOTION_ID_VALID(waiting_for_atspeed) && waiting_for_atspeed != 
>> tc->id)  
>>    {
>> 
>>        rtapi_print_msg(RTAPI_MSG_ERR,
>>                "Was waiting for atspeed on motion id %d, but reached id 
>> %d\n",
>>                waiting_for_atspeed, tc->id);
>> -        waiting_for_atspeed = 0;
>> +        waiting_for_atspeed = MOTION_INVALID_ID;
>>    }
>> 
>>    // check for at-speed before marking the tc active
>> @@ -797,7 +797,7 @@ int tpRunCycle(TP_STRUCT * tp, long period)
>>            /* spindle is still not at the right speed: wait */
>>            return 0;
>>        } else {
>> -            waiting_for_atspeed = 0;
>> +            waiting_for_atspeed = MOTION_INVALID_ID;
>>        }
>>    }
>> 
>> @@ -853,7 +853,7 @@ int tpRunCycle(TP_STRUCT * tp, long period)
>>        } else {
>>            /* passed index, start the move */
>>            emcmotStatus->spindleSync = 1;
>> -            waiting_for_index=0;
>> +            waiting_for_index = MOTION_INVALID_ID;
>>            tc->sync_accel=1;
>>            revs=0;
>>        }
>> diff --git a/src/emc/motion/motion.h b/src/emc/motion/motion.h
>> index 16e794f..dd858ad 100644
>> --- a/src/emc/motion/motion.h
>> +++ b/src/emc/motion/motion.h
>> @@ -79,6 +79,15 @@ to another.
>> #include "emcmotcfg.h"               /* EMCMOT_MAX_JOINTS */
>> #include "kinematics.h"
>> #include <stdarg.h>
>> +#include <limits.h>
>> +
>> +
>> +// define a special value to denote an invalid motion ID 
>> +// NB: do not ever generate a motion id of INT_MIN
>> +// this should be really be tested for in command.c 
>> +
>> +#define MOTION_INVALID_ID INT_MIN
>> +#define MOTION_ID_VALID(x) ((x) != MOTION_INVALID_ID)
>> 
>> #ifdef __cplusplus
>> extern "C" {
>> 
>> ------------------------------------------------------------------------------
>> Better than sec? Nothing is better than sec when it comes to
>> monitoring Big Data applications. Try Boundary one-second 
>> resolution app monitoring today. Free.
>> http://p.sf.net/sfu/Boundary-dev2dev
>> _____________________________________________
>> Emc-commit mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/emc-commit
> 
> -- 
> Sebastian Kuzminsky
> 
> 
> ------------------------------------------------------------------------------
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second 
> resolution app monitoring today. Free.
> http://p.sf.net/sfu/Boundary-dev2dev
> _______________________________________________
> Emc-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-developers

-- 
Sebastian Kuzminsky


------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to