diff --git a/HamShield.h b/HamShield.h index c606884..5b2d956 100644 --- a/HamShield.h +++ b/HamShield.h @@ -8,8 +8,6 @@ #ifndef _HAMSHIELD_H_ #define _HAMSHIELD_H_ -//#include "I2Cdev_rda.h" -//#include "I2Cdev.h" #include "HamShield_comms.h" #include "SimpleFIFO.h" #include "AFSK.h" diff --git a/HamShield_comms.cpp b/HamShield_comms.cpp index 45411f4..95b0881 100644 --- a/HamShield_comms.cpp +++ b/HamShield_comms.cpp @@ -35,7 +35,6 @@ int8_t HSreadWord(uint8_t devAddr, uint8_t regAddr, uint16_t *data) Wire.beginTransmission(devAddr); Wire.write(regAddr); Wire.endTransmission(false); -// Wire.beginTransmission(devAddr); Wire.requestFrom((int)devAddr, 2); // length=words, this wants bytes bool msb = true; // starts with MSB, then LSB @@ -88,11 +87,11 @@ bool HSwriteWord(uint8_t devAddr, uint8_t regAddr, uint16_t data) uint8_t status = 0; Wire.beginTransmission(devAddr); - Wire.write(regAddr); // send address + Wire.write(regAddr); // send address - Wire.write((uint8_t)(data >> 8)); // send MSB - Wire.write((uint8_t)data); // send LSB + Wire.write((uint8_t)(data >> 8)); // send MSB + Wire.write((uint8_t)data); // send LSB - status = Wire.endTransmission(); + status = Wire.endTransmission(); return status == 0; } \ No newline at end of file