??? 03/04/08 14:01 Read: times |
#151874 - 'const' and 'volatile' Responding to: ???'s previous message |
Andy Neil said:
An XDATA memory-mapped read-only port; Maarten Brock said:
Allthough possible I doubt you meant this port to be const. Yes, I did. As referenced by Tsuneo the const keyword is to help optimizations. I didn't think that was for 'const'? I thought 'const' was just to make the compiler warn about attempts to write to the object? The compiler could choose to read this port on startup and cache it in data memory.
Yes: I think you would need to declare it as both 'const' and 'volatile' - which seems contradictory at first glance, but makes sense when you think of a read-only port... |