serial_protocol.hpp: declare as static inline
This commit is contained in:
parent
d14c32eb01
commit
ec11cc49d3
10
common.mk
10
common.mk
@ -53,15 +53,7 @@ sine.pcm: common.mk
|
|||||||
/1ST_READ.BIN=./$< \
|
/1ST_READ.BIN=./$< \
|
||||||
/=./COPYRIGH.TXT \
|
/=./COPYRIGH.TXT \
|
||||||
/=./ABSTRACT.TXT \
|
/=./ABSTRACT.TXT \
|
||||||
/=./BIBLIOGR.TXT \
|
/=./BIBLIOGR.TXT
|
||||||
/=./pcm/REIGN.PCM \
|
|
||||||
/=./pcm/PILLAR.PCM \
|
|
||||||
/=./pcm/RIDDLE.PCM \
|
|
||||||
/=./pcm/PRELUDE.PCM \
|
|
||||||
/=./pcm/CLOCKTOW.PCM \
|
|
||||||
/=./pcm/ELEC.PCM \
|
|
||||||
/=./pcm/ECCLESIA.PCM \
|
|
||||||
/=jvm.bin
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
find -P \
|
find -P \
|
||||||
|
@ -41,7 +41,7 @@ static inline uint32_t le_bswap(const uint32_t n)
|
|||||||
return __builtin_bswap32(n);
|
return __builtin_bswap32(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
union command_reply command_reply(uint32_t cmd, uint32_t arg0, uint32_t arg1)
|
static inline union command_reply command_reply(uint32_t cmd, uint32_t arg0, uint32_t arg1)
|
||||||
{
|
{
|
||||||
union command_reply command = {
|
union command_reply command = {
|
||||||
.cmd = le_bswap(cmd),
|
.cmd = le_bswap(cmd),
|
||||||
@ -67,27 +67,27 @@ namespace command {
|
|||||||
|
|
||||||
static_assert(_maple_raw == 0xb62422e0);
|
static_assert(_maple_raw == 0xb62422e0);
|
||||||
|
|
||||||
union command_reply write(uint32_t dest, uint32_t size)
|
static inline union command_reply write(uint32_t dest, uint32_t size)
|
||||||
{
|
{
|
||||||
return command_reply(_write, dest, size);
|
return command_reply(_write, dest, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
union command_reply read(uint32_t dest, uint32_t size)
|
static inline union command_reply read(uint32_t dest, uint32_t size)
|
||||||
{
|
{
|
||||||
return command_reply(_read, dest, size);
|
return command_reply(_read, dest, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
union command_reply jump(uint32_t dest)
|
static inline union command_reply jump(uint32_t dest)
|
||||||
{
|
{
|
||||||
return command_reply(_jump, dest, 0);
|
return command_reply(_jump, dest, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
union command_reply speed(uint32_t speed)
|
static inline union command_reply speed(uint32_t speed)
|
||||||
{
|
{
|
||||||
return command_reply(_speed, speed, 0);
|
return command_reply(_speed, speed, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
union command_reply maple_raw(uint32_t send_size, uint32_t recv_size)
|
static inline union command_reply maple_raw(uint32_t send_size, uint32_t recv_size)
|
||||||
{
|
{
|
||||||
return command_reply(_maple_raw, send_size, recv_size);
|
return command_reply(_maple_raw, send_size, recv_size);
|
||||||
}
|
}
|
||||||
@ -112,32 +112,32 @@ namespace reply {
|
|||||||
|
|
||||||
static_assert(_crc == 0xcc9aab7c);
|
static_assert(_crc == 0xcc9aab7c);
|
||||||
|
|
||||||
union command_reply write(uint32_t dest, uint32_t size)
|
static inline union command_reply write(uint32_t dest, uint32_t size)
|
||||||
{
|
{
|
||||||
return command_reply(_write, dest, size);
|
return command_reply(_write, dest, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
union command_reply read(uint32_t dest, uint32_t size)
|
static inline union command_reply read(uint32_t dest, uint32_t size)
|
||||||
{
|
{
|
||||||
return command_reply(_read, dest, size);
|
return command_reply(_read, dest, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
union command_reply jump(uint32_t dest)
|
static inline union command_reply jump(uint32_t dest)
|
||||||
{
|
{
|
||||||
return command_reply(_jump, dest, 0);
|
return command_reply(_jump, dest, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
union command_reply speed(uint32_t speed)
|
static inline union command_reply speed(uint32_t speed)
|
||||||
{
|
{
|
||||||
return command_reply(_speed, speed, 0);
|
return command_reply(_speed, speed, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
union command_reply crc(uint32_t crc)
|
static inline union command_reply crc(uint32_t crc)
|
||||||
{
|
{
|
||||||
return command_reply(_crc, crc, 0);
|
return command_reply(_crc, crc, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
union command_reply maple_raw(uint32_t send_size, uint32_t recv_size)
|
static inline union command_reply maple_raw(uint32_t send_size, uint32_t recv_size)
|
||||||
{
|
{
|
||||||
return command_reply(_maple_raw, send_size, recv_size);
|
return command_reply(_maple_raw, send_size, recv_size);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user