Essential type of the left hand operand usart[0U].tx_count
(unsigned) is not the same as that of the right operand "0" (signed).
if(usart[RS485_PORT].tx_count == 0) // error in this line
See Question&Answers more detail:osEssential type of the left hand operand usart[0U].tx_count
(unsigned) is not the same as that of the right operand "0" (signed).
if(usart[RS485_PORT].tx_count == 0) // error in this line
See Question&Answers more detail:os0
is a literal of type int
which is a signed
type, and tx_count
is an unsigned
field. Comparison between signed and unsigned are usually unexpected
To make the right hand side unsigned add the U
suffix
if(usart[RS485_PORT].tx_count == 0U)