Skip to content

Commit

Permalink
tests/periph/selftest_shield: timer allocation conflict
Browse files Browse the repository at this point in the history
- Detect when the same timer is used by `ztimer` (pulled in as
  dependency for a peripheral driver, e.g. `periph_adc` on STM32F3) and
  the test application
- Try to provide a better default (e.g. `TIMER_DEV(1)` when
  `ztimer_periph_timer` is in use, `TIMER_DEV(0)` otherwise)
  • Loading branch information
maribu committed Nov 20, 2023
1 parent e51dc09 commit 3197578
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/periph/selftest_shield/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,17 @@
# define UART_TEST_DEV UART_DEV(0)
#endif
#ifndef TIMER
# define TIMER TIMER_DEV(0)
# if IS_USED(MODULE_ZTIMER_PERIPH_TIMER)
# define TIMER TIMER_DEV(1)
# else
# define TIMER TIMER_DEV(0)
# endif
#endif

#if IS_USED(MODULE_ZTIMER_PERIPH_TIMER)
# if CONFIG_ZTIMER_USEC_DEV == TIMER
# error "Same timer used for ztimer and test"
# endif
#endif

/* A higher clock frequency is beneficial in being able to actually measure the
Expand Down

0 comments on commit 3197578

Please sign in to comment.