Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

Commit ca8a35e

Browse files
authored
Initial v1.2.1 for Portenta_H7
### Initial Releases v1.2.1 1. Initial coding to support **Portenta_H7 boards** such as Portenta_H7 Rev2 ABX00042, etc., using [**ArduinoCore-mbed mbed_portenta** core](https://github.com/arduino/ArduinoCore-mbed) 2. Permit up to 16 super-long-time, super-accurate ISR-based timers to avoid being blocked 3. Using cpp code besides Impl.h code to use if Multiple-Definition linker error. 4. Bump version to v1.2.1 to sync with [STM32_TimerInterrupt library](https://github.com/khoih-prog/STM32_TimerInterrupt)
1 parent fdf31c1 commit ca8a35e

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

src/Portenta_H7_ISR_Timer.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@
3131
#ifndef ISR_TIMER_GENERIC_H
3232
#define ISR_TIMER_GENERIC_H
3333

34-
#if !( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || defined(STM32F7) || \
35-
defined(STM32L0) || defined(STM32L1) || defined(STM32L4) || defined(STM32H7) ||defined(STM32G0) || defined(STM32G4) || \
36-
defined(STM32WB) || defined(STM32MP1) || defined(STM32L5))
37-
//#error This code is designed to run on STM32F/L/H/G/WB/MP1 platform! Please check your Tools->Board setting.
34+
#if !( ( defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) ) && defined(ARDUINO_ARCH_MBED) )
35+
#error This code is intended to run on the MBED ARDUINO_PORTENTA_H7 platform! Please check your Tools->Board setting.
3836
#endif
3937

4038
#ifndef PORTENTA_H7_TIMER_INTERRUPT_VERSION

src_cpp/Portenta_H7_ISR_Timer.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@
3131
#ifndef ISR_TIMER_GENERIC_H
3232
#define ISR_TIMER_GENERIC_H
3333

34-
#if !( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || defined(STM32F7) || \
35-
defined(STM32L0) || defined(STM32L1) || defined(STM32L4) || defined(STM32H7) ||defined(STM32G0) || defined(STM32G4) || \
36-
defined(STM32WB) || defined(STM32MP1) || defined(STM32L5))
37-
//#error This code is designed to run on STM32F/L/H/G/WB/MP1 platform! Please check your Tools->Board setting.
34+
#if !( ( defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) ) && defined(ARDUINO_ARCH_MBED) )
35+
#error This code is intended to run on the MBED ARDUINO_PORTENTA_H7 platform! Please check your Tools->Board setting.
3836
#endif
3937

4038
#ifndef PORTENTA_H7_TIMER_INTERRUPT_VERSION

src_h/Portenta_H7_ISR_Timer.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@
3131
#ifndef ISR_TIMER_GENERIC_H
3232
#define ISR_TIMER_GENERIC_H
3333

34-
#if !( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || defined(STM32F7) || \
35-
defined(STM32L0) || defined(STM32L1) || defined(STM32L4) || defined(STM32H7) ||defined(STM32G0) || defined(STM32G4) || \
36-
defined(STM32WB) || defined(STM32MP1) || defined(STM32L5))
37-
//#error This code is designed to run on STM32F/L/H/G/WB/MP1 platform! Please check your Tools->Board setting.
34+
#if !( ( defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) ) && defined(ARDUINO_ARCH_MBED) )
35+
#error This code is intended to run on the MBED ARDUINO_PORTENTA_H7 platform! Please check your Tools->Board setting.
3836
#endif
3937

4038
#ifndef PORTENTA_H7_TIMER_INTERRUPT_VERSION
@@ -55,12 +53,12 @@
5553
#endif
5654
#endif
5755

58-
#define PORTENTA_H7_ISR_Timer PORTENTA_H7_ISRTimer
56+
#define Portenta_H7_ISR_Timer Portenta_H7_ISRTimer
5957

6058
typedef void (*timerCallback)();
6159
typedef void (*timerCallback_p)(void *);
6260

63-
class PORTENTA_H7_ISR_Timer
61+
class Portenta_H7_ISR_Timer
6462
{
6563

6664
public:
@@ -70,7 +68,7 @@ class PORTENTA_H7_ISR_Timer
7068
#define TIMER_RUN_ONCE 1
7169

7270
// constructor
73-
PORTENTA_H7_ISR_Timer();
71+
Portenta_H7_ISR_Timer();
7472

7573
void init();
7674

@@ -176,4 +174,8 @@ class PORTENTA_H7_ISR_Timer
176174
volatile int numTimers;
177175
};
178176

177+
178+
#include "Portenta_H7_ISR_Timer-Impl.h"
179+
179180
#endif // ISR_TIMER_GENERIC_H
181+

0 commit comments

Comments
 (0)