Skip to content

Commit

Permalink
prevent overflow of incoming rf data into packet buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
ps2 committed Apr 4, 2016
1 parent 9d201b5 commit 825707b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ pump model number ends with 'WW' then you need a 'WorldWide' firmware:

make -f Makefile.uart1_alt2 RADIO_LOCALE=WW

# cc111x UART1_alt2 connected to the Intel Edison UART_1

P1.4 - CT / SSN -> UART_1_RTS (GP129) (pin 63)
P1.5 - RT / SCK -> UART_1_CTS (GP128) (pin 65)
P1.6 - TX / MOSI -> UART_1_RX (GP130) (pin 61)
P1.7 - RX / MISO -> UART_1_TX (GP131) (pin 46)


# UART on the WirelessThings ERF stick

Perform the build. The output file will be stored at output/uart0_alt1_SRF_ERF_US/uart0_alt1_SRF_ERF_US.hex
Expand Down
8 changes: 6 additions & 2 deletions radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,12 @@ void rftxrx_isr(void) __interrupt RFTXRX_VECTOR {
if (packet_count == 0) {
packet_count = 1;
}
radio_rx_buf[radio_rx_buf_len] = d_byte;
radio_rx_buf_len++;
if (radio_rx_buf_len < MAX_PACKET_LEN) {
radio_rx_buf[radio_rx_buf_len] = d_byte;
radio_rx_buf_len++;
} else {
// Overflow
}
if (d_byte == 0) {
RFST = RFST_SIDLE;
while(MARCSTATE!=MARC_STATE_IDLE);
Expand Down

1 comment on commit 825707b

@ps2
Copy link
Owner Author

@ps2 ps2 commented on 825707b Apr 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes #22

Please # to comment.