Skip to content

Commit

Permalink
Simplest possible loopback example
Browse files Browse the repository at this point in the history
Fixed library to remove atomic block for arduinos
  • Loading branch information
Elliot Williams committed Oct 25, 2015
1 parent 55ab726 commit f33be28
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,12 @@ int main(void) {

while (1) {

// Check if the last character typed was a space
status = bufferPeek(&rx_buffer, &input_byte);
if (status == BUFFER_OK && input_byte == ' '){
while(1) {
status = bufferRead(&rx_buffer, &input_byte);
if (status == BUFFER_OK){
bufferWrite(&tx_buffer, input_byte);
} else {
break;
}
}
status = bufferRead(&rx_buffer, &input_byte);
if (status == BUFFER_OK){
bufferWrite(&tx_buffer, input_byte);
enable_transmission();
}

} /* End event loop */
return 0; /* This line is never reached */
}
Expand Down

0 comments on commit f33be28

Please sign in to comment.