This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] 编译器:IAR工作台

Guru**** 2534260 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/570552/compiler-iar-workbench

工具/软件:TI C/C++编译器

大家好,

我收到如下所示的错误。请帮助我解决此问题。

提前感谢。

包含"ESP8266.h"
#include <string.h>

操作操作;
键入t;
状态s = STATUS_NOT_working;

const char ok_answer []="确定\r\n";
const size_t ok_answer_length = strlen (ok_answer);

const char at_inquiry[]="at\r\n";

void ESP8266_send_command (类型类型,操作){
如果(s != status_not _working){
//正在进行操作
// TODO:是否将消息添加到队列?
返回;
}

开关(操作){
案例位置:
OP = AT;
T =查询;
usart1_print (AT_inquiry);
S =状态_工作中;
}
}


//字符串-传入缓冲区
u8 parse_at (volatile char *buffer){
volatile char *pos = strstr (缓冲区,ok_answer);
如果(位置== 0){
返回1;//不匹配
}

u8 new_length = strlen (pos)+ ok_answer_length;
缓冲区=(volatile char*) memmove (缓冲区,位置,new_length);
USART_Clear_STRING();

返回0;
}

void ESP8266_parse_line(){
如果(s!= STATUS_working){
//无操作
返回;
}
volatile char* string = USART_GET_STRING();

开关(op){
案例位置:
如果(parse_at (string)!=0){
usart2_print("-");//错误
S =状态_问题;
}其他{
usart2_print("+");//成功
S =状态_不_工作;
}
}
}

ERROR[Pe059]:函数调用不允许在常量表达式中使用
错误[Pe167]:"char const *"类型的参数与"char *"类型的参数不兼容
错误[Pe167]:"char volatile *"类型的参数与"char const *"类型的参数不兼容
错误[Pe167]:"char volatile *"类型的参数与"char const *"类型的参数不兼容
错误[Pe167]:"char volatile *"类型的参数与"void *"类型的参数不兼容
错误[Pe167]:"char volatile *"类型的参数与"void const *"类型的参数不兼容

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    此论坛用于解答有关TI发布的编译器的问题和讨论。  不幸的是,独立评估报告不是其中之一。  请查看IAR是否有方法可以向他们提出此问题。  或者,如果您告诉我您的代码运行在哪个TI处理器上,那么我可以将此线程移至相关的器件论坛。  他们可能会帮助您。

    谢谢,此致,

    -George