wes3 commented on a change in pull request #1122: Lp5523 improvements
URL: https://github.com/apache/mynewt-core/pull/1122#discussion_r191083686
##########
File path: hw/drivers/lp5523/src/lp5523.c
##########
@@ -106,22 +109,20 @@ lp5523_get_reg(struct led_itf *itf, enum
lp5523_registers addr,
}
static int
-lp5523_set_2_regs(struct led_itf *itf, enum lp5523_registers addr,
- uint8_t vals[2])
+lp5523_set_n_regs(struct led_itf *itf, enum lp5523_registers addr,
+ uint8_t *vals, uint8_t len)
{
int rc;
- uint8_t regs[3];
-
- regs[0] = addr ;
- regs[1] = vals[0];
- regs[2] = vals[1];
+ uint8_t regs[10] = {addr, 0, 0, 0, 0, 0, 0, 0, 0, 0};
Review comment:
I wonder what this code looks when you dis-assemble it? I wonder if a memset
would be better than assign the address to location 0. Also, where does the
"10" come from? Maybe a #define for that would be better?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services