Skip to content

Commit 702fec6

Browse files
committed
move stop bit init to default constructor; added constexpr for default stop bit value
1 parent 1e24077 commit 702fec6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/sfeTk/sfeTkII2C.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3131
class sfeTkII2C : public sfeTkIBus
3232
{
3333
public:
34-
sfeTkII2C() : _address{kNoAddress}
34+
// set the address to No address and stop bit to the default value of 1
35+
sfeTkII2C() : _address{kNoAddress}, _stop{kDefaultStopBit}
3536
{
3637
}
37-
sfeTkII2C(uint8_t addr) : _address{addr}, _stop{true}
38+
sfeTkII2C(uint8_t addr) : _address{addr}
3839
{
3940
}
4041

@@ -89,6 +90,7 @@ class sfeTkII2C : public sfeTkIBus
8990
}
9091

9192
static constexpr uint8_t kNoAddress = 0;
93+
static constexpr uint8_t kDefaultStopBit = 1;
9294

9395
private:
9496
uint8_t _address;

0 commit comments

Comments
 (0)