SCoop - multitask and Simple COOPerative scheduler AVR & ARM

well, but my topic is just all about cooperative mode !

Sorry, I didn't know the rules.

if we put a simple chThdYield() in each loop, your exmple falls to 592876 and that was and still is my point:
we have to provide users with a strong framework and couple of exampels, otherwise they will miss-use the os and will get wrong result.

But I would never do that, I would use other features of the RTOS to handle high priority requirements. But that would break your rule that we can only use features of SCoop.

Salting yield calls at various places in code to make embedded applications work is a real pain and makes the code fragile and unreliable. You get horrible interactions between unrelated tasks.

I wrote my last cooperative scheduler in 1972. I don't plan to go back there.

I'll stick with technology I helped develop thirty years ago, the predecessor of VxWorks. VxWorks is the RTOS used in many NASA projects including all JPL Mars Rovers.

Good luck with SCoop.

Edit: here is a going away challenge, implement the ChibiOS_ARM chFastLogger example with SCoop. This example logs four ADC values at a rate of 1000 Hz. Note that ChibiOS achieves a time jitter of about one microsecond between samples. To get low SNR in a signal you need this level of jitter at 1000 Hz. See any good reference on the theory of ADC signal measurements.

I ran the example with Teensy 3.0.

Here is a bit of typical data the first column is the time in micros():

micros,data0,data1,data2,data3,over
6178008,290,279,231,262,0
6179008,253,246,217,241,0
6180008,258,244,220,241,0
6181008,260,243,222,239,0
6182008,260,242,222,238,0
6183008,261,242,220,240,0
6184008,262,241,220,239,0
6185008,261,241,220,239,0
6186008,261,240,220,238,0
6187008,262,240,219,240,0
6188008,262,241,220,238,0
6189008,263,241,220,237,0
6190008,263,241,220,239,0
6191008,263,241,220,239,0
6192008,265,241,220,238,0
6193008,266,242,221,239,0
6194008,266,242,222,239,0
6195008,265,243,223,239,0
6196008,266,242,223,238,0
6197008,266,242,223,240,0
6198008,260,233,219,239,0
6199008,271,251,224,239,0
6200008,264,243,220,239,0
6201008,265,241,219,239,0
6202008,266,240,221,239,0
6203008,266,242,221,239,0
6204008,266,241,221,237,0
6205008,265,241,222,238,0
6206008,266,241,222,238,0
6207008,266,242,222,240,0