Skip to content

Commit 8619f2b

Browse files
committed
Move buffers for Wire library to DCCM area
1 parent 4e2232e commit 8619f2b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

libraries/Wire/src/Wire.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ TwoWire::TwoWire(I2C_CONTROLLER _controller_id)
3333
: rxBufferIndex(0), rxBufferLength(0), init_status(-1),
3434
controller_id(_controller_id)
3535
{
36-
// Empty
36+
rxBuffer = (uint8_t*)dccm_malloc(BUFFER_LENGTH);
37+
txBuffer = (uint8_t*)dccm_malloc(BUFFER_LENGTH);
3738
}
3839

3940
void TwoWire::begin(void)

libraries/Wire/src/Wire.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ class TwoWire : public Stream {
5858

5959
private:
6060
// RX Buffer
61-
uint8_t rxBuffer[BUFFER_LENGTH];
61+
uint8_t *rxBuffer;
6262
uint8_t rxBufferIndex;
6363
uint8_t rxBufferLength;
6464

6565
// TX Buffer
6666
uint8_t txAddress;
67-
uint8_t txBuffer[BUFFER_LENGTH];
67+
uint8_t *txBuffer;
6868
uint8_t txBufferLength;
6969

7070
int init_status;

0 commit comments

Comments
 (0)