I want to update value of a variable at run time, present in project configuration as per some condition. But currently I am getting this error:
error: lvalue required as left operand of assignment
Actual code:
#include "contiki.h"
#include <stdio.h> /* For printf() */
/*---------------------------------------------------------------------------*/
PROCESS(hello_world_process, "Hello world process");
AUTOSTART_PROCESSES(&hello_world_process);
static void update_project_conf_value(void)
{
printf("Original Value: %d\n",TEST_VALUE);
TEST_VALUE = 0;
printf("After update: %d\n",TEST_VALUE);
}
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(hello_world_process, ev, data)
{
PROCESS_BEGIN();
update_project_conf_value();
PROCESS_END();
}
/*---------------------------------------------------------------------------*/
Project configuration:
#ifndef PROJECT_CONF_H_
#define PROJECT_CONF_H_
#define TEST_VALUE 1
/*---------------------------------------------------------------------------*/
#endif /* PROJECT_CONF_H_ */
/*---------------------------------------------------------------------------*/
Note: I want to update it in one of file as per some condition and then use the updated value in a different file.