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

tests/periph_timer_periodic: Use fmt for in-irq printing

This replaces the printf statement in the timer callback with fmt-based
printing and a single puts. This is less heavy on the stack usage than
printf, making this test a bit easier to digest on the smaller
platforms.
This commit is contained in:
Koen Zandberg 2020-09-22 22:34:55 +02:00
parent bcd2b3e369
commit 57f2bd9934
No known key found for this signature in database
GPG Key ID: 0895A893E6D2985B
2 changed files with 7 additions and 1 deletions

View File

@ -2,4 +2,6 @@ include ../Makefile.tests_common
FEATURES_REQUIRED = periph_timer_periodic
USEMODULE += fmt
include $(RIOTBASE)/Makefile.include

View File

@ -23,6 +23,8 @@
#include "board.h"
#include "macros/units.h"
#include "fmt.h"
#include "mutex.h"
#include "periph/timer.h"
#include "test_utils/expect.h"
@ -61,7 +63,9 @@ static void cb(void *arg, int chan)
{
unsigned c = count[chan]++;
printf("[%d] tick\n", chan);
print_str("[");
print_u32_dec(chan);
print_str("] tick\n");
if (c > CYCLES_MAX) {
timer_stop(TIMER_CYCL);