Rework force system
This commit is contained in:
parent
c5b480995d
commit
79a0b2d6b6
15 changed files with 67 additions and 56 deletions
|
|
@ -61,14 +61,14 @@ inline static uint32_t round_div(uint32_t x, uint32_t y)
|
|||
|
||||
inline static void write_reg(uint8_t addr, uint8_t reg, uint8_t val)
|
||||
{
|
||||
if (i2c_slave_write(addr, ®, &val, 1, false))
|
||||
if (i2c_slave_write(addr, ®, &val, 1))
|
||||
debug("Could not write 0x%02x to 0x%02x, addr = 0x%02x", reg, val, addr);
|
||||
}
|
||||
|
||||
inline static uint8_t read_reg(uint8_t addr, uint8_t reg)
|
||||
{
|
||||
uint8_t res = 0;
|
||||
if (i2c_slave_read(addr, ®, &res, 1, false))
|
||||
if (i2c_slave_read(addr, ®, &res, 1))
|
||||
debug("Could not read from 0x%02x, addr = 0x%02x", reg, addr);
|
||||
return res;
|
||||
}
|
||||
|
|
@ -192,7 +192,7 @@ void pca9685_set_pwm_value(uint8_t addr, uint8_t channel, uint16_t val)
|
|||
{
|
||||
// Normal
|
||||
uint8_t buf[4] = { 0, 0, val, val >> 8 };
|
||||
i2c_slave_write(addr, ®, buf, 4, false);
|
||||
i2c_slave_write(addr, ®, buf, 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue