You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/07/22 09:25:18 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6673: power related update

xiaoxiang781216 commented on code in PR #6673:
URL: https://github.com/apache/incubator-nuttx/pull/6673#discussion_r927468156


##########
include/nuttx/power/pm.h:
##########
@@ -85,6 +87,14 @@
  * own, custom idle loop to support board-specific IDLE time power management
  */
 
+#define PM_WAKELOCK_INITIALIZER(name, domain, state) {name, domain, state}
+
+#define PM_WAKELOCK_DECLARE(var, name, domain, state) \
+      struct pm_wakelock_s var = PM_WAKELOCK_INITIALIZER(name, domain, state)
+
+#define PM_WAKELOCK_DECLARE_STATIC(var, name, domain, state) \

Review Comment:
   Since PM is optional feature, if we reuse PM_WAKELOCK_DECLARE macro, we have to:
   ```
   #ifdef CONFIG_PM
   static PM_WAKELOCK_DECLARE(x, y, z, t);
   #endif
   ```
   On the other hand, we can write more simple code with PM_WAKELOCK_DECLARE_STATIC:
   ```
   PM_WAKELOCK_DECLARE_STATIC(x, y, z, t);
   ```



-- 
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-unsubscribe@nuttx.apache.org

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