VSIDE ver2.29 template compile error

Installing and using VSIDE tools for VLSI Solution's devices that contain a VSDSP signal processor.
Post Reply
User avatar
boen
Senior User
Posts: 86
Joined: Fri 2014-09-19 7:22

VSIDE ver2.29 template compile error

Post by boen » Fri 2014-09-19 7:54

Hi Panu, I have got some problems about compile the templates.
here is the compile message:
lcc -g -hhw_desc -O6 -fsmall-code -DDEBUG -Iinclude -IC:\VSIDE\libvs1005g_vsos3 -o Emulation-Debug\lcd-ili9341.o D:\VSIDE_solutions\lcd\lcd-ili9341.c

./sethandler.h (3) ERROR 72: conflicting prototypes for function 'SetHandler'
C:\VSIDE\libvs1005g_vsos3/vsos.h (383) ERROR 72: (previous declaration here)
D:\VSIDE_solutions\lcd\lcd-ili9341.c (332) Warning 30: parameter 1 is pointer to a different object
D:\VSIDE_solutions\lcd\lcd-ili9341.c (333) Warning 30: parameter 1 is pointer to a different object
Compilation failed with 2 errors and 2 warnings.
C:\VSIDE\bin\make.exe: *** [Emulation-Debug\lcd-ili9341.o] Error 2

the declaration in sethandler.h is void *SetHandler(register __i0 void *hook, register __a0 void *newFunc);
but in vsos.h it is void *SetHandler(register __i0 u_int16 *hook, register __a0 void *newFunc);
my question is, why the paramter hook in vsos.h is in u_int16 * type, but void * in sethandler.h

another question is the line number which show warning 30 is incorrect.(I mean there is no code in line number 332 and 333).

would you please help me check them out, thank you very much.

User avatar
Panu
VLSI Staff
Posts: 2489
Joined: Tue 2010-06-22 13:43

Re: VSIDE ver2.29 template compile error

Post by Panu » Mon 2014-09-22 9:03

Hi!

Uhh... :oops: it's one of those cases where two people write a different prototype for the same asm function - both would produce the same code but the other one is more "elegant" e.g. more "type correct" from the compiler's point of view than the other. In this case the problem is that there are two different versions, one probably from the project itself and the other one from the global library.

As I said, both versions will produce the same code, so it's best to change the local version to match the version which is in the libraries. I'll try to track this down and change the template (or the library) in the next version of VSIDE.

Hmm, the advantage of the void* form is that you can give the address of the hook as the hooked procedure's name without casting it to u_int16. So I think (but I must discuss this with the others) we should change all instances of the prototype to the void* form - this has the advantage of never raising a compiler error as any 16-bit entity is castable to void* .

Sorry for the inconvenience!

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

User avatar
boen
Senior User
Posts: 86
Joined: Fri 2014-09-19 7:22

Re: VSIDE ver2.29 template compile error

Post by boen » Mon 2014-09-22 9:50

Hi Panu,
:D ,thanks for your help, I have already understood the problem.
but when I try to decode the mp3 files by using audiodec.dl3(or AUDIO.dl3), I got the wrong play time seconds, there are the debug messages below:
code which compiled in VSIDE ver 2.27B (two theads with mp3 template):
printf("curr=%d total=%d\n", auDec->cs.playTimeSeconds, auDec->cs.playTimeTotal);
printf("%02d:%02d/%02d:%02d\n", auDec->cs.playTimeSeconds/60,auDec->cs.playTimeSeconds%60, auDec->cs.playTimeTotal/60,auDec->cs.playTimeTotal%60 );

display by uart :
1. curr=0 total=142
2. 00:00/00:00
3. curr=0 total=143
4. 00:00/00:00
5. curr=0 total=144
6. 00:00/00:00
7. curr=0 total=145
8. 00:00/00:00
......
I think there are two problems here.
first: the value of curr is always zero, but total is increase 1 per second.(curr shoud do this)
second: both the play time seconds and the total time seconds show 00:00 by printf().

would you please help me again. thanks very much.(my english is very poor, sorry!)
-boen

Lasse
VLSI Staff
Posts: 27
Joined: Tue 2010-06-22 13:30

Re: VSIDE ver2.29 template compile error

Post by Lasse » Mon 2014-09-22 18:33

Hi,

CodecServices::playTimeSeconds and the like are 32-bit integer values which are "long int" in the VSDSP environment (the data word is 16 bits wide). I think the problem is due to the "%d" format string which assumes 16-bit integer arguments. You'll need to cast the arguments to s_int16 or alternatively use long formatting ("%ld") to see the values correctly.
Software Designer
VLSI Solution

User avatar
boen
Senior User
Posts: 86
Joined: Fri 2014-09-19 7:22

Re: VSIDE ver2.29 template compile error

Post by boen » Wed 2014-09-24 12:29

Lasse wrote:Hi,

CodecServices::playTimeSeconds and the like are 32-bit integer values which are "long int" in the VSDSP environment (the data word is 16 bits wide). I think the problem is due to the "%d" format string which assumes 16-bit integer arguments. You'll need to cast the arguments to s_int16 or alternatively use long formatting ("%ld") to see the values correctly.
Hi Lasse,
thanks for your help, because of your help, I have already known how to print the value on the screen now. but I still have the question that auDec->cs.playTimeTotal is always zero, and some other members of the auDec->cs are also zero, so I think there may be something wrong in the audiodec.dl3 or I use it incorrectly.
would you please help me again, thank you so much.


-boen

Michaelo
User
Posts: 7
Joined: Tue 2015-04-07 3:30
Location: Dublin, Ireland
Contact:

Re: VSIDE ver2.29 template compile error

Post by Michaelo » Tue 2015-04-07 4:17

In version 2.34 the same error occurs...

Code: Select all

C:\VSIDE\libvs1005g_vsos3/vsos.h (401) ERROR 72: (previous declaration here)
C:\Users\Mike\Documents\solutions\VSOS307\vo_fat.c (1281) Warning 30: assignment argument is a pointer to a different object
Changed register u_int16 to register s_int16 ...

Also, new to forum, do you have a getting started section?
Mike

Post Reply