12.07.2015 Views

CooCox CoOS 用户手册

CooCox CoOS 用户手册

CooCox CoOS 用户手册

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>CooCox</strong> <strong>CoOS</strong> idID timeout0E_CALLE_INVALID_IDE_TIMEOUTE_OKIDID:#include "CCRTOS.h"OS_EventID semaphore;;void TaskN (void *pdata){StatusType result;.../* Pend a semaphore, Time out: 20 */result = CoPendSem (semaphore, 20);if (result != E_OK){if (result == E_INVALID_ID){printf("Invalid event ID !\n");}else if (result == E_CALL){printf("Error call in ISR !\n");}else if (result == E_TIMEOUT){printf("Semaphore was not received within the specified 'timeout' time !\n");}}else{…/* Process semaphore here */…}...}:80

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

Saved successfully!

Ooh no, something went wrong!