(timeout)
| 308 | this.select.write(1); |
| 309 | } |
| 310 | waitBusy(timeout) { |
| 311 | if (this.busy.read()) |
| 312 | return; |
| 313 | |
| 314 | if (!timeout) |
| 315 | timeout = 3000; |
| 316 | |
| 317 | const start = Date.now(); |
| 318 | while (!this.busy.read()) { |
| 319 | if ((Date.now() - start) > timeout) |
| 320 | throw new Error("time out"); |
| 321 | } |
| 322 | } |
| 323 | readWords(result) { |
| 324 | this.waitBusy(); |
| 325 | this.select.write(0); |
no test coverage detected