File tree 3 files changed +17
-11
lines changed
3 files changed +17
-11
lines changed Original file line number Diff line number Diff line change 20
20
#ifndef Arduino_h
21
21
#define Arduino_h
22
22
23
- // TEMP: include proper CMSIS
24
- inline void NVIC_SystemReset () {}
25
-
26
- #ifdef __cplusplus
23
+ #if defined(__cplusplus)
24
+ #if !defined(ARDUINO_AS_MBED_LIBRARY)
27
25
#define PinMode MbedPinMode
26
+ #endif
28
27
#include " mbed.h"
29
28
#undef PinMode
30
29
#endif
31
30
31
+ #if defined(ARDUINO_AS_MBED_LIBRARY)
32
+ #define PinMode ArduinoPinMode
33
+ #endif
34
+
32
35
#include " api/ArduinoAPI.h"
33
36
34
- #ifdef __cplusplus
37
+ #if defined(ARDUINO_AS_MBED_LIBRARY)
38
+ #undef PinMode
39
+ #endif
40
+
41
+ #if defined(__cplusplus)
42
+ #if !defined(ARDUINO_AS_MBED_LIBRARY)
35
43
using namespace arduino ;
44
+ #endif
36
45
extern " C" {
37
46
#endif
38
47
Original file line number Diff line number Diff line change 1
- #include " api/HardwareSerial.h"
2
1
#include " api/RingBuffer.h"
3
- #include " mbed/drivers/Serial.h"
4
- #include " mbed/rtos/Thread.h"
5
- #include " mbed/events/EventQueue.h"
2
+ #include " Arduino.h"
6
3
7
4
#ifdef __cplusplus
8
5
@@ -35,7 +32,7 @@ class UART : public HardwareSerial {
35
32
};
36
33
}
37
34
38
- extern UART UART1;
35
+ extern arduino:: UART UART1;
39
36
40
37
#endif
41
38
#endif
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ int main(void)
39
39
40
40
for (;;) {
41
41
loop ();
42
- if (serialEventRun) serialEventRun ();
42
+ if (arduino:: serialEventRun) arduino:: serialEventRun ();
43
43
}
44
44
45
45
return 0 ;
You can’t perform that action at this time.
0 commit comments