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


##########
drivers/power/pm/pm_changestate.c:
##########
@@ -39,6 +39,60 @@
  * Private Functions
  ****************************************************************************/
 
+#ifdef CONFIG_PM_PROCFS
+static void pm_stats(FAR struct pm_domain_s *dom, int curstate, int newstate)
+{
+  struct timespec ts;
+
+  clock_systime_timespec(&ts);
+  clock_timespec_subtract(&ts, &dom->start, &ts);
+
+  if (newstate == PM_RESTORE)
+    {
+      /* Wakeup from WFI */
+
+      clock_timespec_add(&ts, &dom->sleep[curstate], &dom->sleep[curstate]);
+    }
+  else
+    {
+      /* Sleep to WFI */
+
+      clock_timespec_add(&ts, &dom->wake[curstate], &dom->wake[curstate]);
+    }
+
+  /* Update start */
+
+  clock_systime_timespec(&dom->start);
+}
+
+static void pm_stats_preparefail(int domain,

Review Comment:
   Ditto



##########
drivers/power/pm/pm_changestate.c:
##########
@@ -39,6 +39,60 @@
  * Private Functions
  ****************************************************************************/
 
+#ifdef CONFIG_PM_PROCFS
+static void pm_stats(FAR struct pm_domain_s *dom, int curstate, int newstate)

Review Comment:
   @jasonbu please include function Description including its parameters (dom, 
curstate and newstate)



##########
drivers/power/pm/pm_procfs.c:
##########
@@ -398,6 +406,93 @@ static ssize_t pm_read_wakelock(FAR struct file *filep, 
FAR char *buffer,
   return totalsize;
 }
 
+static ssize_t pm_read_preparefail(FAR struct file *filep, FAR char *buffer,

Review Comment:
   Please include function Description



##########
drivers/power/pm/pm_changestate.c:
##########
@@ -60,7 +114,7 @@
  *
  ****************************************************************************/
 
-static int pm_prepall(int domain, enum pm_state_e newstate)
+static int pm_prepall(int domain, enum pm_state_e newstate, bool restore)

Review Comment:
   Please include restore parameter to "Input Parameters" description



-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to