/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: dan
  • Date: 2014-04-15 02:30:19 UTC
  • Revision ID: dan-20140415023019-u1qz3nxv08vpxb4s
First attempt at connecting up all the components on the circuit. Almost finnished but not managed to connect scl, sda, tx0 & rx0. Gonna pass over to Tim to see if he can find a solution.

Show diffs side-by-side

added added

removed removed

 
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
}