Skip to content

Commit

Permalink
Update dx_i2c.c (#31)
Browse files Browse the repository at this point in the history
if i2c binding already open then don't try to reopen
  • Loading branch information
gloveboxes committed Oct 20, 2021
1 parent d89a5c2 commit d8157fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/dx_i2c.c
Expand Up @@ -2,6 +2,10 @@

bool dx_i2cOpen(DX_I2C_BINDING *i2c_binding)
{
if (i2c_binding->opened) {
return true;
}

i2c_binding->fd = I2CMaster_Open(i2c_binding->interfaceId);
if (i2c_binding->fd < 0) {
Log_Debug("ERROR: I2CMaster_Open: errno=%d (%s)\n", errno, strerror(errno));
Expand Down

0 comments on commit d8157fa

Please sign in to comment.