better handlings of logs

This commit is contained in:
Peli de Halleux 2016-04-07 09:03:21 -07:00
parent 5a670f3291
commit 6576f7bd66

View File

@ -596,8 +596,8 @@ namespace ks.rt {
writeSerial(s: string) {
for (let i = 0; i < s.length; ++i) {
let c = s[i];
switch (c) {
case '\n':
this.serialOutBuffer += c;
if (c == '\n') {
Runtime.postMessage(<SimulatorSerialMessage>{
type: 'serial',
data: this.serialOutBuffer,
@ -605,8 +605,6 @@ namespace ks.rt {
})
this.serialOutBuffer = ''
break;
case '\r': continue;
default: this.serialOutBuffer += c;
}
}
}