apply two patches for bufferUntil() and readBytesUntil() in Serial

This commit is contained in:
benfry
2008-06-09 19:12:12 +00:00
parent 29af6b606f
commit cc9a40deb7
3 changed files with 23 additions and 5 deletions

View File

@@ -5,6 +5,8 @@ _ pdf not rendering unicode (though it renders to screen)
_ try updating to newer itext
_ http://dev.processing.org/bugs/show_bug.cgi?id=727
_ pdf sketches exiting before writing has finished
_ need a halt() method which will kill but not quit app (sets finished?)
_ exit() will actually leave the application
_ this may in fact only be internal

View File

@@ -211,7 +211,7 @@ public class Serial implements SerialPortEventListener {
* Set the DTR line. Addition from Tom Hulbert.
*/
public void setDTR(boolean state) {
port.setDTR(state);
port.setDTR(state);
}
@@ -227,8 +227,10 @@ public class Serial implements SerialPortEventListener {
}
buffer[bufferLast++] = (byte) input.read();
if (serialEventMethod != null) {
if ((bufferUntil && (buffer[bufferLast-1] == bufferUntilByte)) ||
((bufferLast - bufferIndex) >= bufferSize)) {
if ((bufferUntil &&
(buffer[bufferLast-1] == bufferUntilByte)) ||
(!bufferUntil &&
((bufferLast - bufferIndex) >= bufferSize))) {
try {
serialEventMethod.invoke(parent, new Object[] { this });
} catch (Exception e) {
@@ -413,8 +415,11 @@ public class Serial implements SerialPortEventListener {
byte outgoing[] = new byte[length];
System.arraycopy(buffer, bufferIndex, outgoing, 0, length);
bufferIndex = 0; // rewind
bufferLast = 0;
bufferIndex += length;
if (bufferIndex == bufferLast) {
bufferIndex = 0; // rewind
bufferLast = 0;
}
return outgoing;
}
}

View File

@@ -10,6 +10,9 @@ X can't seem to verify this
X occasional division by zero on windows
_ http://dev.processing.org/bugs/show_bug.cgi?id=777
_ should be fixed, but need to verify once a release candidate is ready
X two fixes for readBytesUntil() and bufferUntil()
X also not calling serialEvent()
X http://dev.processing.org/bugs/show_bug.cgi?id=96
cleaning
o respond to stop/close events sent by the vm
@@ -53,6 +56,10 @@ _ how to ignore warning stuff?
_ finish osx build script to make the libraries
_ make.sh creating work/lib dirs.. no longer necessary?
wontfix
X Programs run with release 0136+ are sometimes slower due to Java 1.5
X http://dev.processing.org/bugs/show_bug.cgi?id=798
_ make sure that export is using utf8 for writing the .pde files etc
_ should be primarily loadFile() and saveFile() inside Base
_ http://dev.processing.org/bugs/show_bug.cgi?id=743
@@ -227,6 +234,7 @@ _ e.g. ocd is broken in 0125 because of method signature changes
DOC / Bugzilla
_
_ * disable changes to a bug (except by admin) after closed *
_ fix "reply" garbage added
_ fix "back to bug# 778"
@@ -384,6 +392,7 @@ _ how to do this with subclipse instructions?
DOC / Discourse Board
_ auto-close threads when not posted to for 30(?) days
_ add basic guidelines for posting to the board
_ 0. be polite. going on about how much something "sucks" or is "stupid" will make you look like an eight-year-old.
_ 1. don't double (or triple) post
@@ -1081,6 +1090,8 @@ _ arrays are reformatted on each autoformat
_ http://dev.processing.org/bugs/show_bug.cgi?id=259
_ crash on particular string
_ http://dev.processing.org/bugs/show_bug.cgi?id=363
_ autoformat screws up with color arrays
_ http://dev.processing.org/bugs/show_bug.cgi?id=760
TOOLS / Create Font