summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2012-07-29 13:32:37 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2012-07-29 13:32:37 +0200
commit2fc77d271db27ecb140191c2dfafdba835962ffb (patch)
tree4e3c07dc84116c4a05f18442dbb0fef1e56e2e22 /main.cpp
parent7099e9c67abe16f78d62f53ddaa8c75f015d098a (diff)
Ported ppmsum driver to r3 board.
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index e14eb3d..723714a 100644
--- a/main.cpp
+++ b/main.cpp
@@ -12,6 +12,8 @@
#include "lsm303dlm.h"
#include "l3gd20.h"
+#include "ppmsum.h"
+
static Pin& led_status = PA4;
static Pin& led_error = PC4;
@@ -289,6 +291,8 @@ L3GD20 gyro(cs_gyro, SPI1);
LSM303DLM_A accel(I2C2);
LSM303DLM_M magn(I2C2);
+PPMSum ppmsum;
+
int main() {
// Initialize system timer.
STK.LOAD = 168000000 / 8 / 1000; // 1000 Hz.
@@ -336,6 +340,10 @@ int main() {
accel.init();
magn.init();
+ PA0.set_mode(Pin::AF);
+ PA0.set_af(1);
+ ppmsum.enable();
+
while(1) {
led_error.toggle();
Time::sleep(10);
@@ -359,5 +367,9 @@ int main() {
if(usb_ep_ready(1)) {
usb_write(1, (uint32_t*)buf, sizeof(buf));
}
+
+ if(usb_ep_ready(1)) {
+ usb_write(1, (uint32_t*)ppmsum.channels, sizeof(ppmsum.channels));
+ }
}
}