摘要 |
Disclosed is a microprocessor operating system having a program which includes a plurality of tasks requiring periodic execution by the system, and wherein each task is comprised of a plurality of associated subtasks. The system executes the tasks in a orderly fashion by: (A) providing a time variable which is periodically updated to represent a measurement of time; (B) setting the time variable to a predetermined time period during which a first task may be executed; (C) determining whether or not the predetermined time period has lapsed; (D) executing at least one of the subtasks of the first task if the predetermined time period has not lapsed, and then proceeding to step c; and (e) executing another portion of program if the predetermined time period has lapsed, and then proceeding to step c before executing another subtask associated with the first task. When a task having a higher priority than the first task requires execution, the subtask being executing is completed and the higher priority task is executed. Once the first task is returned to for execution, the next subtask is executed. The procedure continually executes all the subtasks associated with the first task.
|