Skip to content

Commit 1fcfced

Browse files
committed
Fixing changes to make greentea test mbed-os-tests-netsocket-connectivity pass for target Realtek AMEBA
1 parent 2e1c2a1 commit 1fcfced

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

features/FEATURE_LWIP/lwip-interface/lwip_stack.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -594,11 +594,13 @@ nsapi_error_t mbed_lwip_emac_init(emac_interface_t *emac)
594594
// Backwards compatibility with people using DEVICE_EMAC
595595
nsapi_error_t mbed_lwip_init(emac_interface_t *emac)
596596
{
597-
nsapi_error_t ret;
597+
nsapi_error_t ret = NSAPI_ERROR_OK;
598598
mbed_lwip_core_init();
599-
ret = mbed_lwip_emac_init(emac);
600-
if (ret == NSAPI_ERROR_OK) {
601-
netif_inited = true;
599+
if(netif_inited == false){
600+
ret = mbed_lwip_emac_init(emac);
601+
if (ret == NSAPI_ERROR_OK) {
602+
netif_inited = true;
603+
}
602604
}
603605
return ret;
604606
}

targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,9 @@ nsapi_error_t RTWInterface::connect(const char *ssid, const char *pass,
228228
nsapi_error_t RTWInterface::disconnect()
229229
{
230230
char essid[33];
231-
231+
232232
wlan_emac_link_change(false);
233+
mbed_lwip_bringdown();
233234
if(wifi_is_connected_to_ap() != RTW_SUCCESS)
234235
return NSAPI_ERROR_NO_CONNECTION;
235236
if(wifi_disconnect()<0){

0 commit comments

Comments
 (0)