mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
boards/waspmote: Fix timer config
- Set XTIMER_HZ to something that is actually possible to generate with one of the available clock dividers from the core frequency - Use xtimer_on_ztimer if xtimer is used and not ztimer_xtimer_compat is used - This is needed because xtimer is simply not compatible with any of the possible clock frequencies of this board
This commit is contained in:
parent
e719eaf97c
commit
d5c0e30a11
@ -1,3 +1,5 @@
|
||||
#ifneq (,$(filter saul_default,$(USEMODULE)))
|
||||
# USEMODULE += saul_gpio
|
||||
#endif
|
||||
|
||||
include $(RIOTMAKE)/boards/ztimer_only.dep.mk
|
||||
|
@ -159,13 +159,26 @@ extern "C" {
|
||||
|
||||
/**
|
||||
* @name xtimer configuration values
|
||||
* @warning This configuration is not actually compatible with xtimer. Sadly,
|
||||
* no compatible clock frequency can be generated with the given core
|
||||
* frequency
|
||||
* @{
|
||||
*/
|
||||
#define XTIMER_WIDTH (16)
|
||||
#define XTIMER_HZ (62500UL)
|
||||
#define XTIMER_HZ (230400LU)
|
||||
#define XTIMER_BACKOFF (40)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name ztimer configuration values
|
||||
* @{
|
||||
*/
|
||||
#define CONFIG_ZTIMER_USEC_TYPE ZTIMER_TYPE_PERIPH_TIMER
|
||||
#define CONFIG_ZTIMER_USEC_DEV (TIMER_DEV(0))
|
||||
#define CONFIG_ZTIMER_USEC_FREQ (230400LU)
|
||||
#define CONFIG_ZTIMER_USEC_WIDTH (16)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
|
||||
*/
|
||||
|
11
makefiles/boards/ztimer_only.dep.mk
Normal file
11
makefiles/boards/ztimer_only.dep.mk
Normal file
@ -0,0 +1,11 @@
|
||||
# Include this for boards whose timer periph cannot generate a clock frequency
|
||||
# suitable for xtimer with the available clock sources and dividers.
|
||||
# This will use ztimer to perform the required frequency conversion.
|
||||
# By default, xtimer is still used with ztimer as backed, unless
|
||||
# ztimer_xtimer_compat is used.
|
||||
|
||||
ifneq (,$(filter xtimer,$(USEMODULE)))
|
||||
ifeq (,$(filter ztimer_xtimer_compat,$(USEMODULE)))
|
||||
USEMODULE += xtimer_on_ztimer
|
||||
endif
|
||||
endif
|
Loading…
Reference in New Issue
Block a user