Skip to content

Commit

Permalink
Merge pull request #658 from DeanIsMe/patch-1
Browse files Browse the repository at this point in the history
Flexible RX_BUFFER_SIZE and TX_BUFFER_SIZE
  • Loading branch information
PaulStoffregen authored Sep 28, 2022
2 parents aa33327 + b64540a commit 3fdd873
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions teensy/HardwareSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@
#include "HardwareSerial.h"
#include "wiring_private.h"

#ifndef RX_BUFFER_SIZE
#define RX_BUFFER_SIZE 64
#endif
static volatile uint8_t rx_buffer[RX_BUFFER_SIZE];
static volatile uint8_t rx_buffer_head = 0;
static volatile uint8_t rx_buffer_tail = 0;

#ifndef TX_BUFFER_SIZE
#define TX_BUFFER_SIZE 40
#endif
static volatile uint8_t tx_buffer[TX_BUFFER_SIZE];
static volatile uint8_t tx_buffer_head = 0;
static volatile uint8_t tx_buffer_tail = 0;
Expand Down

0 comments on commit 3fdd873

Please sign in to comment.