summaryrefslogtreecommitdiff
path: root/common/motion_sense.c
diff options
context:
space:
mode:
authorInno.Park <ih.yoo.park@samsung.corp-partner.google.com>2020-05-27 16:45:24 +0900
committerCommit Bot <commit-bot@chromium.org>2020-05-29 11:04:36 +0000
commit3e98b58661f67fda599fddb03116ae1dcbeaedc0 (patch)
tree6752469ac69bb3cab50d6c13ca170bbdbe088f62 /common/motion_sense.c
parent929d464ed1dfef532f6e9d5fcd4366def92de862 (diff)
downloadchrome-ec-3e98b58661f67fda599fddb03116ae1dcbeaedc0.tar.gz
motion_sense: hold 'ready_status' until next lid angle calculation
Current motionsense task clears the variable ready_status every event loop. In the case that all of two accels work on interrupt mode, no lid angle calculation until next polling event of the third sensor. So it might cause a tablet mode transition to take quite long. *delay = (TABLET_MODE_DEBOUNCE_COUNT + 1) x (collection_rate of the 3rd sensor) BUG=b:154299214 BRANCH=none TEST=build EC, flash 'ec.bin' and boot device. check a tablet mode transition time. Change-Id: I7882730df373dfb5164fb622fe939b6e70b738e0 Signed-off-by: Inno.Park <ih.yoo.park@samsung.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2217609 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Bob Moragues <moragues@chromium.org>
Diffstat (limited to 'common/motion_sense.c')
-rw-r--r--common/motion_sense.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c
index 572696ce80..2592808bb6 100644
--- a/common/motion_sense.c
+++ b/common/motion_sense.c
@@ -833,7 +833,7 @@ void motion_sense_task(void *u)
timestamp_t ts_begin_task, ts_end_task;
int32_t time_diff;
uint32_t event = 0;
- uint16_t ready_status;
+ uint16_t ready_status = 0;
struct motion_sensor_t *sensor;
#ifdef CONFIG_LID_ANGLE
const uint16_t lid_angle_sensors = (BIT(CONFIG_LID_ANGLE_SENSOR_BASE)|
@@ -855,7 +855,6 @@ void motion_sense_task(void *u)
while (1) {
ts_begin_task = get_time();
- ready_status = 0;
for (i = 0; i < motion_sensor_count; ++i) {
sensor = &motion_sensors[i];
@@ -882,8 +881,10 @@ void motion_sense_task(void *u)
* calculation are ready.
*/
ready_status &= lid_angle_sensors;
- if (ready_status == lid_angle_sensors)
+ if (ready_status == lid_angle_sensors) {
motion_lid_calc();
+ ready_status = 0;
+ }
#endif
#ifdef CONFIG_CMD_ACCEL_INFO
if (accel_disp) {