This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Function editor problem (uVision2)

Hello,

I've written an initialization file via the Function Editor (uVision2, version V2.37 ) to generate pulses on P3_2.

This is to simulate RC5.

I've written -among other things- the following button definition

define button "Send 0x2183","send_p32_info( 0x2183 )"
When I compile this file, I get the following error:
*** error75, line13: too many items

According to the documentation (and also to me), this is syntactically correct. When I ignore the error message and just start a new PC debug session, the initialization file works as it should and I can perfectly simulate RC5.

Also, when I restart the IDE and compile again the same initialization file without changing something, I do not get this error message.

Anyone experienced something similar?

--Geert

This is the complete initialization file:
//ws 1, _rword(&PulseWidth)
//ws 1, _rword(&RCapTime)
//ws 1, _rword(&RcMessage)
//ws 1, PrevEdgeInMiddleOfBit
//ws 1, FirstNegEdge
ws 1, ReloadTimerTime
ws 1, EdgeDetectTime
ws 1, NrOfBools
ws 1, Rc5Input

// VALUE TO SEND SHOULD BE AT LEAST 0x2000: FIRST BIT IS ALWAYS 1!!!

define button "Send 0x2183"   , "send_p32_info( 0x2183 )"
define button "Send Vol Up"   , "send_p32_info( 0x3010 )"
define button "Send Vol Down" , "send_p32_info( 0x3011 )"
define button "Send 0x2AAA"   , "send_p32_info( 0x2AAA )"
define button "Send 0x2781"   , "send_p32_info( 0x2781 )"
define button "Send 0x2766"   , "send_p32_info( 0x2766 )"
define button "Send 0x2677"   , "send_p32_info( 0x2677 )"
define button "Send 0x3677"   , "send_p32_info( 0x3677 )"
define button "Send 0x3676"   , "send_p32_info( 0x3676 )"
define button "Send 0x2888"   , "send_p32_info( 0x2888 )"
define button "Send 0x3999"   , "send_p32_info( 0x3999 )"
define button "Send 0x3FFF"   , "send_p32_info( 0x3FFF )"
define button "Send 0x2000"   , "send_p32_info( 0x2000 )"
define button " Send all  "   , "send_all()"
define button "Stop sending"  , "signal kill send_p32_info"
define button "Send 0x20FF"   , "send_p32_info( 0x20AA )"


signal void send_p32_info( unsigned int val )
{
    signed char i;

    //while (1)
    {
        for (i = 13; i >= 0; i--)
        {
            if (val & (1 << i))   /* Send 1 */
            {
                //printf( "P3.2 high\n" );
                P3 |= 0x04; twatch (889);
                //printf( "P3.2 low\n" );
                P3 &= ~0x04; twatch (889);
                printf( "Send 1, counter is: %i\n", i );
            }
            else                  /* Send 0 */
            {
                //printf( "P3.2 low\n" );
                P3 &= ~0x04; twatch (889);
                //printf( "P3.2 high\n" );
                P3 |= 0x04; twatch (889);
                printf( "Send 0, counter is: %i\n", i );
            }
        }

    }
    P3 |= 0x04; twatch (889);
    printf( "***************\n" );
    printf( "***************\n" );
    printf( "* End Sending *\n" );
    printf( "***************\n" );
    printf( "***************\n" );
}


signal void send_all()
{
    signed int i;
    i = 0x2000;

    while ( 1 )
    {
        send_p32_info( i );
        i++;

        if ( i == 0x4000 )
        {
            i = 0x2000;
        }
        swatch( 1 );
    }
}

0