mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-01 23:29:28 +01:00
Change RingBuffer to have buffer size of 128 and also set its members volatile since they are all accessed and modified in interrupt handlers.
This commit is contained in:
parent
065459c18f
commit
4eb05c303b
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
RingBuffer::RingBuffer( void )
|
RingBuffer::RingBuffer( void )
|
||||||
{
|
{
|
||||||
memset( _aucBuffer, 0, SERIAL_BUFFER_SIZE ) ;
|
memset( (void *)_aucBuffer, 0, SERIAL_BUFFER_SIZE ) ;
|
||||||
_iHead=0 ;
|
_iHead=0 ;
|
||||||
_iTail=0 ;
|
_iTail=0 ;
|
||||||
}
|
}
|
||||||
|
@ -25,14 +25,14 @@
|
|||||||
// using a ring buffer (I think), in which head is the index of the location
|
// using a ring buffer (I think), in which head is the index of the location
|
||||||
// to which to write the next incoming character and tail is the index of the
|
// to which to write the next incoming character and tail is the index of the
|
||||||
// location from which to read.
|
// location from which to read.
|
||||||
#define SERIAL_BUFFER_SIZE 64
|
#define SERIAL_BUFFER_SIZE 128
|
||||||
|
|
||||||
class RingBuffer
|
class RingBuffer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
uint8_t _aucBuffer[SERIAL_BUFFER_SIZE] ;
|
volatile uint8_t _aucBuffer[SERIAL_BUFFER_SIZE] ;
|
||||||
int _iHead ;
|
volatile int _iHead ;
|
||||||
int _iTail ;
|
volatile int _iTail ;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RingBuffer( void ) ;
|
RingBuffer( void ) ;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user