aboutsummaryrefslogtreecommitdiff
path: root/apps/px4io/px4io.c
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2013-01-10 02:12:49 -0800
committerpx4dev <px4@purgatory.org>2013-01-13 19:05:01 -0800
commit5e35491a386006c8f27b7761b3845a73bf85f3fa (patch)
treea0ae659ba5c4dbb4a1a57e899cfedfe17ccb7cf1 /apps/px4io/px4io.c
parent329f595bca22ca7f253833d0189c1bf61c23c631 (diff)
downloadpx4-firmware-5e35491a386006c8f27b7761b3845a73bf85f3fa.tar.gz
px4-firmware-5e35491a386006c8f27b7761b3845a73bf85f3fa.tar.bz2
px4-firmware-5e35491a386006c8f27b7761b3845a73bf85f3fa.zip
We can't have DMA on both I2C1 and USART2. Since we need it more for I2C, and since USART2 is going back to being ignored once I2C works, let's make the call.
Turn off the debug output on I2C for now.
Diffstat (limited to 'apps/px4io/px4io.c')
-rw-r--r--apps/px4io/px4io.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/px4io/px4io.c b/apps/px4io/px4io.c
index 4e3555b13..e51c1c73c 100644
--- a/apps/px4io/px4io.c
+++ b/apps/px4io/px4io.c
@@ -51,6 +51,8 @@
#include <drivers/drv_pwm_output.h>
#include <drivers/drv_hrt.h>
+#include <stm32_uart.h>
+
#include "px4io.h"
__EXPORT int user_start(int argc, char *argv[]);
@@ -59,6 +61,8 @@ extern void up_cxxinitialize(void);
struct sys_state_s system_state;
+static struct hrt_call serial_dma_call;
+
int user_start(int argc, char *argv[])
{
/* run C++ ctors before we go any further */
@@ -72,6 +76,12 @@ int user_start(int argc, char *argv[])
/* configure the high-resolution time/callout interface */
hrt_init();
+ /*
+ * Poll at 1ms intervals for received bytes that have not triggered
+ * a DMA event.
+ */
+ hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
+
/* print some startup info */
lib_lowprintf("\nPX4IO: starting\n");