mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
drivers/sensors: wakeup mode optimization.
Build Documentation / build-html (push) Has been cancelled
Build Documentation / build-html (push) Has been cancelled
set nonwakeup mode as initialize state. Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
@@ -750,9 +750,9 @@ static int sensor_open(FAR struct file *filep)
|
||||
|
||||
user->state.interval = UINT32_MAX;
|
||||
user->state.esize = upper->state.esize;
|
||||
user->state.nonwakeup = true;
|
||||
nxsem_init(&user->buffersem, 0, 0);
|
||||
list_add_tail(&upper->userlist, &user->node);
|
||||
sensor_update_nonwakeup(filep, upper, user, true);
|
||||
|
||||
/* The new user generation, notify to other users */
|
||||
|
||||
@@ -1415,6 +1415,7 @@ int sensor_custom_register(FAR struct sensor_lowerhalf_s *lower,
|
||||
list_initialize(&upper->userlist);
|
||||
upper->state.esize = esize;
|
||||
upper->state.min_interval = UINT32_MAX;
|
||||
upper->state.nonwakeup = true;
|
||||
if (lower->ops->activate)
|
||||
{
|
||||
upper->state.nadvertisers = 1;
|
||||
|
||||
Reference in New Issue
Block a user