Thank you everyone for your answers. They have been very helpful. Kind Regards Anthony
> From: [email protected] > To: [email protected] > Date: Tue, 7 Apr 2009 17:34:12 +0200 > Subject: Re: [Mspgcc-users] sfrw macro > > > > This kind of definition serves a double purpose: > > First, you'll get a void value TA0CTL_ which can be used in pojnter > manipulations, as data value or whatever. > Second, you'll get a volatile unsigned int variable located at the TA0CTL_ > address. > > By using the sfrw/sfrb macros, the compiler knows that this is a byte/word > variable and shall be accessed using byte/word access. It also tells the > compiler that this variable is volatile, meaning that its content might > change at any time without notice, so it mus tbe addressed directly each time > it is used and not buffered in a processor register etc. > > Just assigning TA0CTL to 0x160 would require you to cast the value you assign > to it to an unsigned int and the value to an unsigne int * each time you use > it. > > One COULD use 0x0160 directly in the sfrw macro to avoid clobbering the > namespace with the named values. But if you really need the address itself, > you had to extract it by '(void *)(&TA0CTL)'. > > JMGross > > > ----- Ursprüngliche Nachricht ----- > Von: Anthony L > An: [email protected] > Gesendet am: 05 Apr 2009 16:43:18 > Betreff: [Mspgcc-users] sfrw macro > > > > Hi All! > > Could someone please tell me what the purpose of the sfrw macro is? > > For example: > > #define TA0CTL_ 0x0160 > sfrw (TA0CTL,TA0CTL_) > > What would be the difference to defining TA0CTL directly to 0x0160 ? > > Thanks > > Anthony > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > _______________________________________________ > Mspgcc-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mspgcc-users _________________________________________________________________ Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
