mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-14 02:27:21 -07:00
git subrepo clone https://github.com/HarbourMasters/soh.git
subrepo: subdir: "soh" merged: "ba904bbd0" upstream: origin: "https://github.com/HarbourMasters/soh.git" branch: "master" commit: "ba904bbd0" git-subrepo: version: "0.4.1" origin: "???" commit: "???"
This commit is contained in:
parent
0bb0e7b53b
commit
39cc86c260
2466 changed files with 451557 additions and 0 deletions
27
soh/include/command_macros_base.h
Normal file
27
soh/include/command_macros_base.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
#ifndef COMMAND_MACROS_BASE_H
|
||||
#define COMMAND_MACROS_BASE_H
|
||||
|
||||
/**
|
||||
* Command Base macros intended for use in designing of more specific command macros
|
||||
* Each macro packs bytes (B), halfwords (H) and words (W, for consistency) into a single word
|
||||
*/
|
||||
|
||||
#define CMD_BBBB(a, b, c, d) (_SHIFTL(a, 0, 8) | _SHIFTL(b, 8, 8) | _SHIFTL(c, 16, 8) | _SHIFTL(d, 24, 8))
|
||||
|
||||
#define CMD_BBH(a, b, c) (_SHIFTL(a, 0, 8) | _SHIFTL(b, 8, 8) | _SHIFTL(c, 16, 16))
|
||||
|
||||
#define CMD_HBB(a, b, c) (_SHIFTL(a, 0, 16) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 24, 8))
|
||||
|
||||
#define CMD_HH(a, b) (_SHIFTL(a, 0, 16) | _SHIFTL(b, 16, 16))
|
||||
|
||||
#define CMD_W(a) (a)
|
||||
|
||||
#if defined(__GNUC__) || defined(_MSC_VER)
|
||||
#define CMD_F(a) {.f = (a)}
|
||||
#else
|
||||
#define CMD_F(a) {(a)}
|
||||
#endif
|
||||
|
||||
#define CMD_PTR(a) (uintptr_t)(a)
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue