13.07.2015 Views

DSP56xxx C Cross-Compiler User's Guide - Tasking

DSP56xxx C Cross-Compiler User's Guide - Tasking

DSP56xxx C Cross-Compiler User's Guide - Tasking

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.

3–62Chapter 3L3: dc $000001org p,”.ptext”:L4: bclr #0,x:L3 ; _sema_clrjcc L4bset #0,x:L3 ; _sema_setrtsint _sema_set(volatile int *p, int bitnumber);volatile intpinttypedef volatile int semaphore_t;void f(void){static semaphore_t flag = 0;}while( _sema_set( &flag, 0 ) ); /* wait until we set flag ourselves *//* code to handle device */_sema_clr( &flag, 0 );/* free device for other processes */L3: dc $000001org p,”.ptext”:L4: bset #0,x:L3 ; _sema_setjcs L4bclr #0,x:L3 ; _sema_clrrts

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

Saved successfully!

Ooh no, something went wrong!