How to specify a veriable in big-endian format?

Hi,everybody,
I am facing a problem now. I want to specify a veriable in big endian while the whole memory in little endian.
You know,it is very easy to achieve this in IAR toolchain by adding a keyword __big_endian, when defining the veriable, but how can i do in MDK?
Thanks!

Parents
  • You know,it is very easy to achieve this in IAR toolchain by adding a keyword __big_endian, when defining the veriable, but how can i do in MDK?

    I'm afraid, the RealView compiler does not have such facility. You'll have to do it the traditional way: define htonl(), ntohl() and others and use them where appropriate.

Reply
  • You know,it is very easy to achieve this in IAR toolchain by adding a keyword __big_endian, when defining the veriable, but how can i do in MDK?

    I'm afraid, the RealView compiler does not have such facility. You'll have to do it the traditional way: define htonl(), ntohl() and others and use them where appropriate.

Children
No data
More questions in this forum