i am controlling a touchpanel via spi, communication works fine.
Defining the buffers for RX and TX like :
uint16 TX_DataMaster[16]; uint16 RX_DataMaster[16];
works but when the array size exceeds the value of 16 the compiler returns an error like....
Description Resource Path Location Type #10056 symbol "TX_DataMaster" redefined: first defined in "./source/spi_DPP-CT1060A.obj"; redefined in "./source/sys_main.obj" DPP-CT1060A C/C++ Problem
Include guards are used, too!
This is the header:
/* _____HEADER____ ##################################### Display Driver Demmel Products CT1060A - Binary Mode Interface: SPI Jan Scharnweber - 2014 ##################################### */ // /*##### Current SPI Settings##### * Wdelay: 0 * Charlen: 8 Bit (using binary mode) * VCLK1: 100 MHz * Prescale: 255 * Baudrate: 390.625 KHz * MSB first * Wait for enable: no * Parity: no * Clock Phase: 0 * Clock Polarity : 0 * SPI Mode 0 Master * */ // Queue length: 127Byte (127 + <CID>) // Format: <CID> Comand 1 Command X // always wait for ACK from TouchPanel // no syntax check is provided //Includes /*ToDo: - implement include guards - */ #ifndef SPI_DPP_CT1060A_ #define SPI_DPP_CT1060A_ #include "sys_common.h" #include "spi.h" #include "stdio.h" #include "utils.h" /*Flags*/ static bool fDISP_RX_READY = false; static bool fDISP_TX_READY = false; /*Header and Trailer*/ #define ACK 0x06 // Acknowledgment #define NACK 0x15 // Negative Acknowledgment spiDAT1_t dataconfig1_t; // SPI config (also see HCG Settings) uint16 TX_DataMaster[17]; // SP transmitting buffer uint16 RX_DataMaster[1]; // SP receiving buffer /*Functions*/ void DISP_InitSPI(void); bool DISP_CheckStatController(spiBASE_t* spiPort); void DISP_SendByte(uint16* byteToSend); bool DISP_SendCommand(unsigned char *buf, unsigned char length); /**/ #endif // _SPI_DPP_CT1060A_
Both array are defined only ONCE!
What am i doing wrong??
Thanks
Jan