sergiosider wrote on Friday, January 15, 2010:
Dear All & Richard,
I am using FreeRTOS for a while, and now I bumped into a problem that I need help to figure out:
On an MP3 application, I have the following task:
void vFADERTask (void* pvParameters)
{
char STEP;
for (STEP=0; (STEP<32) && (SYSFLAGS(SS_FLAG_PLAYING)); STEP++) {
wrsta(0x46,STEP);
wrsta(0x48,STEP);
vTaskDelay(60 / portTICK_RATE_MS);
}
if (SYSFLAGS(SS_FLAG_PLAYING)) SYSFLAGS(SS_FLAG_ABORTPLAY)=1;
FADERTaskHandle = NULL;
vTaskDelete(NULL);
}
and, in another part of the program:
//create the Fader Task
if (FaderTaskHandle==NULL) {
if (xTaskCreate( vFADERTask, (signed portCHAR*) “Fader”, 64, NULL, 2, &FaderTaskHandle) != pdTRUE) DEBUG_PRINT(“CANT CREATE TASK!!!”);
} else {
DEBUG_PRINT(“Fader task running!”);
}
Here’s what happens:
It’s working fine, until I call it for aproximately 10 times…(plenty of time before each call, so no overlaps)
Then the code to create the task returns != pdTRUE… as there are no resources available
Do I have to clean up anything beyond calling vTaskDelete ?
another ‘parallel’ thing I noticed is that the Task Handle does not get NULLed by TaskDelete, so I had do it manually (is this a potential problem? so the task could be created before actually deleted ?)
Thank you very much!
Sergio P. Sider