Skip to content

Commit 573602b

Browse files
committed
#42 support raw interrupt handling using std::function on ESP32 and STM32 boards
1 parent 3928617 commit 573602b

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/TaskManagerIO.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ uint32_t micros();
4040
#define delayMicroseconds(x) wait_us(x)
4141
#endif // IOA_USE_MBED
4242

43-
/**
44-
* the definition of an interrupt handler function, to be called back when an interrupt occurs.
45-
*/
46-
typedef void (*RawIntHandler)();
47-
4843
/**
4944
* Definition of a function to be called back when an interrupt is detected, marshalled by task manager into a task.
5045
* The pin that caused the interrupt is passed in the parameter on a best efforts basis.

src/TaskPlatformDeps.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,4 +371,12 @@ namespace tm_internal {
371371
#endif // _has_include
372372
#endif // GCC>=5 and !TM_ALLOW_CAPTURED_LAMBDA
373373

374+
#ifdef ESP32
375+
#define RawIntHandler std::function<void(void)>
376+
#elif ARDUINO_ARCH_STM32
377+
#define RawIntHandler callback_function_t
378+
#else
379+
typedef void (*RawIntHandler)();
380+
#endif // RAW INT checks
381+
374382
#endif //TASKMANGERIO_PLATFORMDETERMINATION_H

0 commit comments

Comments
 (0)