Skip to content

Commit 9c1bcac

Browse files
committed
small wire changes
1 parent 74d295e commit 9c1bcac

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

libraries/Wire/src/Wire.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55

66
#include "Wire.h"
77

8-
arduino::MbedI2C::MbedI2C(int sda, int scl) : _sda(sda), _scl(scl), usedTxBuffer(0) {}
8+
arduino::MbedI2C::MbedI2C(int sda, int scl) : _sda(sda), _scl(scl), usedTxBuffer(0), master(NULL) {
9+
#ifdef DEVICE_I2CSLAVE
10+
slave = NULL;
11+
#endif
12+
}
913

1014
void arduino::MbedI2C::begin() {
1115
if(!master){

libraries/Wire/src/Wire.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
#include "drivers/I2CSlave.h"
1212
#include "rtos.h"
1313

14+
#define AP3_WIRE_RX_BUFFER_LEN 256
15+
#define AP3_WIRE_TX_BUFFER_LEN 256
16+
1417
typedef void (*voidFuncPtrParamInt)(int);
1518

1619
namespace arduino {
@@ -52,8 +55,8 @@ class MbedI2C : public HardwareI2C
5255
int _sda;
5356
int _scl;
5457
int _address;
55-
RingBufferN<256> rxBuffer;
56-
uint8_t txBuffer[256];
58+
RingBufferN<AP3_WIRE_RX_BUFFER_LEN> rxBuffer;
59+
uint8_t txBuffer[AP3_WIRE_TX_BUFFER_LEN];
5760
uint32_t usedTxBuffer;
5861
voidFuncPtrParamInt onReceiveCb = NULL;
5962
voidFuncPtr onRequestCb = NULL;

0 commit comments

Comments
 (0)