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.

cc2500emk IAR error

I run one of the applications as outlined in Application Note N049 and receive and warnings when I rebuild all the files.

There are 23 but that all have a similar warning. Below is an example.

Warning[Pe1665]: concatenation with ";" in macro "MCU_IO_SET_PREP" does not create a valid token C:\Documents and Settings\deptadmin\My Documents\IAR Embedded Workbench\430\examples\swra141\source_rev_113\hal\common\hal_rf.c 29

What is causing this? I set up my paths in the preprocessor. When I tried following step 6c, when I selected "Debugger," there was no option to select "FET Debugger" from the "Driver" drop down list so I ignored it.

  • Hi all,


    An update on things.

    Lines with errors:

    HAL_SPI_CS_DEASSERT;

    HAL_SPI_CS_ASSERT;

    while(HAL_SPI_SOMI_VAL);

    HAL_SPI_BEGIN;

    HAL_SPI_END;

    MCU_IO_PERIPHERAL(HAL_SPI_CLK_PORT,  HAL_SPI_CLK_PIN);

    MCU_IO_OUTPUT(HAL_SPI_CS_PORT, HAL_SPI_CS_PIN, 1);

    Lines 26-30 in hal_spi_config.h  define some of the macros used:

    #define HAL_SPI_CS_DEASSERT  MCU_IO_SET(HAL_SPI_CS_PORT, HAL_SPI_CS_PIN)
    #define HAL_SPI_CS_ASSERT    MCU_IO_CLR(HAL_SPI_CS_PORT, HAL_SPI_CS_PIN)
    #define HAL_SPI_SOMI_VAL     MCU_IO_GET(HAL_SPI_SOMI_PORT, HAL_SPI_SOMI_PIN)
    #define HAL_SPI_BEGIN        st( HAL_SPI_CS_ASSERT; while(HAL_SPI_SOMI_VAL); )
    #define HAL_SPI_END          st( HAL_SPI_CS_DEASSERT; )

    I couldn't find the MCU_IO_PERIPHERAL or MCU_IO_OUTPUT macros in any of the .h files so where can I get the header file for this?

    Help please!


    Best wishes,

    Keeley

  • Hi all,
    The macros that are causing some of the warnings are defined below in file hal_msp430.h

    // Macros for simple configuration of IO pins on MSP430
    //----------------------------------------------------------------------------------
    #define MCU_IO_PERIPHERAL(port, pin) MCU_IO_PERIPHERAL_PREP(port, pin)
    #define MCU_IO_INPUT(port, pin) MCU_IO_INPUT_PREP(port, pin)
    #define MCU_IO_OUTPUT(port, pin, val) MCU_IO_OUTPUT_PREP(port, pin, val)
    #define MCU_IO_SET(port, pin) MCU_IO_SET_PREP(port, pin)
    #define MCU_IO_CLR(port, pin) MCU_IO_CLR_PREP(port, pin)
    #define MCU_IO_GET(port, pin) MCU_IO_GET_PREP(port, pin)

    //----------------------------------------------------------------------------------
    // Macros for internal use (the macros above need a new round in the preprocessor)
    //----------------------------------------------------------------------------------
    #define MCU_IO_PERIPHERAL_PREP(port, pin) st( P##port##SEL |= BIT##pin##; )
    #define MCU_IO_INPUT_PREP(port, pin) st( P##port##SEL &= ~BIT##pin##; \
    P##port##DIR &= ~BIT##pin##; )
    #define MCU_IO_OUTPUT_PREP(port, pin, val) st( P##port##SEL &= ~BIT##pin##; \
    if (val) \
    { P##port##OUT |= BIT##pin##; } \
    else \
    { P##port##OUT &= ~BIT##pin##; } \
    P##port##DIR |= BIT##pin##; )
    #define MCU_IO_SET_PREP(port, pin) st( P##port##OUT |= BIT##pin##; )
    #define MCU_IO_CLR_PREP(port, pin) st( P##port##OUT &= ~BIT##pin##; )
    #define MCU_IO_GET(port, pin) MCU_IO_GET_PREP(port, pin)

    Best wishes,

    Keeley
    #define MCU_IO_GET_PREP(port, pin) (P##port##IN & BIT##pin##)