peng12341 Posted May 7, 2008 Report Posted May 7, 2008 I'm using this code: unsigned int FX1; unsigned int FX2; const unsigned char FX_Names[10][11] = {"THRU", "F:92 LP", "F:92 BP", "F:92 HP", "F:T2 L/H", "F:T2 L/W", "Delay", "Reverb", "Flanger", "BeatMasher"}; int FX_Values[10] = {0,10,20,30,40,50,60,70,80,90}; ///////////////////////////////////////////////////////////////////////////// // This function is called by MIOS after startup to initialize the // application ///////////////////////////////////////////////////////////////////////////// void Init(void) __wparam { FX1 = 5; MIOS_SRIO_UpdateFrqSet(1); MIOS_SRIO_NumberSet(4); } void DISPLAY_Tick(void) __wparam { //int n = 5 => works //or //int n = FX1 => does not work MIOS_LCD_CursorSet(0x00); MIOS_LCD_PrintCString("FX 1: "); MIOS_LCD_PrintCString( (FX_Names[n]) ); } Now I have the following problem: If i Initialize the var n in the display_tick function everything works well, but if i use FX1 instead (global var) i get a linker error: Makefile generated. Makefile.bat generated. Assembling MIOS SDCC wrapper ========================================================================== Compiling pic18f452.c ========================================================================== Compiling main.c ========================================================================== Linking project error: missing definition for symbol "__mulint", required by "_output\main.o" ERROR!I don't know why it should use that function.Has anyone an idea? Quote
stryd_one Posted May 7, 2008 Report Posted May 7, 2008 Hello!Mulint is the function used by SDCC when you need to multiply an integer, which you do when calculating the array address from the index. In order to have this function, you need to include LIBSDCC in your linker script. Alas, that is about to be/has been phased out, I removed the documentation from the wiki last night, as the new MIOS/GPUtils structure includes it automatically. You could consider looking at the new structure in SVN.Anyway, in the meantime, grab the library from here and read the readme :) Quote
audiocommander Posted May 7, 2008 Report Posted May 7, 2008 Hi,does it work, when you're avoiding the number in your var-name?so don't do this: int FX1;but instead: int fxOne;if this doesn't fix your problem, you're using a multiplication somewhere ( "*" ), but haven't imported the sdcclib (as stryd_one already wrote)Best,Michael Quote
peng12341 Posted May 7, 2008 Author Report Posted May 7, 2008 Thank you very much stryd_one. It works now.@audiocommander:I already tried that, but that was not the problem. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.