MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / device_start

Function device_start

TactilityKernel/source/device.cpp:169–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169error_t device_start(Device* device) {
170 LOG_I(TAG, "start %s", device->name);
171 if (!device->internal->state.added) {
172 return ERROR_INVALID_STATE;
173 }
174
175 if (device->internal->driver == nullptr) {
176 return ERROR_INVALID_STATE;
177 }
178
179 // Already started
180 if (device->internal->state.started) {
181 return ERROR_NONE;
182 }
183
184 error_t bind_error = driver_bind(device->internal->driver, device);
185 device->internal->state.started = (bind_error == ERROR_NONE);
186 device->internal->state.start_result = bind_error;
187 return bind_error == ERROR_NONE ? ERROR_NONE : ERROR_RESOURCE;
188}
189
190error_t device_stop(struct Device* device) {
191 LOG_I(TAG, "stop %s", device->name);

Callers 6

DeviceTest.cppFile · 0.85
create_child_deviceFunction · 0.85
mountAllFunction · 0.85
startFunction · 0.85
createKernelDeviceHolderFunction · 0.85

Calls 1

driver_bindFunction · 0.85

Tested by

no test coverage detected