Question
How to convert polynomial number to good value
I have polynomial for CRC 0x8C. And in STM I must write 0x31, because it is rotate.
But I don't know, how to convert this value to good value.
In binary:
0x8C - 0b10001100
0x31 - 0b00110001
I create function:
uint8_t ror8_polynomial(uint8_t poly, uint8_t count)
{
return (poly << count) | (poly >> (8 - count));
}And I call this function:
uint8_t test = MP_STM32F7_CRC__rol8_polynomial(0x8C, 6);My new value is: 0x23 - 0b00100011
Any idea, what is wrong?
