Closed Andrewiski closed 8 years ago
Can you please create PR if you are sure how to solve this issue?
Sure I can make a Pull Request for fixing multiple I2c on same device.
Would you like me to have a go at fixing the loading of universial capes using
@RobertCNelson logic from his boot script as well
https://github.com/RobertCNelson/boot-scripts/blob/master/boot/am335x_evm.sh#L321-L407
Hey guys,
@RobertNelson is NOT @RobertCNelson. :-)
While I have the deepest respect for boot scripts, I can’t be of much help writing or modifying them.
Thanks,
@RobertNelson
On May 31, 2016, at 11:25 AM, Andrew DeVries notifications@github.com wrote:
Sure I can make a Pull Request for fixing multiple I2c on same device. Would you like me to have a go at fixing the loading of universial capes using
@RobertNelson https://github.com/RobertNelson logic from his boot script as well
https://github.com/RobertCNelson/boot-scripts/blob/master/boot/am335x_evm.sh#L321-L407 https://github.com/RobertCNelson/boot-scripts/blob/master/boot/am335x_evm.sh#L321-L407 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/theoctal/octalbonescript/issues/68#issuecomment-222776518, or mute the thread https://github.com/notifications/unsubscribe/AANHN-i27nIuQD_lBRdF6prdeTXQKGlOks5qHHz8gaJpZM4IqGKY.
Hi @Andrewiski what do you mean by fixing universal cape loading? You can work and create PR if you feel it will improve OBS. I almost always merge PRs which are crafted well.
Pull request https://github.com/theoctal/octalbonescript/pull/69 posted. Note breaking change on some i2c methods methods as address must be passed in with path but suspect most users of the open function just use the returned port objects calls not call your exposed methods anyways.
@adityapatadia Did you get a chance to look over my suggested changes to fix multiple calls to i2c and fix for Universal Cape already being loaded?
I am sorry I could not get time. I will give a shot this weekend.
@adityapatadia Any update on this pull request or should I just start using my own branch in my applications.
I2c allows multiple i2c devices onsame linux device with different i2c addresses. Current code base is indexing the internal i2c by device "'/dev/i2c-1" and not '/dev/i2c-1' + i2c address calls to open multiple i2c slaves with different address causes all previous devices to have the address of the last device opened. Can be displayed by console.log(port) of the returned port object. If multiple calls are made the expected result should be the same as i2c in that the returned port object retain there address and can be used as separate instances of port + address
In its current implementation before every i2c call the port.address property would need to be set first. This is not how i2c.open is implemented in https://github.com/kelly/node-i2c
internally we should be indexing the open calls by both path and address.
ie
i2c.openPorts[path + ':' + address] = port;
`open: function(path, address, handler, callback) { debug("i2c.open(" + path + ", " + address + ")");