Skip to content

defmt-rtt: available_buffer_size function Ignore available space #1006

@Oveln

Description

@Oveln
fn available_buffer_size(read_cursor: usize, write_cursor: usize) -> usize {
    if read_cursor > write_cursor {
        read_cursor - write_cursor - 1
    } else if read_cursor == 0 {
        BUF_SIZE - write_cursor - 1
    } else {
        BUF_SIZE - write_cursor
    }
}

In the original implementation, if read < write, the available space between 0 and read would be ignored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions