Skip to content

Commit

Permalink
Merge pull request #8327 from SeppoTakalo/i2c_guard
Browse files Browse the repository at this point in the history
Guard Atmel RF driver build by DEVICE_I2C
  • Loading branch information
0xc0170 authored Oct 9, 2018
2 parents 313073c + f16a99c commit 06dffda
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions components/802.15.4_RF/atmel-rf-driver/source/at24mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 */
4 changes: 4 additions & 0 deletions components/802.15.4_RF/atmel-rf-driver/source/at24mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -62,4 +65,5 @@ class AT24Mac {
mbed::I2C _i2c;
};

#endif /* DEVICE_I2C */
#endif /* AT24MAC_H */

0 comments on commit 06dffda

Please sign in to comment.