From b53bedba098af4137984c49efb954d9af46792f6 Mon Sep 17 00:00:00 2001 From: Antti Kauppila Date: Thu, 3 Jan 2019 20:05:08 +0200 Subject: [PATCH] Fixed Realtek test build --- targets/TARGET_Realtek/TARGET_AMEBA/rtw_emac.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/targets/TARGET_Realtek/TARGET_AMEBA/rtw_emac.cpp b/targets/TARGET_Realtek/TARGET_AMEBA/rtw_emac.cpp index 6580b83e2a..2ec69ccdbe 100644 --- a/targets/TARGET_Realtek/TARGET_AMEBA/rtw_emac.cpp +++ b/targets/TARGET_Realtek/TARGET_AMEBA/rtw_emac.cpp @@ -19,6 +19,7 @@ #include #include "mbed_assert.h" #include "mbed_events.h" +#include "mbed_wait_api.h" #include "rtw_emac.h" #include "EMACMemoryManager.h" @@ -33,7 +34,7 @@ #define RTW_EMAC_MTU_SIZE (1500U) -RTW_EMAC::RTW_EMAC() +RTW_EMAC::RTW_EMAC() { set_callback_func((emac_callback)(&RTW_EMAC::wlan_emac_recv), this); } @@ -66,7 +67,7 @@ bool RTW_EMAC::get_hwaddr(uint8_t *addr) const int i; if (RTW_SUCCESS == wifi_get_mac_address(mac)) { - if (sscanf(mac, "%x:%x:%x:%x:%x:%x", + if (sscanf(mac, "%x:%x:%x:%x:%x:%x", &val[0], &val[1], &val[2], &val[3], &val[4], &val[5]) != 6) { printf("Get HW address failed\r\n"); } @@ -177,7 +178,7 @@ void RTW_EMAC::wlan_emac_recv(void *param, struct netif *netif, uint32_t len) buf = enet->memory_manager->alloc_heap(len, 0); if (buf == NULL) { return; - } + } enet->memory_manager->set_len(buf, len); p = buf; @@ -206,7 +207,7 @@ void mbed_default_mac_address(char *mac) { void mbed_mac_address(char *mac) { - char hwaddr[20]; + char hwaddr[20]; int val[6]; int i; if (RTW_SUCCESS == wifi_get_mac_address(hwaddr)) {