[Oberon] a module a page (keeps the mind sane)?

Frans-Pieter Vonck fp at vonck.nl
Tue Nov 6 09:08:35 CET 2018


Hi Jörg,

I saw the coroutine module is not yet written for project oberon.
But that does not keep me from trying out the concept of cooperatieve 
multitasking.
I will look into that,

Thanks.
F.P.

Jörg Straube schreef op 2018-11-05 23:22:
> F.P.
> 
> Installing tasks in the Oberon loop is THE way to enable multi tasking
> in Oberon.
> 
> T := Oberon.NewTask(myHandler, 1000);
> Oberon.Install(T);
> 
> Every 1000 ms the procedure „myHandler“ will be called.
> 
> Another way to have cooperative multitasking is to implement module
> „Coroutines“.
> 
> br
> Jörg
> 
>> Am 05.11.2018 um 22:02 schrieb Frans-Pieter Vonck <fp at vonck.nl>:
>> 
>> Eventloop the arduino way.
>> (a little offtopic
>> Here is a nice  example on Adafruit how multitasking can be achieved 
>> with a timer.
>> https://learn.adafruit.com/multi-tasking-the-arduino-part-1/overview
>> 
>> As the tutorial progresses the event loop is cleaned up by using 
>> classes.
>> 
>> a snippet from the code:
>> 
>>  Flasher led1(12, 100, 400);
>>  Flasher led2(13, 350, 350);
>> 
>> void loop()
>> {
>>    led1.Update();
>>    led2.Update();
>> }
>> 
>> 
>> A scheduler is not necessary and the code is still readable.
>> Could be nice also as an example for oberon07 (astrobe)
>> 
>> Greets,
>> F.P.
>> --
>> 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