Skip to content

Commit 9d56b06

Browse files
committed
Update core
1 parent 1887446 commit 9d56b06

File tree

4,299 files changed

+891447
-221234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,299 files changed

+891447
-221234
lines changed
34.5 KB
Binary file not shown.
819 KB
Binary file not shown.

bootloaders/EDGE_CONTROL/bootloader.hex

+2,218
Large diffs are not rendered by default.

bootloaders/NICLA/bootloader.elf

1.92 MB
Binary file not shown.

bootloaders/NICLA/bootloader.hex

+3,688
Large diffs are not rendered by default.
125 KB
Binary file not shown.
4.06 MB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

cores/arduino/Arduino.h

+28-46
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,20 @@
2323
#if !defined(Arduino_h) && !defined(ARDUINO_LIB_DISCOVERY_PHASE)
2424
#define Arduino_h
2525

26-
#if defined(__cplusplus)
27-
#if !defined(ARDUINO_AS_MBED_LIBRARY)
28-
2926
#include "pinmode_arduino.h"
30-
31-
#ifdef F
32-
#define Arduino_F F
33-
#undef F
34-
#endif // F (mbed included after arduino.h)
35-
#define F Mbed_F
36-
#endif // !ARDUINO_AS_MBED_LIBRARY
37-
#include "mbed_config.h"
38-
#include "mbed/drivers/InterruptIn.h"
39-
#include "mbed/drivers/PwmOut.h"
40-
#include "mbed/drivers/AnalogIn.h"
41-
#include "mbed/drivers/DigitalInOut.h"
42-
#include "mbed.h"
43-
#undef F
44-
#endif //__cplusplus
45-
46-
#if defined(ARDUINO_AS_MBED_LIBRARY)
47-
#define PinMode ArduinoPinMode
48-
#define Arduino_F F
49-
#endif
50-
5127
#include "api/ArduinoAPI.h"
5228

5329
#if defined(__cplusplus)
30+
31+
#undef F
32+
// C++11 F replacement declaration
33+
template <typename T1>
34+
auto F(T1&& A)
35+
-> const arduino::__FlashStringHelper*
36+
{
37+
return (const arduino::__FlashStringHelper*)A;
38+
}
39+
5440
#if !defined(ARDUINO_AS_MBED_LIBRARY)
5541
using namespace arduino;
5642
#endif
@@ -91,28 +77,15 @@ void analogWriteResolution(int bits);
9177

9278
#ifdef __cplusplus
9379
// Types used for the table below
94-
typedef struct _PinDescription
95-
{
96-
PinName name;
97-
mbed::InterruptIn* irq;
98-
mbed::PwmOut* pwm;
99-
mbed::DigitalInOut* gpio;
100-
} PinDescription ;
101-
102-
typedef struct _AnalogPinDescription
103-
{
104-
PinName name;
105-
mbed::AnalogIn* adc;
106-
} AnalogPinDescription ;
107-
108-
int PinNameToIndex(PinName P);
80+
typedef struct _PinDescription PinDescription;
81+
typedef struct _AnalogPinDescription AnalogPinDescription;
10982

11083
// Pins table to be instantiated into variant.cpp
11184
extern PinDescription g_APinDescription[];
11285
extern AnalogPinDescription g_AAnalogPinDescription[];
11386

11487
#ifdef ANALOG_CONFIG
115-
88+
#include "hal/analogin_api.h"
11689
typedef enum _AnalogReferenceMode AnalogReferenceMode;
11790
void analogReference(uint8_t mode);
11891
/* nRF specific function to change analog acquisition time */
@@ -127,18 +100,27 @@ extern analogin_config_t adcCurrentConfig;
127100
#endif
128101

129102
#include "Serial.h"
103+
#include "timer.h"
130104
#if defined(SERIAL_CDC)
131-
#include "USB/PluggableUSBSerial.h"
132-
#define Serial SerialUSB
105+
#define Serial _UART_USB_
106+
#define SerialUSB _UART_USB_
107+
#else
108+
#define Serial _UART1_
109+
#endif
133110
#define Serial1 _UART1_
134111
#define Serial2 _UART2_
135112
#define Serial3 _UART3_
136113
#define Serial4 _UART4_
114+
115+
#if defined(RPC_SERIAL)
116+
#undef Serial
117+
#if __has_include("RPC.h")
118+
#include "SerialRPC.h"
119+
#define Serial SerialRPC
137120
#else
138-
#define Serial _UART1_
139-
#define Serial1 _UART2_
140-
#define Serial2 _UART3_
141-
#define Serial3 _UART4_
121+
extern ErrorSerialClass ErrorSerial;
122+
#define Serial ErrorSerial
123+
#endif
142124
#endif
143125

144126
#include "overloads.h"

cores/arduino/Interrupts.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818

1919
#include "Arduino.h"
20+
#include "pinDefinitions.h"
2021

2122
void detachInterrupt(PinName interruptNum) {
2223
pin_size_t idx = PinNameToIndex(interruptNum);
@@ -28,6 +29,7 @@ void detachInterrupt(PinName interruptNum) {
2829
void detachInterrupt(pin_size_t interruptNum) {
2930
if ((interruptNum < PINS_COUNT) && (digitalPinToInterruptObj(interruptNum) != NULL)) {
3031
delete digitalPinToInterruptObj(interruptNum);
32+
digitalPinToInterruptObj(interruptNum) = nullptr;
3133
}
3234
}
3335

@@ -56,7 +58,9 @@ void attachInterruptParam(pin_size_t interruptNum, voidFuncPtrParam func, PinSta
5658
if (interruptNum >= PINS_COUNT) {
5759
return;
5860
}
59-
detachInterrupt(interruptNum);
61+
if (digitalPinToInterruptObj(interruptNum) != nullptr) {
62+
detachInterrupt(interruptNum);
63+
}
6064
mbed::InterruptIn* irq = new mbed::InterruptIn(digitalPinToPinName(interruptNum));
6165
if (mode == CHANGE) {
6266
irq->rise(mbed::callback(func, param));

0 commit comments

Comments
 (0)