- String c = buffer.remove();
- if(c.length() > glcd.getTextWidth()){
- buffer.addFirst(c.substring(glcd.getTextWidth(), c.length()));
- c = c.substring(0, glcd.getTextWidth());
+ Message c = buffer.remove();
+ if(c.msg.length() > glcd.getTextWidth()){
+ buffer.addFirst(new Message(c.msg.substring(glcd.getTextWidth(), c.msg.length()), c.nl));
+ c.msg = c.msg.substring(0, glcd.getTextWidth());
+ }
+ if(c.nl){
+ glcd.scroll();
+ } else {
+ glcd.clear(glcd.getTextHeight()-1);