Files
wideband/firmware/util/byteswap.h
rusefillc ccb790f532 Steal tunerstudio files from RusEFI (#71)
* Steal tunerstudio files from RusEFI

(cherry picked from commit dcba04fbd31700f5ca4ef4f12a6e220c5713c7d0)

* Steal crc32 files from RusEFI

(cherry picked from commit bfe88b5297c6fc90c8e647e4144c91edafef25f9)

* fix TS steal

(cherry picked from commit a77b9761da4c185359bb2d7e10abd6a8e69c740d)

* fix crc32

(cherry picked from commit cdb4df09f69c2494316c2b12f97dbe19f6bdb598)

* TS stealed from RE

(cherry picked from commit ff470e134036372425da44e9e0fb98737f31c9e9)

* Steal TS

(cherry picked from commit d11406edc2d6b3c1567ce800e207038745a162e7)

* Steal Thread Controller

(cherry picked from commit 2aa5bbd57150e0d5b51e2e88752bdc8697698861)

* Update TunerStudio protocol files

(cherry picked from commit 58f14216ec6e7fc4408e52ccc28a4f912e340b05)

* byteswap.h

(cherry picked from commit 581d647fd49890af4628f0ff5b51e9f193efcac4)

* bugfix

* one more file to compile, another file not ready - removing from this PR

* removing more from this PR

Co-authored-by: Andrey Gusakov <dron0gus@gmail.com>
Co-authored-by: rusefillc <sdfsdfqsf2334234234>
2022-06-29 01:29:40 -07:00

14 lines
311 B
C

#pragma once
// http://en.wikipedia.org/wiki/Endianness
static inline uint16_t SWAP_UINT16(uint16_t x)
{
return ((x << 8) | (x >> 8));
}
static inline uint32_t SWAP_UINT32(uint32_t x)
{
return (((x >> 24) & 0x000000ff) | ((x << 8) & 0x00ff0000) |
((x >> 8) & 0x0000ff00) | ((x << 24) & 0xff000000));
}