HCoop
/
clinton
/
Smoothieware.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
70c2562
)
made SimpleShell wait for the queue to have room so that a serial message can still...
author
Logxen
<logxen@hotmail.com>
Wed, 9 May 2012 11:38:46 +0000
(
04:38
-0700)
committer
Logxen
<logxen@hotmail.com>
Wed, 9 May 2012 11:38:46 +0000
(
04:38
-0700)
src/modules/utils/simpleshell/SimpleShell.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/modules/utils/simpleshell/SimpleShell.cpp
b/src/modules/utils/simpleshell/SimpleShell.cpp
index
95cf7da
..
a6584e8
100644
(file)
--- a/
src/modules/utils/simpleshell/SimpleShell.cpp
+++ b/
src/modules/utils/simpleshell/SimpleShell.cpp
@@
-117,6
+117,8
@@
void SimpleShell::on_main_loop(void* argument){
struct SerialMessage message;
message.message = buffer;
message.stream = this->current_stream;
+ // wait for the queue to have enough room that a serial message could still be received before sending
+ while(this->kernel->player->queue.size() >= this->kernel->player->queue.capacity() - 2) { wait_us(500); }
this->kernel->call_event(ON_CONSOLE_LINE_RECEIVED, &message);
buffer.clear();
return;