Go Down

Topic: Arduino Due Task Scheduler (Read 16941 times) previous topic - next topic

pYro_65

#15
Nov 15, 2012, 03:55 am Last Edit: Nov 15, 2012, 03:59 am by pYro_65 Reason: 1
From what I can tell, yield has a similar effect to the task actually exiting; it simply moves focus to the next task. I don't think you even need to use it in some circumstances. 'suspend()' may be a better name.

It is handy for breaking a 'long' operation; for example calculating PI to 6000 places in one hit halts everything else on the system for quite some time.

Data buffers could overflow if they aren't read often enough; SPI may be interrupt driven, but the code using it may not be, and will require a slice of time to act on the data.

Paul Stoffregen

Yes, yield() is useful if you write a program than does a lot of work and you care about letting other stuff run.

But its main purpose is for libraries that wait.  For example, inside Serial.print(), if the transmit buffer is full, yield() is called while it waits for space in the buffer.

Testato

working porting (still in development) of the DUE Sceduler to the UNO (Avr Core)

http://vbextreme.netai.net/2015/12/26/embedded-arduino-scheduler-patre-1-1/

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

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy