EMAC: Fix "#if DEVICE_EMAC " usage

pull/3975/head
Bartek Szatkowski 2016-09-23 15:41:21 +01:00 committed by Martin Kojtal
parent 2ce9039a1a
commit c80641fe11
4 changed files with 22 additions and 0 deletions

View File

@ -22,7 +22,11 @@
EthernetInterface::EthernetInterface()
: _dhcp(true), _ip_address(), _netmask(), _gateway()
{
#if DEVICE_EMAC
return lwip_bringup(NULL);
#else /* DEVICE_EMAC */
return lwip_bringup();
#endif /* DEVICE_EMAC */
}
int EthernetInterface::set_network(const char *ip_address, const char *netmask, const char *gateway)

View File

@ -14,6 +14,10 @@
* limitations under the License.
*/
#include "platform.h"
#if DEVICE_EMAC
#include "IPStackInterface.h"
#include "lwip_stack.h"
@ -39,3 +43,5 @@ const char * IPStackInterface::get_ip_address()
{
return lwip_get_ip_address(_ip_address, sizeof(_ip_address));
}
#endif /* DEVICE_EMAC */

View File

@ -17,6 +17,10 @@
#ifndef IP_STACK_INTERFACE_H
#define IP_STACK_INTERFACE_H
#include "platform.h"
#if DEVICE_EMAC
#include "emac_api.h"
/**
@ -56,4 +60,6 @@ private:
char _ip_address[16]; //IPv4
};
#endif /* DEVICE_EMAC */
#endif /* IP_STACK_INTERFACE_H */

View File

@ -16,6 +16,10 @@
#ifndef MBED_EMAC_STACK_MEM_H
#define MBED_EMAC_STACK_MEM_H
#include "platform.h"
#if DEVICE_EMAC
#include <stdint.h>
/**
@ -92,4 +96,6 @@ emac_stack_mem_t *emac_stack_mem_chain_dequeue(emac_stack_t* stack, emac_stack_m
*/
uint32_t emac_stack_mem_chain_len(emac_stack_t* stack, emac_stack_mem_chain_t *chain);
#endif /* DEVICE_EMAC */
#endif /* EMAC_MBED_STACK_MEM_h */