mirror of
https://github.com/pine64/blisp.git
synced 2024-12-22 14:30:28 +00:00
Add termios support to libserialport and set_baudrate error handling
This fixes issues with flashing with FT232H
This commit is contained in:
parent
807c21bbef
commit
dd2801d6e9
@ -49,6 +49,9 @@ elseif(UNIX AND NOT APPLE)
|
||||
${CMAKE_SOURCE_DIR}/vendor/libserialport/linux_termios.c)
|
||||
target_compile_definitions(libblisp_obj PRIVATE
|
||||
LIBSERIALPORT_ATBUILD
|
||||
HAVE_TERMIOS2_SPEED
|
||||
HAVE_STRUCT_TERMIOS2
|
||||
HAVE_DECL_BOTHER
|
||||
"SP_API=__attribute__((visibility(\"default\")))"
|
||||
"SP_PRIV=__attribute__((visibility(\"hidden\")))")
|
||||
write_file(${CMAKE_SOURCE_DIR}/vendor/libserialport/config.h "// bypass errors.")
|
||||
|
@ -69,7 +69,10 @@ int32_t blisp_device_open(struct blisp_device* device, const char* port_name)
|
||||
// } else {
|
||||
device->current_baud_rate = 500000;
|
||||
// }
|
||||
sp_set_baudrate(serial_port, device->current_baud_rate);
|
||||
ret = sp_set_baudrate(serial_port, device->current_baud_rate);
|
||||
if (ret != SP_OK) {
|
||||
return -1; // TODO: Handle this
|
||||
}
|
||||
device->serial_port = serial_port;
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user