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:
parent
847c2f8b6b
commit
16b5fd303b
@ -977,9 +977,11 @@ endif
|
|||||||
|
|
||||||
ifneq (,$(filter usbus,$(USEMODULE)))
|
ifneq (,$(filter usbus,$(USEMODULE)))
|
||||||
DEFAULT_MODULE += auto_init_usbus
|
DEFAULT_MODULE += auto_init_usbus
|
||||||
FEATURES_REQUIRED += periph_usbdev
|
|
||||||
USEMODULE += core_thread_flags
|
USEMODULE += core_thread_flags
|
||||||
USEMODULE += event
|
USEMODULE += event
|
||||||
|
ifeq (,$(filter usbdev_mock,$(USEMODULE)))
|
||||||
|
FEATURES_REQUIRED += periph_usbdev
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter usbus_cdc_acm,$(USEMODULE)))
|
ifneq (,$(filter usbus_cdc_acm,$(USEMODULE)))
|
||||||
|
@ -6,13 +6,11 @@
|
|||||||
* directory for more details.
|
* directory for more details.
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @defgroup tests_usbdev_mock USBdev mockup device
|
* @defgroup drivers_usbdev_mock USBdev mockup device
|
||||||
* @ingroup tests
|
* @ingroup drivers
|
||||||
* @brief USBdev mockup device for testing
|
* @brief USBdev mockup device for testing
|
||||||
* @{
|
* @{
|
||||||
*
|
*
|
||||||
* @file
|
|
||||||
*
|
|
||||||
* @author Koen Zandberg <koen@bergzand.net>
|
* @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 */
|
#endif /* USBDEV_MOCK_H */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
/** @} */
|
1
drivers/usbdev_mock/Makefile
Normal file
1
drivers/usbdev_mock/Makefile
Normal file
@ -0,0 +1 @@
|
|||||||
|
include $(RIOTBASE)/Makefile.base
|
@ -17,7 +17,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "embUnit.h"
|
|
||||||
#include "periph/usbdev.h"
|
#include "periph/usbdev.h"
|
||||||
#include "test_utils/expect.h"
|
#include "test_utils/expect.h"
|
||||||
#include "usbdev_mock.h"
|
#include "usbdev_mock.h"
|
@ -1,7 +1,7 @@
|
|||||||
include ../Makefile.tests_common
|
include ../Makefile.tests_common
|
||||||
USEMODULE += embunit
|
USEMODULE += embunit
|
||||||
USEMODULE += usbus
|
USEMODULE += usbus
|
||||||
FEATURES_PROVIDED += periph_usbdev
|
USEMODULE += usbdev_mock
|
||||||
|
|
||||||
DISABLE_MODULE += auto_init_usbus
|
DISABLE_MODULE += auto_init_usbus
|
||||||
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
BOARD_INSUFFICIENT_MEMORY := \
|
BOARD_INSUFFICIENT_MEMORY := \
|
||||||
arduino-duemilanove \
|
arduino-duemilanove \
|
||||||
|
arduino-leonardo \
|
||||||
arduino-nano \
|
arduino-nano \
|
||||||
arduino-uno \
|
arduino-uno \
|
||||||
atmega328p \
|
atmega328p \
|
||||||
|
nucleo-f031k6 \
|
||||||
stm32f030f4-demo \
|
stm32f030f4-demo \
|
||||||
#
|
#
|
||||||
|
@ -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)
|
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) {
|
if (req_phase == TEST_REQ_PHASE_IDLE) {
|
||||||
DEBUG("[ep esr]: Done with the request\n");
|
DEBUG("[ep esr]: Done with the request\n");
|
||||||
/* signal USBDEV_EVENT_ESR to call _test_sequence */
|
/* signal USBDEV_EVENT_ESR to call _test_sequence */
|
||||||
|
Loading…
Reference in New Issue
Block a user