At 05:08 PM 3/19/05 +0000, jamesasteres wrote: >I don't believe the ARM has bit access instructions. So when the >compiler reads the ioset register (or a byte of it?) according to >the datasheet you will read what was previously written. So you >risk setting unwanted pins (likely). That's true, but I don't think it's relevant in this case. IOSET is documented to read back the last values the port was set to > > gpio->ioset.reg |= 0x00008000; Should read the current set value for the port and set the 16'th bit and any other bits that are already set. While > > gpio->ioset.pins.p15 = 1; should logically do the same (after logically doing the appropriate sign wrapping which ends up being a null operation). Anton's earlier question about packed structs is probably very much to the point. It never occurs to me that anyone would use packed structs on an architecture that doesn't support unaligned access. Certainly accessing any of the peripheral registers on anything other than a word boundary could cause interesting results. Perhaps Leonardo can report back the results of the investigation when it's finished ? Robert " 'Freedom' has no meaning of itself. There are always restrictions, be they legal, genetic, or physical. If you don't believe me, try to chew a radio signal. " -- Kelvin Throop, III http://www.aeolusdevelopment.com/
Message
Re: [lpc2000] Re: C union not working
2005-03-20 by Robert Adsett
Attachments
- No local attachments were found for this message.