Donny9 commented on code in PR #15342:
URL: https://github.com/apache/nuttx/pull/15342#discussion_r1897757084
##########
drivers/sensors/gnss_uorb.c:
##########
@@ -168,12 +169,21 @@ static int gnss_activate(FAR struct sensor_lowerhalf_s
*lower,
int ret = OK;
nxmutex_lock(&upper->lock);
- if ((upper->crefs == 0 && enable) || (upper->crefs == 1 && !enable))
+ if ((upper->crefs_orb == 0 && enable) ||
+ (upper->crefs_orb == 1 && !enable))
{
- ret = upper->lower->ops->activate(upper->lower, filep, enable);
+ /* Activate or deactivate only when the driver device has not opened OR
+ * has already closed.
+ */
+
+ if (upper->crefs_dev == 0)
+ {
+ ret = upper->lower->ops->activate(upper->lower, filep, enable);
+ }
+
if (ret >= 0)
Review Comment:
move 174-176 line to after line 179, fix this issue?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]