このトピックに関するすべての質問を読んでいますが、私のような問題はありません。しかし、私はエラーが発生しています:式は変更可能な左辺値でなければなりません。エラーが発生した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;`
上位コードスニペットの意味は、定数メモリ領域のポインタを周辺装置に送るルーチンに渡すことである。
オブジェクト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;
構造の一部ですか?
サイドノート:コード内の 'text_buff [0]'のスペースを 'malloc'しましたか? – LPs