Skip to content

Commit f3d32e7

Browse files
committed
UBEREXPERIMENTAL: try to speedup compilation
1 parent e671b77 commit f3d32e7

File tree

13 files changed

+37
-10
lines changed

13 files changed

+37
-10
lines changed

cores/arduino/Arduino.h

+6-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
1919

20-
#ifndef Arduino_h
20+
#if !defined(Arduino_h) && !defined(ARDUINO_LIB_DISCOVERY_PHASE)
2121
#define Arduino_h
2222

2323
#if defined(__cplusplus)
@@ -29,7 +29,9 @@
2929
#endif // F (mbed included after arduino.h)
3030
#define F Mbed_F
3131
#endif // !ARDUINO_AS_MBED_LIBRARY
32-
#include "mbed.h"
32+
#include "mbed_config.h"
33+
#include "mbed/drivers/InterruptIn.h"
34+
#include "mbed/drivers/PwmOut.h"
3335
#undef PinMode
3436
#undef F
3537
#endif //__cplusplus
@@ -81,15 +83,15 @@ void analogWriteResolution(int bits);
8183
#include "pins_arduino.h"
8284

8385
#ifdef __cplusplus
84-
/* Types used for the table below */
86+
// Types used for the table below
8587
typedef struct _PinDescription
8688
{
8789
PinName name;
8890
mbed::InterruptIn* irq;
8991
mbed::PwmOut* pwm;
9092
} PinDescription ;
9193

92-
/* Pins table to be instantiated into variant.cpp */
94+
// Pins table to be instantiated into variant.cpp
9395
extern PinDescription g_APinDescription[];
9496

9597
#include "Serial.h"

cores/arduino/Serial.h

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "api/RingBuffer.h"
2424
#include "Arduino.h"
25+
#include "mbed/drivers/RawSerial.h"
2526

2627
#ifdef __cplusplus
2728

cores/arduino/USB/PluggableUSBSerial.h

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "Arduino.h"
2222
#include "USBCDC.h"
2323
#include "platform/Stream.h"
24+
#include "mbed/rtos/rtos.h"
2425
#include "Callback.h"
2526

2627
/**

cores/arduino/USB/USBSerial.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "stdint.h"
2323
#include "PluggableUSBSerial.h"
2424
#include "usb_phy_api.h"
25+
#include "mbed.h"
2526

2627
using namespace arduino;
2728

cores/arduino/mbed.h

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#ifndef _MBED_WRAP_H_
2+
#define _MBED_WRAP_H_
3+
4+
#include "Arduino.h"
5+
6+
#if defined(__cplusplus)
7+
#if !defined(ARDUINO_AS_MBED_LIBRARY)
8+
#define PinMode MbedPinMode
9+
#ifdef F
10+
#define Arduino_F F
11+
#undef F
12+
#endif // F (mbed included after arduino.h)
13+
#define F Mbed_F
14+
#endif // !ARDUINO_AS_MBED_LIBRARY
15+
#include "mbed_wrap.h"
16+
#undef PinMode
17+
#undef F
18+
#endif //__cplusplus
19+
20+
#endif //_MBED_WRAP_H_

cores/arduino/mbed/mbed.h renamed to cores/arduino/mbed/mbed_wrap.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
#ifndef MBED_H
16+
#if !defined(MBED_H)
1717
#define MBED_H
1818

1919
#include "platform/mbed_version.h"

cores/arduino/wiring.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
*/
2222

2323
#include "wiring_private.h"
24+
#include "mbed/drivers/LowPowerTimer.h"
25+
#include "mbed/drivers/Timer.h"
26+
#include "mbed/rtos/rtos.h"
27+
#include "mbed/platform/mbed_wait_api.h"
2428

2529
#if DEVICE_LPTICKER
2630
static mbed::LowPowerTimer t;

cores/arduino/wiring_analog.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "Arduino.h"
2424
#include "pins_arduino.h"
25+
#include "mbed/drivers/AnalogIn.h"
2526

2627
static int write_resolution = 8;
2728
static int read_resolution = 10;

cores/arduino/wiring_digital.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "Arduino.h"
2424
#include "pins_arduino.h"
25+
#include "mbed.h"
2526

2627
void pinMode(PinName pin, PinMode mode)
2728
{

libraries/Portenta_Video/anx7625.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
//#include <gpio.h>
2121
//#include <timer.h>
2222
#include <string.h>
23+
#include <mbed/drivers/I2C.h>
2324

2425
#include "anx7625.h"
2526
#include "video_modes.h"

variants/ARDUINO_NANO33BLE/pins_arduino.h

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#pragma once
2-
#include "mbed_config.h"
32
#include <stdint.h>
43
#include <macros.h>
54

variants/PORTENTA_H7_M4/pins_arduino.h

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
#include "mbed_config.h"
2-
31
#pragma once
4-
#include "mbed_config.h"
52
#include <macros.h>
63

74
#ifndef __PINS_ARDUINO__

variants/PORTENTA_H7_M7/pins_arduino.h

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#pragma once
2-
#include "mbed_config.h"
32
#include <macros.h>
43

54
#ifndef __PINS_ARDUINO__

0 commit comments

Comments
 (0)