Skip to content

Commit 34d0e50

Browse files
committed
I2S example sketches failed compliation, Jira 786.
The latest BLE library consumes more heap space that causes these sketches ran out of heap space for their temporary buffers. For now, the size of the tempporary is reduced. For the near future, there are 3 improvements to address this issue. The BLE library will be making use of the DCCM memory instead of heap. The I2S library buffering space is going to the DCCM memory too. The heap space will be increased to maximize the usage of the entire SRAM sapce.
1 parent 4c89a18 commit 34d0e50

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

libraries/CurieI2S/examples/I2SDMA_RXCallBack/I2SDMA_RXCallBack.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
**/
2323
#include <CurieI2SDMA.h>
2424

25-
#define BUFF_SIZE 128
26-
#define OFFSET 2
25+
const int BUFF_SIZE=64;
26+
const int OFFSET=2;
2727
uint32_t dataBuff[BUFF_SIZE+OFFSET]; // extra 2 buffers are for the padding zero
2828

2929
/**

libraries/CurieI2S/examples/I2SDMA_TXCallBack/I2SDMA_TXCallBack.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include <CurieI2SDMA.h>
1111

12-
#define BUFF_SIZE 128
12+
const int BUFF_SIZE=64;
1313
boolean blinkState = true; // state of the LED
1414
uint32_t dataBuff[BUFF_SIZE];
1515
uint32_t loop_count = 0;

libraries/CurieI2S/examples/I2S_RxCallback/I2S_RxCallback.ino

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
**/
1818
#include <CurieI2S.h>
1919

20-
uint32_t dataBuff[256];
20+
const int BUFF_SIZE=128;
21+
22+
uint32_t dataBuff[BUFF_SIZE];
2123
volatile int count = 0;
2224

2325
void setup()
@@ -54,6 +56,6 @@ void rxDataReceived()
5456
while(CurieI2S.available())
5557
{
5658
dataBuff[count++] = CurieI2S.requestdword();
57-
count %= 256; //prevent buffer overflow and just write data in front of the buffer.
59+
count %= BUFF_SIZE; //prevent buffer overflow and just write data in front of the buffer.
5860
}
5961
}

0 commit comments

Comments
 (0)