Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffer comparison cast fix #89

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
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
4 changes: 2 additions & 2 deletions main/modules/serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#define RX_BUF_SIZE 2048
#define TX_BUF_SIZE 2048
#define UART_PATTERN_QUEUE_SIZE 20
#define UART_PATTERN_QUEUE_SIZE 100

Serial::Serial(const std::string name,
const gpio_num_t rx_pin, const gpio_num_t tx_pin, const long baud_rate, const uart_port_t uart_num)
Expand Down Expand Up @@ -93,7 +93,7 @@ int Serial::read(uint32_t timeout) const {

int Serial::read_line(char *buffer, size_t buffer_len) const {
int pos = uart_pattern_pop_pos(this->uart_num);
if (pos >= buffer_len) {
if (pos >= static_cast<int>(buffer_len)) {
if (this->available() < pos) {
uart_flush_input(this->uart_num);
while (uart_pattern_pop_pos(this->uart_num) > 0)
Expand Down