11.07.2015 Views

IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

****** global functions ********************************************/void HW_Wait(void) {OS_EVENT_Wait(&_HW_Event);}void HW_Free(void) {OS_EVENT_Set(&_HW_Event);}void HW_Init(void) {OS_CREATETASK(&_TCBHW, "HWTask", _HWTask, 25, _StackHW);OS_EVENT_Create(&_HW_Event);}/********************************************************************//********************************************************************/static void HPTask(void) {HW_Wait(); /* Wait until HW module is set up */while (1) {OS_Delay (50);}}static void LPTask(void) {HW_Wait(); /* Wait until HW module is set up */while (1) {OS_Delay (200);}}/*********************************************************************** main**********************************************************************/int main(void) {OS_IncDI(); /* Initially disable interrupts */OS_InitKern(); /* Initialize OS */OS_InitHW(); /* Initialize Hardware for OS */HW_Init(); /* Initialize HW module *//* You need to create at least one task before calling OS_Start() */OS_CREATETASK(&TCBHP, "HP Task", HPTask, 100, StackHP);OS_CREATETASK(&TCBLP, "LP Task", LPTask, 50, StackLP);OS_SendString("Start project will start multitasking !\n");OS_Start(); /* Start multitasking */return 0;}OS_EVENT_Reset()DescriptionResets the specified event object to non-signaled state.Prototypevoid OS_EVENT_Reset (OS_EVENT* pEvent)ParameterDescriptionpEventTable 94: OS_EVENT_Reset() parameter listAdditional InformationPointer to the event object which should be reset to non-signaled state.pEvent has to address an existing event object, which has been created before by a call of OS_EVENT_Create().The debug version of <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> will check whether pEvent addresses a valid event object and will callOS_Error() with the error code OS_ERR_EVENT_INVALID in case of an error.86<strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong>for ARM CoresPP<strong>RTOS</strong>-2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!