/** * @brief Computes the 32-bit CRC of a given buffer of data word(32-bit). * @param pBuffer: pointer to the buffer containing the data to be computed * @param BufferLength: length of the buffer to be computed * @retval 32-bit CRC */ uint32_t CRC_CalcBlockCRC_networkorder(uint32_t pBuffer[], uint32_t BufferLength) { uint32_t index = 0; //#warning --> acemor says: the standard crc32 works on bytes with network order but the stm32 hw uses little endian mode for(index = 0; index < BufferLength; index++) { CRC->DR = __rev(pBuffer[index]); //IIT: the standard crc32 works on network order but the stm32 hw works on little endian mode } return (CRC->DR); }
// ARM-LABEL: test_rev // ARM: call i32 @llvm.bswap.i32(i32 %t) uint32_t test_rev(uint32_t t) { return __rev(t); }