Я прочитал все вопросы по этой теме, но ни одна из проблем не кажется моей. Тем не менее, я получаю сообщение об ошибке: выражение должно быть модифицируемым lvalue. Часть кода C, где основаны ошибки, приведен ниже.ошибка: # 137: выражение должно быть модифицируемым значением
ws->fetch_next_state = °1_user_init;
ws->back_to_current = &text_frame_print;
ws->_frame.text_buff[0] = deg_symbol_th; // error line
ws->_frame.text_buff[1] = deg_symbol_te; //error line
ws->_frame.object_no = 2;
ws->objects_counter = 0;`
Значения верхнего кода snipet в прохождении указателя постоянной области памяти к подпрограмме, которая посылает символы на периферийное устройство.
объекты deg_symbol_th
и deg_symbol_te
определяются как
char deg[2] = {0xF8, 0x00};
const struct text_object deg_symbol_th = {6,3,2,45,240, deg};
const struct text_object deg_symbol_te = {6,10,2,265,240, deg};
const struct text_object deg_symb_svc = {6,3,2,430,35, deg};
ws->_frame.text_buff[0]
и является частью структуры
struct frame
{
enum frame_sta frame_status;
enum frame_sta frame_status_diff;
const struct text_object *text_buff;
const struct box_object *box_buff;
const struct area_object *area_buff;
uint8_t object_no;
};
struct wspace{
struct netimer period;
struct nequeue deferred;
struct nevent * deferred_queue_storage[EPA_EEPROM_QUEUE_SIZE];
struct nepa * producer;
struct event_i2c_transfer transfer;
struct text_object *Val_frame_buffer[15];
struct frame _frame;
naction (*back_to_current)(struct nsm * sm, const struct nevent * event);
naction (*fetch_next_state)(struct nsm * sm, const struct nevent * event);
uint32_t i2c_retry;
uint8_t i2c_buffer[35];
}ws;
Что может быть проблема?
Боковое примечание: «malloc'-ate space для' text_buff [0] 'где-то в коде? – LPs