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

Function stop

Platforms/platform-esp32/source/drivers/esp32_uart.cpp:375–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

373}
374
375static error_t stop(Device* device) {
376 ESP_LOGI(TAG, "%s stop", device->name);
377 auto* driver_data = GET_DATA(device);
378
379 lock(driver_data);
380 if (driver_data->is_open) {
381 unlock(driver_data);
382 return ERROR_INVALID_STATE;
383 }
384 unlock(driver_data);
385 device_set_driver_data(device, nullptr);
386 delete driver_data;
387
388 return ERROR_NONE;
389}
390
391const static UartControllerApi esp32_uart_api = {
392 .read_byte = read_byte,

Callers

nothing calls this directly

Calls 3

device_set_driver_dataFunction · 0.85
lockFunction · 0.70
unlockFunction · 0.70

Tested by

no test coverage detected