Arduino Due Task Scheduler
Topic: Arduino Due Task Scheduler
(Read 15687 times)
Re: Arduino Due Task Scheduler.
Nov 15, 2012, 03:55 am
: Nov 15, 2012, 03:59 am by pYro_65
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.
New EEPROM library released
Always making something...
Re: Arduino Due Task Scheduler
Nov 15, 2012, 04:04 am
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.