[Oberon] FPGA - System Clock advance
joerg.straube at iaeth.ch
Fri Mar 1 11:45:59 CET 2019
And look into Texts.WriteClock to learn how clock and date is supposed to be encoded in the 32 bits. You will have to adapt your DT to that as well.
In my system, I use a little bit a different clock encoding as my original routine is from the 1990s. The years 70s, 80s and 90s can not be stored with the encoding currently used in Oberon. But its still 45 years to go until you detect this issue on January 1st 2064!!😊
> Am 01.03.2019 um 11:29 schrieb Jörg Straube <joerg.straube at iaeth.ch>:
> 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...
>> 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*)
>> 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
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
More information about the Oberon