diff options
author | Baohong Liu <baohong.liu@intel.com> | 2017-01-12 15:36:50 -0800 |
---|---|---|
committer | Anas Nashif <nashif@linux.intel.com> | 2017-02-04 20:08:16 +0000 |
commit | fd74c0c5a683b236b21b3b95b7c4354ef0cd59c9 (patch) | |
tree | 70dc2f66cf499ee23d222e8331937d138c3699f9 /samples | |
parent | a96ec2351d62e0a88eddf1dc9275f1fdb2948ed9 (diff) |
samples: bmi160: reduce polling mode sampling frequency
Reduce the accelerometer sampling frequency for polling mode.
So, cpu has more time to fetch the sample.
Also add some waiting time for the new frequency setting to
take effect.
Jira: ZEP-1532
Change-Id: If5c1d8a2b5f30b232a212f2775306ca397b9f80c
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Diffstat (limited to 'samples')
-rw-r--r-- | samples/sensor/bmi160/src/bmi160.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/samples/sensor/bmi160/src/bmi160.c b/samples/sensor/bmi160/src/bmi160.c index 5abb2394e..e357ef3b2 100644 --- a/samples/sensor/bmi160/src/bmi160.c +++ b/samples/sensor/bmi160/src/bmi160.c @@ -207,8 +207,8 @@ static void test_polling_mode(struct device *bmi160) struct sensor_value attr; #if defined(CONFIG_BMI160_ACCEL_ODR_RUNTIME) - /* set sampling frequency to 800Hz for accel */ - attr.val1 = 800; + /* set sampling frequency to 100Hz for accel */ + attr.val1 = 100; attr.val2 = 0; if (sensor_attr_set(bmi160, SENSOR_CHAN_ACCEL_XYZ, @@ -229,6 +229,8 @@ static void test_polling_mode(struct device *bmi160) return; } #endif + /* wait for the change to take effect */ + k_sleep(SLEEPTIME); /* poll the data and print it */ do { |