stm32/usbdev: Use ztimer instead of xtimer

This commit is contained in:
Koen Zandberg 2021-10-24 21:19:03 +02:00
parent a92cdb535e
commit 766ebf0af5
No known key found for this signature in database
GPG Key ID: 0895A893E6D2985B
3 changed files with 6 additions and 4 deletions

View File

@ -4,7 +4,8 @@
USEMODULE += periph stm32_clk stm32_vectors
ifneq (,$(filter periph_usbdev,$(FEATURES_USED)))
USEMODULE += xtimer
USEMODULE += ztimer
USEMODULE += ztimer_msec
endif
ifneq (,$(filter periph_uart_nonblocking,$(USEMODULE)))

View File

@ -8,7 +8,8 @@
config MODULE_PERIPH
bool
default y
select MODULE_XTIMER if MODULE_PERIPH_USBDEV
select MODULE_ZTIMER if MODULE_PERIPH_USBDEV
select MODULE_ZTIMER_MSEC if MODULE_PERIPH_USBDEV
help
stm32 common peripheral code.

View File

@ -24,7 +24,7 @@
#include <errno.h>
#include "bitarithm.h"
#include "xtimer.h"
#include "ztimer.h"
#include "cpu.h"
#include "cpu_conf.h"
#include "periph/pm.h"
@ -606,7 +606,7 @@ static void _set_mode_device(stm32_usb_otg_fshs_t *usbdev)
_global_regs(conf)->GUSBCFG |= USB_OTG_GUSBCFG_FDMOD;
/* Spinlock to prevent a context switch here, needs a delay of 25 ms when
* force switching mode */
xtimer_spin(xtimer_ticks_from_usec(25 * US_PER_MS));
ztimer_spin(ZTIMER_MSEC, 25);
}
static void _usbdev_init(usbdev_t *dev)