简体   繁体   中英

Error: Expected an identifier, in C with CCS for MSP430

I'm currently taking over a project for MSP430 that was previously compiled with MSPGCC, and I was asked to update it so it works with TI's C compiler using CCSv6. However, I'm getting a set of errors that I don't really understand. Here's a sample of my code where there are some errors:

struct UART_UCxxCTL_BITS
{
    UINT8_T UCSWRST : 1;    /**< R/W Software reset enable                  */
    UINT8_T UCTXBRK : 1;    /**< R/W Transmit break                         */
    UINT8_T UCTXADDR: 1;    /**< R/W Transmit address                       */
    UINT8_T UCDORM  : 1;    /**< R/W Dormant                                */
    UINT8_T UCBRKIE : 1;    /**< R/W Receive break character interrupt      */
    UINT8_T UCRXEIE : 1;    /**< R/W Receive eroneous-character interrupt   */
    UINT8_T UCSSEL  : 2;    /**< R/W USCI clock source select               */
    UINT8_T UCSYNC  : 1;    /**< R/W Synchronous mode select    */
    UINT8_T UCMODE  : 2;    /**< R/W Mode select                */
    UINT8_T UCSPB   : 1;    /**< R/W Stop bit select            */
    UINT8_T UC7BIT  : 1;    /**< R/W Character length           */
    UINT8_T UCMSB   : 1;    /**< R/W MSB first select           */
    UINT8_T UCPAR   : 1;    /**< R/W Parity select              */
    UINT8_T UCPEN   : 1;    /**< R/W Parity enable              */
};

For all these lines inside the struct, except for UCMODE and UCSSEL , I'm getting the error: "#41 expected an identifier" In total, I have 38 errors #41 in my project, all of them on structs, but not every struct and not every declarations inside them. They appear in two header files, one for the UART and one for the SPI. These two files are not linked though. In both files structs are declared, some of them quite similar.

For instance, in both files, UCMODE and UCSSEL aren't considered as errors, but the rest is. That's what I find strange.

Please note that UINT8_T is an unsigned char .

Do you know what could bring these errors ?

Thanks a lot.

失败的关键字已在CCS环境中的处理器标头文件msp430f6725.h中定义。

#define UCRXEIE                (0x0020)       /* RX Error interrupt enable */

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM