Skip to content

Commit f16a99c

Browse files
author
Seppo Takalo
committed
Guard Atmel RF driver build by DEVICE_I2C
This module uses AT24MAC chip which is in I2C bus, so it requires device to support I2C
1 parent 1af1a4a commit f16a99c

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

components/802.15.4_RF/atmel-rf-driver/atmel-rf-driver/NanostackRfPhyAtmel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "at24mac.h"
2121
#include "PinNames.h"
2222

23-
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI
23+
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI && DEVICE_I2C
2424

2525
#include "NanostackRfPhy.h"
2626

components/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAtmel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
#include <string.h>
1717

18-
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI
18+
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI && DEVICE_I2C
1919

2020
#include "platform/arm_hal_interrupt.h"
2121
#include "nanostack/platform/arm_hal_phy.h"

components/802.15.4_RF/atmel-rf-driver/source/at24mac.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
#include "at24mac.h"
1717

18+
#if DEVICE_I2C
19+
1820
/* Device addressing */
1921
#define AT24MAC_EEPROM_ADDRESS (0x0A<<4)
2022
#define AT24MAC_RW_PROTECT_ADDRESS (0x06<<4)
@@ -80,3 +82,5 @@ int AT24Mac::read_eui48(void *buf)
8082
return -1; //No ACK
8183
return _i2c.read(AT24MAC_SERIAL_ADDRESS, (char*)buf, EUI48_LEN);
8284
}
85+
86+
#endif /* DEVICE_I2C */

components/802.15.4_RF/atmel-rf-driver/source/at24mac.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
#define AT24MAC_H
1818

1919
#include "PinNames.h"
20+
21+
#if DEVICE_I2C
22+
2023
#include "I2C.h"
2124
#include "drivers/DigitalInOut.h"
2225
#include "platform/mbed_wait_api.h"
@@ -71,4 +74,5 @@ class AT24Mac {
7174
mbed::I2C _i2c;
7275
};
7376

77+
#endif /* DEVICE_I2C */
7478
#endif /* AT24MAC_H */

0 commit comments

Comments
 (0)