1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers: add usbdev_mock

This commit is contained in:
Leandro Lanzieri 2020-08-17 18:30:36 +02:00
parent 847c2f8b6b
commit 16b5fd303b
No known key found for this signature in database
GPG Key ID: 13559905E2EBEAA5
7 changed files with 11 additions and 8 deletions

View File

@ -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)))

View File

@ -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 <koen@bergzand.net>
*/
@ -115,3 +113,4 @@ void usbdev_mock_setup(usbdev_mock_esr_cb_t esr_cb,
#endif /* USBDEV_MOCK_H */
/** @} */
/** @} */

View File

@ -0,0 +1 @@
include $(RIOTBASE)/Makefile.base

View File

@ -17,7 +17,6 @@
#include <stdio.h>
#include <string.h>
#include "embUnit.h"
#include "periph/usbdev.h"
#include "test_utils/expect.h"
#include "usbdev_mock.h"

View File

@ -1,7 +1,7 @@
include ../Makefile.tests_common
USEMODULE += embunit
USEMODULE += usbus
FEATURES_PROVIDED += periph_usbdev
USEMODULE += usbdev_mock
DISABLE_MODULE += auto_init_usbus

View File

@ -1,7 +1,9 @@
BOARD_INSUFFICIENT_MEMORY := \
arduino-duemilanove \
arduino-leonardo \
arduino-nano \
arduino-uno \
atmega328p \
nucleo-f031k6 \
stm32f030f4-demo \
#

View File

@ -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 */