Go Down

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


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.
Forum Mod anyone?


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.


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


- [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