Merge pull request #8327 from SeppoTakalo/i2c_guard

Guard Atmel RF driver build by DEVICE_I2C
pull/8192/merge
Martin Kojtal 2018-10-09 11:37:43 -05:00 committed by GitHub
commit 06dffda530
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View File

@ -20,7 +20,7 @@
#include "at24mac.h"
#include "PinNames.h"
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI && DEVICE_I2C
#include "NanostackRfPhy.h"

View File

@ -15,7 +15,7 @@
*/
#include <string.h>
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI && DEVICE_I2C
#include "platform/arm_hal_interrupt.h"
#include "nanostack/platform/arm_hal_phy.h"

View File

@ -15,6 +15,8 @@
*/
#include "at24mac.h"
#if DEVICE_I2C
/* Device addressing */
#define AT24MAC_EEPROM_ADDRESS (0x0A<<4)
#define AT24MAC_RW_PROTECT_ADDRESS (0x06<<4)
@ -59,3 +61,5 @@ int AT24Mac::read_eui48(void *buf)
return -1; //No ACK
return _i2c.read(AT24MAC_SERIAL_ADDRESS, (char*)buf, EUI48_LEN);
}
#endif /* DEVICE_I2C */

View File

@ -17,6 +17,9 @@
#define AT24MAC_H
#include "PinNames.h"
#if DEVICE_I2C
#include "I2C.h"
#include "drivers/DigitalInOut.h"
#include "platform/mbed_wait_api.h"
@ -62,4 +65,5 @@ private:
mbed::I2C _i2c;
};
#endif /* DEVICE_I2C */
#endif /* AT24MAC_H */