ArduinoUniqueID icon indicating copy to clipboard operation
ArduinoUniqueID copied to clipboard

Incorrect endianness during copy since the chip is little endian

Open echoGee opened this issue 3 years ago • 0 comments

https://github.com/ricaun/ArduinoUniqueID/blob/cba84522cfd33302630e781997fb776174cc888c/src/ArduinoUniqueID.cpp#L94-L97

This should be copied in reverse since the architecture is little endian

	id[i * 4 + 0] = (uint8_t)(pdwUniqueID[i] >> 0);
	id[i * 4 + 1] = (uint8_t)(pdwUniqueID[i] >> 8);
	id[i * 4 + 2] = (uint8_t)(pdwUniqueID[i] >> 16);
	id[i * 4 + 3] = (uint8_t)(pdwUniqueID[i] >> 24);

echoGee avatar Feb 07 '22 15:02 echoGee