Skip to content

[Bug] 在串口V2的驱动里面,_serial_poll_tx 这个函数里面,为什么要判断if (putc_result < 0) break;,这样会导致发送中文错误。 #11392

@zhangjun1992

Description

@zhangjun1992

RT-Thread Version

5.2.2

Hardware Type/Architectures

hpm6750

Develop Toolchain

Other

Describe the bug

Image 5.0.2的是这样的,发送的时候没有判断返回值;直接调用发送; Image 5.2.2的增加了返回值小于0直接break了。发送英文字符的时候没问题,但是当发送中文的时候,会转义,现在bsp的驱动是返回的发送字符,导致发送中文字符就丢数据了。如果没有明确说明putc接口返回值定义说明,这样很多bsp这里就会都出问题。 Image

Other additional context

No response

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