aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32F1xx/I2C/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'testhal/STM32F1xx/I2C/main.c')
-rw-r--r--testhal/STM32F1xx/I2C/main.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/testhal/STM32F1xx/I2C/main.c b/testhal/STM32F1xx/I2C/main.c
index 3179c488a..ae1bea5af 100644
--- a/testhal/STM32F1xx/I2C/main.c
+++ b/testhal/STM32F1xx/I2C/main.c
@@ -57,6 +57,22 @@ static msg_t PollAccelThread(void *arg) {
}
+/*
+ * Accelerometer thread
+ */
+static WORKING_AREA(PollAccelThreadWA, 128);
+static msg_t PollAccelThread(void *arg) {
+ (void)arg;
+ systime_t time = chTimeNow();
+
+ while (TRUE) {
+ time += MS2ST(20);
+ request_acceleration_data();
+ chThdSleepUntil(time);
+ }
+ return 0;
+}
+
/*