examples: fix static code analysis findings
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
This commit is contained in:
@@ -123,7 +123,7 @@ main(void)
|
||||
}
|
||||
|
||||
/* set slave address */
|
||||
mraa_i2c_address(i2c, HMC5883L_I2C_ADDR);
|
||||
status = mraa_i2c_address(i2c, HMC5883L_I2C_ADDR);
|
||||
if (status != MRAA_SUCCESS) {
|
||||
goto err_exit;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,6 @@ txbuf[2] = 0x00
|
||||
while True:
|
||||
rxbuf = dev.write(txbuf)
|
||||
value = ((rxbuf[1] & 0x03) << 8) | rxbuf[2]
|
||||
print value
|
||||
print(value)
|
||||
time.sleep(0.5)
|
||||
|
||||
|
||||
@@ -38,6 +38,5 @@ for x in range(0,100):
|
||||
rxbuf = dev.write(txbuf)
|
||||
if rxbuf != txbuf:
|
||||
print("We have an error captain!")
|
||||
break
|
||||
exit(1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user