summaryrefslogtreecommitdiff
path: root/gcc/m2/gm2-libs-coroutines/TimerHandler.mod
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/m2/gm2-libs-coroutines/TimerHandler.mod')
-rw-r--r--gcc/m2/gm2-libs-coroutines/TimerHandler.mod37
1 files changed, 20 insertions, 17 deletions
diff --git a/gcc/m2/gm2-libs-coroutines/TimerHandler.mod b/gcc/m2/gm2-libs-coroutines/TimerHandler.mod
index d3dee319ca1..1285873486d 100644
--- a/gcc/m2/gm2-libs-coroutines/TimerHandler.mod
+++ b/gcc/m2/gm2-libs-coroutines/TimerHandler.mod
@@ -41,8 +41,9 @@ CONST
MaxQuantum = 4 ; (* Maximum ticks a process may consume *)
(* before being rescheduled. *)
BaseTicks = 1000000 ; (* Max resolution of clock ticks per sec *)
- TimerStackSize = 100000H ; (* Reasonable sized stack for a process *)
- Debugging = FALSE ; (* Do you want lots of debugging info? *)
+ TimerStackSize = 100000H ; (* Reasonable sized stack for a process *)
+ Debugging = FALSE ; (* Do you want lots of debugging info? *)
+ EnableLED = FALSE ; (* Should the scroll LED be pulsed? *)
TYPE
EVENT = POINTER TO RECORD
@@ -328,21 +329,23 @@ BEGIN
(* Now compenstate for lost ticks *)
StartClock (TimerIntNo, CurrentCount + (BaseTicks DIV TicksPerSecond)) ;
- (* your code needs to go here *)
- INC (TotalTicks) ; (* (iii) *) (* remove for student *)
- (* now pulse scroll LED *) (* remove for student *)
- IF (TotalTicks MOD TicksPerSecond) = 0 (* remove for student *)
- THEN (* remove for student *)
- ScrollLED := NOT ScrollLED ; (* remove for student *)
- (* r := printf("<scroll %d>", TotalTicks); *)
- SwitchScroll(ScrollLED) (* (iv) *) (* remove for student *)
- END ; (* remove for student *)
- IF (TotalTicks MOD MaxQuantum) = 0 (* remove for student *)
- THEN (* remove for student *)
- RotateRunQueue (* (ii) *) (* remove for student *)
- END ; (* remove for student *)
-
- CheckActiveQueue (* (i) *) (* remove for student *)
+ INC (TotalTicks) ; (* (iii) *)
+ IF EnableLED
+ THEN
+ (* now pulse scroll LED *)
+ IF (TotalTicks MOD TicksPerSecond) = 0
+ THEN
+ ScrollLED := NOT ScrollLED ;
+ (* r := printf("<scroll %d>", TotalTicks); *)
+ SwitchScroll(ScrollLED) (* (iv) *)
+ END
+ END ;
+ IF (TotalTicks MOD MaxQuantum) = 0
+ THEN
+ RotateRunQueue (* (ii) *)
+ END ;
+
+ CheckActiveQueue (* (i) *)
END
END Timer ;