File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
@@ -27,7 +27,7 @@ const usb_standard_desc_t *usb_parse_next_descriptor(const usb_standard_desc_t *
2727 return NULL ; // Next descriptor is out of bounds
2828 }
2929 // Return the next descriptor, update offset
30- const usb_standard_desc_t * ret_desc = (const usb_standard_desc_t * )(((uint32_t )cur_desc ) + cur_desc -> bLength );
30+ const usb_standard_desc_t * ret_desc = (const usb_standard_desc_t * )(((uintptr_t )cur_desc ) + cur_desc -> bLength );
3131 * offset += cur_desc -> bLength ;
3232 return ret_desc ;
3333}
Original file line number Diff line number Diff line change 1+ # NOTE: This kind of mocking currently works on Linux targets only.
2+ # On Espressif chips, too many dependencies are missing at the moment.
3+ message (STATUS "building USB HOST MOCKS" )
4+
5+ idf_component_get_property(original_usb_dir usb COMPONENT_OVERRIDEN_DIR)
6+
7+ idf_component_mock(INCLUDE_DIRS "${original_usb_dir} /include"
8+ "${original_usb_dir} /include/esp_private"
9+ "${original_usb_dir} /include/usb"
10+ "${original_usb_dir} /private_include"
11+ MOCK_HEADER_FILES ${original_usb_dir} /include /usb/usb_host.h
12+ ${original_usb_dir} /include /esp_private/usb_phy.h
13+ REQUIRES freertos)
14+
15+
16+ # We do not mock usb_helpers. We use the original implementation.
17+ # This way, we can test Class drivers descriptor parsing
18+ target_sources (${COMPONENT_LIB} PRIVATE "${original_usb_dir} /usb_helpers.c" )
Original file line number Diff line number Diff line change 1+ :cmock :
2+ :plugins :
3+ - expect
4+ - expect_any_args
5+ - return_thru_ptr
6+ - ignore
7+ - ignore_arg
You can’t perform that action at this time.
0 commit comments