[Oberon] FPGA - System Clock advance

Jörg Straube joerg.straube at iaeth.ch
Fri Mar 1 11:29:08 CET 2019


The procedure DT is on the right track. Mine is a little bit more complex to be more accurate. See below.

The basic idea is indeed to call DT regularly. Doing it in the GC handler is one idea but has the big drawback that you have to modify/recompile Oberon.Mod

The GC handler is a background task. Try to make your DT an own background task. The Oberon system is a multitasking OS...
If you master the background task challenge you will realize that the background task is not exactly called every second but sometimes 1012 ms, sometimes 1003 or 1034 ms. Your DT should take that into account. Kernel.Time() can help there...

Jörg

> Am 01.03.2019 um 11:08 schrieb Tomas Kral <thomas.kral at email.cz>:
> 
> On Thu, 28 Feb 2019 21:54:14 +0100
> Jörg <joerg.straube at iaeth.ch> wrote:
> 
>> - Kernel.Time() counts the ms since last reboot.
>> - Kernel.Clock() stores date and time in seconds.
> 
> This would be easy, but needs refinement :-)
> 
> PROCEDURE DT; (*advance date time*)
> BEGIN
> dt := Kernel.Clock(); (*date time in secs*)
> INC(dt); Kernel.SetClock(dt);
> END DT;
> 
> PROCEDURE GC; (*garbage collect*)
> BEGIN DT();
> (*do gc*)
> END GC;
> 
> -- 
> Tomas Kral <thomas.kral at email.cz>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon



More information about the Oberon mailing list