mirror of
https://github.com/a2stuff/vnIIc.git
synced 2024-09-27 15:55:41 +00:00
Fix ESLint warnings (and one actual bug)
This commit is contained in:
parent
8efe1058f8
commit
0242c645ca
12
server.js
12
server.js
@ -421,7 +421,7 @@ async function getSerialPort() {
|
|||||||
if (n <= 0) throw new Error();
|
if (n <= 0) throw new Error();
|
||||||
const result = [];
|
const result = [];
|
||||||
while (result.length < n) {
|
while (result.length < n) {
|
||||||
const {value, done} = await gen.next();
|
const {value, done} = await this.gen.next();
|
||||||
if (done) throw new Error('out of data');
|
if (done) throw new Error('out of data');
|
||||||
result.push(value);
|
result.push(value);
|
||||||
}
|
}
|
||||||
@ -463,7 +463,7 @@ async function startStreaming() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
while (true) {
|
for (;;) {
|
||||||
const command = (await port.read(1))[0];
|
const command = (await port.read(1))[0];
|
||||||
const size = (await port.read(1))[0];
|
const size = (await port.read(1))[0];
|
||||||
const data = size ? await port.read(size) : [];
|
const data = size ? await port.read(size) : [];
|
||||||
@ -491,9 +491,11 @@ async function startStreaming() {
|
|||||||
// Screen
|
// Screen
|
||||||
case 0x80:
|
case 0x80:
|
||||||
// Send a copy
|
// Send a copy
|
||||||
let copy = new Uint8Array(hires_buffer);
|
{
|
||||||
await port.write(copy);
|
let copy = new Uint8Array(hires_buffer);
|
||||||
break;
|
await port.write(copy);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
console.warn(`Unexpected protocol command: ${command}`);
|
console.warn(`Unexpected protocol command: ${command}`);
|
||||||
|
Loading…
Reference in New Issue
Block a user