Arduino KVComm  master
Key-Value pair communication library for Arduino
KV_Helpers.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <stddef.h> // size_t
4 
7 
14 inline size_t nextWord(size_t i) { return i - (i % 4) + 4; }
19 
24 inline size_t roundUpToWordSizeMultiple(size_t i) {
25  return i + 3 - ((i + 3) % 4);
26 }
27 
28 /// @}
nextWord
size_t nextWord(size_t i)
Get the offset of the next 4-byte word.
Definition: KV_Helpers.hpp:18
roundUpToWordSizeMultiple
size_t roundUpToWordSizeMultiple(size_t i)
Round up a size to a multiple of 4-byte words.
Definition: KV_Helpers.hpp:24