Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,8 @@ int _hat_info(uint8_t address, struct HatInfo* entry, char* pData,
else
{
// no board info found
if (eeprom_fd != 1)
close(eeprom_fd);
return RESULT_BAD_PARAMETER;
}

Expand All @@ -1077,7 +1079,10 @@ int _hat_info(uint8_t address, struct HatInfo* entry, char* pData,
{
*pSize = custom_size + 1; // add room for null
}
if (eeprom_fd != -1)
close(eeprom_fd);
}


return RESULT_SUCCESS;
}
Expand Down
4 changes: 4 additions & 0 deletions tools/daqhats_read_eeproms
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ if [ "$rc" != 0 ]; then
exit $rc
fi

# /sys/class/i2c-adapter is deprecated since 2009
SYS=/sys/class/i2c-adapter/i2c-$BUS
if [ ! -d "$SYS" ]; then
SYS=/sys/bus/i2c/devices/i2c-$BUS
fi

rm -f /etc/mcc/hats/*.bin

Expand Down