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

Function xs_sensor_start

modules/drivers/w3csensor/sensor.c:143–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143void xs_sensor_start(xsMachine *the)
144{
145 xsSensor sensor = xsmcGetHostData(xsThis);
146
147 if (kStateIdle != sensor->state)
148 return;
149
150 sensor->state = kStateActivating;
151
152 sensor->timer = modTimerAdd(sensor->interval, sensor->interval, readSensor, &sensor, sizeof(sensor));
153 if (NULL == sensor->timer)
154 xsUnknownError("out of memory");
155
156 updateRemember(sensor);
157}
158
159void xs_sensor_stop(xsMachine *the)
160{

Callers

nothing calls this directly

Calls 2

updateRememberFunction · 0.85
modTimerAddFunction · 0.50

Tested by

no test coverage detected