Go Down

Topic: SCoop - multitask and Simple COOPerative scheduler AVR & ARM (Read 35947 times) previous topic - next topic

greypanda

I'm confused. If I run this code in a "normal" loop, it prints the value:

void loop()
{

    String s1 = "abcde";
    Serial.println(s1);
}

But within the SCoop loop it fails (doesn't print anything):
void mytask::loop()
{
    String s1 = "abcde";
    Serial.println(s1);
}

jimford

Have you got a 'yield' somewhere in your main loop, such that processing is handed over to your 'mytask'?

Jim

moe69

hi fabriceo,

i´m looking for an easy and simple multitask/scheduler to get my project working.

These are the basic tasks i want to run:

- Pushbutton (short press/long press = Timer?)
- Write Serial (Bluetooth / Event based)
- Read Serial (Bluetooth / Event based)
- Update Display (Time or Event based)

I looked into your wiki and the tutorial to understand your scheduler.
Do you think it is possible to use SCoop with my project. I got only a  bit of expirience in programming, so your tutorial is not easy to read.
But if it is possible to ask you some questions if i got stuck in coding, then i will give SCoo a try.

I put a blog about my project online. If you want to have a look:
http://arduwin.blogspot.de/

Thx for your help!

michaeltanner

Hi all,

Really good stuff, SCoop! Thanks for the work!
I would like to use SCoop with Teensy 3.1 but it looks like this doesn't work. I can compile example sketches up to Teensy 3.0 without problems, but as soon as I choose Teensy 3.1 I will get plenty of errors...

Is there somebody around using SCoop already with Teensy 3.1?

Thanks,
Regards,
Mike

Code: [Select]

Compiling 'Scheduler' for 'Teensy 3.1'
PoolControl.ino:In file included from
SCoop.h:79:2: error: #error "this library might not be compatible with this NON-AVR \ ARM platform. Please experiment and report on Arduino.cc forum"
SCoop.h:141:28: error: variable or field 'sleep' declared void
SCoop.h:141:28: error: 'SCDelay_t' was not declared in this scope
SCoop.h:247:24: error: expected ')' before 'reload'
SCoop.h:249:3: error: 'SCDelay_t' does not name a type
SCoop.h:250:3: error: 'SCDelay_t' does not name a type
SCoop.h:257:3: error: 'SCDelay_t' does not name a type
SCoop.h:260:3: error: 'SCDelay_t' does not name a type
SCoop.h:263:3: error: 'SCDelay_t' does not name a type
SCoop.h:265:3: error: 'SCDelay_t' does not name a type
SCoop.h:269:12: error: expected type-specifier before 'SCDelay_t'
SCoop.h:272:3: error: 'SCDelay_t' does not name a type
SCoop.h:272:3: error: ISO C++ forbids declaration of 'rhs' with no type [-fpermissive]
SCoop.h:277:33: error: 'SCDelay_t' does not name a type
SCoop.h:277:43: error: ISO C++ forbids declaration of 'rhs' with no type [-fpermissive]
SCoop.h:280:33: error: 'SCDelay_t' does not name a type
SCoop.h:280:43: error: ISO C++ forbids declaration of 'rhs' with no type [-fpermissive]
SCoop.h:283:3: error: 'SCDelay_t' does not name a type
SCoop.h:285:3: error: 'SCDelay_t' does not name a type
SCoop.h:In member function 'SCoopDelay& SCoopDelay::operator=(int)'
SCoop.h:272:3: error: 'set' was not declared in this scope
SCoop.h:In member function 'SCoopDelay& SCoopDelay::operator=(const SCoopDelay&)'
SCoop.h:275:5: error: 'timeValue' was not declared in this scope
SCoop.h:275:19: error: 'const class SCoopDelay' has no member named 'timeValue'
SCoop.h:In member function 'SCoopDelay& SCoopDelay::operator+=(int)'
SCoop.h:278:12: error: 'add' was not declared in this scope
SCoop.h:In member function 'SCoopDelay& SCoopDelay::operator-=(int)'
SCoop.h:281:12: error: 'sub' was not declared in this scope
SCoop.h:At global scope
SCoop.h:295:25: error: expected ')' before 'reload'
SCoop.h:297:3: error: 'micros_t' does not name a type
SCoop.h:298:3: error: 'micros_t' does not name a type
SCoop.h:305:3: error: 'micros_t' does not name a type
SCoop.h:308:3: error: 'micros_t' does not name a type
SCoop.h:311:3: error: 'micros_t' does not name a type
SCoop.h:313:3: error: 'micros_t' does not name a type
SCoop.h:317:12: error: expected type-specifier before 'micros_t'
SCoop.h:320:3: error: 'micros_t' does not name a type
SCoop.h:320:3: error: ISO C++ forbids declaration of 'rhs' with no type [-fpermissive]
SCoop.h:325:35: error: 'micros_t' does not name a type
SCoop.h:325:44: error: ISO C++ forbids declaration of 'rhs' with no type [-fpermissive]
SCoop.h:328:35: error: 'micros_t' does not name a type
SCoop.h:328:44: error: ISO C++ forbids declaration of 'rhs' with no type [-fpermissive]
SCoop.h:332:3: error: 'micros_t' does not name a type
<--- snip too much errors... --->

Rob_Brouwer

Hello,

It seems there is no answer on the question if it is possible to use Scoop with the teensy 3.1 version.
Compiling gives a lot of errors and I am wondering why.

Greetings Rob

fabriceo

Hi Rob
Just have a look at the begining of the include file and look for a Define like mk20dx128 and add a new one on the line for the t3.1 which is mk20dx256, or something like that, then it should work ;)

im sory that I didnt followup on this lib as much as it should but still hope you guys have fun with it

Cheers

Rob_Brouwer

Hi Fabriceo,

Thanks for the reply.
I have changed  mk20dx128 in mk20dx256 and now its compiling without errors.
Its now time for me to read the manuals and try all the examples to see if this is what I am looking for. At first glance it looks very promessing.

Greetings Rob


Testato

- [Guida] IDE - http://goo.gl/ln6glr
- [Lib] ST7032i LCD I2C - http://goo.gl/GNojT6
- [Lib] PCF8574+HD44780 LCD I2C - http://goo.gl/r7CstH

wongss

I used SCoop v1.2 on ATMega328p for a number of projects and worked very fine but I must be very careful with the tasks' stacks due to the very limited RAM. I use a separate task to report all the tasks' stacks and also the maximum time taken to go 1 round-robin (normally <10ms).

SCoop makes handling multiple IO and tasks so easy without the need to go pre-emptive multitasking.

Thanks for the port of SCoop to Teensy 3.1 (using instruction given & also need to change the code very slightly to remove warnings) that has so much more resources. Tried it and works fine too.

Thanks for the SCoop.

Go Up