Package org.deepjava.runtime.ppc32
Class Task
- java.lang.Object
-
- org.deepjava.runtime.ppc32.Task
-
- All Implemented Interfaces:
Ippc32
,Actionable
- Direct Known Subclasses:
BlueRS
,BlueRSCmdInt
,BlueRSCmdIntDemo
,BlueRSDemo
,CAN1Test
,DateTime
,EPOStest1
,ExceptionDemo
,FileTransfer
,HD44780U
,HLC1395Demo
,HLC1395Pulsed
,MotorDemo1
,RN131
,Robi2
,Robi2LedBlinkerDemo
,Robi2LineTask
,Robi2MotorDemo
,Robi2ObstacleTask
,Robi2SensorProximityDemo_Led
,Robi2SensorProximityDemo_Out
,SimpleBlinkerDemo
,SimpleBlinkerDemo
,SPIDemo
,SystemInOutReflector
,SystemOutDemo1
,SystemOutDemo2
,UART3Demo
,UART3InOutReflector
,UART6Demo
,VL53L0X
,VL53L0XTest
,WifiDemo
public class Task extends Object implements Actionable, Ippc32
This class implements a simple non-preemptive tasking system. Each task runs to completion. After this the next task in the ready queue will run. Tasks with a period equal to 0 will be rescheduled immediately after completion Tasks with a period greater than 0 will be scheduled when their time has come.- Author:
- urs.graf@ntb.ch
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
done
static int
firstErr
first error occurred, see this error list
1: error at installation
2: too many tasks
3: task is already or still installedstatic int
maxNofTasks
int
nofActivations
number of activationsint
period
period: 0 <= period : period time in ms
The period is must be specified before installation of the task by callinginstall
.boolean
safe
safe=FALSE -> task gets removed on trap, currently not usedint
time
time: 0 <= time : start time in ms from install time-
Fields inherited from interface org.deepjava.runtime.ppc32.Ippc32
CR, CTR, DAR, DEC, DSISR, FPR0, FPR1, FPR10, FPR11, FPR12, FPR13, FPR14, FPR15, FPR16, FPR17, FPR18, FPR19, FPR2, FPR20, FPR21, FPR22, FPR23, FPR24, FPR25, FPR26, FPR27, FPR28, FPR29, FPR3, FPR30, FPR31, FPR4, FPR5, FPR6, FPR7, FPR8, FPR9, FPSCR, LR, MSR, R0, R1, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R2, R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, R3, R30, R31, R4, R5, R6, R7, R8, R9, SPR1, SPR18, SPR19, SPR22, SPR26, SPR268, SPR269, SPR27, SPR272, SPR273, SPR274, SPR275, SPR287, SPR8, SPR9, SPRG0, SPRG1, SPRG2, SPRG3, SRR0, SRR1, TBLread, TBUread, XER
-
-
Constructor Summary
Constructors Constructor Description Task()
Creates a new Task.Task(Actionable act)
Creates a new Task.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
action()
Action to be performed by the task(package private) static void
error(int n)
static void
install(Task task)
Installs a new Task.(package private) static void
loop()
static void
remove(Task task)
Removes an installed taskstatic int
time()
Returns system time in milliseconds, time starts at powerup
-
-
-
Field Detail
-
maxNofTasks
public static final int maxNofTasks
- See Also:
- Constant Field Values
-
done
public static boolean done
-
firstErr
public static int firstErr
first error occurred, see this error list
1: error at installation
2: too many tasks
3: task is already or still installed
-
time
public int time
time: 0 <= time : start time in ms from install time
-
period
public int period
period: 0 <= period : period time in ms
The period is must be specified before installation of the task by callinginstall
. Subsequent modifications of this value do not have any effects!
-
nofActivations
public int nofActivations
number of activations
-
safe
public boolean safe
safe=FALSE -> task gets removed on trap, currently not used
-
-
Constructor Detail
-
Task
public Task()
Creates a new Task.
It's action method will be called by the task scheduler
-
Task
public Task(Actionable act)
Creates a new Task.
The action method of the parameter Actionable will be called by the task scheduler- Parameters:
act
- Actionable to be installed.
-
-
Method Detail
-
error
static void error(int n)
-
action
public void action()
Action to be performed by the task- Specified by:
action
in interfaceActionable
-
time
public static int time()
Returns system time in milliseconds, time starts at powerup- Returns:
- Current time in ms.
-
install
public static void install(Task task)
Installs a new Task.- Parameters:
task
- Task to be installed.
-
remove
public static void remove(Task task)
Removes an installed task- Parameters:
task
- Task to be removed.
-
loop
static void loop()
-
-