esp32_ethernet_milight_hub/lib/Radio/RadioUtils.cpp

18 lines
284 B
C++
Raw Normal View History

2021-01-15 21:49:01 +00:00
#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;
}