diff --git a/Makefile.dep b/Makefile.dep index dacaa1b387..91e48962cc 100644 --- a/Makefile.dep +++ b/Makefile.dep @@ -977,9 +977,11 @@ endif ifneq (,$(filter usbus,$(USEMODULE))) DEFAULT_MODULE += auto_init_usbus - FEATURES_REQUIRED += periph_usbdev USEMODULE += core_thread_flags USEMODULE += event + ifeq (,$(filter usbdev_mock,$(USEMODULE))) + FEATURES_REQUIRED += periph_usbdev + endif endif ifneq (,$(filter usbus_cdc_acm,$(USEMODULE))) diff --git a/tests/usbus/usbdev_mock.h b/drivers/include/usbdev_mock.h similarity index 97% rename from tests/usbus/usbdev_mock.h rename to drivers/include/usbdev_mock.h index 8bebcaaeb6..30c5c74b4e 100644 --- a/tests/usbus/usbdev_mock.h +++ b/drivers/include/usbdev_mock.h @@ -6,13 +6,11 @@ * directory for more details. */ /** - * @defgroup tests_usbdev_mock USBdev mockup device - * @ingroup tests + * @defgroup drivers_usbdev_mock USBdev mockup device + * @ingroup drivers * @brief USBdev mockup device for testing * @{ * - * @file - * * @author Koen Zandberg */ @@ -115,3 +113,4 @@ void usbdev_mock_setup(usbdev_mock_esr_cb_t esr_cb, #endif /* USBDEV_MOCK_H */ /** @} */ +/** @} */ diff --git a/drivers/usbdev_mock/Makefile b/drivers/usbdev_mock/Makefile new file mode 100644 index 0000000000..48422e909a --- /dev/null +++ b/drivers/usbdev_mock/Makefile @@ -0,0 +1 @@ +include $(RIOTBASE)/Makefile.base diff --git a/tests/usbus/usbdev_mock.c b/drivers/usbdev_mock/usbdev_mock.c similarity index 99% rename from tests/usbus/usbdev_mock.c rename to drivers/usbdev_mock/usbdev_mock.c index bd96bba83e..abf9515f75 100644 --- a/tests/usbus/usbdev_mock.c +++ b/drivers/usbdev_mock/usbdev_mock.c @@ -17,7 +17,6 @@ #include #include -#include "embUnit.h" #include "periph/usbdev.h" #include "test_utils/expect.h" #include "usbdev_mock.h" diff --git a/tests/usbus/Makefile b/tests/usbus/Makefile index 236d98343c..eada3089ec 100644 --- a/tests/usbus/Makefile +++ b/tests/usbus/Makefile @@ -1,7 +1,7 @@ include ../Makefile.tests_common USEMODULE += embunit USEMODULE += usbus -FEATURES_PROVIDED += periph_usbdev +USEMODULE += usbdev_mock DISABLE_MODULE += auto_init_usbus diff --git a/tests/usbus/Makefile.ci b/tests/usbus/Makefile.ci index 437811ffa9..3585ad2b49 100644 --- a/tests/usbus/Makefile.ci +++ b/tests/usbus/Makefile.ci @@ -1,7 +1,9 @@ BOARD_INSUFFICIENT_MEMORY := \ arduino-duemilanove \ + arduino-leonardo \ arduino-nano \ arduino-uno \ atmega328p \ + nucleo-f031k6 \ stm32f030f4-demo \ # diff --git a/tests/usbus/main.c b/tests/usbus/main.c index 1224b61839..3252ce36de 100644 --- a/tests/usbus/main.c +++ b/tests/usbus/main.c @@ -274,7 +274,7 @@ static void _handle_data(usbdev_mock_t *dev, usbdev_mock_ep_t *ep, size_t len) static void _ep_esr_validation(usbdev_mock_t *dev, usbdev_mock_ep_t *ep) { - DEBUG("[ep esr]: Data available for stack: %u\n", ep->available); + DEBUG("[ep esr]: Data available for stack: %u\n", (unsigned)ep->available); if (req_phase == TEST_REQ_PHASE_IDLE) { DEBUG("[ep esr]: Done with the request\n"); /* signal USBDEV_EVENT_ESR to call _test_sequence */