acassis commented on code in PR #17487:
URL: https://github.com/apache/nuttx/pull/17487#discussion_r2619060184


##########
drivers/power/battery/battery_gauge.c:
##########
@@ -104,11 +107,28 @@ static const struct file_operations g_batteryops =
  * Private Functions
  ****************************************************************************/
 
-static int battery_gauge_notify(FAR struct battery_gauge_priv_s *priv,
-                                uint32_t mask)
+static void battery_gauge_work(FAR void *arg)
 {
+  FAR struct battery_gauge_priv_s *priv =
+    (FAR struct battery_gauge_priv_s *)arg;
   FAR struct pollfd *fds = priv->fds;
   int semcnt;
+
+  if (priv->mask)

Review Comment:
   ```suggestion
     if (priv->mask != 0)



##########
drivers/power/battery/battery_charger.c:
##########
@@ -118,12 +138,14 @@ static int battery_charger_notify(FAR struct 
battery_charger_priv_s *priv,
   priv->mask |= mask;
   if (priv->mask)
     {
-      poll_notify(&fds, 1, POLLIN);
-
-      nxsem_get_value(&priv->wait, &semcnt);
-      if (semcnt < 1)
+      if (priv->interval)

Review Comment:
   ```suggestion
         if (priv->interval > 0)



##########
drivers/power/battery/battery_gauge.c:
##########
@@ -120,12 +140,14 @@ static int battery_gauge_notify(FAR struct 
battery_gauge_priv_s *priv,
   priv->mask |= mask;
   if (priv->mask)
     {
-      poll_notify(&fds, 1, POLLIN);
-
-      nxsem_get_value(&priv->wait, &semcnt);
-      if (semcnt < 1)
+      if (priv->interval)

Review Comment:
   ```suggestion
         if (priv->interval > 0)



-- 
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]

Reply via email to