/elec/quadcopter

To get this branch, use:
bzr branch http://bzr.ed.am/elec/quadcopter

« back to all changes in this revision

Viewing changes to src/rc-interface/motors.cc

  • Committer: dan
  • Date: 2014-04-02 20:02:36 UTC
  • mto: This revision was merged to the branch mainline in revision 32.
  • Revision ID: dan-20140402200236-vcmm7ejo7q8qclvq
moved rc-interface project in to its own folder

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
#include "motors.h"
7
7
#include "config.h"
 
8
#include "common.h"
8
9
#include <Arduino.h>
9
10
#include <limits.h>
10
11
 
73
74
                //      Serial.println( width );
74
75
                // }
75
76
        }
 
77
 
 
78
        // else, if an event is coming up soon, sleep and service the event to make
 
79
        // sure that no other code runs and blocks us!
 
80
        else
 
81
        {
 
82
                long delay = calculate_duration( now, next_event_at );
 
83
                if( delay < 250 )
 
84
                {
 
85
                        if( delay > 20 )
 
86
                                delayMicroseconds( delay - 20 );
 
87
                        update();
 
88
                }
 
89
        }
 
90
        
76
91
}