rtel wrote on Monday, February 09, 2009:
> In regards to priority inversion and priority inheritance.
> Is priority inheritance automatic in FreeRTOS, or is it an
> option that I need to turn on, and how do I do that if I need to?
Priority inheritance is automatic if you are using a Mutex type semaphore - created with the xSemaphoreCreateMutex() API function. The only difference between binary semaphores and mutexes is that mutexes have this extra functionality.
Note that the priority inheritance mechanism assumes that only one mutex will be held by a task at any one time.
> I ask because it seems that a mutex is causing my program to freeze.
Freeze in what sense? Completely crash? Or wait for the semaphore indefinitely?
> Also, in regards to switching tasks.
> Lets say I am writing to an SD card. Lets say I am writing
> 512 bytes to the card, can or will the FreeRTOS scheduler
> switch while doing something… ie. in the middle of a command?
FreeRTOS knows nothing about what your application is doing, or how your SD card driver and file system operate. The tick interrupt will continue to function as long as interrupts remain enabled (not in a critical section). Interrupts will also continue, but not perform a context switch, if the scheduler is suspended (vTaskSuspendAll() has been called). In the latter case context switches are held pending until the scheduler is unsuspended.