Skip to content

Commit 36d969d

Browse files
committed
library: Wire: change default pins type
This allows _ALTx pins usage. Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent f1c3352 commit 36d969d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

cores/arduino/pins_arduino.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ static const uint32_t SCK = PIN_SPI_SCK;
8080
#define PIN_WIRE_SCL 15
8181
#endif
8282

83-
static const uint8_t SDA = PIN_WIRE_SDA;
84-
static const uint8_t SCL = PIN_WIRE_SCL;
83+
static const uint32_t SDA = PIN_WIRE_SDA;
84+
static const uint32_t SCL = PIN_WIRE_SCL;
8585

8686
#ifdef __cplusplus
8787
extern "C" {

libraries/Wire/src/Wire.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ TwoWire::TwoWire()
3939
_i2c.scl = digitalPinToPinName(SCL);
4040
}
4141

42-
TwoWire::TwoWire(uint8_t sda, uint8_t scl)
42+
TwoWire::TwoWire(uint32_t sda, uint32_t scl)
4343
{
4444
_i2c.sda = digitalPinToPinName(sda);
4545
_i2c.scl = digitalPinToPinName(scl);
4646
}
4747

4848
// Public Methods //////////////////////////////////////////////////////////////
4949

50-
void TwoWire::begin(uint8_t sda, uint8_t scl)
50+
void TwoWire::begin(uint32_t sda, uint32_t scl)
5151
{
5252
_i2c.sda = digitalPinToPinName(sda);
5353
_i2c.scl = digitalPinToPinName(scl);

libraries/Wire/src/Wire.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class TwoWire : public Stream {
6464

6565
public:
6666
TwoWire();
67-
TwoWire(uint8_t sda, uint8_t scl);
67+
TwoWire(uint32_t sda, uint32_t scl);
6868
// setSCL/SDA have to be called before begin()
6969
void setSCL(uint32_t scl)
7070
{
@@ -83,7 +83,7 @@ class TwoWire : public Stream {
8383
_i2c.sda = sda;
8484
};
8585
void begin(bool generalCall = false);
86-
void begin(uint8_t, uint8_t);
86+
void begin(uint32_t, uint32_t);
8787
void begin(uint8_t, bool generalCall = false);
8888
void begin(int, bool generalCall = false);
8989
void end();

0 commit comments

Comments
 (0)