Skip to content

Commit 34627b7

Browse files
authored
Merge pull request ARMmbed#14280 from hugueskamba/hk_cmake_refactor_wiced
CMake: Refactor WIO_EMW3166 support
2 parents c153880 + bc6679e commit 34627b7

File tree

14 files changed

+36
-38
lines changed

14 files changed

+36
-38
lines changed

connectivity/drivers/wifi/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# Copyright (c) 2020 ARM Limited. All rights reserved.
1+
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4+
add_subdirectory(TARGET_WICED EXCLUDE_FROM_ALL)
5+
46
add_subdirectory(esp8266-driver)
57

68
target_link_libraries(mbed-wifi
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_library(mbed-wiced INTERFACE)
5+
6+
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
7+
set(LIB_WICED_DRIVERS TOOLCHAIN_ARMC6/TARGET_WIO_EMW3166/libwiced_drivers.ar)
8+
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
9+
set(LIB_WICED_DRIVERS TOOLCHAIN_GCC_ARM/TARGET_WIO_EMW3166/libwiced_drivers.a)
10+
endif()
11+
12+
target_link_libraries(mbed-wiced INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/${LIB_WICED_DRIVERS})
13+
14+
target_include_directories(mbed-wiced
15+
INTERFACE
16+
wiced_interface
17+
)
18+
19+
target_sources(mbed-wiced
20+
INTERFACE
21+
wiced_interface/default_wifi_interface.cpp
22+
)
File renamed without changes.

targets/TARGET_WICED/wiced_interface/WicedInterface.h renamed to connectivity/drivers/wifi/TARGET_WICED/wiced_interface/WicedInterface.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,12 @@
2929
/** WicedInterface class
3030
* Implementation of the NetworkStack for the Wiced
3131
*/
32-
class WicedInterface : public WiFiInterface, public EMACInterface
33-
{
32+
class WicedInterface : public WiFiInterface, public EMACInterface {
3433
public:
3534

3635
WicedInterface(
37-
EMAC &emac = WICED_EMAC::get_instance(),
38-
OnboardNetworkStack &stack = OnboardNetworkStack::get_default_instance());
36+
EMAC &emac = WICED_EMAC::get_instance(),
37+
OnboardNetworkStack &stack = OnboardNetworkStack::get_default_instance());
3938

4039
/** Start the interface
4140
*
@@ -80,7 +79,8 @@ class WicedInterface : public WiFiInterface, public EMACInterface
8079
* @param channel Channel on which the connection is to be made, or 0 for any (Default: 0)
8180
* @return Not supported, returns NSAPI_ERROR_UNSUPPORTED
8281
*/
83-
nsapi_error_t set_channel(uint8_t channel) {
82+
nsapi_error_t set_channel(uint8_t channel)
83+
{
8484
if (channel != 0) {
8585
return NSAPI_ERROR_UNSUPPORTED;
8686
}

targets/TARGET_WICED/wiced_interface/wiced_emac.h renamed to connectivity/drivers/wifi/TARGET_WICED/wiced_interface/wiced_emac.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ class WICED_EMAC : public EMAC {
154154
emac_link_input_cb_t emac_link_input_cb; /**< Callback for incoming data */
155155
emac_link_state_change_cb_t emac_link_state_cb;
156156
EMACMemoryManager *memory_manager;
157-
158157
};
159158

160159
#endif /* WICED_EMAC_H_ */

0 commit comments

Comments
 (0)