1 2 3 4 5 6 7 8 9
10 11 12 13
14 package ti.sysbios.knl;
15
16 import xdc.rov.ViewInfo;
17
18 /*!
19 * ======== Idle ========
20 * Idle Thread Manager.
21 *
22 * The Idle module is used to specify the list of functions to be called
23 * when no other tasks are running in the system.
24 *
25 * If tasking is enabled, then the Task module will create an "Idle task"
26 * with the lowest possible priority. When no other tasks are running, this
27 * idle task runs in an infinite loop, calling the list of functions
28 * specified by the Idle module.
29 *
30 * If tasking is disabled, then the idle functions are called in an infinite
31 * loop after main and any Module startup functions.
32 *
33 * The list of idle functions is only statically configurable; it cannot be
34 * modified at runtime.
35 */
36
37 module Idle
38 {
39 /*! Idle function type definition. */
40 typedef Void (*FuncPtr)();
41
42 metaonly struct ModuleView {
43 String IdleFunctions[];
44 }
45
46 /*! @_nodoc */
47 @Facet
48 metaonly config ViewInfo.Instance rovViewInfo =
49 xdc.rov.ViewInfo.create({
50 viewMap: [
51 ['Module', {type: ViewInfo.MODULE, viewInitFxn: 'viewInitModule', structName: 'ModuleView'}]
52 ]
53 });
54
55 /*!
56 * ======== funcList ========
57 * The array of functions to be called when no other Tasks are running.
58 */
59 config FuncPtr funcList[length] = [];
60
61 /*!
62 * ======== addFunc ========
63 * Statically add a function to the Idle function list.
64 */
65 metaonly Void addFunc(FuncPtr func);
66
67 /*!
68 * ======== loop ========
69 * @_nodoc
70 * Idle loop which calls the idle functions in an infinite loop.
71 *
72 * This function is called internally and is not normally intended
73 * to be called by the client.
74 *
75 * When tasking is enabled, the Task module creates an Idle task which
76 * simply calls this function. If tasking is disabled, then this function
77 * is called after main and any module startup functions.
78 *
79 * The body of this function is an infinite loop that calls the "run"
80 * function.
81 */
82 Void loop(UArg arg1, UArg arg2);
83
84 /*!
85 * ======== run ========
86 * @_nodoc
87 * Make one pass through idle functions
88 *
89 * This function is called internally by Idle_loop and is not normally
90 * intended to be called by the client.
91 *
92 * This function makes one pass through the array of functions from
93 * idleFunc array calling one function after the next. This function
94 * returns after all functions have been executed one time.
95 */
96 Void run();
97
98 }
99 100 101
102