mirror of https://github.com/ARMmbed/mbed-os.git
Fixed Realtek test build
parent
bc76c2a2f5
commit
b53bedba09
|
@ -19,6 +19,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "mbed_assert.h"
|
#include "mbed_assert.h"
|
||||||
#include "mbed_events.h"
|
#include "mbed_events.h"
|
||||||
|
#include "mbed_wait_api.h"
|
||||||
|
|
||||||
#include "rtw_emac.h"
|
#include "rtw_emac.h"
|
||||||
#include "EMACMemoryManager.h"
|
#include "EMACMemoryManager.h"
|
||||||
|
@ -33,7 +34,7 @@
|
||||||
|
|
||||||
#define RTW_EMAC_MTU_SIZE (1500U)
|
#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);
|
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;
|
int i;
|
||||||
|
|
||||||
if (RTW_SUCCESS == wifi_get_mac_address(mac)) {
|
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) {
|
&val[0], &val[1], &val[2], &val[3], &val[4], &val[5]) != 6) {
|
||||||
printf("Get HW address failed\r\n");
|
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);
|
buf = enet->memory_manager->alloc_heap(len, 0);
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
enet->memory_manager->set_len(buf, len);
|
enet->memory_manager->set_len(buf, len);
|
||||||
p = buf;
|
p = buf;
|
||||||
|
@ -206,7 +207,7 @@ void mbed_default_mac_address(char *mac) {
|
||||||
|
|
||||||
void mbed_mac_address(char *mac)
|
void mbed_mac_address(char *mac)
|
||||||
{
|
{
|
||||||
char hwaddr[20];
|
char hwaddr[20];
|
||||||
int val[6];
|
int val[6];
|
||||||
int i;
|
int i;
|
||||||
if (RTW_SUCCESS == wifi_get_mac_address(hwaddr)) {
|
if (RTW_SUCCESS == wifi_get_mac_address(hwaddr)) {
|
||||||
|
|
Loading…
Reference in New Issue