Multiple frames implementation (#2)
* Add rx event handlers * Fix compile errors and add constness * Pass sender id * Change api interface * Revert changes * Add filter fifo * Add default setup * Add receive function * Remove interrupt activation * Activate RX interrupts * Merge remote changes * Add event list constructor * Fix compilation bug * Send and receive multiple frames * Refactor * Refactor * Fix compile error * Use known syntax * Refactor * Provide storage * Add frame end * Add some documentation * Turn macros into functions * Refactor * Refactor * Fix compile error * Use ExtendedIds Co-authored-by: Riccardo998 <riccardo.storchi98@gmail.com>
This commit is contained in:
committed by
GitHub
parent
90d1836dfa
commit
7b09401b00
+8
-5
@@ -4,14 +4,17 @@
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#define arrayLength(array) \
|
||||
#define sizeofarray(array) \
|
||||
(sizeof(array) / sizeof(*(array)))
|
||||
|
||||
#define stringArrayLength(array) \
|
||||
stringBufferLength((array), sizeof(array))
|
||||
stringBufferLength((array), sizeofarray(array))
|
||||
|
||||
#define stringBufferLength(pbuffer, maxLen) \
|
||||
strnlen((const char*)(pbuffer), maxLen)
|
||||
|
||||
#define min(a, b) ((a) < (b) ? a : b);
|
||||
#define mask(value, bits) (value & bits)
|
||||
|
||||
size_t stringBufferLength(uint8_t *buffer, size_t maxLen) {
|
||||
return strnlen((const char*)buffer, maxLen);
|
||||
}
|
||||
|
||||
#endif /* INC_MMR_CAN_UTIL_H_ */
|
||||
|
||||
Reference in New Issue
Block a user