Gast
#365059
Hallo, eine kurze Frage an die Experten:
Ich habe eine Interrupt Routine die ein struct verändert:
typedef struct
{
volatile uint8_t trid; // Tx, RX id
volatile uint8_t arq_cnt; // command or response
volatile uint8_t length; // packet length
volatile uint16_t crc; // 16-bi crc checksum
uint8_t volatile *data; // pointer to the main data
} modem_frame;
Frage:
Reicht es, wenn ich die die struct variable selber als volatile
deklariere, oder muss ich - wie oben gemacht - alle Elemente des
struct's zusätzlich als volatile declarieren?
Oder muss ich die einzelnen Elemente des struct's als volatile
deklarieren und die Deklaration der Variable modem_frame braucht nicht
mehr als volatile deklariert werden?
Oder beides zusammen, also so:
modem_frame volatile *rx_frame;