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:
parent
bcd2b3e369
commit
57f2bd9934
@ -2,4 +2,6 @@ include ../Makefile.tests_common
|
||||
|
||||
FEATURES_REQUIRED = periph_timer_periodic
|
||||
|
||||
USEMODULE += fmt
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user