Forums

SDK SPI compile error

Started by Corey, Rick March 6, 2003
Hi

I'm trying to use the SDK to configure a 56F803 SPI peripheral. I start
with #define INCLUDE_SPI in appconfig.h. (I already have #define
INCLUDE_IO.)
As soon as I #define INCLUDE_SPI, I get the following compile error: (I'm
using 5.0.4).

I haven't written any SPI code yet, just #defined INCLUDE_SPI.

Can anyone suggest where I should look to untangle this?
It seems to be a prototype mismatch between spiRead and spiRead (?)

spidrv.c defines the middle param as a pointer to UWord16. io.h and
spidrv.h seem to think it should be a void pointer.

Could this some mis-match between 5.0.2 and 5.0.4? I updated, but would
have assumed that I imported all the relevant files.
Maybe I need to recompile some lib, again?

Thanks in advance. I'm afraid to charge in and start changing SDK code.
All I did was #define INCLUDE_SPI!

Rick Corey - - - -
compiler error message:

Error : cannot convert
'unsigned int (*)(int, unsigned short *, unsigned int)' to
'unsigned int (*)(int, const void *, unsigned int)'
const.c line 2335 spiWrite,

- - - - - -
const.c?
const io_sInterface spidrvIOInterfaceVT = {
spiClose,
spiRead,
--> spiWrite,
NULL
};

- - - - - - - -
IO.H:

typedef const struct
{
int (*pClose)(int);
ssize_t (*pRead)(int, void *, size_t);
ssize_t (*pWrite)(int, const void *, size_t);
UWord16 (*pIoctl)(int, UWord16, void *, ...);
} io_sInterface;

- - - - - -
spidrv.h:
EXPORT ssize_t spiRead (int FileDesc, void * pBuffer, size_t
NWords);
EXPORT ssize_t spiWrite (int FileDesc, UWord16 * pBuffer,
size_t Size);

- - - - - -
spidrv.c

ssize_t spiWrite(int FileDesc, UWord16 * pBuffer, size_t Size)



RE: [motoroladsp] SDK SPI compile error

If you turn on the "Relaxed Pointer Type Rules" box in the Metrowerks Target Settings panel for
 C/C++language settings, the error disappears!!!

Jerry.

-----Original Message-----
From: Corey, Rick [mailto:r...@dpconline.com]
Sent: Thursday, March 06, 2003 1:23 PM
To: 'm...@yahoogroups.com'
Subject: [motoroladsp] SDK SPI compile error


Hi

I'm trying to use the SDK to configure a 56F803 SPI peripheral.  I start
with #define INCLUDE_SPI in appconfig.h.  (I already have #define
INCLUDE_IO.)
As soon as I #define INCLUDE_SPI, I get the following compile error:   (I'm
using 5.0.4).

 I haven't written any SPI code yet, just #defined INCLUDE_SPI. 

Can anyone suggest where I should look to untangle this? 
It seems to be a prototype mismatch between spiRead and spiRead (?)

spidrv.c defines the middle param as a pointer to UWord16.  io.h and
spidrv.h seem to think it should be a void pointer.

Could this some mis-match between 5.0.2 and 5.0.4?  I updated, but would
have assumed that I imported all the relevant files. 
Maybe I need to recompile some lib, again? 

Thanks in advance.  I'm afraid to charge in and start changing SDK code.
All I did was #define INCLUDE_SPI!

Rick Corey


- - - -
compiler error message:

        Error   : cannot convert
        'unsigned int (*)(int,   unsigned short *,    unsigned int)' to
        'unsigned int (*)(int,   const void *,            unsigned int)'
        const.c line 2335     spiWrite,

- - - - - -
const.c?
        const io_sInterface spidrvIOInterfaceVT = {
                spiClose,
                spiRead,
-->             spiWrite,
                NULL
        };

- - - - - - - -
IO.H:

        typedef const struct
        {
                int                 (*pClose)(int);
                ssize_t             (*pRead)(int, void *, size_t);
                ssize_t             (*pWrite)(int, const void *, size_t);
                UWord16             (*pIoctl)(int, UWord16, void *, ...);
        } io_sInterface;

- - - - - -
spidrv.h:
        EXPORT ssize_t      spiRead  (int FileDesc, void * pBuffer, size_t
NWords);
        EXPORT ssize_t      spiWrite (int FileDesc, UWord16 * pBuffer,
size_t Size);

- - - - - -
spidrv.c

        ssize_t spiWrite(int FileDesc, UWord16 * pBuffer, size_t Size)


_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer.  You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:  m...@yahoogroups.com

To Post:  m...@yahoogroups.com

To Leave: m...@yahoogroups.com

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3
 

" TARGET="_blank">http://docs.yahoo.com/info/terms/



________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information visit http://www.messagelabs.com
________________________________________________________________________


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information visit http://www.messagelabs.com
________________________________________________________________________