Uso de RTOS
UCOS_II.H
Go to the documentation of this file.
1 
6 /*
7 *********************************************************************************************************
8 * uC/OS-II
9 * The Real-Time Kernel
10 *
11 * (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
12 * All Rights Reserved
13 *
14 * File : uCOS_II.H
15 * By : Jean J. Labrosse
16 *********************************************************************************************************
17 */
18 
19 /*
20 *********************************************************************************************************
21 * MISCELLANEOUS
22 *********************************************************************************************************
23 */
24 
25 #define OS_VERSION 252
27 #ifdef OS_GLOBALS
28 #define OS_EXT
29 #else
30 #define OS_EXT extern
31 #endif
32 
33 #ifndef FALSE
34 #define FALSE 0
35 #endif
36 
37 #ifndef TRUE
38 #define TRUE 1
39 #endif
40 
41 #define OS_PRIO_SELF 0xFF
43 #if OS_TASK_STAT_EN > 0
44 #define OS_N_SYS_TASKS 2
45 #else
46 #define OS_N_SYS_TASKS 1
47 #endif
48 
49 #define OS_STAT_PRIO (OS_LOWEST_PRIO - 1)
50 #define OS_IDLE_PRIO (OS_LOWEST_PRIO)
52 #define OS_EVENT_TBL_SIZE ((OS_LOWEST_PRIO) / 8 + 1)
53 #define OS_RDY_TBL_SIZE ((OS_LOWEST_PRIO) / 8 + 1)
55 #define OS_TASK_IDLE_ID 65535
56 #define OS_TASK_STAT_ID 65534
58 #define OS_EVENT_EN (((OS_Q_EN > 0) && (OS_MAX_QS > 0)) || (OS_MBOX_EN > 0) || (OS_SEM_EN > 0) || (OS_MUTEX_EN > 0))
60 /*$PAGE*/
61 /*
62 *********************************************************************************************************
63 * TASK STATUS (Bit definition for OSTCBStat)
64 *********************************************************************************************************
65 */
66 #define OS_STAT_RDY 0x00
67 #define OS_STAT_SEM 0x01
68 #define OS_STAT_MBOX 0x02
69 #define OS_STAT_Q 0x04
70 #define OS_STAT_SUSPEND 0x08
71 #define OS_STAT_MUTEX 0x10
72 #define OS_STAT_FLAG 0x20
74 /*
75 *********************************************************************************************************
76 * OS_EVENT types
77 *********************************************************************************************************
78 */
79 #define OS_EVENT_TYPE_UNUSED 0
80 #define OS_EVENT_TYPE_MBOX 1
81 #define OS_EVENT_TYPE_Q 2
82 #define OS_EVENT_TYPE_SEM 3
83 #define OS_EVENT_TYPE_MUTEX 4
84 #define OS_EVENT_TYPE_FLAG 5
86 /*
87 *********************************************************************************************************
88 * EVENT FLAGS
89 *********************************************************************************************************
90 */
91 #define OS_FLAG_WAIT_CLR_ALL 0
92 #define OS_FLAG_WAIT_CLR_AND 0
94 #define OS_FLAG_WAIT_CLR_ANY 1
95 #define OS_FLAG_WAIT_CLR_OR 1
97 #define OS_FLAG_WAIT_SET_ALL 2
98 #define OS_FLAG_WAIT_SET_AND 2
100 #define OS_FLAG_WAIT_SET_ANY 3
101 #define OS_FLAG_WAIT_SET_OR 3
104 #define OS_FLAG_CONSUME 0x80
107 #define OS_FLAG_CLR 0
108 #define OS_FLAG_SET 1
110 /*
111 *********************************************************************************************************
112 * Possible values for 'opt' argument of OSSemDel(), OSMboxDel(), OSQDel() and OSMutexDel()
113 *********************************************************************************************************
114 */
115 #define OS_DEL_NO_PEND 0
116 #define OS_DEL_ALWAYS 1
118 /*
119 *********************************************************************************************************
120 * OS???PostOpt() OPTIONS
121 *
122 * These #defines are used to establish the options for OSMboxPostOpt() and OSQPostOpt().
123 *********************************************************************************************************
124 */
125 #define OS_POST_OPT_NONE 0x00
126 #define OS_POST_OPT_BROADCAST 0x01
127 #define OS_POST_OPT_FRONT 0x02
129 /*
130 *********************************************************************************************************
131 * TASK OPTIONS (see OSTaskCreateExt())
132 *********************************************************************************************************
133 */
134 #define OS_TASK_OPT_STK_CHK 0x0001
135 #define OS_TASK_OPT_STK_CLR 0x0002
136 #define OS_TASK_OPT_SAVE_FP 0x0004
138 /*
139 *********************************************************************************************************
140 * ERROR CODES
141 *********************************************************************************************************
142 */
143 #define OS_NO_ERR 0
145 #define OS_ERR_EVENT_TYPE 1
146 #define OS_ERR_PEND_ISR 2
147 #define OS_ERR_POST_NULL_PTR 3
148 #define OS_ERR_PEVENT_NULL 4
149 #define OS_ERR_POST_ISR 5
150 #define OS_ERR_QUERY_ISR 6
151 #define OS_ERR_INVALID_OPT 7
152 #define OS_ERR_TASK_WAITING 8
154 #define OS_TIMEOUT 10
155 #define OS_TASK_NOT_EXIST 11
157 #define OS_MBOX_FULL 20
159 #define OS_Q_FULL 30
161 #define OS_PRIO_EXIST 40
162 #define OS_PRIO_ERR 41
163 #define OS_PRIO_INVALID 42
165 #define OS_SEM_OVF 50
167 #define OS_TASK_DEL_ERR 60
168 #define OS_TASK_DEL_IDLE 61
169 #define OS_TASK_DEL_REQ 62
170 #define OS_TASK_DEL_ISR 63
172 #define OS_NO_MORE_TCB 70
174 #define OS_TIME_NOT_DLY 80
175 #define OS_TIME_INVALID_MINUTES 81
176 #define OS_TIME_INVALID_SECONDS 82
177 #define OS_TIME_INVALID_MILLI 83
178 #define OS_TIME_ZERO_DLY 84
180 #define OS_TASK_SUSPEND_PRIO 90
181 #define OS_TASK_SUSPEND_IDLE 91
183 #define OS_TASK_RESUME_PRIO 100
184 #define OS_TASK_NOT_SUSPENDED 101
186 #define OS_MEM_INVALID_PART 110
187 #define OS_MEM_INVALID_BLKS 111
188 #define OS_MEM_INVALID_SIZE 112
189 #define OS_MEM_NO_FREE_BLKS 113
190 #define OS_MEM_FULL 114
191 #define OS_MEM_INVALID_PBLK 115
192 #define OS_MEM_INVALID_PMEM 116
193 #define OS_MEM_INVALID_PDATA 117
194 #define OS_MEM_INVALID_ADDR 118
196 #define OS_ERR_NOT_MUTEX_OWNER 120
198 #define OS_TASK_OPT_ERR 130
200 #define OS_ERR_DEL_ISR 140
201 #define OS_ERR_CREATE_ISR 141
203 #define OS_FLAG_INVALID_PGRP 150
204 #define OS_FLAG_ERR_WAIT_TYPE 151
205 #define OS_FLAG_ERR_NOT_RDY 152
206 #define OS_FLAG_INVALID_OPT 153
207 #define OS_FLAG_GRP_DEPLETED 154
209 /*$PAGE*/
210 /*
211 *********************************************************************************************************
212 * EVENT CONTROL BLOCK
213 *********************************************************************************************************
214 */
215 
216 #if (OS_EVENT_EN > 0) && (OS_MAX_EVENTS > 0)
217 typedef struct {
218  INT8U OSEventType;
219  INT8U OSEventGrp;
220  INT16U OSEventCnt;
221  void *OSEventPtr;
222  INT8U OSEventTbl[OS_EVENT_TBL_SIZE];
223 } OS_EVENT;
224 #endif
225 
226 
227 /*
228 *********************************************************************************************************
229 * EVENT FLAGS CONTROL BLOCK
230 *********************************************************************************************************
231 */
232 
233 #if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
234 typedef struct { /* Event Flag Group */
235  INT8U OSFlagType; /* Should be set to OS_EVENT_TYPE_FLAG */
236  void *OSFlagWaitList; /* Pointer to first NODE of task waiting on event flag */
237  OS_FLAGS OSFlagFlags; /* 8, 16 or 32 bit flags */
238 } OS_FLAG_GRP;
239 
240 
241 
242 typedef struct { /* Event Flag Wait List Node */
243  void *OSFlagNodeNext; /* Pointer to next NODE in wait list */
244  void *OSFlagNodePrev; /* Pointer to previous NODE in wait list */
245  void *OSFlagNodeTCB; /* Pointer to TCB of waiting task */
246  void *OSFlagNodeFlagGrp; /* Pointer to Event Flag Group */
247  OS_FLAGS OSFlagNodeFlags; /* Event flag to wait on */
248  INT8U OSFlagNodeWaitType; /* Type of wait: */
249  /* OS_FLAG_WAIT_AND */
250  /* OS_FLAG_WAIT_ALL */
251  /* OS_FLAG_WAIT_OR */
252  /* OS_FLAG_WAIT_ANY */
253 } OS_FLAG_NODE;
254 #endif
255 
256 
257 /*
258 *********************************************************************************************************
259 * MESSAGE MAILBOX DATA
260 *********************************************************************************************************
261 */
262 
263 #if OS_MBOX_EN > 0
264 typedef struct {
265  void *OSMsg; /* Pointer to message in mailbox */
266  INT8U OSEventTbl[OS_EVENT_TBL_SIZE]; /* List of tasks waiting for event to occur */
267  INT8U OSEventGrp; /* Group corresponding to tasks waiting for event to occur */
268 } OS_MBOX_DATA;
269 #endif
270 
271 /*
272 *********************************************************************************************************
273 * MEMORY PARTITION DATA STRUCTURES
274 *********************************************************************************************************
275 */
276 
277 #if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
278 typedef struct { /* MEMORY CONTROL BLOCK */
279  void *OSMemAddr; /* Pointer to beginning of memory partition */
280  void *OSMemFreeList; /* Pointer to list of free memory blocks */
281  INT32U OSMemBlkSize; /* Size (in bytes) of each block of memory */
282  INT32U OSMemNBlks; /* Total number of blocks in this partition */
283  INT32U OSMemNFree; /* Number of memory blocks remaining in this partition */
284 } OS_MEM;
285 
286 
287 typedef struct {
288  void *OSAddr; /* Pointer to the beginning address of the memory partition */
289  void *OSFreeList; /* Pointer to the beginning of the free list of memory blocks */
290  INT32U OSBlkSize; /* Size (in bytes) of each memory block */
291  INT32U OSNBlks; /* Total number of blocks in the partition */
292  INT32U OSNFree; /* Number of memory blocks free */
293  INT32U OSNUsed; /* Number of memory blocks used */
294 } OS_MEM_DATA;
295 #endif
296 
297 /*$PAGE*/
298 /*
299 *********************************************************************************************************
300 * MUTUAL EXCLUSION SEMAPHORE DATA
301 *********************************************************************************************************
302 */
303 
304 #if OS_MUTEX_EN > 0
305 typedef struct {
306  INT8U OSEventTbl[OS_EVENT_TBL_SIZE]; /* List of tasks waiting for event to occur */
307  INT8U OSEventGrp; /* Group corresponding to tasks waiting for event to occur */
308  INT8U OSValue; /* Mutex value (0 = used, 1 = available) */
309  INT8U OSOwnerPrio; /* Mutex owner's task priority or 0xFF if no owner */
310  INT8U OSMutexPIP; /* Priority Inheritance Priority or 0xFF if no owner */
311 } OS_MUTEX_DATA;
312 #endif
313 
314 /*
315 *********************************************************************************************************
316 * MESSAGE QUEUE DATA
317 *********************************************************************************************************
318 */
319 
320 #if OS_Q_EN > 0
321 typedef struct os_q { /* QUEUE CONTROL BLOCK */
322  struct os_q *OSQPtr; /* Link to next queue control block in list of free blocks */
323  void **OSQStart; /* Pointer to start of queue data */
324  void **OSQEnd; /* Pointer to end of queue data */
325  void **OSQIn; /* Pointer to where next message will be inserted in the Q */
326  void **OSQOut; /* Pointer to where next message will be extracted from the Q */
327  INT16U OSQSize; /* Size of queue (maximum number of entries) */
328  INT16U OSQEntries; /* Current number of entries in the queue */
329 } OS_Q;
330 
331 
332 typedef struct {
333  void *OSMsg; /* Pointer to next message to be extracted from queue */
334  INT16U OSNMsgs; /* Number of messages in message queue */
335  INT16U OSQSize; /* Size of message queue */
336  INT8U OSEventTbl[OS_EVENT_TBL_SIZE]; /* List of tasks waiting for event to occur */
337  INT8U OSEventGrp; /* Group corresponding to tasks waiting for event to occur */
338 } OS_Q_DATA;
339 #endif
340 
341 /*
342 *********************************************************************************************************
343 * SEMAPHORE DATA
344 *********************************************************************************************************
345 */
346 
347 #if OS_SEM_EN > 0
348 typedef struct {
349  INT16U OSCnt; /* Semaphore count */
350  INT8U OSEventTbl[OS_EVENT_TBL_SIZE]; /* List of tasks waiting for event to occur */
351  INT8U OSEventGrp; /* Group corresponding to tasks waiting for event to occur */
352 } OS_SEM_DATA;
353 #endif
354 
355 /*
356 *********************************************************************************************************
357 * TASK STACK DATA
358 *********************************************************************************************************
359 */
360 
361 #if OS_TASK_CREATE_EXT_EN > 0
362 typedef struct {
363  INT32U OSFree; /* Number of free bytes on the stack */
364  INT32U OSUsed; /* Number of bytes used on the stack */
365 } OS_STK_DATA;
366 #endif
367 
368 /*$PAGE*/
369 /*
370 *********************************************************************************************************
371 * TASK CONTROL BLOCK
372 *********************************************************************************************************
373 */
374 
375 typedef struct os_tcb {
378 #if OS_TASK_CREATE_EXT_EN > 0
379  void *OSTCBExtPtr; /* Pointer to user definable data for TCB extension */
380  OS_STK *OSTCBStkBottom; /* Pointer to bottom of stack */
381  INT32U OSTCBStkSize; /* Size of task stack (in number of stack elements) */
382  INT16U OSTCBOpt; /* Task options as passed by OSTaskCreateExt() */
383  INT16U OSTCBId; /* Task ID (0..65535) */
384 #endif
385 
386  struct os_tcb *OSTCBNext;
387  struct os_tcb *OSTCBPrev;
389 #if ((OS_Q_EN > 0) && (OS_MAX_QS > 0)) || (OS_MBOX_EN > 0) || (OS_SEM_EN > 0) || (OS_MUTEX_EN > 0)
390  OS_EVENT *OSTCBEventPtr; /* Pointer to event control block */
391 #endif
392 
393 #if ((OS_Q_EN > 0) && (OS_MAX_QS > 0)) || (OS_MBOX_EN > 0)
394  void *OSTCBMsg; /* Message received from OSMboxPost() or OSQPost() */
395 #endif
396 
397 #if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
398 #if OS_TASK_DEL_EN > 0
399  OS_FLAG_NODE *OSTCBFlagNode; /* Pointer to event flag node */
400 #endif
401  OS_FLAGS OSTCBFlagsRdy; /* Event flags that made task ready to run */
402 #endif
403 
413 #if OS_TASK_DEL_EN > 0
414  BOOLEAN OSTCBDelReq; /* Indicates whether a task needs to delete itself */
415 #endif
416 } OS_TCB;
417 
418 /*$PAGE*/
419 /*
420 *********************************************************************************************************
421 * GLOBAL VARIABLES
422 *********************************************************************************************************
423 */
424 
427 #if (OS_EVENT_EN > 0) && (OS_MAX_EVENTS > 0)
428 OS_EXT OS_EVENT *OSEventFreeList; /* Pointer to list of free EVENT control blocks */
429 OS_EXT OS_EVENT OSEventTbl[OS_MAX_EVENTS];/* Table of EVENT control blocks */
430 #endif
431 
432 #if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
433 OS_EXT OS_FLAG_GRP OSFlagTbl[OS_MAX_FLAGS]; /* Table containing event flag groups */
434 OS_EXT OS_FLAG_GRP *OSFlagFreeList; /* Pointer to free list of event flag groups */
435 #endif
436 
437 #if OS_TASK_STAT_EN > 0
438 OS_EXT INT8S OSCPUUsage; /* Percentage of CPU used */
439 OS_EXT INT32U OSIdleCtrMax; /* Max. value that idle ctr can take in 1 sec. */
440 OS_EXT INT32U OSIdleCtrRun; /* Val. reached by idle ctr at run time in 1 sec. */
441 OS_EXT BOOLEAN OSStatRdy; /* Flag indicating that the statistic task is rdy */
442 OS_EXT OS_STK OSTaskStatStk[OS_TASK_STAT_STK_SIZE]; /* Statistics task stack */
443 #endif
444 
450 OS_EXT INT8U OSPrioCur;
453 OS_EXT INT8U OSRdyGrp;
458 OS_EXT INT8U OSTaskCtr;
460 OS_EXT volatile INT32U OSIdleCtr;
465 OS_EXT OS_TCB *OSTCBCur;
468 OS_EXT OS_TCB *OSTCBList;
472 #if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
473 OS_EXT OS_MEM *OSMemFreeList;
474 OS_EXT OS_MEM OSMemTbl[OS_MAX_MEM_PART];
475 #endif
476 
477 #if (OS_Q_EN > 0) && (OS_MAX_QS > 0)
478 OS_EXT OS_Q *OSQFreeList;
479 OS_EXT OS_Q OSQTbl[OS_MAX_QS];
480 #endif
481 
482 #if OS_TIME_GET_SET_EN > 0
483 OS_EXT volatile INT32U OSTime;
484 #endif
485 
486 /* Microchip PIC18xxx specific - lookup in program memory because of limited RAM space */
487 extern rom INT8U const OSMapTbl[];
488 extern rom INT8U const OSUnMapTbl[];
489 /* End Microchip PIC18xxx specific */
490 
491 /*$PAGE*/
492 /*
493 *********************************************************************************************************
494 * FUNCTION PROTOTYPES
495 * (Target Independent Functions)
496 *********************************************************************************************************
497 */
498 
499 /*
500 *********************************************************************************************************
501 * EVENT FLAGS MANAGEMENT
502 *********************************************************************************************************
503 */
504 
505 #if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
506 
507 #if OS_FLAG_ACCEPT_EN > 0
508 OS_FLAGS OSFlagAccept(OS_FLAG_GRP *pgrp, OS_FLAGS flags, INT8U wait_type, INT8U *err);
509 #endif
510 
511 OS_FLAG_GRP *OSFlagCreate(OS_FLAGS flags, INT8U *err);
512 
513 #if OS_FLAG_DEL_EN > 0
514 OS_FLAG_GRP *OSFlagDel(OS_FLAG_GRP *pgrp, INT8U opt, INT8U *err);
515 #endif
516 
517 OS_FLAGS OSFlagPend(OS_FLAG_GRP *pgrp, OS_FLAGS flags, INT8U wait_type, INT16U timeout, INT8U *err);
518 OS_FLAGS OSFlagPost(OS_FLAG_GRP *pgrp, OS_FLAGS flags, INT8U operation, INT8U *err);
519 
520 #if OS_FLAG_QUERY_EN > 0
521 OS_FLAGS OSFlagQuery(OS_FLAG_GRP *pgrp, INT8U *err);
522 #endif
523 #endif
524 
525 /*
526 *********************************************************************************************************
527 * MESSAGE MAILBOX MANAGEMENT
528 *********************************************************************************************************
529 */
530 
531 #if OS_MBOX_EN > 0
532 
533 #if OS_MBOX_ACCEPT_EN > 0
534 void *OSMboxAccept(OS_EVENT *pevent);
535 #endif
536 
537 OS_EVENT *OSMboxCreate(void *msg);
538 
539 #if OS_MBOX_DEL_EN > 0
540 OS_EVENT *OSMboxDel(OS_EVENT *pevent, INT8U opt, INT8U *err);
541 #endif
542 
543 void *OSMboxPend(OS_EVENT *pevent, INT16U timeout, INT8U *err);
544 
545 #if OS_MBOX_POST_EN > 0
546 INT8U OSMboxPost(OS_EVENT *pevent, void *msg);
547 #endif
548 
549 #if OS_MBOX_POST_OPT_EN > 0
550 INT8U OSMboxPostOpt(OS_EVENT *pevent, void *msg, INT8U opt);
551 #endif
552 
553 #if OS_MBOX_QUERY_EN > 0
554 INT8U OSMboxQuery(OS_EVENT *pevent, OS_MBOX_DATA *pdata);
555 #endif
556 #endif
557 
558 /*
559 *********************************************************************************************************
560 * MEMORY MANAGEMENT
561 *********************************************************************************************************
562 */
563 
564 #if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
565 
566 OS_MEM *OSMemCreate(void *addr, INT32U nblks, INT32U blksize, INT8U *err);
567 void *OSMemGet(OS_MEM *pmem, INT8U *err);
568 INT8U OSMemPut(OS_MEM *pmem, void *pblk);
569 
570 #if OS_MEM_QUERY_EN > 0
571 INT8U OSMemQuery(OS_MEM *pmem, OS_MEM_DATA *pdata);
572 #endif
573 
574 #endif
575 
576 /*
577 *********************************************************************************************************
578 * MUTUAL EXCLUSION SEMAPHORE MANAGEMENT
579 *********************************************************************************************************
580 */
581 
582 #if OS_MUTEX_EN > 0
583 
584 #if OS_MUTEX_ACCEPT_EN > 0
585 INT8U OSMutexAccept(OS_EVENT *pevent, INT8U *err);
586 #endif
587 
588 OS_EVENT *OSMutexCreate(INT8U prio, INT8U *err);
589 
590 #if OS_MUTEX_DEL_EN > 0
591 OS_EVENT *OSMutexDel(OS_EVENT *pevent, INT8U opt, INT8U *err);
592 #endif
593 
594 void OSMutexPend(OS_EVENT *pevent, INT16U timeout, INT8U *err);
595 INT8U OSMutexPost(OS_EVENT *pevent);
596 
597 #if OS_MUTEX_QUERY_EN > 0
598 INT8U OSMutexQuery(OS_EVENT *pevent, OS_MUTEX_DATA *pdata);
599 #endif
600 
601 #endif
602 
603 /*$PAGE*/
604 /*
605 *********************************************************************************************************
606 * MESSAGE QUEUE MANAGEMENT
607 *********************************************************************************************************
608 */
609 
610 #if (OS_Q_EN > 0) && (OS_MAX_QS > 0)
611 
612 #if OS_Q_ACCEPT_EN > 0
613 void *OSQAccept(OS_EVENT *pevent);
614 #endif
615 
616 OS_EVENT *OSQCreate(void **start, INT16U size);
617 
618 #if OS_Q_DEL_EN > 0
619 OS_EVENT *OSQDel(OS_EVENT *pevent, INT8U opt, INT8U *err);
620 #endif
621 
622 #if OS_Q_FLUSH_EN > 0
623 INT8U OSQFlush(OS_EVENT *pevent);
624 #endif
625 
626 void *OSQPend(OS_EVENT *pevent, INT16U timeout, INT8U *err);
627 
628 #if OS_Q_POST_EN > 0
629 INT8U OSQPost(OS_EVENT *pevent, void *msg);
630 #endif
631 
632 #if OS_Q_POST_FRONT_EN > 0
633 INT8U OSQPostFront(OS_EVENT *pevent, void *msg);
634 #endif
635 
636 #if OS_Q_POST_OPT_EN > 0
637 INT8U OSQPostOpt(OS_EVENT *pevent, void *msg, INT8U opt);
638 #endif
639 
640 #if OS_Q_QUERY_EN > 0
641 INT8U OSQQuery(OS_EVENT *pevent, OS_Q_DATA *pdata);
642 #endif
643 
644 #endif
645 
646 /*$PAGE*/
647 /*
648 *********************************************************************************************************
649 * SEMAPHORE MANAGEMENT
650 *********************************************************************************************************
651 */
652 #if OS_SEM_EN > 0
653 
654 #if OS_SEM_ACCEPT_EN > 0
655 INT16U OSSemAccept(OS_EVENT *pevent);
656 #endif
657 
658 OS_EVENT *OSSemCreate(INT16U cnt);
659 
660 #if OS_SEM_DEL_EN > 0
661 OS_EVENT *OSSemDel(OS_EVENT *pevent, INT8U opt, INT8U *err);
662 #endif
663 
664 void OSSemPend(OS_EVENT *pevent, INT16U timeout, INT8U *err);
665 INT8U OSSemPost(OS_EVENT *pevent);
666 
667 #if OS_SEM_QUERY_EN > 0
668 INT8U OSSemQuery(OS_EVENT *pevent, OS_SEM_DATA *pdata);
669 #endif
670 
671 #endif
672 
673 /*$PAGE*/
674 /*
675 *********************************************************************************************************
676 * TASK MANAGEMENT
677 *********************************************************************************************************
678 */
679 #if OS_TASK_CHANGE_PRIO_EN > 0
680 INT8U OSTaskChangePrio(INT8U oldprio, INT8U newprio);
681 #endif
682 
683 #if OS_TASK_CREATE_EN > 0
684 INT8U OSTaskCreate(void (*task)(void *pd), void *pdata, OS_STK *ptos, INT8U prio);
685 #endif
686 
687 #if OS_TASK_CREATE_EXT_EN > 0
688 INT8U OSTaskCreateExt(void (*task)(void *pd),
689  void *pdata,
690  OS_STK *ptos,
691  INT8U prio,
692  INT16U id,
693  OS_STK *pbos,
694  INT32U stk_size,
695  void *pext,
696  INT16U opt);
697 #endif
698 
699 #if OS_TASK_DEL_EN > 0
700 INT8U OSTaskDel(INT8U prio);
701 INT8U OSTaskDelReq(INT8U prio);
702 #endif
703 
704 #if OS_TASK_SUSPEND_EN > 0
705 INT8U OSTaskResume(INT8U prio);
706 INT8U OSTaskSuspend(INT8U prio);
707 #endif
708 
709 #if OS_TASK_CREATE_EXT_EN > 0
710 INT8U OSTaskStkChk(INT8U prio, OS_STK_DATA *pdata);
711 #endif
712 
713 #if OS_TASK_QUERY_EN > 0
714 INT8U OSTaskQuery(INT8U prio, OS_TCB *pdata);
715 #endif
716 
717 /*$PAGE*/
718 /*
719 *********************************************************************************************************
720 * TIME MANAGEMENT
721 *********************************************************************************************************
722 */
723 
724 void OSTimeDly(INT16U ticks);
725 
726 #if OS_TIME_DLY_HMSM_EN > 0
727 INT8U OSTimeDlyHMSM(INT8U hours, INT8U minutes, INT8U seconds, INT16U milli);
728 #endif
729 
730 #if OS_TIME_DLY_RESUME_EN > 0
731 INT8U OSTimeDlyResume(INT8U prio);
732 #endif
733 
734 #if OS_TIME_GET_SET_EN > 0
735 INT32U OSTimeGet(void);
736 void OSTimeSet(INT32U ticks);
737 #endif
738 
739 void OSTimeTick(void);
740 
741 /*
742 *********************************************************************************************************
743 * MISCELLANEOUS
744 *********************************************************************************************************
745 */
746 
747 void OSInit(void);
748 
749 void OSIntEnter(void);
750 void OSIntExit(void);
751 
752 #if OS_SCHED_LOCK_EN > 0
753 void OSSchedLock(void);
754 void OSSchedUnlock(void);
755 #endif
756 
757 void OSStart(void);
758 
759 void OSStatInit(void);
760 
761 INT16U OSVersion(void);
762 
763 /*$PAGE*/
764 /*
765 *********************************************************************************************************
766 * INTERNAL FUNCTION PROTOTYPES
767 * (Your application MUST NOT call these functions)
768 *********************************************************************************************************
769 */
770 
771 #if OS_TASK_DEL_EN > 0
772 void OS_Dummy(void);
773 #endif
774 
775 #if ((OS_Q_EN > 0) && (OS_MAX_QS > 0)) || (OS_MBOX_EN > 0) || (OS_SEM_EN > 0) || (OS_MUTEX_EN > 0)
776 INT8U OS_EventTaskRdy(OS_EVENT *pevent, void *msg, INT8U msk);
777 void OS_EventTaskWait(OS_EVENT *pevent);
778 void OS_EventTO(OS_EVENT *pevent);
779 void OS_EventWaitListInit(OS_EVENT *pevent);
780 #endif
781 
782 #if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
783 void OS_FlagInit(void);
784 void OS_FlagUnlink(OS_FLAG_NODE *pnode);
785 #endif
786 
787 #if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
788 void OS_MemInit(void);
789 #endif
790 
791 #if OS_Q_EN > 0
792 void OS_QInit(void);
793 #endif
794 
795 void OS_Sched(void);
796 
797 void OS_TaskIdle(void *data);
798 
799 #if OS_TASK_STAT_EN > 0
800 void OS_TaskStat(void *data);
801 #endif
802 
803 INT8U OS_TCBInit(INT8U prio, OS_STK *ptos, OS_STK *pbos, INT16U id, INT32U stk_size, void *pext, INT16U opt);
804 
805 /*$PAGE*/
806 /*
807 *********************************************************************************************************
808 * FUNCTION PROTOTYPES
809 * (Target Specific Functions)
810 *********************************************************************************************************
811 */
812 
813 #if OS_VERSION >= 204
814 void OSInitHookBegin(void);
815 void OSInitHookEnd(void);
816 #endif
817 
818 void OSIntCtxSw(void);
819 
820 void OSStartHighRdy(void);
821 
822 void OSTaskCreateHook(OS_TCB *ptcb);
823 void OSTaskDelHook(OS_TCB *ptcb);
824 
825 #if OS_VERSION >= 251
826 void OSTaskIdleHook(void);
827 #endif
828 
829 void OSTaskStatHook(void);
830 OS_STK *OSTaskStkInit(void (*task)(void *pd), void *pdata, OS_STK *ptos, INT16U opt);
831 void OSTaskSwHook(void);
832 
833 #if OS_VERSION >= 204
834 void OSTCBInitHook(OS_TCB *ptcb);
835 #endif
836 
837 void OSTimeTickHook(void);
838 
839 /*
840 *********************************************************************************************************
841 * FUNCTION PROTOTYPES
842 * (Compiler Specific ISR prototypes)
843 *********************************************************************************************************
844 */
845 
846 #ifndef OS_ISR_PROTO_EXT
847 void OSCtxSw(void);
848 void OSTickISR(void);
849 #endif
850 
851 /*$PAGE*/
852 /*
853 *********************************************************************************************************
854 * LOOK FOR MISSING #define CONSTANTS
855 *
856 * This section is used to generate ERROR messages at compile time if certain #define constants are
857 * MISSING in OS_CFG.H. This allows you to quickly determine the source of the error.
858 *
859 * You SHOULD NOT change this section UNLESS you would like to add more comments as to the source of the
860 * compile time error.
861 *********************************************************************************************************
862 */
863 
864 /*
865 *********************************************************************************************************
866 * EVENT FLAGS
867 *********************************************************************************************************
868 */
869 
870 #ifndef OS_FLAG_EN
871 #error "OS_CFG.H, Missing OS_FLAG_EN: Enable (1) or Disable (0) code generation for Event Flags"
872 #else
873  #ifndef OS_MAX_FLAGS
874  #error "OS_CFG.H, Missing OS_MAX_FLAGS: Max. number of Event Flag Groups in your application"
875  #else
876  #if OS_MAX_FLAGS == 0
877  #error "OS_CFG.H, OS_MAX_FLAGS must be > 0"
878  #endif
879  #if OS_MAX_FLAGS > 255
880  #error "OS_CFG.H, OS_MAX_FLAGS must be <= 255"
881  #endif
882  #endif
883 
884  #ifndef OS_FLAG_WAIT_CLR_EN
885  #error "OS_CFG.H, Missing OS_FLAG_WAIT_CLR_EN: Include code for Wait on Clear EVENT FLAGS"
886  #endif
887 
888  #ifndef OS_FLAG_ACCEPT_EN
889  #error "OS_CFG.H, Missing OS_FLAG_ACCEPT_EN: Include code for OSFlagAccept()"
890  #endif
891 
892  #ifndef OS_FLAG_DEL_EN
893  #error "OS_CFG.H, Missing OS_FLAG_DEL_EN: Include code for OSFlagDel()"
894  #endif
895 
896  #ifndef OS_FLAG_QUERY_EN
897  #error "OS_CFG.H, Missing OS_FLAG_QUERY_EN: Include code for OSFlagQuery()"
898  #endif
899 #endif
900 
901 /*
902 *********************************************************************************************************
903 * MESSAGE MAILBOXES
904 *********************************************************************************************************
905 */
906 
907 #ifndef OS_MBOX_EN
908 #error "OS_CFG.H, Missing OS_MBOX_EN: Enable (1) or Disable (0) code generation for MAILBOXES"
909 #else
910  #ifndef OS_MBOX_ACCEPT_EN
911  #error "OS_CFG.H, Missing OS_MBOX_ACCEPT_EN: Include code for OSMboxAccept()"
912  #endif
913 
914  #ifndef OS_MBOX_DEL_EN
915  #error "OS_CFG.H, Missing OS_MBOX_DEL_EN: Include code for OSMboxDel()"
916  #endif
917 
918  #ifndef OS_MBOX_POST_EN
919  #error "OS_CFG.H, Missing OS_MBOX_POST_EN: Include code for OSMboxPost()"
920  #endif
921 
922  #ifndef OS_MBOX_POST_OPT_EN
923  #error "OS_CFG.H, Missing OS_MBOX_POST_OPT_EN: Include code for OSMboxPostOpt()"
924  #endif
925 
926  #ifndef OS_MBOX_QUERY_EN
927  #error "OS_CFG.H, Missing OS_MBOX_QUERY_EN: Include code for OSMboxQuery()"
928  #endif
929 #endif
930 
931 /*
932 *********************************************************************************************************
933 * MEMORY MANAGEMENT
934 *********************************************************************************************************
935 */
936 
937 #ifndef OS_MEM_EN
938 #error "OS_CFG.H, Missing OS_MEM_EN: Enable (1) or Disable (0) code generation for MEMORY MANAGER"
939 #else
940  #ifndef OS_MAX_MEM_PART
941  #error "OS_CFG.H, Missing OS_MAX_MEM_PART: Max. number of memory partitions"
942  #else
943  #if OS_MAX_MEM_PART == 0
944  #error "OS_CFG.H, OS_MAX_MEM_PART must be > 0"
945  #endif
946  #if OS_MAX_MEM_PART > 255
947  #error "OS_CFG.H, OS_MAX_MEM_PART must be <= 255"
948  #endif
949  #endif
950 
951  #ifndef OS_MEM_QUERY_EN
952  #error "OS_CFG.H, Missing OS_MEM_QUERY_EN: Include code for OSMemQuery()"
953  #endif
954 #endif
955 
956 /*
957 *********************************************************************************************************
958 * MUTUAL EXCLUSION SEMAPHORES
959 *********************************************************************************************************
960 */
961 
962 #ifndef OS_MUTEX_EN
963 #error "OS_CFG.H, Missing OS_MUTEX_EN: Enable (1) or Disable (0) code generation for MUTEX"
964 #else
965  #ifndef OS_MUTEX_ACCEPT_EN
966  #error "OS_CFG.H, Missing OS_MUTEX_ACCEPT_EN: Include code for OSMutexAccept()"
967  #endif
968 
969  #ifndef OS_MUTEX_DEL_EN
970  #error "OS_CFG.H, Missing OS_MUTEX_DEL_EN: Include code for OSMutexDel()"
971  #endif
972 
973  #ifndef OS_MUTEX_QUERY_EN
974  #error "OS_CFG.H, Missing OS_MUTEX_QUERY_EN: Include code for OSMutexQuery()"
975  #endif
976 #endif
977 
978 /*
979 *********************************************************************************************************
980 * MESSAGE QUEUES
981 *********************************************************************************************************
982 */
983 
984 #ifndef OS_Q_EN
985 #error "OS_CFG.H, Missing OS_Q_EN: Enable (1) or Disable (0) code generation for QUEUES"
986 #else
987  #ifndef OS_MAX_QS
988  #error "OS_CFG.H, Missing OS_MAX_QS: Max. number of queue control blocks"
989  #else
990  #if OS_MAX_QS == 0
991  #error "OS_CFG.H, OS_MAX_QS must be > 0"
992  #endif
993  #if OS_MAX_QS > 255
994  #error "OS_CFG.H, OS_MAX_QS must be <= 255"
995  #endif
996  #endif
997 
998  #ifndef OS_Q_ACCEPT_EN
999  #error "OS_CFG.H, Missing OS_Q_ACCEPT_EN: Include code for OSQAccept()"
1000  #endif
1001 
1002  #ifndef OS_Q_DEL_EN
1003  #error "OS_CFG.H, Missing OS_Q_DEL_EN: Include code for OSQDel()"
1004  #endif
1005 
1006  #ifndef OS_Q_FLUSH_EN
1007  #error "OS_CFG.H, Missing OS_Q_FLUSH_EN: Include code for OSQFlush()"
1008  #endif
1009 
1010  #ifndef OS_Q_POST_EN
1011  #error "OS_CFG.H, Missing OS_Q_POST_EN: Include code for OSQPost()"
1012  #endif
1013 
1014  #ifndef OS_Q_POST_FRONT_EN
1015  #error "OS_CFG.H, Missing OS_Q_POST_FRONT_EN: Include code for OSQPostFront()"
1016  #endif
1017 
1018  #ifndef OS_Q_POST_OPT_EN
1019  #error "OS_CFG.H, Missing OS_Q_POST_OPT_EN: Include code for OSQPostOpt()"
1020  #endif
1021 
1022  #ifndef OS_Q_QUERY_EN
1023  #error "OS_CFG.H, Missing OS_Q_QUERY_EN: Include code for OSQQuery()"
1024  #endif
1025 #endif
1026 
1027 /*
1028 *********************************************************************************************************
1029 * SEMAPHORES
1030 *********************************************************************************************************
1031 */
1032 
1033 #ifndef OS_SEM_EN
1034 #error "OS_CFG.H, Missing OS_SEM_EN: Enable (1) or Disable (0) code generation for SEMAPHORES"
1035 #else
1036  #ifndef OS_SEM_ACCEPT_EN
1037  #error "OS_CFG.H, Missing OS_SEM_ACCEPT_EN: Include code for OSSemAccept()"
1038  #endif
1039 
1040  #ifndef OS_SEM_DEL_EN
1041  #error "OS_CFG.H, Missing OS_SEM_DEL_EN: Include code for OSSemDel()"
1042  #endif
1043 
1044  #ifndef OS_SEM_QUERY_EN
1045  #error "OS_CFG.H, Missing OS_SEM_QUERY_EN: Include code for OSSemQuery()"
1046  #endif
1047 #endif
1048 
1049 /*
1050 *********************************************************************************************************
1051 * TASK MANAGEMENT
1052 *********************************************************************************************************
1053 */
1054 
1055 #ifndef OS_MAX_TASKS
1056 #error "OS_CFG.H, Missing OS_MAX_TASKS: Max. number of tasks in your application"
1057 #else
1058  #if OS_MAX_TASKS == 0
1059  #error "OS_CFG.H, OS_MAX_TASKS must be >= 2"
1060  #endif
1061  #if OS_MAX_TASKS > 63
1062  #error "OS_CFG.H, OS_MAX_TASKS must be <= 63"
1063  #endif
1064 #endif
1065 
1066 #ifndef OS_TASK_IDLE_STK_SIZE
1067 #error "OS_CFG.H, Missing OS_TASK_IDLE_STK_SIZE: Idle task stack size"
1068 #endif
1069 
1070 #ifndef OS_TASK_STAT_EN
1071 #error "OS_CFG.H, Missing OS_TASK_STAT_EN: Enable (1) or Disable(0) the statistics task"
1072 #endif
1073 
1074 #ifndef OS_TASK_STAT_STK_SIZE
1075 #error "OS_CFG.H, Missing OS_TASK_STAT_STK_SIZE: Statistics task stack size"
1076 #endif
1077 
1078 #ifndef OS_TASK_CHANGE_PRIO_EN
1079 #error "OS_CFG.H, Missing OS_TASK_CHANGE_PRIO_EN: Include code for OSTaskChangePrio()"
1080 #endif
1081 
1082 #ifndef OS_TASK_CREATE_EN
1083 #error "OS_CFG.H, Missing OS_TASK_CREATE_EN: Include code for OSTaskCreate()"
1084 #endif
1085 
1086 #ifndef OS_TASK_CREATE_EXT_EN
1087 #error "OS_CFG.H, Missing OS_TASK_CREATE_EXT_EN: Include code for OSTaskCreateExt()"
1088 #endif
1089 
1090 #ifndef OS_TASK_DEL_EN
1091 #error "OS_CFG.H, Missing OS_TASK_DEL_EN: Include code for OSTaskDel()"
1092 #endif
1093 
1094 #ifndef OS_TASK_SUSPEND_EN
1095 #error "OS_CFG.H, Missing OS_TASK_SUSPEND_EN: Include code for OSTaskSuspend() and OSTaskResume()"
1096 #endif
1097 
1098 #ifndef OS_TASK_QUERY_EN
1099 #error "OS_CFG.H, Missing OS_TASK_QUERY_EN: Include code for OSTaskQuery()"
1100 #endif
1101 
1102 /*
1103 *********************************************************************************************************
1104 * TIME MANAGEMENT
1105 *********************************************************************************************************
1106 */
1107 
1108 #ifndef OS_TICKS_PER_SEC
1109 #error "OS_CFG.H, Missing OS_TICKS_PER_SEC: Sets the number of ticks in one second"
1110 #endif
1111 
1112 #ifndef OS_TIME_DLY_HMSM_EN
1113 #error "OS_CFG.H, Missing OS_TIME_DLY_HMSM_EN: Include code for OSTimeDlyHMSM()"
1114 #endif
1115 
1116 #ifndef OS_TIME_DLY_RESUME_EN
1117 #error "OS_CFG.H, Missing OS_TIME_DLY_RESUME_EN: Include code for OSTimeDlyResume()"
1118 #endif
1119 
1120 #ifndef OS_TIME_GET_SET_EN
1121 #error "OS_CFG.H, Missing OS_TIME_GET_SET_EN: Include code for OSTimeGet() and OSTimeSet()"
1122 #endif
1123 
1124 /*
1125 *********************************************************************************************************
1126 * MISCELLANEOUS
1127 *********************************************************************************************************
1128 */
1129 
1130 #ifndef OS_MAX_EVENTS
1131 #error "OS_CFG.H, Missing OS_MAX_EVENTS: Max. number of event control blocks in your application"
1132 #else
1133  #if OS_MAX_EVENTS == 0
1134  #error "OS_CFG.H, OS_MAX_EVENTS must be > 0"
1135  #endif
1136  #if OS_MAX_EVENTS > 255
1137  #error "OS_CFG.H, OS_MAX_EVENTS must be <= 255"
1138  #endif
1139 #endif
1140 
1141 #ifndef OS_LOWEST_PRIO
1142 #error "OS_CFG.H, Missing OS_LOWEST_PRIO: Defines the lowest priority that can be assigned"
1143 #endif
1144 
1145 #ifndef OS_ARG_CHK_EN
1146 #error "OS_CFG.H, Missing OS_ARG_CHK_EN: Enable (1) or Disable (0) argument checking"
1147 #endif
1148 
1149 #ifndef OS_CPU_HOOKS_EN
1150 #error "OS_CFG.H, Missing OS_CPU_HOOKS_EN: uC/OS-II hooks are found in the processor port files when 1"
1151 #endif
1152 
1153 #ifndef OS_SCHED_LOCK_EN
1154 #error "OS_CFG.H, Missing OS_SCHED_LOCK_EN: Include code for OSSchedLock() and OSSchedUnlock()"
1155 #endif
OS_EXT INT8U OSIntNesting
Definition: UCOS_II.H:445
struct os_tcb * OSTCBPrev
Definition: UCOS_II.H:387
unsigned char INT8U
Definition: OS_CPU.H:38
INT8U OSTCBStat
Definition: UCOS_II.H:405
void OSStatInit(void)
STATISTICS INITIALIZATION.
OS_EXT INT8U OSRdyTbl[OS_RDY_TBL_SIZE]
Definition: UCOS_II.H:454
#define OS_MAX_QS
Definition: OS_CFG.H:42
OS_EXT INT32U OSCtxSwCtr
Definition: UCOS_II.H:425
#define OS_MAX_EVENTS
Definition: OS_CFG.H:28
OS_EXT OS_TCB OSTCBTbl[OS_MAX_TASKS+OS_N_SYS_TASKS]
Definition: UCOS_II.H:470
void OSTaskDelHook(OS_TCB *ptcb)
TASK DELETION HOOK This function is called when a task is deleted.
Definition: OS_CPU_C.C:146
void OSInitHookEnd(void)
OS INITIALIZATION HOOK This This function is called by OSInit() at the end of OSInit().
Definition: OS_CPU_C.C:314
#define OS_TASK_IDLE_STK_SIZE
Definition: OS_CFG.H:53
OS_STK * OSTaskStkInit(void(*task)(void *pd), void *pdata, OS_STK *ptos, INT16U opt)
INITIALIZE A TASK&#39;S STACK This function is called by either OSTaskCreate() or OSTaskCreateExt() to ...
Definition: OS_CPU_C.C:69
void OSInitHookBegin(void)
OS INITIALIZATION HOOK This function is called by OSInit() at the beginning of OSInit().
Definition: OS_CPU_C.C:291
INT8U OSMboxPost(OS_EVENT *pevent, void *msg)
POST MESSAGE TO A MAILBOX.
Definition: OS_MBOX.C:381
INT8U OSMboxPostOpt(OS_EVENT *pevent, void *msg, INT8U opt)
POST MESSAGE TO A MAILBOX.
Definition: OS_MBOX.C:458
INT16U OS_FLAGS
Definition: OS_CFG.H:131
OS_EXT OS_STK OSTaskIdleStk[OS_TASK_IDLE_STK_SIZE]
Definition: UCOS_II.H:462
void OSIntEnter(void)
ENTER ISR.
Definition: OS_CORE.C:161
INT8U OS_TCBInit(INT8U prio, OS_STK *ptos, OS_STK *pbos, INT16U id, INT32U stk_size, void *pext, INT16U opt)
INITIALIZE TCB.
Definition: OS_CORE.C:1131
void OS_Sched(void)
SCHEDULER This function is called by other uC/OS-II services to determine whether a new...
Definition: OS_CORE.C:939
void OS_TaskIdle(void *data)
IDLE TASK.
Definition: OS_CORE.C:986
INT16U OSVersion(void)
GET VERSION.
Definition: OS_CORE.C:472
OS_EXT volatile INT32U OSIdleCtr
Definition: UCOS_II.H:460
OS_EXT OS_TCB * OSTCBHighRdy
Definition: UCOS_II.H:467
#define OS_EVENT_TBL_SIZE
Definition: UCOS_II.H:52
void OSTaskIdleHook(void)
IDLE TASK HOOK This function is called by OS_TaskIdle() which is executed whenever no other task is r...
Definition: OS_CPU_C.C:269
INT8U OSTCBPrio
Definition: UCOS_II.H:406
void * OSMboxPend(OS_EVENT *pevent, INT16U timeout, INT8U *err)
PEND ON MAILBOX FOR A MESSAGE.
Definition: OS_MBOX.C:293
OS_EVENT * OSMboxDel(OS_EVENT *pevent, INT8U opt, INT8U *err)
DELETE A MAIBOX.
Definition: OS_MBOX.C:180
OS_EXT OS_TCB * OSTCBCur
Definition: UCOS_II.H:465
INT8U OSTCBY
Definition: UCOS_II.H:409
OS_EVENT * OSMboxCreate(void *msg)
CREATE A MESSAGE MAILBOX.
Definition: OS_MBOX.C:109
OS_EXT BOOLEAN OSRunning
Definition: UCOS_II.H:456
INT8U OS_STK
Definition: OS_CPU.H:52
void OSTCBInitHook(OS_TCB *ptcb)
TICK HOOK.
Definition: OS_CPU_C.C:243
Definition: UCOS_II.H:375
OS_EXT OS_TCB * OSTCBPrioTbl[OS_LOWEST_PRIO+1]
Definition: UCOS_II.H:469
rom INT8U const OSMapTbl[]
Definition: OS_CORE.C:30
void OSTaskStatHook(void)
STATISTIC TASK HOOK This function is called every second by uC/OS-II&#39;s statistics task...
Definition: OS_CPU_C.C:196
void OSIntCtxSw(void)
PERFORM A CONTEXT SWITCH (From an ISR)
Definition: OS_CPU_C.C:817
OS_STK * OSTCBStkPtr
Definition: UCOS_II.H:376
rom INT8U const OSUnMapTbl[]
Definition: OS_CORE.C:43
void OSCtxSw(void)
Switch the context by calling the function directly, since there are no software interrupts in a PIC1...
Definition: OS_CPU_C.C:495
INT8U OSTCBX
Definition: UCOS_II.H:408
#define OS_RDY_TBL_SIZE
Definition: UCOS_II.H:53
void * OSMboxAccept(OS_EVENT *pevent)
ACCEPT MESSAGE FROM MAILBOX.
Definition: OS_MBOX.C:55
void OSTimeTick(void)
PROCESS SYSTEM TICK.
Definition: OS_CORE.C:415
INT8U OSTCBBitX
Definition: UCOS_II.H:410
#define OS_MAX_TASKS
Definition: OS_CFG.H:47
unsigned char BOOLEAN
Definition: OS_CPU.H:37
#define OS_MAX_FLAGS
Definition: OS_CFG.H:32
unsigned long INT32U
Definition: OS_CPU.H:42
OS_EXT INT8U OSIntExitY
Definition: UCOS_II.H:446
OS_EXT OS_TCB * OSTCBList
Definition: UCOS_II.H:468
OS_EXT INT8U OSTaskCtr
Definition: UCOS_II.H:458
void OSTimeDly(INT16U ticks)
DELAY TASK &#39;n&#39; TICKS (n from 0 to 65535) param ticks.
Definition: OS_TIME.C:50
INT8U OSTCBBitY
Definition: UCOS_II.H:411
void OSIntExit(void)
EXIT ISR.
Definition: OS_CORE.C:194
void OSTaskCreateHook(OS_TCB *ptcb)
TASK CREATION HOOK This function is called when a task is created.
Definition: OS_CPU_C.C:121
OS_EXT INT8U OSPrioHighRdy
Definition: UCOS_II.H:451
void OSTaskSwHook(void)
TASK SWITCH HOOK This function is called when a task switch is performed. This allows you to perfor...
Definition: OS_CPU_C.C:173
INT16U OSTCBDly
Definition: UCOS_II.H:404
#define OS_LOWEST_PRIO
Definition: OS_CFG.H:50
OS_EXT INT8U OSPrioCur
Definition: UCOS_II.H:450
struct os_tcb * OSTCBNext
Definition: UCOS_II.H:386
#define OS_MAX_MEM_PART
Definition: OS_CFG.H:37
INT8U OSMboxQuery(OS_EVENT *pevent, OS_MBOX_DATA *pdata)
QUERY A MESSAGE MAILBOX.
Definition: OS_MBOX.C:530
void OSInit(void)
INITIALIZATION.
Definition: OS_CORE.C:95
OS_EXT INT8U OSLockNesting
Definition: UCOS_II.H:448
OS_EXT OS_TCB * OSTCBFreeList
Definition: UCOS_II.H:466
signed char INT8S
Definition: OS_CPU.H:39
#define OS_N_SYS_TASKS
Definition: UCOS_II.H:46
unsigned int INT16U
Definition: OS_CPU.H:40
void OSTimeTickHook(void)
TICK HOOK This function is called every tick.
Definition: OS_CPU_C.C:218
#define OS_TASK_STAT_STK_SIZE
Definition: OS_CFG.H:56
OS_EXT INT8U OSRdyGrp
Definition: UCOS_II.H:453
void OSStart(void)
START MULTITASKING.
Definition: OS_CORE.C:333
void OSStartHighRdy(void)
START HIGHEST PRIORITY TASK.
Definition: OS_CPU_C.C:377