mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-27 08:46:01 -04:00
Simplify MessageQueue pop() usage.
This commit is contained in:
parent
d8b3b4cb6b
commit
b13081696d
3 changed files with 9 additions and 20 deletions
|
@ -47,8 +47,9 @@ public:
|
|||
return push(&message, sizeof(message));
|
||||
}
|
||||
|
||||
size_t pop(void* const buf, const size_t len) {
|
||||
return fifo.out_r(buf, len);
|
||||
const Message* pop(std::array<uint8_t, Message::MAX_SIZE>& buf) {
|
||||
const Message* const p = reinterpret_cast<Message*>(buf.data());
|
||||
return fifo.out_r(buf.data(), buf.size()) ? p : nullptr;
|
||||
}
|
||||
|
||||
size_t len() const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue