1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 22:43:50 +01:00

sys/isrpipe: 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. Finally, it chanes the argument name passed to the
static intializer to decouble the API from the implmentation details.
This commit is contained in:
Joshua DeWeese 2025-04-02 13:44:54 -04:00 committed by Joshua DeWeese
parent 4d39d6e2f3
commit 0f7c6a8481

View File

@ -41,15 +41,21 @@ typedef struct {
/**
* @brief Static initializer for irspipe
*
* @note The size of the buffer (`sizeof(@p buf)`) must be a power of two.
*
* @param[in] buf buffer to use as ringbuffer
*/
#define ISRPIPE_INIT(tsrb_buf) { .mutex = MUTEX_INIT_LOCKED, \
.tsrb = TSRB_INIT(tsrb_buf) }
#define ISRPIPE_INIT(buf) { .mutex = MUTEX_INIT_LOCKED, \
.tsrb = TSRB_INIT(buf) }
/**
* @brief Initialisation function for isrpipe
*
* @note The size of the buffer (@p bufsize) must be a power of two.
*
* @param[in] isrpipe isrpipe object to initialize
* @param[in] buf buffer to use as ringbuffer (must be power of two sized!)
* @param[in] buf buffer to use as ringbuffer
* @param[in] bufsize size of @p buf
*/
void isrpipe_init(isrpipe_t *isrpipe, uint8_t *buf, size_t bufsize);