[riot-notifications] [RIOT-OS/RIOT] core/bitarithm: introduce bitarithm_get/set_masked(), convert pca9685 (#12238)

benpicco notifications at github.com
Mon Sep 16 20:51:43 CEST 2019

benpicco commented on this pull request.

> @@ -274,21 +273,21 @@ static int _init(pca9685_t *dev)
     /* set Auto-Increment flag */
     uint8_t byte = 0;
-    _set_reg_bit(&byte, PCA9685_MODE2_INVERT, dev->params.inv);
-    _set_reg_bit(&byte, PCA9685_MODE2_OUTDRV, dev->params.out_drv);
-    _set_reg_bit(&byte, PCA9685_MODE2_OUTNE, dev->params.out_ne);
+    bitarithm_set_masked(&byte, PCA9685_MODE2_INVERT, dev->params.inv);

Will do, just thought it's easier when I provide an example with it.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190916/cf03a9a9/attachment.htm>

More information about the notifications mailing list