aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2013-01-23 18:57:16 -0800
committerpx4dev <px4@purgatory.org>2013-01-23 18:57:16 -0800
commitd8a013f8720e81afb637b8206fbe521ccb43ac8f (patch)
tree8d6218bc0ab4c05950944e4ac088b8575b291ac3
parentb34311915a04e9ec4d301930e4342f285b5c6cb4 (diff)
downloadpx4-firmware-d8a013f8720e81afb637b8206fbe521ccb43ac8f.tar.gz
px4-firmware-d8a013f8720e81afb637b8206fbe521ccb43ac8f.tar.bz2
px4-firmware-d8a013f8720e81afb637b8206fbe521ccb43ac8f.zip
Tinkering.
-rw-r--r--apps/systemcmds/i2c/i2c.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/systemcmds/i2c/i2c.c b/apps/systemcmds/i2c/i2c.c
index 422d9f915..e1babdc12 100644
--- a/apps/systemcmds/i2c/i2c.c
+++ b/apps/systemcmds/i2c/i2c.c
@@ -80,12 +80,13 @@ int i2c_main(int argc, char *argv[])
usleep(100000);
- uint32_t val = 0x12345678;
- int ret = transfer(PX4_I2C_OBDEV_PX4IO, (uint8_t *)&val, sizeof(val), NULL, 0);
+ uint8_t buf[] = { 0, 4};
+ int ret = transfer(PX4_I2C_OBDEV_PX4IO, buf, sizeof(buf), NULL, 0);
if (ret)
errx(1, "send failed - %d", ret);
+ uint32_t val;
ret = transfer(PX4_I2C_OBDEV_PX4IO, NULL, 0, (uint8_t *)&val, sizeof(val));
if (ret)
errx(1, "recive failed - %d", ret);
@@ -128,7 +129,7 @@ transfer(uint8_t address, uint8_t *send, unsigned send_len, uint8_t *recv, unsig
* if there are any devices on the bus with a different frequency
* preference. Really, this is pointless.
*/
- I2C_SETFREQUENCY(i2c, 320000);
+ I2C_SETFREQUENCY(i2c, 400000);
ret = I2C_TRANSFER(i2c, &msgv[0], msgs);
// reset the I2C bus to unwedge on error