1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2026-01-01 01:41:18 +01:00

isrpipe: adapt for tsrb API type change

This commit is contained in:
Martine Lenders 2019-06-05 13:03:30 +02:00
parent fb19b514f4
commit dfc8bbd96c
3 changed files with 5 additions and 4 deletions

View File

@ -42,7 +42,8 @@ typedef struct {
/**
* @brief Static initializer for irspipe
*/
#define ISRPIPE_INIT(tsrb_buf) { .mutex = MUTEX_INIT, .tsrb = TSRB_INIT(tsrb_buf) }
#define ISRPIPE_INIT(tsrb_buf) { .mutex = MUTEX_INIT, \
.tsrb = TSRB_INIT(tsrb_buf) }
/**
* @brief Initialisation function for isrpipe

View File

@ -22,7 +22,7 @@
void isrpipe_init(isrpipe_t *isrpipe, char *buf, size_t bufsize)
{
mutex_init(&isrpipe->mutex);
tsrb_init(&isrpipe->tsrb, buf, bufsize);
tsrb_init(&isrpipe->tsrb, (uint8_t *)buf, bufsize);
}
int isrpipe_write_one(isrpipe_t *isrpipe, char c)
@ -41,7 +41,7 @@ int isrpipe_read(isrpipe_t *isrpipe, char *buffer, size_t count)
{
int res;
while (!(res = tsrb_get(&isrpipe->tsrb, buffer, count))) {
while (!(res = tsrb_get(&isrpipe->tsrb, (uint8_t *)buffer, count))) {
mutex_lock(&isrpipe->mutex);
}
return res;

View File

@ -44,7 +44,7 @@ int isrpipe_read_timeout(isrpipe_t *isrpipe, char *buffer, size_t count, uint32_
xtimer_t timer = { .callback = _cb, .arg = &_timeout };
xtimer_set(&timer, timeout);
while (!(res = tsrb_get(&isrpipe->tsrb, buffer, count))) {
while (!(res = tsrb_get(&isrpipe->tsrb, (uint8_t *)buffer, count))) {
mutex_lock(&isrpipe->mutex);
if (_timeout.flag) {
res = -ETIMEDOUT;