1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

stdio_rtt: Add unit clarification to poll define

This commit is contained in:
Koen Zandberg 2021-11-03 11:16:21 +01:00
parent aa17621279
commit 265185ffea
No known key found for this signature in database
GPG Key ID: BA1718B37D79F51C
2 changed files with 6 additions and 5 deletions

View File

@ -32,7 +32,7 @@ your stdout bandwidth by lowering the poll interval. The default is 50ms.
A choice of 5ms is good during printf-heavy debugging:
```
CFLAGS += -DSTDIO_POLL_INTERVAL=5000U
CFLAGS += -DSTDIO_POLL_INTERVAL_MS=5U
```
SEGGER RTT supports stdin as well, and this is enabled by default. It requires

View File

@ -87,8 +87,8 @@
/* This parameter affects the bandwidth of both input and output. Decreasing
it will significantly improve bandwidth at the cost of CPU time. */
#ifndef STDIO_POLL_INTERVAL
#define STDIO_POLL_INTERVAL 50U
#ifndef STDIO_POLL_INTERVAL_MS
#define STDIO_POLL_INTERVAL_MS 50U
#endif
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
@ -317,7 +317,8 @@ ssize_t stdio_read(void* buffer, size_t count) {
}
uint32_t last_wakeup = ztimer_now(ZTIMER_MSEC);
while(1) {
ztimer_periodic_wakeup(ZTIMER_MSEC, &last_wakeup, STDIO_POLL_INTERVAL);
ztimer_periodic_wakeup(ZTIMER_MSEC, &last_wakeup,
STDIO_POLL_INTERVAL_MS);
res = rtt_read(buffer, count);
if (res > 0)
return res;
@ -331,7 +332,7 @@ ssize_t stdio_write(const void* in, size_t len) {
int written = rtt_write(buffer, (unsigned)len);
uint32_t last_wakeup = ztimer_now(ZTIMER_MSEC);
while (blocking_stdout && ((size_t)written < len)) {
ztimer_periodic_wakeup(ZTIMER_MSEC, &last_wakeup, STDIO_POLL_INTERVAL);
ztimer_periodic_wakeup(ZTIMER_MSEC, &last_wakeup, STDIO_POLL_INTERVAL_MS);
written += rtt_write(&buffer[written], len-written);
}
return (ssize_t)written;