8000 Skip drain and fix raw repl string search · arduino/micropython.js@82dd435 · GitHub
[go: up one dir, main page]

Skip to content

Commit 82dd435

Browse files
committed
Skip drain and fix raw repl string search
1 parent b78d9ff commit 82dd435

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

micropython.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,18 @@ class MicroPythonBoard {
114114
enter_raw_repl(timeout) {
115115
return new Promise(async (resolve, reject) => {
116116
// ctrl-C twice: interrupt any running program
117-
await this.write_and_drain(Buffer.from(`\r\x03\x03`))
117+
await this.serial.write(Buffer.from(`\r\x03\x03`))
118118
// flush input
119119
await this.serial.flush()
120120
// ctrl-A: enter raw REPL
121-
await this.write_and_drain(Buffer.from(`\r\x01`))
121+
await this.serial.write(Buffer.from(`\r\x01`))
122122

123123
let data = await this.read_until({
124-
ending: Buffer.from(`raw REPL; CTRL-B to exit\r\n>`),
124+
ending: Buffer.from(`raw REPL; CTRL-B to exit`),
125125
timeout: timeout
126126
})
127127

128-
if (data.indexOf(`raw REPL; CTRL-B to exit\r\n>`) !== -1) {
128+
if (data.indexOf(`raw REPL; CTRL-B to exit`) !== -1) {
129129
this.in_raw_repl = true
130130
return resolve()
131131
} else {
@@ -137,7 +137,7 @@ class MicroPythonBoard {
137137
async exit_raw_repl() {
138138
if (this.in_raw_repl) {
139139
// ctrl-B: enter friendly REPL
140-
await this.write_and_drain(Buffer.from(`\r\x02`))
140+
await this.serial.write(Buffer.from(`\r\x02`))
141141
this.in_raw_repl = false
142142
}
143143
return Promise.resolve()

0 commit comments

Comments
 (0)
0