warning: passing ‘ char[*] ‘ to parameter of type ‘ uint8_t * ‘ 解决warning
·
在做串口通信的时候 遇到如下警告
warning: passing ' char[11] ' to parameter of type ' uint8_t * ' (aka ' unsigned char * ') coverts between pointers to integer type with diffrent sign
- 将
UART_send("我检测到了LM75A !!", 20);
//串口发送字符串数组,强制转化到
UART_send((uint8_t *)"我检测到了LM75A !!", 20);
- 或者修改对应的串口通讯函数
void UART_send(uint8_t *Buffer, uint32_t Length)
uint8_t(unsigned char) 为 char,如下
void UART_send(char *Buffer, uint32_t Length)
这时再调用就没有warning
更多推荐
已为社区贡献2条内容
所有评论(0)