acassis commented on code in PR #17487:
URL: https://github.com/apache/nuttx/pull/17487#discussion_r2615212167
##########
drivers/power/battery/battery_charger.c:
##########
@@ -102,11 +105,28 @@ static const struct file_operations g_batteryops =
* Private Functions
****************************************************************************/
-static int battery_charger_notify(FAR struct battery_charger_priv_s *priv,
- uint32_t mask)
+static void battery_charger_work(FAR void *arg)
{
+ FAR struct battery_charger_priv_s *priv =
+ (FAR struct battery_charger_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_monitor.c:
##########
@@ -119,12 +139,14 @@ static int battery_monitor_notify(FAR struct
battery_monitor_priv_s *priv,
priv->mask |= mask;
if (priv->mask)
Review Comment:
```suggestion
if (priv->mask != 0)
##########
drivers/power/battery/battery_monitor.c:
##########
@@ -119,12 +139,14 @@ static int battery_monitor_notify(FAR struct
battery_monitor_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_monitor.c:
##########
@@ -119,12 +139,14 @@ static int battery_monitor_notify(FAR struct
battery_monitor_priv_s *priv,
priv->mask |= mask;
if (priv->mask)
Review Comment:
This was in the original code, but please fix it as well
##########
drivers/power/battery/battery_monitor.c:
##########
@@ -103,11 +106,28 @@ static const struct file_operations g_batteryops =
* Private Functions
****************************************************************************/
-static int battery_monitor_notify(FAR struct battery_monitor_priv_s *priv,
- uint32_t mask)
+static void battery_monitor_work(FAR void *arg)
{
+ FAR struct battery_monitor_priv_s *priv =
+ (FAR struct battery_monitor_priv_s *)arg;
FAR struct pollfd *fds = priv->fds;
int semcnt;
+
+ if (priv->mask)
Review Comment:
```suggestion
if (priv->mask != 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]