Skip to content

Commit 41f98f9

Browse files
committed
Allocate RingBuffer buffer into DCCM area
-this buffer is used by the uart. Moving it into the DCCM area would save us 128 bytes of SRAM
1 parent 8619f2b commit 41f98f9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

cores/arduino/RingBuffer.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
RingBuffer::RingBuffer( void )
2525
{
26+
_aucBuffer = (uint8_t*)dccm_malloc(UART_BUFFER_SIZE);
2627
memset( _aucBuffer, 0, UART_BUFFER_SIZE ) ;
2728
_iHead=0 ;
2829
_iTail=0 ;

cores/arduino/RingBuffer.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#define _RING_BUFFER_
1919

2020
#include <stdint.h>
21+
#include "dccm/dccm_alloc.h"
2122

2223
// Define constants and variables for buffering incoming serial data. We're
2324
// using a ring buffer (I think), in which head is the index of the location
@@ -28,7 +29,7 @@
2829
class RingBuffer
2930
{
3031
public:
31-
uint8_t _aucBuffer[UART_BUFFER_SIZE] ;
32+
uint8_t *_aucBuffer;
3233
int _iHead ;
3334
int _iTail ;
3435
bool _buffer_overflow ;

0 commit comments

Comments
 (0)