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