Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions libsweep/src/unix/serial.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ static speed_t get_baud(int32_t bitrate) {
throw error{"Only baud rate 115200 is supported at this time."};
return -1;
}

// translate human readable bitrate to termios bitrate
if (bitrate == 115200)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This conditional branch is redundant given the if (bitrate != 115200) above, which results in an error. Maybe just

// if defined, translate human readable bitrate to termios bitrate
#ifdef B115200
    return B115200
#endif
return bitrate;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well ok, I was supposing that more bitrates would be supported in the future.

{
#ifdef B115200

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you clang format as well. Format file included in the main repo. If not, let me know and I'll clean it up before merging.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not use to it but I can figure out how it works

bitrate = B115200;
#endif
}

return bitrate;
}

Expand Down