Last active
March 29, 2024 03:40
-
-
Save mshafeeqkn/3597c9eeda0a4a24917d6bc870dddafa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint8_t reverse_byte(uint8_t byte) { | |
byte = ((byte & 0x55) << 1) | ((byte & 0xAA) >> 1); | |
byte = ((byte & 0x33) << 2) | ((byte & 0xCC) >> 2); | |
byte = ((byte & 0x0F) << 4) | ((byte & 0xF0) >> 4); | |
return byte; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment