mirror of https://github.com/ARMmbed/mbed-os.git
Added memory manager set to add_ethernet_interface() of test stack
This allows that EMAC memory manager can be used to allocate EMAC driver memory already after the add_ethernet_interface() call.pull/6847/head
parent
31b8f73de7
commit
e481c5ef75
|
@ -114,6 +114,9 @@ nsapi_error_t EmacTestNetworkStack::add_ethernet_interface(EMAC &emac, bool defa
|
|||
|
||||
m_interface->m_emac = &emac;
|
||||
|
||||
EmacTestMemoryManager *memory_manager = &EmacTestMemoryManager::get_instance();
|
||||
emac.set_memory_manager(*memory_manager);
|
||||
|
||||
*interface_out = m_interface;
|
||||
|
||||
return NSAPI_ERROR_OK;
|
||||
|
|
|
@ -115,8 +115,6 @@ EmacTestMemoryManager *emac_m_mngr_get(void)
|
|||
bool emac_if_init(void)
|
||||
{
|
||||
static EMAC *emac = &EMAC::get_default_instance();
|
||||
static EmacTestMemoryManager *memory_manager = &EmacTestMemoryManager::get_instance();
|
||||
emac->set_memory_manager(*memory_manager);
|
||||
|
||||
emac->set_link_input_cb(emac_if_link_input_cb);
|
||||
emac->set_link_state_cb(emac_if_link_state_change_cb);
|
||||
|
|
|
@ -124,7 +124,8 @@ public:
|
|||
/** Register a network interface with the IP stack
|
||||
*
|
||||
* Connects EMAC layer with the IP stack and initializes all the required infrastructure.
|
||||
* This function should be called only once for each available interface.
|
||||
* This function should be called only once for each available interface. EMAC memory
|
||||
* manager is available to EMAC after this function call.
|
||||
*
|
||||
* @param emac EMAC HAL implementation for this network interface
|
||||
* @param default_if true if the interface should be treated as the default one
|
||||
|
|
Loading…
Reference in New Issue