Part Number: TMS320F28377D
Tool/software: TI C/C++ Compiler
Hi,
Is there any function to swap 16-bit variable (first byte with second byte)? I can of course swap it manually, but I wonder if there is a dedicated function.
Thanks.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: TMS320F28377D
Tool/software: TI C/C++ Compiler
Hi,
Is there any function to swap 16-bit variable (first byte with second byte)? I can of course swap it manually, but I wonder if there is a dedicated function.
Thanks.
No, I don't know of any function or instruction to do that. You'll need to write something yourself. You could try experimenting with the __byte() intrinsic to see if it gets you any better performance than shifting and adding in C.
Whitney
Hi Mubin,
Also see the below e2e thread. There is a C28x architecture instruction to swap the bytes, but if you want to use this you need to create a callable assembly function.
