MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / close

Method close

modules/drivers/sensors/tmp117/tmp117.js:153–166  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151 io.writeUint16(Register.TMP117_CONF, conf, true);
152 }
153 close() {
154 if ("ready" === this.#status) {
155 const io = this.#io;
156 let conf = io.readUint16(Register.TMP117_CONF, true);
157 conf &= ~ConfigMask.MODE;
158 conf |= SHUTDOWN_MODE;
159 io.writeUint16(Register.TMP117_CONF, conf, true);
160 this.#status = undefined;
161 }
162 this.#monitor?.close();
163 this.#monitor = undefined;
164 this.#io.close();
165 this.#io = undefined;
166 }
167 #twoC16(val) {
168 return (val > 32768) ? -(65535 - val + 1) : val;
169 }

Callers

nothing calls this directly

Calls 3

closeMethod · 0.65
readUint16Method · 0.45
writeUint16Method · 0.45

Tested by

no test coverage detected