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 )"
*** error75, line13: too many items
//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 ); } }
Jon, What I have seen is the following: When the toolbox is visible, then the Function Editor has compilation problems. When I first remove the toolbox and then compile, there's no problem. As far as I know (but I can be mistaken), there's nowhere mentioned in the documentation that you should not compile a file in the Function Editor while the toolbox is activated. Is this right? Could you pls. redo the test again with the toolbox visible before starting the compilation and see if you have the same phenomenon as I have? Rgds, --Geert
Jon, I think I finally found what it was. All my previous explanations were not completely correct. For instance, the fact that the toolbox should not be visible while compiling is not true. After I posted this answer, I tried again and then it went wrong again. What I finally did (after re-installing V7.01 and seeing also there it went wrong), was deleting the .opt file that belongs to the project (when I created a new project, I did not have problems with a similar initialization file). When I then compiled the original initialization file, I didn't see any problems anymore. And indeed, when you look in the .opt file, you can see some sections containing the keyword OPTBT, which can have the following syntax:
OPTBT 0,(Vol Up)(p32_info( 0x3010))