mirror of https://github.com/ARMmbed/mbed-os.git
Removed EMAC get default instance from EMAC tests
Test environment now uses the EMAC defined by add ethernet interface.pull/6847/head
parent
fc0ce8cb72
commit
fd2c6ba12b
|
@ -163,7 +163,7 @@ char *EmacTestNetworkStack::Interface::get_gateway(char *buf, nsapi_size_t bufle
|
|||
|
||||
nsapi_error_t EmacTestNetworkStack::Interface::bringup(bool dhcp, const char *ip, const char *netmask, const char *gw, const nsapi_ip_stack_t stack, bool blocking)
|
||||
{
|
||||
if (!emac_if_init()) {
|
||||
if (!emac_if_init(m_emac)) {
|
||||
TEST_ASSERT_MESSAGE(0, "emac initialization failed!");
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#define EMAC_INITIALIZE_H
|
||||
|
||||
unsigned char *emac_if_get_hw_addr(void);
|
||||
bool emac_if_init(void);
|
||||
bool emac_if_init(EMAC *emac);
|
||||
EMAC *emac_if_get(void);
|
||||
EmacTestMemoryManager *emac_m_mngr_get(void);
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
using namespace utest::v1;
|
||||
|
||||
static unsigned char eth_mac_addr[ETH_MAC_ADDR_LEN];
|
||||
EMAC *emac_handle = NULL;
|
||||
|
||||
void test_emac_initialize()
|
||||
{
|
||||
|
@ -104,7 +105,7 @@ unsigned char *emac_if_get_hw_addr(void)
|
|||
|
||||
EMAC *emac_if_get(void)
|
||||
{
|
||||
return &EMAC::get_default_instance();
|
||||
return emac_handle;
|
||||
}
|
||||
|
||||
EmacTestMemoryManager *emac_m_mngr_get(void)
|
||||
|
@ -112,9 +113,9 @@ EmacTestMemoryManager *emac_m_mngr_get(void)
|
|||
return &EmacTestMemoryManager::get_instance();
|
||||
}
|
||||
|
||||
bool emac_if_init(void)
|
||||
bool emac_if_init(EMAC *emac)
|
||||
{
|
||||
static EMAC *emac = &EMAC::get_default_instance();
|
||||
emac_handle = emac;
|
||||
|
||||
emac->set_link_input_cb(emac_if_link_input_cb);
|
||||
emac->set_link_state_cb(emac_if_link_state_change_cb);
|
||||
|
|
Loading…
Reference in New Issue