📄 task2_start.c
字号:
/***************************************************************
*
* Module : _e7t_task2_start.c
* Description : This is an application that continuous runs
* until interrupted by a periodic interrupt
* Platform : e7t
* History :
*
* 2000-03-26 Andrew N. Sloss
* - implememtented on ARM Evaluator7T
*
* Notes : none...
*
***************************************************************/
/***************************************************************
* IMPORT
***************************************************************/
#include "../core/mutex.h"
#include "../headers/api_types.h"
#include "../devices/ddf_io.h"
#include "../e7t/devices/ddf_types.h"
#include "../e7t/events/swis.h"
#include "../headers/api_device.h"
#define GREEN1 0
#define RED 2
#define ORANGE 1
#define GREEN2 3
/*****************************************************************************
* ROTUINES
*****************************************************************************/
device_treestr *orange_host;
UID oled;
/* -- openOrangeLED -----------------------------------------------------------
*
* Description : opens the communication port to the red LED
*
* Parameters : none..
* Return : BOOLean - successful | unsucessful
* Notes :
*
*/
BOOL openOrangeLED (void)
{
/* --------------------------------------------------------------
* eventIODeviceOpen -
* open the LED driver node...
* --------------------------------------------------------------
*/
orange_host = eventIODeviceOpen(&oled,DEVICE_LED_E7T,ORANGE);
/* check that a device driver is found ... */
if (orange_host==0) {return FALSE;}
/* check the UID .................. */
switch (oled)
{
case DEVICE_IN_USE:
case DEVICE_UNKNOWN:
return FALSE;
}
return TRUE;
}
/* -- switchOnOrangeLED -------------------------------------------------------
*
* Description : switches on the Orange LED
*
* Parameter : none...
* Return : none...
* Notes :
*
*/
void switchOnOrangeLED (void)
{eventIODeviceWriteBit(orange_host,oled,(UINT)1);}
/* -- switchOffOrangeLED ------------------------------------------------------
*
* Description : switches off the Orange LED
*
* Parameter : none...
* Return : none...
* Notes :
*
*/
void switchOffOrangeLED (void)
{eventIODeviceWriteBit(orange_host,oled,(UINT)0);}
/* -- C_EntryTask2 ------------------------------------------------------------
*
* Description : C entry point for task 2
*
* Parameters : none...
* Return : none...
* Other :
*
* This task executes continuously
*
*/
void C_EntryTask2(void)
{
volatile int delay;
if (openOrangeLED ()==TRUE)
{
while (1)
{
bWAIT;
switchOnOrangeLED ();
/* dummy time delay...*/
for (delay=0; delay<0x10ffff; delay++) {}
bSIGNAL;
switchOffOrangeLED ();
/* dummy time delay...*/
for (delay=0; delay<0x10ffff; delay++) {}
}
}
/*
* error loop
*/
while (1)
{
delay=0xBEEF0002;
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -