2017-10-03 23:12:45 +00:00
|
|
|
//
|
|
|
|
// BitReverse.cpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 03/10/2017.
|
2018-05-13 19:19:52 +00:00
|
|
|
// Copyright 2017 Thomas Harte. All rights reserved.
|
2017-10-03 23:12:45 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "BitReverse.hpp"
|
|
|
|
|
|
|
|
void Storage::Data::BitReverse::reverse(std::vector<uint8_t> &vector) {
|
|
|
|
for(auto &byte : vector) {
|
|
|
|
byte =
|
2020-05-10 03:00:39 +00:00
|
|
|
uint8_t(
|
2017-10-03 23:12:45 +00:00
|
|
|
((byte & 0x01) << 7) |
|
|
|
|
((byte & 0x02) << 5) |
|
|
|
|
((byte & 0x04) << 3) |
|
|
|
|
((byte & 0x08) << 1) |
|
|
|
|
((byte & 0x10) >> 1) |
|
|
|
|
((byte & 0x20) >> 3) |
|
|
|
|
((byte & 0x40) >> 5) |
|
|
|
|
((byte & 0x80) >> 7)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|