aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32F1xx/I2C/main.c
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-12-07 17:58:42 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-12-07 17:58:42 +0000
commitb9df6d7c801d711fda3d83cd9a2eb7b456f60276 (patch)
treedb3c066803791aaf1a1e200dd6bd8590f7512ff8 /testhal/STM32F1xx/I2C/main.c
parent0738591b023a4e2c6cacebadebfef08aafea4d6e (diff)
downloadChibiOS-b9df6d7c801d711fda3d83cd9a2eb7b456f60276.tar.gz
ChibiOS-b9df6d7c801d711fda3d83cd9a2eb7b456f60276.tar.bz2
ChibiOS-b9df6d7c801d711fda3d83cd9a2eb7b456f60276.zip
I2C. Testhal switch to synchronous driver model.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3571 35acf78f-673a-0410-8e92-d51de3d6d3f4
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;
+}
+
/*