herolic / aeroquad

Automatically exported from code.google.com/p/aeroquad
0 stars 0 forks source link

Camera_AeroQuad class should be encapsulated by ifdef #134

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Add 
#if defined (__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
at line 220 in front of 
class Camera_AeroQuad : public Camera {
and a #endif at the end if the file.

The comments between line 28 and 43 include some micro characters, better use 
us instead of µs, as the character set causes problems.
Here is a fixed version

/*
Some basics about the 16 bit timer:
- The timer counts clock ticks derived from the CPU clock. Using 16MHz CPU clock
  and a prescaler of 8 gives a timer clock of 2MHz, one tick every 0.5us. This
  is also called timer resolution.
- The timer is used as cyclic upwards counter, the counter periode is set in the
  ICRx register. IIRC periode-1 has to be set in the ICRx register.
- When the counter reaches 0, the outputs are set
- When the counter reaches OCRxy, the corresponding output is cleared.
In the code below, the periode shall be 20ms, so the ICRx register is set to
 40000 ticks of 0.5us/tick. It probably should be 39999, but who cares about
 this 0.5us for the periode.
The high time shall be 1500us, so the OCRxy register is set to 3000. A change of
 the timer periode does not change this setting, as the clock rate is still one
 tick every 0.5us. If the prescaler was changed, the OCRxy register value would
 be different.
*/

Original issue reported on code.google.com by al...@arcor.de on 27 Jul 2011 at 1:14

GoogleCodeExporter commented 9 years ago
done!

Original comment by CaranchoEngineering@gmail.com on 27 Jul 2011 at 10:01