diff --git a/PCF8574.cpp b/PCF8574.cpp index 4c91bf3..81701e9 100644 --- a/PCF8574.cpp +++ b/PCF8574.cpp @@ -12,14 +12,8 @@ PCF8574::PCF8574(const uint8_t deviceAddress, TwoWire *wire) -{ - _address = deviceAddress; - _wire = wire; - _dataIn = 0; - _dataOut = 0xFF; - _buttonMask = 0xFF; - _error = PCF8574_OK; -} +: _address {deviceAddress}, _wire {wire} +{} bool PCF8574::begin(uint8_t value) diff --git a/PCF8574.h b/PCF8574.h index 96c5bb6..a3d91f9 100644 --- a/PCF8574.h +++ b/PCF8574.h @@ -78,11 +78,12 @@ class PCF8574 private: + int _error {PCF8574_OK}; uint8_t _address; - uint8_t _dataIn; - uint8_t _dataOut; - uint8_t _buttonMask; - int _error; + uint8_t _dataIn {0}; + uint8_t _dataOut {0xFF}; + uint8_t _buttonMask {0xFF}; + TwoWire* _wire; };