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.

Compiler: IAR WORKBENCH

Tool/software: TI C/C++ Compiler

Hello Everyone,

I'm getting an error as shown below.Please help me to resolve this one.

Thanks in advance.

#include "esp8266.h"
#include <string.h>

Operation op;
Type t;
Status s = STATUS_NOT_WORKING;

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

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

void esp8266_send_command(Type type, Operation operation) {
if (s != STATUS_NOT_WORKING) {
// Operation in progress
// TODO: Add message to queue?
return;
}

switch (operation) {
case AT:
op = AT;
t = INQUIRY;
usart1_print(at_inquiry);
s = STATUS_WORKING;
}
}


// string - incoming buffer
u8 parse_AT(volatile char *buffer) {
volatile char *pos = strstr(buffer, ok_answer);
if (pos == 0) {
return 1; // No match
}

u8 new_length = strlen(pos) + ok_answer_length;
buffer = (volatile char*) memmove(buffer, pos, new_length);
usart_clear_string();

return 0;
}

void esp8266_parse_line() {
if (s != STATUS_WORKING) {
// Nothing to do
return;
}
volatile char* string = usart_get_string();

switch (op) {
case AT:
if (parse_AT(string) != 0) {
usart2_print("-"); // error
s = STATUS_PROBLEM;
} else {
usart2_print("+"); // success
s = STATUS_NOT_WORKING;
}
}
}

Error[Pe059]: function call is not allowed in a constant expression
Error[Pe167]: argument of type "char const *" is incompatible with parameter of type "char *"
Error[Pe167]: argument of type "char volatile *" is incompatible with parameter of type "char const *"
Error[Pe167]: argument of type "char volatile *" is incompatible with parameter of type "char const *"
Error[Pe167]: argument of type "char volatile *" is incompatible with parameter of type "void *"
Error[Pe167]: argument of type "char volatile *" is incompatible with parameter of type "void const *"

  • This forum is for questions and discussion regarding compilers released by TI.  Unfortunately, IAR is not one of them.  Please see if IAR has a way you can ask them this question.  Or, if you tell me which TI processor your code runs on, then I can move this thread to the relevant device forum.  And they can probably help you.

    Thanks and regards,

    -George