FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [October 2005 Threads] portYIELD() in preemptive modePosted by Jeff Smith on October 12, 2005 I'm trying to work out some functions on a board with a port to GCC/HCS12 that is not proven yet. I have been successful with two tasks on different priority, who toggle an LED using vTaskDelay(). I've tested this with either portYIELD() or preemptive mode. It was working after my message at 2005-08-05 16:35
Now I am apparently stuck on using vApplicationIdleHook(), which may not be execuding, and don't know if I'm using portYIELD() properly.
I use preemptive mode. In a task, priority 1, I have these lines .while (!(SCISR1 & RDRF)) .portYIELD();
I think this is supposed to mean that on every kernel tick, it would check for the flag above (because it's the highest priority), and then if not flag it would execute the idle hook for the rest of the tick period. Am I wrong? I don't ever see the output I coded in the idle hook.
RE: portYIELD() in preemptive modePosted by Nobody/Anonymous on October 12, 2005 portYIELD() forces a context switch, but if the task calling yield is the highest priority task in the system it will run again immediately as you have not asked it to block, therefore the idle task will never execute. Try using vTaskDelay(1) instead. This will block the calling task until the next tick.
RE: portYIELD() in preemptive modePosted by Jeff Smith on October 12, 2005 Yeah, thanks. I guess Yield only has a use in the same-priority group (and cooperative mode).
Someday I hope I can follow this scheduler implementation. Funny, having no background in task swapping, I thought it would be more complex than it is. I'm not the type to rely on school or books, so it has been a challenge getting started.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|