File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44#include <Arduino.h>
55
66/* Uncomment this to allow Exception Handling functionality */
7- #define _PROCESS_EXCEPTION_HANDLING
7+ // #define _PROCESS_EXCEPTION_HANDLING
88
99/* Uncomment this to allow the scheduler to interrupt long running processes */
1010// This requires _PROCESS_EXCEPTION_HANDLING to also be enabled
11- #define _PROCESS_TIMEOUT_INTERRUPTS
11+ // #define _PROCESS_TIMEOUT_INTERRUPTS
1212
1313/* Uncomment this to allow Process timing statistics functionality */
1414#define _PROCESS_STATISTICS
Original file line number Diff line number Diff line change @@ -78,4 +78,8 @@ typedef enum ProcessWarning
7878 #error "'_PROCESS_EXCEPTION_HANDLING' is not supported on the ESP8266."
7979#endif
8080
81+
82+ #if defined(_PROCESS_TIMEOUT_INTERRUPTS) && !defined(_PROCESS_EXCEPTION_HANDLING)
83+ #error "'_PROCESS_TIMEOUT_INTERRUPTS' requires enabling `_PROCESS_EXCEPTION_HANDLING`"
84+ #endif
8185#endif
Original file line number Diff line number Diff line change 22#include " Process.h"
33
44Process *Scheduler::_active = NULL ;
5+
6+ #ifdef _PROCESS_EXCEPTION_HANDLING
57jmp_buf Scheduler::_env = {};
8+ #endif
69
10+ #ifdef _PROCESS_TIMEOUT_INTERRUPTS
711ISR (TIMER0_COMPA_vect)
812{
913 if (Scheduler::getActive ()) { // routine is running
@@ -12,7 +16,7 @@ ISR(TIMER0_COMPA_vect)
1216 longjmp (Scheduler::_env, LONGJMP_ISR_CODE);
1317 }
1418}
15-
19+ # endif
1620
1721Scheduler::Scheduler ()
1822: _pLevels{}
You can’t perform that action at this time.
0 commit comments