зеркало из https://github.com/microsoft/jacdac-ts.git
removed cycle
This commit is contained in:
Родитель
833c50c5c2
Коммит
6b07b46185
|
@ -3,7 +3,8 @@ import { CMD_SET_REG, REPORT_RECEIVE, REPORT_UPDATE } from "./constants";
|
|||
import { Service } from "./service";
|
||||
import { intOfBuffer } from "./buffer";
|
||||
import { Node } from "./node";
|
||||
import { bufferEq, bufferOfInt } from "./utils";
|
||||
import { bufferEq } from "./utils";
|
||||
import { bufferOfInt } from "./struct";
|
||||
|
||||
export class Register extends Node {
|
||||
private _data: Uint8Array;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Service } from "./service";
|
||||
import { REG_IS_STREAMING, CMD_CALIBRATE, REG_LOW_THRESHOLD } from "./constants";
|
||||
import { bufferOfInt } from "./utils";
|
||||
import { bufferOfInt } from "./struct";
|
||||
|
||||
export function setStreamingAsync(service: Service, on: boolean) {
|
||||
const register = service.registerAt(REG_IS_STREAMING);
|
||||
|
|
|
@ -86,3 +86,7 @@ function packUnpackCore(format: string, nums: number[], buf: Uint8Array, isPack:
|
|||
}
|
||||
return off
|
||||
}
|
||||
|
||||
export function bufferOfInt(value: number): Uint8Array {
|
||||
return pack("i", [value | 0])
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { pack } from "./struct"
|
||||
|
||||
export function error(msg: string) {
|
||||
throw new Error(msg)
|
||||
|
@ -42,10 +41,6 @@ export function bufferEq(a: Uint8Array, b: ArrayLike<number>) {
|
|||
return true
|
||||
}
|
||||
|
||||
export function bufferOfInt(value: number): Uint8Array {
|
||||
return pack("i", [value | 0])
|
||||
}
|
||||
|
||||
export function hash(buf: Uint8Array, bits: number) {
|
||||
bits |= 0
|
||||
if (bits < 1)
|
||||
|
|
Загрузка…
Ссылка в новой задаче