Hi
I am using K60 uc with CW 10.6. Using structure I am storing some values and printing it. The datatypes present in the structure has signed int, unsigned int 32, float.... When I am printing it , the values are appearing to be flipped(as uc is little endian). I tried converting it so that It appears in Big Endian form but it didn't worked well.
Firstly I tried using __builtin_bswap32(); // Present in GCC compiler
It works fine for uint32_t .but It didn't worked for float values.
then I tried using
ntohl(); //Network to Host byte order (Long)
htonl(); //Host to Network byte order (Long)
for this I didn't new what header files to include, and so it didn't worked.
then I searched ARM's website and got a document http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0491i/BABBHFJF.html but again this was not for single value. and didn't worked.
Is there any command which does this ??
Kind Regards
Amit Kumar
Hello Amit Kumar,
please check if you can find something useful in professor Erich Blog:
A little or big Indian? A Plea for Peace… | MCU on Eclipse
==========================================
this answer is for you, if it helps, please click on "correct answer" button. thanks!
Best Regards,
Zhang Jun