From 5b7c5b232c22be7f228a564fbb74f70ac034c08b Mon Sep 17 00:00:00 2001 From: Joshua DeWeese Date: Wed, 2 Apr 2025 13:37:38 -0400 Subject: [PATCH] sys/tsrb: emphasize buffer size requirement This patch makes the requirement on buffer size more prominent. Additionally, it adds the missing argument to the doxygen block of the static initializer. --- sys/include/tsrb.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/include/tsrb.h b/sys/include/tsrb.h index 4d9c610dcb..7a2eb4c3a4 100644 --- a/sys/include/tsrb.h +++ b/sys/include/tsrb.h @@ -45,14 +45,21 @@ typedef struct tsrb { /** * @brief Static initializer + * + * @note The size of the buffer (`sizeof(@p BUF)`) must be a power of two. + * + * @param[in] BUF Buffer to use by tsrb. */ #define TSRB_INIT(BUF) { (BUF), sizeof (BUF), 0, 0 } /** * @brief Initialize a tsrb. + * + * @note The size of the buffer (@p bufsize) must be a power of two. + * * @param[out] rb Datum to initialize. * @param[in] buffer Buffer to use by tsrb. - * @param[in] bufsize `sizeof (buffer)`, must be power of 2. + * @param[in] bufsize Size of @p buffer. */ static inline void tsrb_init(tsrb_t *rb, uint8_t *buffer, unsigned bufsize) {