2019-01-14 07:47 PM
I want to reverse the Bits of a unsigned long data that is acquired by serial port. I used __RBIT() function in Attolic Truestudio but it does not work . I found during debugging the ARM_ARCH_7M is not defined .
I compiled similar code in the KEIL , it works well. Kindly guide me in this regard.
2019-01-15 03:11 AM
Why not using the C language operators (~, one's complement), instead of macros with questionable portability ?
2019-01-15 03:53 AM
AvaTar,
this is about bit reversal, i.e. "mirroring" the word, changing the bit ordering; not bit inversion/negating.
jehanzebnoorpuri,
I don't use Atollic, but in your source you should have included stm32f7xx.h, that should include the header for your particular STM32 model, that should include core_cm7.h, that should include core_cmFunc.h , and that for gcc should include cmsis_gcc.h, and that should include definition of __RBIT() as a static inline function. Go along that chain.
JW
2019-01-15 04:58 AM
You're right - my bad.
Bit shuffling, as it's called in the e.g. in the FFT context.