From d8a37b8887768ab45b82381357398057f126023a Mon Sep 17 00:00:00 2001 From: "Kai Clemens Liebich (AE/ESC2.1)" Date: Wed, 20 Nov 2019 08:47:59 +0100 Subject: [PATCH] Fixed interrupts not being reactivated. Small style updates (tab = 4 whitespaces) --- extras/Doxyfile | 2 +- extras/html/_r_e_a_d_m_e_8md_source.html | 100 ++- extras/html/_tasks_8cpp.html | 102 +-- extras/html/_tasks_8cpp_source.html | 609 +++++++++++++- extras/html/_tasks_8h.html | 122 +-- extras/html/_tasks_8h_source.html | 151 +++- .../dir_68267d1309a1af8e8297ef4c3efbcdba.html | 46 +- extras/html/doxygen.css | 169 +--- extras/html/files.html | 52 +- extras/html/globals.html | 60 +- extras/html/globals_defs.html | 60 +- extras/html/globals_func.html | 60 +- extras/html/globals_type.html | 60 +- extras/html/index.html | 50 +- extras/html/jquery.js | 21 +- extras/html/navtree.css | 7 +- extras/html/navtree.js | 50 +- extras/html/navtreedata.js | 1 - extras/html/navtreeindex0.js | 59 +- extras/html/resize.js | 153 ++-- extras/html/search/all_0.html | 2 +- extras/html/search/all_0.js | 2 +- extras/html/search/all_1.html | 2 +- extras/html/search/all_1.js | 14 +- extras/html/search/defines_0.html | 2 +- extras/html/search/files_0.html | 2 +- extras/html/search/functions_0.html | 2 +- extras/html/search/search.css | 12 +- extras/html/search/searchdata.js | 11 +- extras/html/search/typedefs_0.html | 2 +- extras/html/tabs.css | 61 +- src/Tasks.cpp | 769 +++++++++--------- src/Tasks.h | 278 +++---- 33 files changed, 1940 insertions(+), 1153 deletions(-) diff --git a/extras/Doxyfile b/extras/Doxyfile index 402bd94..0c2dadb 100644 --- a/extras/Doxyfile +++ b/extras/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "Task scheduler library" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.0 +PROJECT_NUMBER = 1.3 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/extras/html/_r_e_a_d_m_e_8md_source.html b/extras/html/_r_e_a_d_m_e_8md_source.html index c57ae18..28d72e1 100644 --- a/extras/html/_r_e_a_d_m_e_8md_source.html +++ b/extras/html/_r_e_a_d_m_e_8md_source.html @@ -3,8 +3,7 @@ - - + Task scheduler library: README.md Source File @@ -15,10 +14,14 @@ + @@ -28,9 +31,9 @@ Logo - +
Task scheduler library -  1.0 +  1.3
Arduino library for simply executing tasks in parallel
@@ -39,19 +42,38 @@ - + - - - - + +
-
1 Arduino Task Scheduler
2 ----------------------
3 
4 This library implements a simple, preemptive task scheduler that is executed in parallel to the 1ms timer interrupt
5 used for the Arduino millis() function. It allows to define cyclic tasks or tasks that should be executed in the future
6 in parallel to the normal program execution inside the main loop.
7 
8 The task scheduler is executed every 1ms. A possibly running task is interrupted by this and only resumed after all succeeding tasks have finished. This means
9 that always the task started last has the highest priority. This effect needs to be kept in mind when programming a software using this library.
10 
11 Notes:
12  - Deadlocks can appear when one task waits for another taks which was started before.
13  - Timing critical tasks may not execute properly when they are interrupted for too long by other tasks. Thus it is recommended to keep task execution as short as possible.
14  - The Arduino MEGA leaves the interrupts state shortly after starting the task scheduler which makes the scheduler reentrant and allows any other interrupt (timer, UART, etc.) to be triggered.
15  - The Arduino DUE enables other interrupts by using the lowest possible priority (15) for the task scheduler interrupt.
16 
17 Warning: The Arduino Due does not support reeantrant interrupts due to HW limitations. This means that unlike the Arduino MEGA the DUE is not able to execute
18 fast 1ms tasks several times before finishing a slower tasks with for example a 10ms timebase. This problem will be especially visible if the sum of the
19 execution time of all tasks is greater than the execution period of the fastest task.
20 
21 Supported Boards:
22  - all boards using the Atmel ATMega328 controller, e.g. Arduino Uno and Nano
23  - all boards using the Atmel ATMega2560 controller, e.g. Arduino Mega
24  - all boards using the Atmel SAM3X8E controller, e.g. Arduino Due
25 
26 Consumed interrupt:
27  - Atmel ATMega328 & ATMega2560: Scheduler uses TIMER0_COMPA interrupt. This maintains millis() and analogWrite() functionality on T0 pins. However,
28  frequent changes of the duty cycle using analogWrite() lead to a jitter in scheduler timing.
29  - Atmel SAM3X8E: Scheduler uses TC3 interrupt.
30 
31 CPU runtime:
32  - Atmel ATMega328 & ATMega2560:
33  - 5μs without pending tasks
34  - 12μs + task duration when tasks are executed
35  - Atmel SAM3X8E:
36  - tbdμs without pending tasks
37  - tbdμs + task duration when tasks are executed
38 
39 Have fun!
40 
41 ====================================
42 
43 # Revision History
44 
45 1.0 (2019-10-12):
46  - initial release
+
1 Arduino Task Scheduler
+
2 ----------------------
+
3 
+
4 This library implements a simple, preemptive task scheduler that is executed in parallel to the 1ms timer interrupt
+
5 used for the Arduino millis() function. It allows to define cyclic tasks or tasks that should be executed in the future
+
6 in parallel to the normal program execution inside the main loop.
+
7 
+
8 The task scheduler is executed every 1ms. A possibly running task is interrupted by this and only resumed after all succeeding tasks have finished. This means
+
9 that always the task started last has the highest priority. This effect needs to be kept in mind when programming a software using this library.
+
10 
+
11 Notes:
+
12  - Deadlocks can appear when one task waits for another taks which was started before.
+
13  - Timing critical tasks may not execute properly when they are interrupted for too long by other tasks. Thus it is recommended to keep task execution as short as possible.
+
14  - The Arduino MEGA leaves the interrupts state shortly after starting the task scheduler which makes the scheduler reentrant and allows any other interrupt (timer, UART, etc.) to be triggered.
+
15  - The Arduino DUE enables other interrupts by using the lowest possible priority (15) for the task scheduler interrupt.
+
16 
+
17 Warning: The Arduino Due does not support reeantrant interrupts due to HW limitations. This means that unlike the Arduino MEGA the DUE is not able to execute
+
18 fast 1ms tasks several times before finishing a slower tasks with for example a 10ms timebase. This problem will be especially visible if the sum of the
+
19 execution time of all tasks is greater than the execution period of the fastest task.
+
20 
+
21 Supported Boards:
+
22  - all boards using the Atmel ATMega328 controller, e.g. Arduino Uno and Nano
+
23  - all boards using the Atmel ATMega2560 controller, e.g. Arduino Mega
+
24  - all boards using the Atmel SAM3X8E controller, e.g. Arduino Due
+
25 
+
26 Consumed interrupt:
+
27  - Atmel ATMega328 & ATMega2560: Scheduler uses TIMER0_COMPA interrupt. This maintains millis() and analogWrite() functionality on T0 pins. However,
+
28  frequent changes of the duty cycle using analogWrite() lead to a jitter in scheduler timing.
+
29  - Atmel SAM3X8E: Scheduler uses TC3 interrupt.
+
30 
+
31 CPU runtime:
+
32  - Atmel ATMega328 & ATMega2560:
+
33  - 5μs without pending tasks
+
34  - 12μs + task duration when tasks are executed
+
35  - Atmel SAM3X8E:
+
36  - tbdμs without pending tasks
+
37  - tbdμs + task duration when tasks are executed
+
38 
+
39 Have fun!
+
40 
+
41 ====================================
+
42 
+
43 # Revision History
+
44 
+
45 1.0 (2019-10-12):
+
46  - initial release
+
diff --git a/extras/html/_tasks_8cpp.html b/extras/html/_tasks_8cpp.html index d3f3488..b841512 100644 --- a/extras/html/_tasks_8cpp.html +++ b/extras/html/_tasks_8cpp.html @@ -3,8 +3,7 @@ - - + Task scheduler library: Tasks.cpp File Reference @@ -15,10 +14,14 @@ + @@ -28,9 +31,9 @@ Logo - +
Task scheduler library -  1.0 +  1.3
Arduino library for simply executing tasks in parallel
@@ -39,19 +42,38 @@ - + - - - - + +
diff --git a/extras/html/_tasks_8h.html b/extras/html/_tasks_8h.html index 5e5f4eb..f03b499 100644 --- a/extras/html/_tasks_8h.html +++ b/extras/html/_tasks_8h.html @@ -3,8 +3,7 @@ - - + Task scheduler library: Tasks.h File Reference @@ -15,10 +14,14 @@ + @@ -28,9 +31,9 @@ Logo - +
Task scheduler library -  1.0 +  1.3
Arduino library for simply executing tasks in parallel
@@ -39,19 +42,38 @@
- + - - - - + +
- + - - - - + +
-Go to the documentation of this file.
1 
32 /*-----------------------------------------------------------------------------
33  MODULE DEFINITION FOR MULTIPLE INCLUSION
34 -----------------------------------------------------------------------------*/
35 #ifndef TASKS_H
36 #define TASKS_H
37 
38 
39 /*-----------------------------------------------------------------------------
40  INCLUDE FILES
41 -----------------------------------------------------------------------------*/
42 #include <Arduino.h>
43 
44 
45 /*-----------------------------------------------------------------------------
46  COMPILER OPTIONS
47 -----------------------------------------------------------------------------*/
48 #pragma GCC optimize ("O2")
49 
50 
51 /*-----------------------------------------------------------------------------
52  GLOBAL MACROS
53 -----------------------------------------------------------------------------*/
54 #define MAX_TASK_CNT 8
55 //#define PTR_NON_STATIC_METHOD(instance, method) [instance](){instance.method();}
56 
57 
58 /*-----------------------------------------------------------------------------
59  GLOBAL CLASS
60 -----------------------------------------------------------------------------*/
61 
62 typedef void (*Task)(void);
63 
64 
65 
73 void Tasks_Init(void);
74 
75 
76 
84 void Tasks_Clear(void);
85 
86 
87 
108 bool Tasks_Add(Task func, int16_t period, int16_t delay = 0);
109 
110 
111 
123 bool Tasks_Remove(Task func);
124 
125 
126 
145 bool Tasks_Delay(Task func, int16_t delay);
146 
147 
148 
164 bool Tasks_SetState(Task func, bool state);
165 
166 
167 
180 inline bool Tasks_Start_Task(Task func)
181  {
182  return Tasks_SetState(func, true);
183  }
184 
185 
186 
199 inline bool Tasks_Pause_Task(Task func)
200  {
201  return Tasks_SetState(func, false);
202  }
203 
204 
205 
213 void Tasks_Start(void);
214 
215 
216 
224 void Tasks_Pause(void);
225 
226 
227 #endif //TASKS_H
void(* Task)(void)
Example prototype for a function than can be executed as a task.
Definition: Tasks.h:62
-
void Tasks_Init(void)
Initialize timer and reset the tasks scheduler at first call.
Definition: Tasks.cpp:131
-
bool Tasks_SetState(Task func, bool state)
Enable or disable the execution of a task.
Definition: Tasks.cpp:375
-
bool Tasks_Add(Task func, int16_t period, int16_t delay=0)
Add a task to the task scheduler.
Definition: Tasks.cpp:174
+Go to the documentation of this file.
1 
+
32 /*-----------------------------------------------------------------------------
+
33  MODULE DEFINITION FOR MULTIPLE INCLUSION
+
34 -----------------------------------------------------------------------------*/
+
35 #ifndef TASKS_H
+
36 #define TASKS_H
+
37 
+
38 
+
39 /*-----------------------------------------------------------------------------
+
40  INCLUDE FILES
+
41 -----------------------------------------------------------------------------*/
+
42 #include <Arduino.h>
+
43 
+
44 
+
45 /*-----------------------------------------------------------------------------
+
46  COMPILER OPTIONS
+
47 -----------------------------------------------------------------------------*/
+
48 #pragma GCC optimize ("O2")
+
49 
+
50 
+
51 /*-----------------------------------------------------------------------------
+
52  GLOBAL MACROS
+
53 -----------------------------------------------------------------------------*/
+
54 #define MAX_TASK_CNT 8
+
55 //#define PTR_NON_STATIC_METHOD(instance, method) [instance](){instance.method();}
+
56 
+
57 
+
58 /*-----------------------------------------------------------------------------
+
59  GLOBAL CLASS
+
60 -----------------------------------------------------------------------------*/
+
61 
+
62 typedef void (*Task)(void);
+
63 
+
64 
+
65 
+
73 void Tasks_Init(void);
+
74 
+
75 
+
76 
+
84 void Tasks_Clear(void);
+
85 
+
86 
+
87 
+
108 bool Tasks_Add(Task func, int16_t period, int16_t delay = 0);
+
109 
+
110 
+
111 
+
123 bool Tasks_Remove(Task func);
+
124 
+
125 
+
126 
+
145 bool Tasks_Delay(Task func, int16_t delay);
+
146 
+
147 
+
148 
+
164 bool Tasks_SetState(Task func, bool state);
+
165 
+
166 
+
167 
+
180 inline bool Tasks_Start_Task(Task func)
+
181  {
+
182  return Tasks_SetState(func, true);
+
183  }
+
184 
+
185 
+
186 
+
199 inline bool Tasks_Pause_Task(Task func)
+
200  {
+
201  return Tasks_SetState(func, false);
+
202  }
+
203 
+
204 
+
205 
+
213 void Tasks_Start(void);
+
214 
+
215 
+
216 
+
224 void Tasks_Pause(void);
+
225 
+
226 
+
227 #endif //TASKS_H
+
void(* Task)(void)
Example prototype for a function than can be executed as a task.
Definition: Tasks.h:62
+
void Tasks_Init(void)
Initialize timer and reset the tasks scheduler at first call.
Definition: Tasks.cpp:130
+
bool Tasks_SetState(Task func, bool state)
Enable or disable the execution of a task.
Definition: Tasks.cpp:365
+
bool Tasks_Add(Task func, int16_t period, int16_t delay=0)
Add a task to the task scheduler.
Definition: Tasks.cpp:173
bool Tasks_Start_Task(Task func)
Activate a task in the scheduler.
Definition: Tasks.h:180
-
bool Tasks_Delay(Task func, int16_t delay)
Delay execution of a task.
Definition: Tasks.cpp:321
-
bool Tasks_Remove(Task func)
Remove a task from the task scheduler.
Definition: Tasks.cpp:259
-
void Tasks_Pause(void)
Pause the task scheduler.
Definition: Tasks.cpp:443
-
void Tasks_Clear(void)
Reset the tasks schedulder.
Definition: Tasks.cpp:145
+
bool Tasks_Delay(Task func, int16_t delay)
Delay execution of a task.
Definition: Tasks.cpp:314
+
bool Tasks_Remove(Task func)
Remove a task from the task scheduler.
Definition: Tasks.cpp:258
+
void Tasks_Pause(void)
Pause the task scheduler.
Definition: Tasks.cpp:430
+
void Tasks_Clear(void)
Reset the tasks schedulder.
Definition: Tasks.cpp:144
bool Tasks_Pause_Task(Task func)
Deactivate a task in the scheduler.
Definition: Tasks.h:199
-
void Tasks_Start(void)
Start the task scheduler.
Definition: Tasks.cpp:417
+
void Tasks_Start(void)
Start the task scheduler.
Definition: Tasks.cpp:404
@@ -105,7 +208,7 @@ + doxygen 1.8.9.1 diff --git a/extras/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/extras/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html index 6fcfd9a..ae19efb 100644 --- a/extras/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/extras/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -3,8 +3,7 @@ - - + Task scheduler library: src Directory Reference @@ -15,10 +14,14 @@ + @@ -28,9 +31,9 @@ Logo - +
Task scheduler library -  1.0 +  1.3
Arduino library for simply executing tasks in parallel
@@ -39,19 +42,32 @@ - + - - - - +
diff --git a/extras/html/doxygen.css b/extras/html/doxygen.css index 4f1ab91..a000833 100644 --- a/extras/html/doxygen.css +++ b/extras/html/doxygen.css @@ -1,13 +1,9 @@ -/* The standard CSS for doxygen 1.8.13 */ +/* The standard CSS for doxygen 1.8.9.1 */ body, table, div, p, dl { font: 400 14px/22px Roboto,sans-serif; } -p.reference, p.definition { - font: 400 14px/22px Roboto,sans-serif; -} - /* @group Heading Levels */ h1.groupheader { @@ -177,7 +173,7 @@ pre.fragment { } div.fragment { - padding: 0px; + padding: 4px 6px; margin: 4px 8px 4px 2px; background-color: #FBFCFD; border: 1px solid #C4CFE5; @@ -210,11 +206,6 @@ div.line { transition-duration: 0.5s; } -div.line:after { - content:"\000A"; - white-space: pre; -} - div.line.glow { background-color: cyan; box-shadow: 0 0 10px cyan; @@ -236,15 +227,6 @@ span.lineno a:hover { background-color: #C8C8C8; } -.lineno { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - div.ah, span.ah { background-color: black; font-weight: bold; @@ -260,7 +242,7 @@ div.ah, span.ah { -webkit-box-shadow: 2px 2px 3px #999; -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); - background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000 110%); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); } div.classindex ul { @@ -514,29 +496,6 @@ table.memberdecls { /* Styles for detailed member documentation */ -.memtitle { - padding: 8px; - border-top: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; - border-top-right-radius: 4px; - border-top-left-radius: 4px; - margin-bottom: -1px; - background-image: url('nav_f.png'); - background-repeat: repeat-x; - background-color: #E2E8F2; - line-height: 1.25; - font-weight: 300; - float:left; -} - -.permalink -{ - font-size: 65%; - display: inline-block; - vertical-align: middle; -} - .memtemplate { font-size: 80%; color: #4665A2; @@ -575,7 +534,7 @@ table.memberdecls { } .memname { - font-weight: 400; + font-weight: bold; margin-left: 6px; } @@ -591,24 +550,24 @@ table.memberdecls { color: #253555; font-weight: bold; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - background-color: #DFE5F1; + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; /* opera specific markup */ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); border-top-right-radius: 4px; + border-top-left-radius: 4px; /* firefox specific markup */ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; -moz-border-radius-topright: 4px; + -moz-border-radius-topleft: 4px; /* webkit specific markup */ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -webkit-border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; } -.overload { - font-family: "courier new",courier,monospace; - font-size: 65%; -} - .memdoc, dl.reflist dd { border-bottom: 1px solid #A8B8D9; border-left: 1px solid #A8B8D9; @@ -873,10 +832,6 @@ address { color: #2A3D61; } -table.doxtable caption { - caption-side: top; -} - table.doxtable { border-collapse:collapse; margin-top: 4px; @@ -950,7 +905,6 @@ table.fieldtable { padding-bottom: 4px; padding-top: 5px; text-align:left; - font-weight: 400; -moz-border-radius-topleft: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-left-radius: 4px; @@ -1043,18 +997,6 @@ div.summary a white-space: nowrap; } -table.classindex -{ - margin: 10px; - white-space: nowrap; - margin-left: 3%; - margin-right: 3%; - width: 94%; - border: 0; - border-spacing: 0; - padding: 0; -} - div.ingroups { font-size: 8pt; @@ -1166,11 +1108,6 @@ dl.section dd { border: 0px none; } -#projectalign -{ - vertical-align: middle; -} - #projectname { font: 300% Tahoma, Arial,sans-serif; @@ -1215,11 +1152,6 @@ dl.section dd { text-align: center; } -.plantumlgraph -{ - text-align: center; -} - .diagraph { text-align: center; @@ -1259,7 +1191,7 @@ div.toc { border-radius: 7px 7px 7px 7px; float: right; height: auto; - margin: 0 8px 10px 10px; + margin: 0 20px 10px 10px; width: 200px; } @@ -1515,82 +1447,3 @@ tr.heading h2 { } } -/* @group Markdown */ - -/* -table.markdownTable { - border-collapse:collapse; - margin-top: 4px; - margin-bottom: 4px; -} - -table.markdownTable td, table.markdownTable th { - border: 1px solid #2D4068; - padding: 3px 7px 2px; -} - -table.markdownTableHead tr { -} - -table.markdownTableBodyLeft td, table.markdownTable th { - border: 1px solid #2D4068; - padding: 3px 7px 2px; -} - -th.markdownTableHeadLeft th.markdownTableHeadRight th.markdownTableHeadCenter th.markdownTableHeadNone { - background-color: #374F7F; - color: #FFFFFF; - font-size: 110%; - padding-bottom: 4px; - padding-top: 5px; -} - -th.markdownTableHeadLeft { - text-align: left -} - -th.markdownTableHeadRight { - text-align: right -} - -th.markdownTableHeadCenter { - text-align: center -} -*/ - -table.markdownTable { - border-collapse:collapse; - margin-top: 4px; - margin-bottom: 4px; -} - -table.markdownTable td, table.markdownTable th { - border: 1px solid #2D4068; - padding: 3px 7px 2px; -} - -table.markdownTable tr { -} - -th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { - background-color: #374F7F; - color: #FFFFFF; - font-size: 110%; - padding-bottom: 4px; - padding-top: 5px; -} - -th.markdownTableHeadLeft, td.markdownTableBodyLeft { - text-align: left -} - -th.markdownTableHeadRight, td.markdownTableBodyRight { - text-align: right -} - -th.markdownTableHeadCenter, td.markdownTableBodyCenter { - text-align: center -} - - -/* @end */ diff --git a/extras/html/files.html b/extras/html/files.html index 7797887..505fccd 100644 --- a/extras/html/files.html +++ b/extras/html/files.html @@ -3,8 +3,7 @@ - - + Task scheduler library: File List @@ -15,10 +14,14 @@ + @@ -28,9 +31,9 @@ Logo - +
Task scheduler library -  1.0 +  1.3
Arduino library for simply executing tasks in parallel
@@ -39,19 +42,38 @@
- + - - - - + +
diff --git a/extras/html/globals.html b/extras/html/globals.html index 98ad218..3703059 100644 --- a/extras/html/globals.html +++ b/extras/html/globals.html @@ -3,8 +3,7 @@ - - + Task scheduler library: Globals @@ -15,10 +14,14 @@ + @@ -28,9 +31,9 @@ Logo - +
Task scheduler library -  1.0 +  1.3
Arduino library for simply executing tasks in parallel
@@ -39,19 +42,46 @@
- + - - - - + + +
diff --git a/extras/html/globals_defs.html b/extras/html/globals_defs.html index baf530d..1985aa2 100644 --- a/extras/html/globals_defs.html +++ b/extras/html/globals_defs.html @@ -3,8 +3,7 @@ - - + Task scheduler library: Globals @@ -15,10 +14,14 @@ + @@ -28,9 +31,9 @@ Logo - +
Task scheduler library -  1.0 +  1.3
Arduino library for simply executing tasks in parallel
@@ -39,19 +42,46 @@
- + - - - - + + +
diff --git a/extras/html/globals_func.html b/extras/html/globals_func.html index 29e118c..6c07aa8 100644 --- a/extras/html/globals_func.html +++ b/extras/html/globals_func.html @@ -3,8 +3,7 @@ - - + Task scheduler library: Globals @@ -15,10 +14,14 @@ + @@ -28,9 +31,9 @@ Logo - +
Task scheduler library -  1.0 +  1.3
Arduino library for simply executing tasks in parallel
@@ -39,19 +42,46 @@
- + - - - - + + +
diff --git a/extras/html/globals_type.html b/extras/html/globals_type.html index b0f1745..61c34f8 100644 --- a/extras/html/globals_type.html +++ b/extras/html/globals_type.html @@ -3,8 +3,7 @@ - - + Task scheduler library: Globals @@ -15,10 +14,14 @@ + @@ -28,9 +31,9 @@ Logo - +
Task scheduler library -  1.0 +  1.3
Arduino library for simply executing tasks in parallel
@@ -39,19 +42,46 @@
- + - - - - + + +
diff --git a/extras/html/index.html b/extras/html/index.html index a3169d2..5527654 100644 --- a/extras/html/index.html +++ b/extras/html/index.html @@ -3,9 +3,8 @@ - - -Task scheduler library: Arduino Task Scheduler + +Task scheduler library: Main Page @@ -15,10 +14,14 @@ + @@ -28,9 +31,9 @@ Logo - +
Task scheduler library -  1.0 +  1.3
Arduino library for simply executing tasks in parallel
@@ -39,19 +42,32 @@
- + - - - - +

This library implements a simple, preemptive task scheduler that is executed in parallel to the 1ms timer interrupt used for the Arduino millis() function. It allows to define cyclic tasks or tasks that should be executed in the future in parallel to the normal program execution inside the main loop.

@@ -128,7 +144,7 @@

Revision History

    + doxygen 1.8.9.1
diff --git a/extras/html/jquery.js b/extras/html/jquery.js index f5343ed..1f4d0b4 100644 --- a/extras/html/jquery.js +++ b/extras/html/jquery.js @@ -65,23 +65,4 @@ Released under MIT license. https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt */ -(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{a(jQuery)}}(function(k){var A=k(document),s=k(window),w=k("body");var n="displayController",e="hasActiveHover",d="forcedOpen",u="hasMouseMove",f="mouseOnToPopup",g="originalTitle",y="powertip",o="powertipjq",l="powertiptarget",E=180/Math.PI;var c={isTipOpen:false,isFixedTipOpen:false,isClosing:false,tipOpenImminent:false,activeHover:null,currentX:0,currentY:0,previousX:0,previousY:0,desyncTimeout:null,mouseTrackingActive:false,delayInProgress:false,windowWidth:0,windowHeight:0,scrollTop:0,scrollLeft:0};var p={none:0,top:1,bottom:2,left:4,right:8};k.fn.powerTip=function(F,N){if(!this.length){return this}if(k.type(F)==="string"&&k.powerTip[F]){return k.powerTip[F].call(this,this,N)}var O=k.extend({},k.fn.powerTip.defaults,F),G=new x(O);h();this.each(function M(){var R=k(this),Q=R.data(y),P=R.data(o),T=R.data(l),S;if(R.data(n)){k.powerTip.destroy(R)}S=R.attr("title");if(!Q&&!T&&!P&&S){R.data(y,S);R.data(g,S);R.removeAttr("title")}R.data(n,new t(R,O,G))});if(!O.manual){this.on({"mouseenter.powertip":function J(P){k.powerTip.show(this,P)},"mouseleave.powertip":function L(){k.powerTip.hide(this)},"focus.powertip":function K(){k.powerTip.show(this)},"blur.powertip":function H(){k.powerTip.hide(this,true)},"keydown.powertip":function I(P){if(P.keyCode===27){k.powerTip.hide(this,true)}}})}return this};k.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:false,popupId:"powerTip",intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:false,offset:10,mouseOnToPopup:false,manual:false};k.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se","n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]};k.powerTip={show:function z(F,G){if(G){i(G);c.previousX=G.pageX;c.previousY=G.pageY;k(F).data(n).show()}else{k(F).first().data(n).show(true,true)}return F},reposition:function r(F){k(F).first().data(n).resetPosition();return F},hide:function D(G,F){if(G){k(G).first().data(n).hide(F)}else{if(c.activeHover){c.activeHover.data(n).hide(true)}}return G},destroy:function C(G){k(G).off(".powertip").each(function F(){var I=k(this),H=[g,n,e,d];if(I.data(g)){I.attr("title",I.data(g));H.push(y)}I.removeData(H)});return G}};k.powerTip.showTip=k.powerTip.show;k.powerTip.closeTip=k.powerTip.hide;function b(){var F=this;F.top="auto";F.left="auto";F.right="auto";F.bottom="auto";F.set=function(H,G){if(k.isNumeric(G)){F[H]=Math.round(G)}}}function t(K,N,F){var J=null;function L(P,Q){M();if(!K.data(e)){if(!P){c.tipOpenImminent=true;J=setTimeout(function O(){J=null;I()},N.intentPollInterval)}else{if(Q){K.data(d,true)}F.showTip(K)}}}function G(P){M();c.tipOpenImminent=false;if(K.data(e)){K.data(d,false);if(!P){c.delayInProgress=true;J=setTimeout(function O(){J=null;F.hideTip(K);c.delayInProgress=false},N.closeDelay)}else{F.hideTip(K)}}}function I(){var Q=Math.abs(c.previousX-c.currentX),O=Math.abs(c.previousY-c.currentY),P=Q+O;if(P",{id:Q.popupId});if(w.length===0){w=k("body")}w.append(O)}if(Q.followMouse){if(!O.data(u)){A.on("mousemove",M);s.on("scroll",M);O.data(u,true)}}if(Q.mouseOnToPopup){O.on({mouseenter:function L(){if(O.data(f)){if(c.activeHover){c.activeHover.data(n).cancel()}}},mouseleave:function N(){if(c.activeHover){c.activeHover.data(n).hide()}}})}function I(S){S.data(e,true);O.queue(function R(T){H(S);T()})}function H(S){var U;if(!S.data(e)){return}if(c.isTipOpen){if(!c.isClosing){K(c.activeHover)}O.delay(100).queue(function R(V){H(S);V()});return}S.trigger("powerTipPreRender");U=B(S);if(U){O.empty().append(U)}else{return}S.trigger("powerTipRender");c.activeHover=S;c.isTipOpen=true;O.data(f,Q.mouseOnToPopup);if(!Q.followMouse){G(S);c.isFixedTipOpen=true}else{M()}O.fadeIn(Q.fadeInTime,function T(){if(!c.desyncTimeout){c.desyncTimeout=setInterval(J,500)}S.trigger("powerTipOpen")})}function K(R){c.isClosing=true;c.activeHover=null;c.isTipOpen=false;c.desyncTimeout=clearInterval(c.desyncTimeout);R.data(e,false);R.data(d,false);O.fadeOut(Q.fadeOutTime,function S(){var T=new b();c.isClosing=false;c.isFixedTipOpen=false;O.removeClass();T.set("top",c.currentY+Q.offset);T.set("left",c.currentX+Q.offset);O.css(T);R.trigger("powerTipClose")})}function M(){if(!c.isFixedTipOpen&&(c.isTipOpen||(c.tipOpenImminent&&O.data(u)))){var R=O.outerWidth(),V=O.outerHeight(),U=new b(),S,T;U.set("top",c.currentY+Q.offset);U.set("left",c.currentX+Q.offset);S=m(U,R,V);if(S!==p.none){T=a(S);if(T===1){if(S===p.right){U.set("left",c.windowWidth-R)}else{if(S===p.bottom){U.set("top",c.scrollTop+c.windowHeight-V)}}}else{U.set("left",c.currentX-R-Q.offset);U.set("top",c.currentY-V-Q.offset)}}O.css(U)}}function G(S){var R,T;if(Q.smartPlacement){R=k.fn.powerTip.smartPlacementLists[Q.placement];k.each(R,function(U,W){var V=m(F(S,W),O.outerWidth(),O.outerHeight());T=W;if(V===p.none){return false}})}else{F(S,Q.placement);T=Q.placement}O.addClass(T)}function F(U,T){var R=0,S,W,V=new b();V.set("top",0);V.set("left",0);O.css(V);do{S=O.outerWidth();W=O.outerHeight();V=P.compute(U,T,S,W,Q.offset);O.css(V)}while(++R<=5&&(S!==O.outerWidth()||W!==O.outerHeight()));return V}function J(){var R=false;if(c.isTipOpen&&!c.isClosing&&!c.delayInProgress){if(c.activeHover.data(e)===false||c.activeHover.is(":disabled")){R=true}else{if(!v(c.activeHover)&&!c.activeHover.is(":focus")&&!c.activeHover.data(d)){if(O.data(f)){if(!v(O)){R=true}}else{R=true}}}if(R){K(c.activeHover)}}}this.showTip=I;this.hideTip=K;this.resetPosition=G}function q(F){return window.SVGElement&&F[0] instanceof SVGElement}function h(){if(!c.mouseTrackingActive){c.mouseTrackingActive=true;k(function H(){c.scrollLeft=s.scrollLeft();c.scrollTop=s.scrollTop();c.windowWidth=s.width();c.windowHeight=s.height()});A.on("mousemove",i);s.on({resize:function G(){c.windowWidth=s.width();c.windowHeight=s.height()},scroll:function F(){var I=s.scrollLeft(),J=s.scrollTop();if(I!==c.scrollLeft){c.currentX+=I-c.scrollLeft;c.scrollLeft=I}if(J!==c.scrollTop){c.currentY+=J-c.scrollTop;c.scrollTop=J}}})}}function i(F){c.currentX=F.pageX;c.currentY=F.pageY}function v(F){var H=F.offset(),J=F[0].getBoundingClientRect(),I=J.right-J.left,G=J.bottom-J.top;return c.currentX>=H.left&&c.currentX<=H.left+I&&c.currentY>=H.top&&c.currentY<=H.top+G}function B(I){var G=I.data(y),F=I.data(o),K=I.data(l),H,J;if(G){if(k.isFunction(G)){G=G.call(I[0])}J=G}else{if(F){if(k.isFunction(F)){F=F.call(I[0])}if(F.length>0){J=F.clone(true,true)}}else{if(K){H=k("#"+K);if(H.length>0){J=H.html()}}}}return J}function m(M,L,K){var G=c.scrollTop,J=c.scrollLeft,I=G+c.windowHeight,F=J+c.windowWidth,H=p.none;if(M.topI||Math.abs(M.bottom-c.windowHeight)>I){H|=p.bottom}if(M.leftF){H|=p.left}if(M.left+L>F||M.right1){return}h.preventDefault();var j=h.originalEvent.changedTouches[0],g=document.createEvent("MouseEvents");g.initMouseEvent(i,true,true,window,1,j.screenX,j.screenY,j.clientX,j.clientY,false,false,false,false,0,null);h.target.dispatchEvent(g)}d._touchStart=function(h){var g=this;if(a||!g._mouseCapture(h.originalEvent.changedTouches[0])){return}a=true;g._touchMoved=false;e(h,"mouseover");e(h,"mousemove");e(h,"mousedown")};d._touchMove=function(g){if(!a){return}this._touchMoved=true;e(g,"mousemove")};d._touchEnd=function(g){if(!a){return}e(g,"mouseup");e(g,"mouseout");if(!this._touchMoved){e(g,"click")}a=false};d._mouseInit=function(){var g=this;g.element.bind({touchstart:b.proxy(g,"_touchStart"),touchmove:b.proxy(g,"_touchMove"),touchend:b.proxy(g,"_touchEnd")});f.call(g)};d._mouseDestroy=function(){var g=this;g.element.unbind({touchstart:b.proxy(g,"_touchStart"),touchmove:b.proxy(g,"_touchMove"),touchend:b.proxy(g,"_touchEnd")});c.call(g)}})(jQuery);/*! - * SmartMenus jQuery Plugin - v1.0.0 - January 27, 2016 - * http://www.smartmenus.org/ - * - * Copyright Vasil Dinkov, Vadikom Web Ltd. - * http://vadikom.com - * - * Licensed MIT - */ -(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{if(typeof module==="object"&&typeof module.exports==="object"){module.exports=a(require("jquery"))}else{a(jQuery)}}}(function(a){var b=[],e=!!window.createPopup,f=false,d="ontouchstart" in window,h=false,g=window.requestAnimationFrame||function(l){return setTimeout(l,1000/60)},c=window.cancelAnimationFrame||function(l){clearTimeout(l)};function k(m){var n=".smartmenus_mouse";if(!h&&!m){var o=true,l=null;a(document).bind(i([["mousemove",function(s){var t={x:s.pageX,y:s.pageY,timeStamp:new Date().getTime()};if(l){var q=Math.abs(l.x-t.x),p=Math.abs(l.y-t.y);if((q>0||p>0)&&q<=2&&p<=2&&t.timeStamp-l.timeStamp<=300){f=true;if(o){var r=a(s.target).closest("a");if(r.is("a")){a.each(b,function(){if(a.contains(this.$root[0],r[0])){this.itemEnter({currentTarget:r[0]});return false}})}o=false}}}l=t}],[d?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut",function(p){if(j(p.originalEvent)){f=false}}]],n));h=true}else{if(h&&m){a(document).unbind(n);h=false}}}function j(l){return !/^(4|mouse)$/.test(l.pointerType)}function i(l,n){if(!n){n=""}var m={};a.each(l,function(o,p){m[p[0].split(" ").join(n+" ")+n]=p[1]});return m}a.SmartMenus=function(m,l){this.$root=a(m);this.opts=l;this.rootId="";this.accessIdPrefix="";this.$subArrow=null;this.activatedItems=[];this.visibleSubMenus=[];this.showTimeout=0;this.hideTimeout=0;this.scrollTimeout=0;this.clickActivated=false;this.focusActivated=false;this.zIndexInc=0;this.idInc=0;this.$firstLink=null;this.$firstSub=null;this.disabled=false;this.$disableOverlay=null;this.$touchScrollingSub=null;this.cssTransforms3d="perspective" in m.style||"webkitPerspective" in m.style;this.wasCollapsible=false;this.init()};a.extend(a.SmartMenus,{hideAll:function(){a.each(b,function(){this.menuHideAll()})},destroy:function(){while(b.length){b[0].destroy()}k(true)},prototype:{init:function(n){var l=this;if(!n){b.push(this);this.rootId=(new Date().getTime()+Math.random()+"").replace(/\D/g,"");this.accessIdPrefix="sm-"+this.rootId+"-";if(this.$root.hasClass("sm-rtl")){this.opts.rightToLeftSubMenus=true}var r=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).bind(i([["mouseover focusin",a.proxy(this.rootOver,this)],["mouseout focusout",a.proxy(this.rootOut,this)],["keydown",a.proxy(this.rootKeyDown,this)]],r)).delegate("a",i([["mouseenter",a.proxy(this.itemEnter,this)],["mouseleave",a.proxy(this.itemLeave,this)],["mousedown",a.proxy(this.itemDown,this)],["focus",a.proxy(this.itemFocus,this)],["blur",a.proxy(this.itemBlur,this)],["click",a.proxy(this.itemClick,this)]],r));r+=this.rootId;if(this.opts.hideOnClick){a(document).bind(i([["touchstart",a.proxy(this.docTouchStart,this)],["touchmove",a.proxy(this.docTouchMove,this)],["touchend",a.proxy(this.docTouchEnd,this)],["click",a.proxy(this.docClick,this)]],r))}a(window).bind(i([["resize orientationchange",a.proxy(this.winResize,this)]],r));if(this.opts.subIndicators){this.$subArrow=a("").addClass("sub-arrow");if(this.opts.subIndicatorsText){this.$subArrow.html(this.opts.subIndicatorsText)}}k()}this.$firstSub=this.$root.find("ul").each(function(){l.menuInit(a(this))}).eq(0);this.$firstLink=this.$root.find("a").eq(0);if(this.opts.markCurrentItem){var p=/(index|default)\.[^#\?\/]*/i,m=/#.*/,q=window.location.href.replace(p,""),o=q.replace(m,"");this.$root.find("a").each(function(){var s=this.href.replace(p,""),t=a(this);if(s==q||s==o){t.addClass("current");if(l.opts.markCurrentTree){t.parentsUntil("[data-smartmenus-id]","ul").each(function(){a(this).dataSM("parent-a").addClass("current")})}}})}this.wasCollapsible=this.isCollapsible()},destroy:function(m){if(!m){var n=".smartmenus";this.$root.removeData("smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").unbind(n).undelegate(n);n+=this.rootId;a(document).unbind(n);a(window).unbind(n);if(this.opts.subIndicators){this.$subArrow=null}}this.menuHideAll();var l=this;this.$root.find("ul").each(function(){var o=a(this);if(o.dataSM("scroll-arrows")){o.dataSM("scroll-arrows").remove()}if(o.dataSM("shown-before")){if(l.opts.subMenusMinWidth||l.opts.subMenusMaxWidth){o.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap")}if(o.dataSM("scroll-arrows")){o.dataSM("scroll-arrows").remove()}o.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})}if((o.attr("id")||"").indexOf(l.accessIdPrefix)==0){o.removeAttr("id")}}).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("ie-shim").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded");this.$root.find("a.has-submenu").each(function(){var o=a(this);if(o.attr("id").indexOf(l.accessIdPrefix)==0){o.removeAttr("id")}}).removeClass("has-submenu").removeDataSM("sub").removeAttr("aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM("sub");if(this.opts.subIndicators){this.$root.find("span.sub-arrow").remove()}if(this.opts.markCurrentItem){this.$root.find("a.current").removeClass("current")}if(!m){this.$root=null;this.$firstLink=null;this.$firstSub=null;if(this.$disableOverlay){this.$disableOverlay.remove();this.$disableOverlay=null}b.splice(a.inArray(this,b),1)}},disable:function(l){if(!this.disabled){this.menuHideAll();if(!l&&!this.opts.isPopup&&this.$root.is(":visible")){var m=this.$root.offset();this.$disableOverlay=a('
').css({position:"absolute",top:m.top,left:m.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(true),opacity:0}).appendTo(document.body)}this.disabled=true}},docClick:function(l){if(this.$touchScrollingSub){this.$touchScrollingSub=null;return}if(this.visibleSubMenus.length&&!a.contains(this.$root[0],l.target)||a(l.target).is("a")){this.menuHideAll()}},docTouchEnd:function(m){if(!this.lastTouch){return}if(this.visibleSubMenus.length&&(this.lastTouch.x2===undefined||this.lastTouch.x1==this.lastTouch.x2)&&(this.lastTouch.y2===undefined||this.lastTouch.y1==this.lastTouch.y2)&&(!this.lastTouch.target||!a.contains(this.$root[0],this.lastTouch.target))){if(this.hideTimeout){clearTimeout(this.hideTimeout);this.hideTimeout=0}var l=this;this.hideTimeout=setTimeout(function(){l.menuHideAll()},350)}this.lastTouch=null},docTouchMove:function(m){if(!this.lastTouch){return}var l=m.originalEvent.touches[0];this.lastTouch.x2=l.pageX;this.lastTouch.y2=l.pageY},docTouchStart:function(m){var l=m.originalEvent.touches[0];this.lastTouch={x1:l.pageX,y1:l.pageY,target:l.target}},enable:function(){if(this.disabled){if(this.$disableOverlay){this.$disableOverlay.remove();this.$disableOverlay=null}this.disabled=false}},getClosestMenu:function(m){var l=a(m).closest("ul");while(l.dataSM("in-mega")){l=l.parent().closest("ul")}return l[0]||null},getHeight:function(l){return this.getOffset(l,true)},getOffset:function(n,l){var m;if(n.css("display")=="none"){m={position:n[0].style.position,visibility:n[0].style.visibility};n.css({position:"absolute",visibility:"hidden"}).show()}var o=n[0].getBoundingClientRect&&n[0].getBoundingClientRect(),p=o&&(l?o.height||o.bottom-o.top:o.width||o.right-o.left);if(!p&&p!==0){p=l?n[0].offsetHeight:n[0].offsetWidth}if(m){n.hide().css(m)}return p},getStartZIndex:function(l){var m=parseInt(this[l?"$root":"$firstSub"].css("z-index"));if(!l&&isNaN(m)){m=parseInt(this.$root.css("z-index"))}return !isNaN(m)?m:1},getTouchPoint:function(l){return l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0]||l},getViewport:function(l){var m=l?"Height":"Width",o=document.documentElement["client"+m],n=window["inner"+m];if(n){o=Math.min(o,n)}return o},getViewportHeight:function(){return this.getViewport(true)},getViewportWidth:function(){return this.getViewport()},getWidth:function(l){return this.getOffset(l)},handleEvents:function(){return !this.disabled&&this.isCSSOn()},handleItemEvents:function(l){return this.handleEvents()&&!this.isLinkInMegaMenu(l)},isCollapsible:function(){return this.$firstSub.css("position")=="static"},isCSSOn:function(){return this.$firstLink.css("display")=="block"},isFixed:function(){var l=this.$root.css("position")=="fixed";if(!l){this.$root.parentsUntil("body").each(function(){if(a(this).css("position")=="fixed"){l=true;return false}})}return l},isLinkInMegaMenu:function(l){return a(this.getClosestMenu(l[0])).hasClass("mega-menu")},isTouchMode:function(){return !f||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function(p,l){var n=p.closest("ul"),q=n.dataSM("level");if(q>1&&(!this.activatedItems[q-2]||this.activatedItems[q-2][0]!=n.dataSM("parent-a")[0])){var m=this;a(n.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(n).each(function(){m.itemActivate(a(this).dataSM("parent-a"))})}if(!this.isCollapsible()||l){this.menuHideSubMenus(!this.activatedItems[q-1]||this.activatedItems[q-1][0]!=p[0]?q-1:q)}this.activatedItems[q-1]=p;if(this.$root.triggerHandler("activate.smapi",p[0])===false){return}var o=p.dataSM("sub");if(o&&(this.isTouchMode()||(!this.opts.showOnClick||this.clickActivated))){this.menuShow(o)}},itemBlur:function(m){var l=a(m.currentTarget);if(!this.handleItemEvents(l)){return}this.$root.triggerHandler("blur.smapi",l[0])},itemClick:function(o){var n=a(o.currentTarget);if(!this.handleItemEvents(n)){return}if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==n.closest("ul")[0]){this.$touchScrollingSub=null;o.stopPropagation();return false}if(this.$root.triggerHandler("click.smapi",n[0])===false){return false}var p=a(o.target).is("span.sub-arrow"),m=n.dataSM("sub"),l=m?m.dataSM("level")==2:false;if(m&&!m.is(":visible")){if(this.opts.showOnClick&&l){this.clickActivated=true}this.itemActivate(n);if(m.is(":visible")){this.focusActivated=true;return false}}else{if(this.isCollapsible()&&p){this.itemActivate(n);this.menuHide(m);return false}}if(this.opts.showOnClick&&l||n.hasClass("disabled")||this.$root.triggerHandler("select.smapi",n[0])===false){return false}},itemDown:function(m){var l=a(m.currentTarget);if(!this.handleItemEvents(l)){return}l.dataSM("mousedown",true)},itemEnter:function(n){var m=a(n.currentTarget);if(!this.handleItemEvents(m)){return}if(!this.isTouchMode()){if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=0}var l=this;this.showTimeout=setTimeout(function(){l.itemActivate(m)},this.opts.showOnClick&&m.closest("ul").dataSM("level")==1?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",m[0])},itemFocus:function(m){var l=a(m.currentTarget);if(!this.handleItemEvents(l)){return}if(this.focusActivated&&(!this.isTouchMode()||!l.dataSM("mousedown"))&&(!this.activatedItems.length||this.activatedItems[this.activatedItems.length-1][0]!=l[0])){this.itemActivate(l,true)}this.$root.triggerHandler("focus.smapi",l[0])},itemLeave:function(m){var l=a(m.currentTarget);if(!this.handleItemEvents(l)){return}if(!this.isTouchMode()){l[0].blur();if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=0}}l.removeDataSM("mousedown");this.$root.triggerHandler("mouseleave.smapi",l[0])},menuHide:function(m){if(this.$root.triggerHandler("beforehide.smapi",m[0])===false){return}m.stop(true,true);if(m.css("display")!="none"){var l=function(){m.css("z-index","")};if(this.isCollapsible()){if(this.opts.collapsibleHideFunction){this.opts.collapsibleHideFunction.call(this,m,l)}else{m.hide(this.opts.collapsibleHideDuration,l)}}else{if(this.opts.hideFunction){this.opts.hideFunction.call(this,m,l)}else{m.hide(this.opts.hideDuration,l)}}if(m.dataSM("ie-shim")){m.dataSM("ie-shim").remove().css({"-webkit-transform":"",transform:""})}if(m.dataSM("scroll")){this.menuScrollStop(m);m.css({"touch-action":"","-ms-touch-action":"","-webkit-transform":"",transform:""}).unbind(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()}m.dataSM("parent-a").removeClass("highlighted").attr("aria-expanded","false");m.attr({"aria-expanded":"false","aria-hidden":"true"});var n=m.dataSM("level");this.activatedItems.splice(n-1,1);this.visibleSubMenus.splice(a.inArray(m,this.visibleSubMenus),1);this.$root.triggerHandler("hide.smapi",m[0])}},menuHideAll:function(){if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=0}var m=this.opts.isPopup?1:0;for(var l=this.visibleSubMenus.length-1;l>=m;l--){this.menuHide(this.visibleSubMenus[l])}if(this.opts.isPopup){this.$root.stop(true,true);if(this.$root.is(":visible")){if(this.opts.hideFunction){this.opts.hideFunction.call(this,this.$root)}else{this.$root.hide(this.opts.hideDuration)}if(this.$root.dataSM("ie-shim")){this.$root.dataSM("ie-shim").remove()}}}this.activatedItems=[];this.visibleSubMenus=[];this.clickActivated=false;this.focusActivated=false;this.zIndexInc=0;this.$root.triggerHandler("hideAll.smapi")},menuHideSubMenus:function(n){for(var l=this.activatedItems.length-1;l>=n;l--){var m=this.activatedItems[l].dataSM("sub");if(m){this.menuHide(m)}}},menuIframeShim:function(l){if(e&&this.opts.overlapControlsInIE&&!l.dataSM("ie-shim")){l.dataSM("ie-shim",a("