[riot-notifications] [RIOT-OS/RIOT] drivers: support for NXP PCA9685 I2C 16-channel, 12-bit PWM controller (#10556)

benpicco notifications at github.com
Sat Sep 7 16:20:19 CEST 2019


benpicco commented on this pull request.



> +
+    /* read current register value */
+    EXEC_RET(_read(dev, reg, &byte, 1));
+
+    /* set masked bits to the given value  */
+    _set_reg_bit(&byte, mask, data);
+
+    /* write back new register value */
+    EXEC_RET(_write(dev, reg, &byte, 1));
+
+    return PCA9685_OK;
+}
+
+static void _set_reg_bit(uint8_t *byte, uint8_t mask, uint8_t bit)
+{
+    ASSERT_PARAM(byte != NULL);

Seems a bit excessive, this is an internal function that gets only called on local variables.
Maybe the compiler will even optimise it away.

-- 
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/10556#pullrequestreview-285173668
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190907/a1955905/attachment.htm>


More information about the notifications mailing list