Package org.deepjava.runtime.arm32
Class Task
- java.lang.Object
-
- org.deepjava.runtime.arm32.Task
-
- All Implemented Interfaces:
Iarm32,Actionable
- Direct Known Subclasses:
Blinker,Blinker,FlinkDemo,FlinkDemo,HD44780U,MotorDemo,RN131,SystemInOutReflector,SystemOutDemo,TCRT1000,TCRT1000Demo,VL53L0XDemo,WatchdogDemo,WatchdogTask,WifiDemo
public class Task extends Object implements Actionable, Iarm32
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 booleandonestatic intfirstErrfirst error occurred, see this error list
1: error at installation
2: too many tasks
3: task is already or still installedstatic intmaxNofTaskslongnextTimeintnofActivationsnumber of activationsintperiodperiod: 0 <= period : period time in ms
The period is must be specified before installation of the task by callinginstall.longperiodNsbooleansafesafe=FALSE -> task gets removed on trap, currently not usedinttimetime: 0 <= time : start time in ms from install time-
Fields inherited from interface org.deepjava.runtime.arm32.Iarm32
ACTLR, CPACR, CPSR, D0, D1, D10, D11, D12, D13, D14, D15, D16, D17, D18, D19, D2, D20, D21, D22, D23, D24, D25, D26, D27, D28, D29, D3, D30, D31, D4, D5, D6, D7, D8, D9, FPSCR, ID_ISAR0, ID_ISAR1, ID_ISAR2, ID_ISAR3, LR, LR_ABT, LR_FIQ, LR_IRQ, LR_MON, LR_SVC, LR_UND, LR_USR, MIDR, MPIDR, MPUIR, PC, R0, R1, R10, R10_FIQ, R11, R11_FIQ, R12, R12_FIQ, R2, R3, R4, R5, R6, R7, R8, R8_FIQ, R9, R9_FIQ, S0, S1, S10, S11, S12, S13, S14, S15, S16, S17, S18, S19, S2, S20, S21, S22, S23, S24, S25, S26, S27, S28, S29, S3, S30, S31, S4, S5, S6, S7, S8, S9, SCTLR, SP, SP_ABT, SP_FIQ, SP_IRQ, SP_MON, SP_SVC, SP_UND, SP_USR, SPSR_ABT, SPSR_FIQ, SPSR_IRQ, SPSR_MON, SPSR_SVC, SPSR_UND
-
-
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 voidaction()Action to be performed by the task(package private) static voiderror(int n)static voidinstall(Task task)Installs a new Task.(package private) static voidloop()static voidremove(Task task)Removes an installed taskstatic inttime()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
-
nextTime
public long nextTime
-
periodNs
public long periodNs
-
-
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:
actionin 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()
-
-