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
RE: About Structure Definition
Hans-Bernhard Broeker
Whaddayamean, "How can they?" They did, and it would appear it worked. So what exactly is your problem with this?
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.