Skip to content

Commit b730146

Browse files
committed
cleanup, fix typos, formatting
1 parent 485ab87 commit b730146

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

src/SparkFun_TMF882X_Library.h

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
//
1919
// Repository:
2020
// https://github.com/sparkfun/SparkFun_Qwiic_TMF882X_Arduino_Library
21-
//k
2221
//
2322
// SparkFun code, firmware, and software is released under the MIT
2423
// License(http://opensource.org/licenses/MIT).
@@ -57,17 +56,19 @@
5756
// Arduino things
5857
#include <Wire.h>
5958

60-
class SparkFun_TMF882X : public QwDevTMF882X {
59+
class SparkFun_TMF882X : public QwDevTMF882X
60+
{
6161

62-
public:
62+
public:
6363
// Default noop constructor
64-
SparkFun_TMF882X() {};
64+
SparkFun_TMF882X(){};
6565

6666
///////////////////////////////////////////////////////////////////////
6767
// begin()
6868
//
69-
// This method is called to initialize the TMF882X library and connection to
70-
// the TMF882X device. This method must be called before calling any other method.
69+
// This method is called to initialize the TMF882X library and connect to
70+
// the TMF882X device. This method must be called before calling any other method
71+
// that interacts with the device.
7172
//
7273
// This method follows the standard startup pattern in SparkFun Arduino
7374
// libraries.
@@ -78,37 +79,39 @@ class SparkFun_TMF882X : public QwDevTMF882X {
7879
// address optional. I2C Address. If not provided, the default address is used.
7980
// retval true on success, false on startup failure
8081
//
81-
// Two versions - the methods is overridden
82+
// This methond is overridden, implementing two versions.
8283
//
8384
// Version 1:
84-
// User passes in an aready setup wirePort
85+
// User passes in an aready setup wirePort object
8586

86-
bool begin(TwoWire& wirePort, uint8_t deviceAddress = kDefaultTMF882XAddress)
87+
bool begin(TwoWire &wirePort, uint8_t deviceAddress = kDefaultTMF882XAddress)
8788
{
8889
// Setup I2C object and pass into the superclass
8990
_i2cBus.init(wirePort);
9091
setCommunicationBus(_i2cBus, deviceAddress);
9192

9293
// Initialize the system - return results
9394
return this->QwDevTMF882X::init();
94-
};
95+
}
9596

9697
///////////////////////////////////////////////////////////////////////
9798
// begin()
9899
//
99100
// Version 2:
100101
//
101-
// User doesn't provide a wireport
102-
bool begin(uint8_t deviceAddress = kDefaultTMF882XAddress){
102+
// User doesn't provide a wireport object.
103103

104+
bool begin(uint8_t deviceAddress = kDefaultTMF882XAddress)
105+
{
104106
_i2cBus.init();
105107
setCommunicationBus(_i2cBus, deviceAddress);
106-
return this->QwDevTMF882X::init();
108+
return this->QwDevTMF882X::init();
107109
}
110+
108111
///////////////////////////////////////////////////////////////////////
109112
// setOutputDevice()
110113
//
111-
// This method is called to provide an output Serial device that the
114+
// This method is called to provide an output Serial device that the
112115
// is used to output messages from the underlying AMS SDK.
113116
//
114117
// This is helpful when debug or info messages are enabled in the library
@@ -117,11 +120,11 @@ class SparkFun_TMF882X : public QwDevTMF882X {
117120
// --------- ----------------------------
118121
// theStream The output stream device - normally a Serial port.
119122

120-
void setOutputDevice(Stream& theStream)
123+
void setOutputDevice(Stream &theStream)
121124
{
122-
sfe_set_output_device((void*)&theStream);
125+
sfe_set_output_device((void *)&theStream);
123126
}
124127

125-
private:
128+
private:
126129
QwI2C _i2cBus;
127130
};

0 commit comments

Comments
 (0)