/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: 2016-04-10 13:50:17 UTC
  • Revision ID: dan-20160410135017-2tpazgewnjazokqo
Removed -cash.lib from the ignore file

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
}