esp32_ethernet_milight_hub/lib/Radio/RadioUtils.cpp
2021-01-15 22:49:01 +01:00

18 lines
No EOL
284 B
C++

#include <RadioUtils.h>
#include <stdint.h>
#include <stddef.h>
#include <Arduino.h>
uint8_t reverseBits(uint8_t byte) {
uint8_t result = byte;
uint8_t i = 7;
for (byte >>= 1; byte; byte >>= 1) {
result <<= 1;
result |= byte & 1;
--i;
}
return result << i;
}