Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect endianness during copy since the chip is little endian #17

Open
echoGee opened this issue Feb 7, 2022 · 0 comments
Open

Incorrect endianness during copy since the chip is little endian #17

echoGee opened this issue Feb 7, 2022 · 0 comments

Comments

@echoGee
Copy link

echoGee commented Feb 7, 2022

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

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant