lpcware

Compiler error

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by lmoreira on Tue Mar 29 23:48:13 MST 2011
Hi Guys,
I am writing a program in C for the LPC1343 board , where I am using an union of two structures and an array.
The problem is that I am getting an error when building the program, but I can not get what it is trying to tell me.

this is the header file where I get the error:

[PHP]/*
* dataBufferHandler.h
*
*  Created on: 8 Mar 2011
*  Author: LM
*    Version: 1.0
*  Description:
*
*/

#ifndef DATABUFFERHANDLER_H_
#define DATABUFFERHANDLER_H_

#define NUMBEROFBUFFERS            20

#define NUMBEROFRXDATAB         (NUMBEROFBUFFERS/4)

#define NUMBEROFTXDATAB         (NUMBEROFBUFFERS/4)

#define NUMBEROFRXPACKETB        (NUMBEROFBUFFERS/4)

#define NUMBEROFTXPACKETB        (NUMBEROFBUFFERS/4)

#define TXDATATYPE                1
#define RXDATATYPE                2
#define TXPACKETTYPE            3
#define RXPACKETTYPE            4

typedef union
{
    struct
    {

        char processNumber;
        char pNumberB;
        char dataSize;
        char data[50];

    }dataS;

    struct
    {
        char pStartChar;
        char pTypeChar[2];
        char pNumberH[2];
        char pSize[2];
        char pChecksum[2];
        char pData[100];
        char pEndChar;
    }packetS;
    char buffer[110];
}MultiBuffer;


MultiBuffer *getMultiBuffer();
uint32_t GetBufferOnQueue(uint32_t type, MultiBuffer pBuffer);

uint32_t setdataReady(TXData *pBuffer);


#endif /* DATABUFFERHANDLER_H_ */ [/PHP]
This is the error I get:
"expected '=', ',', ';', 'asm' or '__attribute__' before 'GetBufferOnQueue'"

I get this error on the prototype for the GetBufferOnQueue function.

I have tried this code on Pelles C and it works fine.

I don't think the problem is with this function but I can not see what the compiler is complaining about. Is there a problem with pointers or unions in LPCExpresso that I don't know about?

Been trying to sort this out for a few days and any help would be appreciated.
Thanks
Best Regards
                   Luis

Outcomes