Changeset 250

Show
Ignore:
Timestamp:
09/08/08 15:08:57 (5 years ago)
Author:
telle
Message:

bugfix: after modification of read, wait did not work anymore.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/telle/RWTHMindstormsNXT/@NXTmotor/wait.m

    r218 r250  
    2929% Author: Aulis Telle, IND, RWTH Aachen 
    3030 
    31 timedOut = 0; 
     31if nargout > 0 
     32    timedOut = 0; 
     33end 
    3234 
    3335if ~exist('timeout','var') 
     
    3941 
    4042data = read(obj); 
    41 if data.TachoLimit == 0 && data.RunStateByte ~= 0 
     43if data.TachoLimit == 0 && ~ strcmp(data.RunState,'idle') 
    4244    warning('RWTHMINDSTORMS:MotorWait',... 
    4345        'Motor running infinitely. Not waiting for this motor!'); 
     
    4547end 
    4648 
    47 while data.RunStateByte ~= 0 
    48     if timeout > 0 && now >= endtime 
     49while ~ strcmp(data.RunState,'idle') 
     50    if exist('timedOut', 'var') && timeout > 0 && now >= endtime 
    4951        timedOut = 1; 
    5052        break;