Show
Ignore:
Timestamp:
08/01/08 18:18:52 (5 months ago)
Author:
liamstask
Message:

- fix for negative step positions, resolves #68

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • firmware/trunk/libraries/stepper/stepper.c

    r771 r776  
    634634void Stepper_IRQCallback( int id ) 
    635635{ 
     636  if(id < 0 || id > 1) 
     637    return; 
    636638  StepperControl* s = Stepper->control[ id ];  
    637639 
     
    876878void Stepper_SetBipolarOutput( StepperControl *s, int position ) 
    877879{ 
    878   int output = position % 4; 
     880  //int output = position % 4; // work around % bug - negative numbers not handled properly 
     881  int output = position & 0x3; 
    879882  int* iop = s->io; 
    880883