Permalink
Browse files

(Hopefully) fixed rapid write/read cycles causing lockups.

  • Loading branch information...
mossblaser committed Feb 14, 2011
1 parent 4443d01 commit 9375a8d717c180dda516f49bf5119adf72462828
Showing with 4 additions and 5 deletions.
  1. +4 −5 arduino/lib/comms.cpp
View
@@ -92,6 +92,10 @@ Comms::Write(uint8_t byte)
// Return the line to the idle state as an end bit
pins->Write(HIGH);
Clock();
Clock();
Clock();
Clock();
Clock();
return true;
@@ -193,17 +197,12 @@ Comms::ReadToBuffer()
// Check buffer isn't too full
int new_buffer_tail = (buffer_tail + 1) % COMMS_BUFFER_SIZE;
if (new_buffer_tail == buffer_head) {
Clock();
Clock();
return false;
}
// Store data in buffer
buffer[buffer_tail] = data;
buffer_tail = new_buffer_tail;
Clock();
Clock();
return true;
}

0 comments on commit 9375a8d

Please sign in to comment.