| 141 | } |
| 142 | |
| 143 | void 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 | |
| 159 | void xs_sensor_stop(xsMachine *the) |
| 160 | { |
nothing calls this directly
no test coverage detected