Keil Logo Arm Logo

Discussion Forum

About Structure Definition

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
Justin Wong
Posted
14-Jan-2005 01:58 GMT
Toolset
C51
New! About Structure Definition
Dear Friends:
I never met the following definition before, would you help me to find out how they can define them like this?
#define ResetInfo(info)                info.cmd            = 0;             info.status         = MI_OK;            info.irqSource      = 0;               info.nBytesSent     = 0;               info.nBytesToSend   = 0;              info.nBytesReceived = 0;              info.nBitsReceived  = 0;               info.collPos        = 0;

typedef struct
         {
            unsigned char  cmd;           //!< command code
            char           status;        // communication status
            unsigned char  nBytesSent;    // how many bytes already sent
            unsigned char  nBytesToSend;  // how many bytes to send
            unsigned char  nBytesReceived;// how many bytes received
            unsigned short nBitsReceived; // how many bits received
            unsigned char  irqSource;     // which interrupts have occured
            unsigned char  collPos;       // at which position occured a
                                          // collision
         } MfCmdInfo;

static   volatile                     MfCmdInfo     MInfo;

ResetInfo(MInfo);

Thank you.
Read-Only
Author
Hans-Bernhard Broeker
Posted
15-Jan-2005 16:55 GMT
Toolset
C51
New! RE: About Structure Definition
Whaddayamean, "How can they?" They did, and it would appear it worked. So what exactly is your problem with this?

Next Thread | Thread List | Previous Thread Start a Thread | Settings

arm-logo-small

Keil logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.