工具/软件:
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.
工具/软件:
typedef struct { // bit descriptions uint32_t position_lo; uint32_t position_hi; uint16_t error1; uint16_t error2; uint16_t data; uint16_t data_crc; uint16_t address; uint32_t additional_data1; uint32_t additional_data2; uint32_t additional_data1_crc; uint32_t additional_data2_crc; uint32_t test_lo; uint32_t test_hi; uint32_t position_clocks; // volatile struct SPI_REGS *spi; uint32_t delay_comp; uint32_t sdata[16]; // Send data buffer uint32_t rdata[16]; // Receive data buffer uint16_t dataReady; uint16_t fifo_level; } ENDAT_DATA_STRUCT; extern ENDAT_DATA_STRUCT endat22Data;
LIN、
如前所述、无需 extern 关键字。 换句话说、在"pm_endat22_header.h"中、保留结构体并删除调用 extern 关键字的第68行。 在调用结构的任何.c 文件中(即"endat22.c"和 "pm_endat22_source.c")、确保在 文件顶部执行"#include pm_endat22_header.h"、并且不要再次重新声明结构( 删除 "pm_endat22_source.c"的第30行 )。 通过 在 头文件中定义结构并使用.c 文件中的#include、用户可以跨多个文件使用该结构。 无需重新声明结构体。
此致、
Aishwarya