Skip to content

Commit afcbca6

Browse files
committed
Base: Don't build mbed when using arduino
some boards use arduino but have mbed underneath, only build the arduino interface for simplicity
1 parent 401c083 commit afcbca6

9 files changed

+21
-15
lines changed

src/BaseClasses/ANT_BaseFramework.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#ifndef ANT_BASEFRAMEWORK_h
22
#define ANT_BASEFRAMEWORK_h
33

4+
#define IS_MBED (defined(__MBED__) && !defined(ARDUINO))
5+
46
#ifdef UNIT_TEST
57
#include "Util/Testing.h"
68
#elif defined(ARDUINO)
79
#include "Arduino.h"
8-
#elif defined(__MBED__)
10+
#elif IS_MBED
911
#include "mbed.h"
1012
#endif
1113

src/BaseClasses/ANT_BaseSerialAnt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,6 @@ void BaseSerialAnt<T>::send(AntRequest &request) {
110110

111111
#if defined(ARDUINO) || defined(UNIT_TEST)
112112
template class BaseSerialAnt<Stream>;
113-
#elif defined(__MBED__)
113+
#elif IS_MBED
114114
template class BaseSerialAnt<UARTSerial>;
115115
#endif

src/BaseClasses/ANT_BaseSpiAnt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,6 @@ void BaseSpiAnt<S, I, O>::resetRadio() {
155155
setHostSRdy(1);
156156
}
157157

158-
#if defined(__MBED__)
158+
#if IS_MBED
159159
template class BaseSpiAnt<SPISlave, DigitalIn, DigitalOut>;
160160
#endif

src/MainClasses/ANT_MbedSerialAnt.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#ifdef __MBED__
1+
#if IS_MBED
22

33
#include <MainClasses/ANT_MbedSerialAnt.h>
44
#include <ANT_private_defines.h>
@@ -30,4 +30,4 @@ uint32_t MbedSerialAnt::getMs() {
3030
}
3131

3232

33-
#endif // __MBED__
33+
#endif // IS_MBED

src/MainClasses/ANT_MbedSerialAnt.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#ifndef ANT_MBEDSERIALANT_h
22
#define ANT_MBEDSERIALANT_h
33

4-
#ifdef __MBED__
4+
#include <BaseClasses/ANT_BaseFramework.h>
5+
6+
#if IS_MBED
57

68
#include <BaseClasses/ANT_BaseSerialAnt.h>
79

@@ -17,6 +19,6 @@ class MbedSerialAnt : public BaseSerialAnt<UARTSerial> {
1719
UARTSerial* _serial;
1820
};
1921

20-
#endif // __MBED__
22+
#endif // IS_MBED
2123

2224
#endif // ANT_MBEDSERIALANT_h
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#ifdef __MBED__
1+
#if IS_MBED
22

33
#include <MainClasses/ANT_MbedSerialAntWithCallbacks.h>
44

55
MbedSerialAntWithCallbacks::MbedSerialAntWithCallbacks() : MbedSerialAnt(), BaseAntWithCallbacks() {}
66

7-
#endif // __MBED__
7+
#endif // IS_MBED
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#ifndef ANT_MBEDSERIALANTWITHCALLBACKS_h
22
#define ANT_MBEDSERIALANTWITHCALLBACKS_h
33

4-
#ifdef __MBED__
4+
#include <BaseClasses/ANT_BaseFramework.h>
5+
6+
#if IS_MBED
57

68
#include <BaseClasses/ANT_BaseAntWithCallbacks.h>
79
#include <MainClasses/ANT_MbedSerialAnt.h>
@@ -11,6 +13,6 @@ class MbedSerialAntWithCallbacks : public MbedSerialAnt, public BaseAntWithCallb
1113
MbedSerialAntWithCallbacks();
1214
};
1315

14-
#endif // __MBED__
16+
#endif // IS_MBED
1517

1618
#endif // ANT_MBEDSERIALANTWITHCALLBACKS_h

src/MainClasses/ANT_MbedSpiAnt.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#ifdef __MBED__
1+
#if IS_MBED
22

33
#include <MainClasses/ANT_MbedSpiAnt.h>
44
#include <ANT_private_defines.h>
@@ -41,4 +41,4 @@ uint32_t MbedSpiAnt::getMs() {
4141
}
4242

4343

44-
#endif // __MBED__
44+
#endif // IS_MBED

src/MainClasses/ANT_MbedSpiAnt.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef ANT_MBEDSPIANT_h
22
#define ANT_MBEDSPIANT_h
33

4-
#ifdef __MBED__
4+
#if IS_MBED
55

66
#include <BaseClasses/ANT_BaseSpiAnt.h>
77

@@ -23,6 +23,6 @@ class MbedSpiAnt : public BaseSpiAnt<SPISlave, DigitalIn, DigitalOut> {
2323
DigitalIn* _hostEnable;
2424
};
2525

26-
#endif // __MBED__
26+
#endif // IS_MBED
2727

2828
#endif // ANT_MBEDSPIANT_h

0 commit comments

Comments
 (0)