/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/common.cc

  • Committer: Tim Marston
  • Date: 2013-11-28 22:56:14 UTC
  • Revision ID: tim@ed.am-20131128225614-016og5owu7b0qp3k
test/escs: added ESC (motor control) testing program

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//
2
 
// common.cc
3
 
//
4
 
 
5
 
 
6
 
#include "common.h"
7
 
#include <limits.h>
8
 
 
9
 
 
10
 
unsigned long calculate_duration( unsigned long then, unsigned long now )
11
 
{
12
 
        return now - then;
13
 
        
14
 
        if( now < then )
15
 
                return now + ( ULONG_MAX - then );
16
 
        else
17
 
                return now - then;
18
 
}