[riot-notifications] [RIOT-OS/RIOT] drivers/cc110x: add power off (sleep) functions (#16232)

benpicco notifications at github.com
Tue Jun 8 10:47:02 CEST 2021


@benpicco commented on this pull request.



> +        assert(len == sizeof(netopt_enable_t));
+        return cc110x_set_promiscuous_mode(dev, *((const netopt_enable_t *)val));
+    case NETOPT_STATE:
+        assert(len == sizeof(netopt_state_t));
+        switch (*((netopt_state_t *)val)) {
+        case NETOPT_STATE_RESET:
+        case NETOPT_STATE_IDLE:
+            if (cc110x_acquire(dev)) {
+                return -EIO;
+            }
+            cc110x_enter_rx_mode(dev);
+            cc110x_release(dev);
+            return sizeof(netopt_state_t);
+        case NETOPT_STATE_OFF:
+        case NETOPT_STATE_SLEEP:
+            cc110x_sleep(dev);

No `cc110x_acquire()` needed here?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16232#pullrequestreview-678257691
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210608/ef4550ec/attachment.htm>


More information about the notifications mailing list