diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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)); + } } } |