373a8c32b2
git-svn-id: file:///srv/dev-disk-by-uuid-17e88007-4d0c-45e0-8757-cacfcc458630/repositories/svn/Diplomarbeit@55 9fe90eed-be63-e94b-8204-d34ff4c2ff93
285 lines
7.2 KiB
C
285 lines
7.2 KiB
C
/* ---------------------------------------------------------------------------
|
|
* taskfunctions.c (c) 2008 Micro-key bv
|
|
* ---------------------------------------------------------------------------
|
|
* Micro-key bv
|
|
* Industrieweg 28, 9804 TG Noordhorn
|
|
* Postbus 92, 9800 AB Zuidhorn
|
|
* The Netherlands
|
|
* Tel: +31 594 503020
|
|
* Fax: +31 594 505825
|
|
* Email: support@microkey.nl
|
|
* Web: www.microkey.nl
|
|
* ---------------------------------------------------------------------------
|
|
* Description:
|
|
* Contains Functions to control the TestLED Tasks
|
|
* ---------------------------------------------------------------------------
|
|
* Version(s): 0.1, Apr 09, 2008, MMi
|
|
* Creation.
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* System include files
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
#include "lpc23xx.h"
|
|
#include "types.h"
|
|
|
|
/* FreeRTOS includes */
|
|
#include "FreeRTOS.h"
|
|
#include "task.h"
|
|
/* ---------------------------------------------------------------------------
|
|
* Application include files
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
#include "taskfunctions.h"
|
|
#include "dio.h"
|
|
/* ---------------------------------------------------------------------------
|
|
* Local constant and macro definitions
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* Global variable definitions
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* Local variable definitions
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* Local function definitions
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
void taskInit (void)
|
|
{
|
|
d_gLED = 0; /* Initialize TaskStatus with 0 */
|
|
d_ledtestled = 0;
|
|
d_dioled = 0;
|
|
d_aioled = 0;
|
|
d_busled = 0;
|
|
d_eepromled = 0;
|
|
d_flashled = 0;
|
|
d_mmcled = 0;
|
|
d_logled = 0;
|
|
d_comled = 0;
|
|
d_powerled = 0;
|
|
d_rtcled = 0;
|
|
}
|
|
|
|
void diotasksdelete(void)
|
|
{
|
|
if (d_dioled == pdPASS) /* If defined Task exists */
|
|
{
|
|
vTaskDelete (dioled); /* Delete Task */
|
|
dioWrite (0,DIOLED,FALSE); /* Switch off corresponding DIO-LED */
|
|
d_dioled = 0; /* Set TaskStatus to 0 */
|
|
}
|
|
if (d_ledtestled == pdPASS)
|
|
{
|
|
vTaskDelete (ledtestled);
|
|
dioWrite (0,LEDTESTLED,FALSE);
|
|
d_ledtestled = 0;
|
|
}
|
|
if (d_aioled == pdPASS)
|
|
{
|
|
vTaskDelete (aioled);
|
|
dioWrite (0,AIOLED,FALSE);
|
|
d_aioled = 0;
|
|
}
|
|
if (d_busled == pdPASS)
|
|
{
|
|
vTaskDelete (busled);
|
|
dioWrite (0,BUSLED,FALSE);
|
|
d_busled = 0;
|
|
}
|
|
#if (allMemoryUseSameLED == 0)
|
|
if (d_eepromled == pdPASS)
|
|
{
|
|
vTaskDelete (eepromled);
|
|
dioWrite (0,EEPROMLED,FALSE);
|
|
d_eepromled = 0;
|
|
}
|
|
if (d_flashled == pdPASS)
|
|
{
|
|
vTaskDelete (flashled);
|
|
dioWrite (0,FLASHLED,FALSE);
|
|
d_flashled = 0;
|
|
}
|
|
if (d_logled == pdPASS)
|
|
{
|
|
vTaskDelete (logled);
|
|
dioWrite (0,LOGLED,FALSE);
|
|
d_logled = 0;
|
|
}
|
|
#else
|
|
if (d_batteryled == pdPASS)
|
|
{
|
|
vTaskDelete (batteryled);
|
|
dioWrite (0,BATTERYLED,FALSE);
|
|
d_batteryled = 0;
|
|
}
|
|
|
|
if (d_memoryled == pdPASS)
|
|
{
|
|
vTaskDelete (memoryled);
|
|
dioWrite (0,MEMORYLED,FALSE);
|
|
d_memoryled = 0;
|
|
}
|
|
#endif
|
|
if (d_mmcled == pdPASS)
|
|
{
|
|
vTaskDelete (mmcled);
|
|
dioWrite (0,MMCLED,FALSE);
|
|
d_mmcled = 0;
|
|
}
|
|
if (d_comled == pdPASS)
|
|
{
|
|
vTaskDelete (comled);
|
|
dioWrite (0,COMLED,FALSE);
|
|
d_comled = 0;
|
|
}
|
|
if (d_powerled == pdPASS)
|
|
{
|
|
vTaskDelete (powerled);
|
|
dioWrite (0,POWERLED,FALSE);
|
|
d_powerled = 0;
|
|
}
|
|
if (d_rtcled == pdPASS)
|
|
{
|
|
vTaskDelete (rtcled);
|
|
dioWrite (0,RTCLED,FALSE);
|
|
d_rtcled = 0;
|
|
}
|
|
}
|
|
|
|
void diotaskssuspend(void)
|
|
{
|
|
if (d_dioled == pdPASS) /* If defined Task exists */
|
|
{
|
|
vTaskSuspend (dioled); /* Suspend Task */
|
|
dioWrite (0,DIOLED,FALSE); /* Switch off corresponding DIO-LED */
|
|
}
|
|
if (d_ledtestled == pdPASS)
|
|
{
|
|
vTaskSuspend (ledtestled);
|
|
dioWrite (0,LEDTESTLED,FALSE);
|
|
}
|
|
if (d_aioled == pdPASS)
|
|
{
|
|
vTaskSuspend (aioled);
|
|
dioWrite (0,AIOLED,FALSE);
|
|
}
|
|
if (d_busled == pdPASS)
|
|
{
|
|
vTaskSuspend (busled);
|
|
dioWrite (0,BUSLED,FALSE);
|
|
}
|
|
#if (allMemoryUseSameLED == 0)
|
|
if (d_eepromled == pdPASS)
|
|
{
|
|
vTaskSuspend (eepromled);
|
|
dioWrite (0,EEPROMLED,FALSE);
|
|
}
|
|
if (d_flashled == pdPASS)
|
|
{
|
|
vTaskSuspend (flashled);
|
|
dioWrite (0,FLASHLED,FALSE);
|
|
}
|
|
if (d_logled == pdPASS)
|
|
{
|
|
vTaskSuspend (logled);
|
|
dioWrite (0,LOGLED,FALSE);
|
|
}
|
|
#else
|
|
if (d_batteryled == pdPASS)
|
|
{
|
|
vTaskSuspend (batteryled);
|
|
dioWrite (0,BATTERYLED,FALSE);
|
|
}
|
|
if (d_memoryled == pdPASS)
|
|
{
|
|
vTaskSuspend (memoryled);
|
|
dioWrite (0,MEMORYLED,FALSE);
|
|
}
|
|
#endif
|
|
if (d_mmcled == pdPASS)
|
|
{
|
|
vTaskSuspend (mmcled);
|
|
dioWrite (0,MMCLED,FALSE);
|
|
}
|
|
if (d_comled == pdPASS)
|
|
{
|
|
vTaskSuspend (comled);
|
|
dioWrite (0,COMLED,FALSE);
|
|
}
|
|
if (d_powerled == pdPASS)
|
|
{
|
|
vTaskSuspend (powerled);
|
|
dioWrite (0,POWERLED,FALSE);
|
|
}
|
|
if (d_rtcled == pdPASS)
|
|
{
|
|
vTaskSuspend (rtcled);
|
|
dioWrite (0,RTCLED,FALSE);
|
|
}
|
|
}
|
|
|
|
void diotasksresume(void)
|
|
{
|
|
if (d_batteryled == pdPASS) /* If defined Task exists */
|
|
{
|
|
vTaskResume(batteryled); /* Resume Task */
|
|
}
|
|
if (d_dioled == pdPASS)
|
|
{
|
|
vTaskResume(dioled);
|
|
}
|
|
if (d_ledtestled == pdPASS)
|
|
{
|
|
vTaskResume(ledtestled);
|
|
}
|
|
if (d_aioled == pdPASS)
|
|
{
|
|
vTaskResume(aioled);
|
|
}
|
|
if (d_busled == pdPASS)
|
|
{
|
|
vTaskResume(busled);
|
|
}
|
|
if (d_eepromled == pdPASS)
|
|
{
|
|
vTaskResume(eepromled);
|
|
}
|
|
if (d_flashled == pdPASS)
|
|
{
|
|
vTaskResume(flashled);
|
|
}
|
|
if (d_logled == pdPASS)
|
|
{
|
|
vTaskResume(logled);
|
|
}
|
|
if (d_memoryled == pdPASS)
|
|
{
|
|
vTaskResume (memoryled);
|
|
}
|
|
if (d_mmcled == pdPASS)
|
|
{
|
|
vTaskResume(mmcled);
|
|
}
|
|
if (d_comled == pdPASS)
|
|
{
|
|
vTaskResume(comled);
|
|
}
|
|
if (d_powerled == pdPASS)
|
|
{
|
|
vTaskResume(powerled);
|
|
}
|
|
if (d_rtcled == pdPASS)
|
|
{
|
|
vTaskResume(rtcled);
|
|
}
|
|
}
|