| 373 | } |
| 374 | |
| 375 | static 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 | |
| 391 | const static UartControllerApi esp32_uart_api = { |
| 392 | .read_byte = read_byte, |
nothing calls this directly
no test coverage detected