00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef OS_uCOS_II_H
00024 #define OS_uCOS_II_H
00025
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029
00030
00031
00032
00033
00034
00035
00036 #define OS_VERSION 286u
00037
00038
00039
00040
00041
00042
00043
00044 #include <app_cfg.h>
00045 #include <os_cfg.h>
00046 #include <os_cpu.h>
00047
00048
00049
00050
00051
00052
00053
00054 #ifdef OS_GLOBALS
00055 #define OS_EXT
00056 #else
00057 #define OS_EXT extern
00058 #endif
00059
00060 #ifndef OS_FALSE
00061 #define OS_FALSE 0u
00062 #endif
00063
00064 #ifndef OS_TRUE
00065 #define OS_TRUE 1u
00066 #endif
00067
00068 #define OS_ASCII_NUL (INT8U)0
00069
00070 #define OS_PRIO_SELF 0xFFu
00071
00072 #if OS_TASK_STAT_EN > 0
00073 #define OS_N_SYS_TASKS 2u
00074 #else
00075 #define OS_N_SYS_TASKS 1u
00076 #endif
00077
00078 #define OS_TASK_STAT_PRIO (OS_LOWEST_PRIO - 1)
00079 #define OS_TASK_IDLE_PRIO (OS_LOWEST_PRIO)
00080
00081 #if OS_LOWEST_PRIO <= 63
00082 #define OS_EVENT_TBL_SIZE ((OS_LOWEST_PRIO) / 8 + 1)
00083 #define OS_RDY_TBL_SIZE ((OS_LOWEST_PRIO) / 8 + 1)
00084 #else
00085 #define OS_EVENT_TBL_SIZE ((OS_LOWEST_PRIO) / 16 + 1)
00086 #define OS_RDY_TBL_SIZE ((OS_LOWEST_PRIO) / 16 + 1)
00087 #endif
00088
00089 #define OS_TASK_IDLE_ID 65535u
00090 #define OS_TASK_STAT_ID 65534u
00091 #define OS_TASK_TMR_ID 65533u
00092
00093 #define OS_EVENT_EN (((OS_Q_EN > 0) && (OS_MAX_QS > 0)) || (OS_MBOX_EN > 0) || (OS_SEM_EN > 0) || (OS_MUTEX_EN > 0))
00094
00095 #define OS_TCB_RESERVED ((OS_TCB *)1)
00096
00097
00098
00099
00100
00101
00102
00103 #define OS_STAT_RDY 0x00u
00104 #define OS_STAT_SEM 0x01u
00105 #define OS_STAT_MBOX 0x02u
00106 #define OS_STAT_Q 0x04u
00107 #define OS_STAT_SUSPEND 0x08u
00108 #define OS_STAT_MUTEX 0x10u
00109 #define OS_STAT_FLAG 0x20u
00110 #define OS_STAT_MULTI 0x80u
00111
00112 #define OS_STAT_PEND_ANY (OS_STAT_SEM | OS_STAT_MBOX | OS_STAT_Q | OS_STAT_MUTEX | OS_STAT_FLAG)
00113
00114
00115
00116
00117
00118
00119 #define OS_STAT_PEND_OK 0u
00120 #define OS_STAT_PEND_TO 1u
00121 #define OS_STAT_PEND_ABORT 2u
00122
00123
00124
00125
00126
00127
00128 #define OS_EVENT_TYPE_UNUSED 0u
00129 #define OS_EVENT_TYPE_MBOX 1u
00130 #define OS_EVENT_TYPE_Q 2u
00131 #define OS_EVENT_TYPE_SEM 3u
00132 #define OS_EVENT_TYPE_MUTEX 4u
00133 #define OS_EVENT_TYPE_FLAG 5u
00134
00135 #define OS_TMR_TYPE 100u
00136
00137
00138
00139
00140
00141
00142
00143 #define OS_FLAG_WAIT_CLR_ALL 0u
00144 #define OS_FLAG_WAIT_CLR_AND 0u
00145
00146 #define OS_FLAG_WAIT_CLR_ANY 1u
00147 #define OS_FLAG_WAIT_CLR_OR 1u
00148
00149 #define OS_FLAG_WAIT_SET_ALL 2u
00150 #define OS_FLAG_WAIT_SET_AND 2u
00151
00152 #define OS_FLAG_WAIT_SET_ANY 3u
00153 #define OS_FLAG_WAIT_SET_OR 3u
00154
00155
00156 #define OS_FLAG_CONSUME 0x80u
00157
00158
00159 #define OS_FLAG_CLR 0u
00160 #define OS_FLAG_SET 1u
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170 #if OS_TICK_STEP_EN > 0
00171 #define OS_TICK_STEP_DIS 0u
00172 #define OS_TICK_STEP_WAIT 1u
00173 #define OS_TICK_STEP_ONCE 2u
00174 #endif
00175
00176
00177
00178
00179
00180
00181 #define OS_DEL_NO_PEND 0u
00182 #define OS_DEL_ALWAYS 1u
00183
00184
00185
00186
00187
00188
00189
00190
00191 #define OS_PEND_OPT_NONE 0u
00192 #define OS_PEND_OPT_BROADCAST 1u
00193
00194
00195
00196
00197
00198
00199
00200
00201 #define OS_POST_OPT_NONE 0x00u
00202 #define OS_POST_OPT_BROADCAST 0x01u
00203 #define OS_POST_OPT_FRONT 0x02u
00204 #define OS_POST_OPT_NO_SCHED 0x04u
00205
00206
00207
00208
00209
00210
00211 #define OS_TASK_OPT_NONE 0x0000u
00212 #define OS_TASK_OPT_STK_CHK 0x0001u
00213 #define OS_TASK_OPT_STK_CLR 0x0002u
00214 #define OS_TASK_OPT_SAVE_FP 0x0004u
00215
00216
00217
00218
00219
00220
00221 #define OS_TMR_OPT_NONE 0u
00222
00223 #define OS_TMR_OPT_ONE_SHOT 1u
00224 #define OS_TMR_OPT_PERIODIC 2u
00225
00226 #define OS_TMR_OPT_CALLBACK 3u
00227 #define OS_TMR_OPT_CALLBACK_ARG 4u
00228
00229
00230
00231
00232
00233
00234 #define OS_TMR_STATE_UNUSED 0u
00235 #define OS_TMR_STATE_STOPPED 1u
00236 #define OS_TMR_STATE_COMPLETED 2u
00237 #define OS_TMR_STATE_RUNNING 3u
00238
00239
00240
00241
00242
00243
00244 #define OS_ERR_NONE 0u
00245
00246 #define OS_ERR_EVENT_TYPE 1u
00247 #define OS_ERR_PEND_ISR 2u
00248 #define OS_ERR_POST_NULL_PTR 3u
00249 #define OS_ERR_PEVENT_NULL 4u
00250 #define OS_ERR_POST_ISR 5u
00251 #define OS_ERR_QUERY_ISR 6u
00252 #define OS_ERR_INVALID_OPT 7u
00253 #define OS_ERR_PDATA_NULL 9u
00254
00255 #define OS_ERR_TIMEOUT 10u
00256 #define OS_ERR_EVENT_NAME_TOO_LONG 11u
00257 #define OS_ERR_PNAME_NULL 12u
00258 #define OS_ERR_PEND_LOCKED 13u
00259 #define OS_ERR_PEND_ABORT 14u
00260 #define OS_ERR_DEL_ISR 15u
00261 #define OS_ERR_CREATE_ISR 16u
00262 #define OS_ERR_NAME_GET_ISR 17u
00263 #define OS_ERR_NAME_SET_ISR 18u
00264
00265 #define OS_ERR_MBOX_FULL 20u
00266
00267 #define OS_ERR_Q_FULL 30u
00268 #define OS_ERR_Q_EMPTY 31u
00269
00270 #define OS_ERR_PRIO_EXIST 40u
00271 #define OS_ERR_PRIO 41u
00272 #define OS_ERR_PRIO_INVALID 42u
00273
00274 #define OS_ERR_SEM_OVF 50u
00275
00276 #define OS_ERR_TASK_CREATE_ISR 60u
00277 #define OS_ERR_TASK_DEL 61u
00278 #define OS_ERR_TASK_DEL_IDLE 62u
00279 #define OS_ERR_TASK_DEL_REQ 63u
00280 #define OS_ERR_TASK_DEL_ISR 64u
00281 #define OS_ERR_TASK_NAME_TOO_LONG 65u
00282 #define OS_ERR_TASK_NO_MORE_TCB 66u
00283 #define OS_ERR_TASK_NOT_EXIST 67u
00284 #define OS_ERR_TASK_NOT_SUSPENDED 68u
00285 #define OS_ERR_TASK_OPT 69u
00286 #define OS_ERR_TASK_RESUME_PRIO 70u
00287 #define OS_ERR_TASK_SUSPEND_IDLE 71u
00288 #define OS_ERR_TASK_SUSPEND_PRIO 72u
00289 #define OS_ERR_TASK_WAITING 73u
00290
00291 #define OS_ERR_TIME_NOT_DLY 80u
00292 #define OS_ERR_TIME_INVALID_MINUTES 81u
00293 #define OS_ERR_TIME_INVALID_SECONDS 82u
00294 #define OS_ERR_TIME_INVALID_MS 83u
00295 #define OS_ERR_TIME_ZERO_DLY 84u
00296 #define OS_ERR_TIME_DLY_ISR 85u
00297
00298 #define OS_ERR_MEM_INVALID_PART 90u
00299 #define OS_ERR_MEM_INVALID_BLKS 91u
00300 #define OS_ERR_MEM_INVALID_SIZE 92u
00301 #define OS_ERR_MEM_NO_FREE_BLKS 93u
00302 #define OS_ERR_MEM_FULL 94u
00303 #define OS_ERR_MEM_INVALID_PBLK 95u
00304 #define OS_ERR_MEM_INVALID_PMEM 96u
00305 #define OS_ERR_MEM_INVALID_PDATA 97u
00306 #define OS_ERR_MEM_INVALID_ADDR 98u
00307 #define OS_ERR_MEM_NAME_TOO_LONG 99u
00308
00309 #define OS_ERR_NOT_MUTEX_OWNER 100u
00310
00311 #define OS_ERR_FLAG_INVALID_PGRP 110u
00312 #define OS_ERR_FLAG_WAIT_TYPE 111u
00313 #define OS_ERR_FLAG_NOT_RDY 112u
00314 #define OS_ERR_FLAG_INVALID_OPT 113u
00315 #define OS_ERR_FLAG_GRP_DEPLETED 114u
00316 #define OS_ERR_FLAG_NAME_TOO_LONG 115u
00317
00318 #define OS_ERR_PIP_LOWER 120u
00319
00320 #define OS_ERR_TMR_INVALID_DLY 130u
00321 #define OS_ERR_TMR_INVALID_PERIOD 131u
00322 #define OS_ERR_TMR_INVALID_OPT 132u
00323 #define OS_ERR_TMR_INVALID_NAME 133u
00324 #define OS_ERR_TMR_NON_AVAIL 134u
00325 #define OS_ERR_TMR_INACTIVE 135u
00326 #define OS_ERR_TMR_INVALID_DEST 136u
00327 #define OS_ERR_TMR_INVALID_TYPE 137u
00328 #define OS_ERR_TMR_INVALID 138u
00329 #define OS_ERR_TMR_ISR 139u
00330 #define OS_ERR_TMR_NAME_TOO_LONG 140u
00331 #define OS_ERR_TMR_INVALID_STATE 141u
00332 #define OS_ERR_TMR_STOPPED 142u
00333 #define OS_ERR_TMR_NO_CALLBACK 143u
00334
00335
00336
00337
00338
00339
00340 #define OS_NO_ERR OS_ERR_NONE
00341 #define OS_TIMEOUT OS_ERR_TIMEOUT
00342 #define OS_TASK_NOT_EXIST OS_ERR_TASK_NOT_EXIST
00343 #define OS_MBOX_FULL OS_ERR_MBOX_FULL
00344 #define OS_Q_FULL OS_ERR_Q_FULL
00345 #define OS_Q_EMPTY OS_ERR_Q_EMPTY
00346 #define OS_PRIO_EXIST OS_ERR_PRIO_EXIST
00347 #define OS_PRIO_ERR OS_ERR_PRIO
00348 #define OS_PRIO_INVALID OS_ERR_PRIO_INVALID
00349 #define OS_SEM_OVF OS_ERR_SEM_OVF
00350 #define OS_TASK_DEL_ERR OS_ERR_TASK_DEL
00351 #define OS_TASK_DEL_IDLE OS_ERR_TASK_DEL_IDLE
00352 #define OS_TASK_DEL_REQ OS_ERR_TASK_DEL_REQ
00353 #define OS_TASK_DEL_ISR OS_ERR_TASK_DEL_ISR
00354 #define OS_NO_MORE_TCB OS_ERR_TASK_NO_MORE_TCB
00355 #define OS_TIME_NOT_DLY OS_ERR_TIME_NOT_DLY
00356 #define OS_TIME_INVALID_MINUTES OS_ERR_TIME_INVALID_MINUTES
00357 #define OS_TIME_INVALID_SECONDS OS_ERR_TIME_INVALID_SECONDS
00358 #define OS_TIME_INVALID_MS OS_ERR_TIME_INVALID_MS
00359 #define OS_TIME_ZERO_DLY OS_ERR_TIME_ZERO_DLY
00360 #define OS_TASK_SUSPEND_PRIO OS_ERR_TASK_SUSPEND_PRIO
00361 #define OS_TASK_SUSPEND_IDLE OS_ERR_TASK_SUSPEND_IDLE
00362 #define OS_TASK_RESUME_PRIO OS_ERR_TASK_RESUME_PRIO
00363 #define OS_TASK_NOT_SUSPENDED OS_ERR_TASK_NOT_SUSPENDED
00364 #define OS_MEM_INVALID_PART OS_ERR_MEM_INVALID_PART
00365 #define OS_MEM_INVALID_BLKS OS_ERR_MEM_INVALID_BLKS
00366 #define OS_MEM_INVALID_SIZE OS_ERR_MEM_INVALID_SIZE
00367 #define OS_MEM_NO_FREE_BLKS OS_ERR_MEM_NO_FREE_BLKS
00368 #define OS_MEM_FULL OS_ERR_MEM_FULL
00369 #define OS_MEM_INVALID_PBLK OS_ERR_MEM_INVALID_PBLK
00370 #define OS_MEM_INVALID_PMEM OS_ERR_MEM_INVALID_PMEM
00371 #define OS_MEM_INVALID_PDATA OS_ERR_MEM_INVALID_PDATA
00372 #define OS_MEM_INVALID_ADDR OS_ERR_MEM_INVALID_ADDR
00373 #define OS_MEM_NAME_TOO_LONG OS_ERR_MEM_NAME_TOO_LONG
00374 #define OS_TASK_OPT_ERR OS_ERR_TASK_OPT
00375 #define OS_FLAG_INVALID_PGRP OS_ERR_FLAG_INVALID_PGRP
00376 #define OS_FLAG_ERR_WAIT_TYPE OS_ERR_FLAG_WAIT_TYPE
00377 #define OS_FLAG_ERR_NOT_RDY OS_ERR_FLAG_NOT_RDY
00378 #define OS_FLAG_INVALID_OPT OS_ERR_FLAG_INVALID_OPT
00379 #define OS_FLAG_GRP_DEPLETED OS_ERR_FLAG_GRP_DEPLETED
00380
00381
00382
00383
00384
00385
00386
00387
00388 #if (OS_EVENT_EN) && (OS_MAX_EVENTS > 0)
00389 typedef struct os_event {
00390 INT8U OSEventType;
00391 void *OSEventPtr;
00392 INT16U OSEventCnt;
00393 #if OS_LOWEST_PRIO <= 63
00394 INT8U OSEventGrp;
00395 INT8U OSEventTbl[OS_EVENT_TBL_SIZE];
00396 #else
00397 INT16U OSEventGrp;
00398 INT16U OSEventTbl[OS_EVENT_TBL_SIZE];
00399 #endif
00400
00401 #if OS_EVENT_NAME_SIZE > 1
00402 INT8U OSEventName[OS_EVENT_NAME_SIZE];
00403 #endif
00404 } OS_EVENT;
00405 #endif
00406
00407
00408
00409
00410
00411
00412
00413
00414 #if (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
00415
00416 #if OS_FLAGS_NBITS == 8
00417 typedef INT8U OS_FLAGS;
00418 #endif
00419
00420 #if OS_FLAGS_NBITS == 16
00421 typedef INT16U OS_FLAGS;
00422 #endif
00423
00424 #if OS_FLAGS_NBITS == 32
00425 typedef INT32U OS_FLAGS;
00426 #endif
00427
00428
00429 typedef struct os_flag_grp {
00430 INT8U OSFlagType;
00431 void *OSFlagWaitList;
00432 OS_FLAGS OSFlagFlags;
00433 #if OS_FLAG_NAME_SIZE > 1
00434 INT8U OSFlagName[OS_FLAG_NAME_SIZE];
00435 #endif
00436 } OS_FLAG_GRP;
00437
00438
00439
00440 typedef struct os_flag_node {
00441 void *OSFlagNodeNext;
00442 void *OSFlagNodePrev;
00443 void *OSFlagNodeTCB;
00444 void *OSFlagNodeFlagGrp;
00445 OS_FLAGS OSFlagNodeFlags;
00446 INT8U OSFlagNodeWaitType;
00447
00448
00449
00450
00451 } OS_FLAG_NODE;
00452 #endif
00453
00454
00455
00456
00457
00458
00459
00460
00461 #if OS_MBOX_EN > 0
00462 typedef struct os_mbox_data {
00463 void *OSMsg;
00464 #if OS_LOWEST_PRIO <= 63
00465 INT8U OSEventTbl[OS_EVENT_TBL_SIZE];
00466 INT8U OSEventGrp;
00467 #else
00468 INT16U OSEventTbl[OS_EVENT_TBL_SIZE];
00469 INT16U OSEventGrp;
00470 #endif
00471 } OS_MBOX_DATA;
00472 #endif
00473
00474
00475
00476
00477
00478
00479
00480 #if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
00481 typedef struct os_mem {
00482 void *OSMemAddr;
00483 void *OSMemFreeList;
00484 INT32U OSMemBlkSize;
00485 INT32U OSMemNBlks;
00486 INT32U OSMemNFree;
00487 #if OS_MEM_NAME_SIZE > 1
00488 INT8U OSMemName[OS_MEM_NAME_SIZE];
00489 #endif
00490 } OS_MEM;
00491
00492
00493 typedef struct os_mem_data {
00494 void *OSAddr;
00495 void *OSFreeList;
00496 INT32U OSBlkSize;
00497 INT32U OSNBlks;
00498 INT32U OSNFree;
00499 INT32U OSNUsed;
00500 } OS_MEM_DATA;
00501 #endif
00502
00503
00504
00505
00506
00507
00508
00509
00510 #if OS_MUTEX_EN > 0
00511 typedef struct os_mutex_data {
00512 #if OS_LOWEST_PRIO <= 63
00513 INT8U OSEventTbl[OS_EVENT_TBL_SIZE];
00514 INT8U OSEventGrp;
00515 #else
00516 INT16U OSEventTbl[OS_EVENT_TBL_SIZE];
00517 INT16U OSEventGrp;
00518 #endif
00519 BOOLEAN OSValue;
00520 INT8U OSOwnerPrio;
00521 INT8U OSMutexPIP;
00522 } OS_MUTEX_DATA;
00523 #endif
00524
00525
00526
00527
00528
00529
00530
00531 #if OS_Q_EN > 0
00532 typedef struct os_q {
00533 struct os_q *OSQPtr;
00534 void **OSQStart;
00535 void **OSQEnd;
00536 void **OSQIn;
00537 void **OSQOut;
00538 INT16U OSQSize;
00539 INT16U OSQEntries;
00540 } OS_Q;
00541
00542
00543 typedef struct os_q_data {
00544 void *OSMsg;
00545 INT16U OSNMsgs;
00546 INT16U OSQSize;
00547 #if OS_LOWEST_PRIO <= 63
00548 INT8U OSEventTbl[OS_EVENT_TBL_SIZE];
00549 INT8U OSEventGrp;
00550 #else
00551 INT16U OSEventTbl[OS_EVENT_TBL_SIZE];
00552 INT16U OSEventGrp;
00553 #endif
00554 } OS_Q_DATA;
00555 #endif
00556
00557
00558
00559
00560
00561
00562
00563 #if OS_SEM_EN > 0
00564 typedef struct os_sem_data {
00565 INT16U OSCnt;
00566 #if OS_LOWEST_PRIO <= 63
00567 INT8U OSEventTbl[OS_EVENT_TBL_SIZE];
00568 INT8U OSEventGrp;
00569 #else
00570 INT16U OSEventTbl[OS_EVENT_TBL_SIZE];
00571 INT16U OSEventGrp;
00572 #endif
00573 } OS_SEM_DATA;
00574 #endif
00575
00576
00577
00578
00579
00580
00581
00582 #if OS_TASK_CREATE_EXT_EN > 0
00583 typedef struct os_stk_data {
00584 INT32U OSFree;
00585 INT32U OSUsed;
00586 } OS_STK_DATA;
00587 #endif
00588
00589
00590
00591
00592
00593
00594
00595
00596 typedef struct os_tcb {
00597 OS_STK *OSTCBStkPtr;
00598
00599 #if OS_TASK_CREATE_EXT_EN > 0
00600 void *OSTCBExtPtr;
00601 OS_STK *OSTCBStkBottom;
00602 INT32U OSTCBStkSize;
00603 INT16U OSTCBOpt;
00604 INT16U OSTCBId;
00605 #endif
00606
00607 struct os_tcb *OSTCBNext;
00608 struct os_tcb *OSTCBPrev;
00609
00610 #if (OS_EVENT_EN) || (OS_FLAG_EN > 0)
00611 OS_EVENT *OSTCBEventPtr;
00612 #endif
00613
00614 #if (OS_EVENT_EN) && (OS_EVENT_MULTI_EN > 0)
00615 OS_EVENT **OSTCBEventMultiPtr;
00616 #endif
00617
00618 #if ((OS_Q_EN > 0) && (OS_MAX_QS > 0)) || (OS_MBOX_EN > 0)
00619 void *OSTCBMsg;
00620 #endif
00621
00622 #if (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
00623 #if OS_TASK_DEL_EN > 0
00624 OS_FLAG_NODE *OSTCBFlagNode;
00625 #endif
00626 OS_FLAGS OSTCBFlagsRdy;
00627 #endif
00628
00629 INT16U OSTCBDly;
00630 INT8U OSTCBStat;
00631 INT8U OSTCBStatPend;
00632 INT8U OSTCBPrio;
00633
00634 INT8U OSTCBX;
00635 INT8U OSTCBY;
00636 #if OS_LOWEST_PRIO <= 63
00637 INT8U OSTCBBitX;
00638 INT8U OSTCBBitY;
00639 #else
00640 INT16U OSTCBBitX;
00641 INT16U OSTCBBitY;
00642 #endif
00643
00644 #if OS_TASK_DEL_EN > 0
00645 INT8U OSTCBDelReq;
00646 #endif
00647
00648 #if OS_TASK_PROFILE_EN > 0
00649 INT32U OSTCBCtxSwCtr;
00650 INT32U OSTCBCyclesTot;
00651 INT32U OSTCBCyclesStart;
00652 OS_STK *OSTCBStkBase;
00653 INT32U OSTCBStkUsed;
00654 #endif
00655
00656 #if OS_TASK_NAME_SIZE > 1
00657 INT8U OSTCBTaskName[OS_TASK_NAME_SIZE];
00658 #endif
00659 } OS_TCB;
00660
00661
00662
00663
00664
00665
00666
00667
00668 #if OS_TMR_EN > 0
00669 typedef void (*OS_TMR_CALLBACK)(void *ptmr, void *parg);
00670
00671
00672
00673 typedef struct os_tmr {
00674 INT8U OSTmrType;
00675 OS_TMR_CALLBACK OSTmrCallback;
00676 void *OSTmrCallbackArg;
00677 void *OSTmrNext;
00678 void *OSTmrPrev;
00679 INT32U OSTmrMatch;
00680 INT32U OSTmrDly;
00681 INT32U OSTmrPeriod;
00682 #if OS_TMR_CFG_NAME_SIZE > 0
00683 INT8U OSTmrName[OS_TMR_CFG_NAME_SIZE];
00684 #endif
00685 INT8U OSTmrOpt;
00686 INT8U OSTmrState;
00687
00688
00689
00690 } OS_TMR;
00691
00692
00693
00694 typedef struct os_tmr_wheel {
00695 OS_TMR *OSTmrFirst;
00696 INT16U OSTmrEntries;
00697 } OS_TMR_WHEEL;
00698 #endif
00699
00700
00701
00702
00703
00704
00705
00706
00707 OS_EXT INT32U OSCtxSwCtr;
00708
00709 #if (OS_EVENT_EN) && (OS_MAX_EVENTS > 0)
00710 OS_EXT OS_EVENT *OSEventFreeList;
00711 OS_EXT OS_EVENT OSEventTbl[OS_MAX_EVENTS];
00712 #endif
00713
00714 #if (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
00715 OS_EXT OS_FLAG_GRP OSFlagTbl[OS_MAX_FLAGS];
00716 OS_EXT OS_FLAG_GRP *OSFlagFreeList;
00717 #endif
00718
00719 #if OS_TASK_STAT_EN > 0
00720 OS_EXT INT8U OSCPUUsage;
00721 OS_EXT INT32U OSIdleCtrMax;
00722 OS_EXT INT32U OSIdleCtrRun;
00723 OS_EXT BOOLEAN OSStatRdy;
00724 OS_EXT OS_STK OSTaskStatStk[OS_TASK_STAT_STK_SIZE];
00725 #endif
00726
00727 OS_EXT INT8U OSIntNesting;
00728
00729 OS_EXT INT8U OSLockNesting;
00730
00731 OS_EXT INT8U OSPrioCur;
00732 OS_EXT INT8U OSPrioHighRdy;
00733
00734 #if OS_LOWEST_PRIO <= 63
00735 OS_EXT INT8U OSRdyGrp;
00736 OS_EXT INT8U OSRdyTbl[OS_RDY_TBL_SIZE];
00737 #else
00738 OS_EXT INT16U OSRdyGrp;
00739 OS_EXT INT16U OSRdyTbl[OS_RDY_TBL_SIZE];
00740 #endif
00741
00742 OS_EXT BOOLEAN OSRunning;
00743
00744 OS_EXT INT8U OSTaskCtr;
00745
00746 OS_EXT volatile INT32U OSIdleCtr;
00747
00748 OS_EXT OS_STK OSTaskIdleStk[OS_TASK_IDLE_STK_SIZE];
00749
00750
00751 OS_EXT OS_TCB *OSTCBCur;
00752 OS_EXT OS_TCB *OSTCBFreeList;
00753 OS_EXT OS_TCB *OSTCBHighRdy;
00754 OS_EXT OS_TCB *OSTCBList;
00755 OS_EXT OS_TCB *OSTCBPrioTbl[OS_LOWEST_PRIO + 1];
00756 OS_EXT OS_TCB OSTCBTbl[OS_MAX_TASKS + OS_N_SYS_TASKS];
00757
00758 #if OS_TICK_STEP_EN > 0
00759 OS_EXT INT8U OSTickStepState;
00760 #endif
00761
00762 #if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
00763 OS_EXT OS_MEM *OSMemFreeList;
00764 OS_EXT OS_MEM OSMemTbl[OS_MAX_MEM_PART];
00765 #endif
00766
00767 #if (OS_Q_EN > 0) && (OS_MAX_QS > 0)
00768 OS_EXT OS_Q *OSQFreeList;
00769 OS_EXT OS_Q OSQTbl[OS_MAX_QS];
00770 #endif
00771
00772 #if OS_TIME_GET_SET_EN > 0
00773 OS_EXT volatile INT32U OSTime;
00774 #endif
00775
00776 #if OS_TMR_EN > 0
00777 OS_EXT INT16U OSTmrFree;
00778 OS_EXT INT16U OSTmrUsed;
00779 OS_EXT INT32U OSTmrTime;
00780
00781 OS_EXT OS_EVENT *OSTmrSem;
00782 OS_EXT OS_EVENT *OSTmrSemSignal;
00783
00784 OS_EXT OS_TMR OSTmrTbl[OS_TMR_CFG_MAX];
00785 OS_EXT OS_TMR *OSTmrFreeList;
00786 OS_EXT OS_STK OSTmrTaskStk[OS_TASK_TMR_STK_SIZE];
00787
00788 OS_EXT OS_TMR_WHEEL OSTmrWheelTbl[OS_TMR_CFG_WHEEL_SIZE];
00789 #endif
00790
00791 extern INT8U const OSUnMapTbl[256];
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807 #if (OS_EVENT_EN)
00808
00809 #if (OS_EVENT_NAME_SIZE > 1)
00810 INT8U OSEventNameGet (OS_EVENT *pevent,
00811 INT8U *pname,
00812 INT8U *perr);
00813
00814 void OSEventNameSet (OS_EVENT *pevent,
00815 INT8U *pname,
00816 INT8U *perr);
00817 #endif
00818
00819 #if (OS_EVENT_MULTI_EN > 0)
00820 INT16U OSEventPendMulti (OS_EVENT **pevents_pend,
00821 OS_EVENT **pevents_rdy,
00822 void **pmsgs_rdy,
00823 INT16U timeout,
00824 INT8U *perr);
00825 #endif
00826
00827 #endif
00828
00829
00830
00831
00832
00833
00834
00835 #if (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
00836
00837 #if OS_FLAG_ACCEPT_EN > 0
00838 OS_FLAGS OSFlagAccept (OS_FLAG_GRP *pgrp,
00839 OS_FLAGS flags,
00840 INT8U wait_type,
00841 INT8U *perr);
00842 #endif
00843
00844 OS_FLAG_GRP *OSFlagCreate (OS_FLAGS flags,
00845 INT8U *perr);
00846
00847 #if OS_FLAG_DEL_EN > 0
00848 OS_FLAG_GRP *OSFlagDel (OS_FLAG_GRP *pgrp,
00849 INT8U opt,
00850 INT8U *perr);
00851 #endif
00852
00853 #if (OS_FLAG_EN > 0) && (OS_FLAG_NAME_SIZE > 1)
00854 INT8U OSFlagNameGet (OS_FLAG_GRP *pgrp,
00855 INT8U *pname,
00856 INT8U *perr);
00857
00858 void OSFlagNameSet (OS_FLAG_GRP *pgrp,
00859 INT8U *pname,
00860 INT8U *perr);
00861 #endif
00862
00863 OS_FLAGS OSFlagPend (OS_FLAG_GRP *pgrp,
00864 OS_FLAGS flags,
00865 INT8U wait_type,
00866 INT16U timeout,
00867 INT8U *perr);
00868
00869 OS_FLAGS OSFlagPendGetFlagsRdy (void);
00870 OS_FLAGS OSFlagPost (OS_FLAG_GRP *pgrp,
00871 OS_FLAGS flags,
00872 INT8U opt,
00873 INT8U *perr);
00874
00875 #if OS_FLAG_QUERY_EN > 0
00876 OS_FLAGS OSFlagQuery (OS_FLAG_GRP *pgrp,
00877 INT8U *perr);
00878 #endif
00879 #endif
00880
00881
00882
00883
00884
00885
00886
00887 #if OS_MBOX_EN > 0
00888
00889 #if OS_MBOX_ACCEPT_EN > 0
00890 void *OSMboxAccept (OS_EVENT *pevent);
00891 #endif
00892
00893 OS_EVENT *OSMboxCreate (void *pmsg);
00894
00895 #if OS_MBOX_DEL_EN > 0
00896 OS_EVENT *OSMboxDel (OS_EVENT *pevent,
00897 INT8U opt,
00898 INT8U *perr);
00899 #endif
00900
00901 void *OSMboxPend (OS_EVENT *pevent,
00902 INT16U timeout,
00903 INT8U *perr);
00904
00905 #if OS_MBOX_PEND_ABORT_EN > 0
00906 INT8U OSMboxPendAbort (OS_EVENT *pevent,
00907 INT8U opt,
00908 INT8U *perr);
00909 #endif
00910
00911 #if OS_MBOX_POST_EN > 0
00912 INT8U OSMboxPost (OS_EVENT *pevent,
00913 void *pmsg);
00914 #endif
00915
00916 #if OS_MBOX_POST_OPT_EN > 0
00917 INT8U OSMboxPostOpt (OS_EVENT *pevent,
00918 void *pmsg,
00919 INT8U opt);
00920 #endif
00921
00922 #if OS_MBOX_QUERY_EN > 0
00923 INT8U OSMboxQuery (OS_EVENT *pevent,
00924 OS_MBOX_DATA *p_mbox_data);
00925 #endif
00926 #endif
00927
00928
00929
00930
00931
00932
00933
00934 #if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
00935
00936 OS_MEM *OSMemCreate (void *addr,
00937 INT32U nblks,
00938 INT32U blksize,
00939 INT8U *perr);
00940
00941 void *OSMemGet (OS_MEM *pmem,
00942 INT8U *perr);
00943 #if OS_MEM_NAME_SIZE > 1
00944 INT8U OSMemNameGet (OS_MEM *pmem,
00945 INT8U *pname,
00946 INT8U *perr);
00947
00948 void OSMemNameSet (OS_MEM *pmem,
00949 INT8U *pname,
00950 INT8U *perr);
00951 #endif
00952 INT8U OSMemPut (OS_MEM *pmem,
00953 void *pblk);
00954
00955 #if OS_MEM_QUERY_EN > 0
00956 INT8U OSMemQuery (OS_MEM *pmem,
00957 OS_MEM_DATA *p_mem_data);
00958 #endif
00959
00960 #endif
00961
00962
00963
00964
00965
00966
00967
00968 #if OS_MUTEX_EN > 0
00969
00970 #if OS_MUTEX_ACCEPT_EN > 0
00971 BOOLEAN OSMutexAccept (OS_EVENT *pevent,
00972 INT8U *perr);
00973 #endif
00974
00975 OS_EVENT *OSMutexCreate (INT8U prio,
00976 INT8U *perr);
00977
00978 #if OS_MUTEX_DEL_EN > 0
00979 OS_EVENT *OSMutexDel (OS_EVENT *pevent,
00980 INT8U opt,
00981 INT8U *perr);
00982 #endif
00983
00984 void OSMutexPend (OS_EVENT *pevent,
00985 INT16U timeout,
00986 INT8U *perr);
00987
00988 INT8U OSMutexPost (OS_EVENT *pevent);
00989
00990 #if OS_MUTEX_QUERY_EN > 0
00991 INT8U OSMutexQuery (OS_EVENT *pevent,
00992 OS_MUTEX_DATA *p_mutex_data);
00993 #endif
00994
00995 #endif
00996
00997
00998
00999
01000
01001
01002
01003
01004 #if (OS_Q_EN > 0) && (OS_MAX_QS > 0)
01005
01006 #if OS_Q_ACCEPT_EN > 0
01007 void *OSQAccept (OS_EVENT *pevent,
01008 INT8U *perr);
01009 #endif
01010
01011 OS_EVENT *OSQCreate (void **start,
01012 INT16U size);
01013
01014 #if OS_Q_DEL_EN > 0
01015 OS_EVENT *OSQDel (OS_EVENT *pevent,
01016 INT8U opt,
01017 INT8U *perr);
01018 #endif
01019
01020 #if OS_Q_FLUSH_EN > 0
01021 INT8U OSQFlush (OS_EVENT *pevent);
01022 #endif
01023
01024 void *OSQPend (OS_EVENT *pevent,
01025 INT16U timeout,
01026 INT8U *perr);
01027
01028 #if OS_Q_PEND_ABORT_EN > 0
01029 INT8U OSQPendAbort (OS_EVENT *pevent,
01030 INT8U opt,
01031 INT8U *perr);
01032 #endif
01033
01034 #if OS_Q_POST_EN > 0
01035 INT8U OSQPost (OS_EVENT *pevent,
01036 void *pmsg);
01037 #endif
01038
01039 #if OS_Q_POST_FRONT_EN > 0
01040 INT8U OSQPostFront (OS_EVENT *pevent,
01041 void *pmsg);
01042 #endif
01043
01044 #if OS_Q_POST_OPT_EN > 0
01045 INT8U OSQPostOpt (OS_EVENT *pevent,
01046 void *pmsg,
01047 INT8U opt);
01048 #endif
01049
01050 #if OS_Q_QUERY_EN > 0
01051 INT8U OSQQuery (OS_EVENT *pevent,
01052 OS_Q_DATA *p_q_data);
01053 #endif
01054
01055 #endif
01056
01057
01058
01059
01060
01061
01062
01063 #if OS_SEM_EN > 0
01064
01065 #if OS_SEM_ACCEPT_EN > 0
01066 INT16U OSSemAccept (OS_EVENT *pevent);
01067 #endif
01068
01069 OS_EVENT *OSSemCreate (INT16U cnt);
01070
01071 #if OS_SEM_DEL_EN > 0
01072 OS_EVENT *OSSemDel (OS_EVENT *pevent,
01073 INT8U opt,
01074 INT8U *perr);
01075 #endif
01076
01077 void OSSemPend (OS_EVENT *pevent,
01078 INT16U timeout,
01079 INT8U *perr);
01080
01081 #if OS_SEM_PEND_ABORT_EN > 0
01082 INT8U OSSemPendAbort (OS_EVENT *pevent,
01083 INT8U opt,
01084 INT8U *perr);
01085 #endif
01086
01087 INT8U OSSemPost (OS_EVENT *pevent);
01088
01089 #if OS_SEM_QUERY_EN > 0
01090 INT8U OSSemQuery (OS_EVENT *pevent,
01091 OS_SEM_DATA *p_sem_data);
01092 #endif
01093
01094 #if OS_SEM_SET_EN > 0
01095 void OSSemSet (OS_EVENT *pevent,
01096 INT16U cnt,
01097 INT8U *perr);
01098 #endif
01099
01100 #endif
01101
01102
01103
01104
01105
01106
01107
01108 #if OS_TASK_CHANGE_PRIO_EN > 0
01109 INT8U OSTaskChangePrio (INT8U oldprio,
01110 INT8U newprio);
01111 #endif
01112
01113 #if OS_TASK_CREATE_EN > 0
01114 INT8U OSTaskCreate (void (*task)(void *p_arg),
01115 void *p_arg,
01116 OS_STK *ptos,
01117 INT8U prio);
01118 #endif
01119
01120 #if OS_TASK_CREATE_EXT_EN > 0
01121 INT8U OSTaskCreateExt (void (*task)(void *p_arg),
01122 void *p_arg,
01123 OS_STK *ptos,
01124 INT8U prio,
01125 INT16U id,
01126 OS_STK *pbos,
01127 INT32U stk_size,
01128 void *pext,
01129 INT16U opt);
01130 #endif
01131
01132 #if OS_TASK_DEL_EN > 0
01133 INT8U OSTaskDel (INT8U prio);
01134 INT8U OSTaskDelReq (INT8U prio);
01135 #endif
01136
01137 #if OS_TASK_NAME_SIZE > 1
01138 INT8U OSTaskNameGet (INT8U prio,
01139 INT8U *pname,
01140 INT8U *perr);
01141
01142 void OSTaskNameSet (INT8U prio,
01143 INT8U *pname,
01144 INT8U *perr);
01145 #endif
01146
01147 #if OS_TASK_SUSPEND_EN > 0
01148 INT8U OSTaskResume (INT8U prio);
01149 INT8U OSTaskSuspend (INT8U prio);
01150 #endif
01151
01152 #if (OS_TASK_STAT_STK_CHK_EN > 0) && (OS_TASK_CREATE_EXT_EN > 0)
01153 INT8U OSTaskStkChk (INT8U prio,
01154 OS_STK_DATA *p_stk_data);
01155 #endif
01156
01157 #if OS_TASK_QUERY_EN > 0
01158 INT8U OSTaskQuery (INT8U prio,
01159 OS_TCB *p_task_data);
01160 #endif
01161
01162
01163
01164
01165
01166
01167
01168
01169 void OSTimeDly (INT16U ticks);
01170
01171 #if OS_TIME_DLY_HMSM_EN > 0
01172 INT8U OSTimeDlyHMSM (INT8U hours,
01173 INT8U minutes,
01174 INT8U seconds,
01175 INT16U milli);
01176 #endif
01177
01178 #if OS_TIME_DLY_RESUME_EN > 0
01179 INT8U OSTimeDlyResume (INT8U prio);
01180 #endif
01181
01182 #if OS_TIME_GET_SET_EN > 0
01183 INT32U OSTimeGet (void);
01184 void OSTimeSet (INT32U ticks);
01185 #endif
01186
01187 void OSTimeTick (void);
01188
01189
01190
01191
01192
01193
01194
01195 #if OS_TMR_EN > 0
01196 OS_TMR *OSTmrCreate (INT32U dly,
01197 INT32U period,
01198 INT8U opt,
01199 OS_TMR_CALLBACK callback,
01200 void *callback_arg,
01201 INT8U *pname,
01202 INT8U *perr);
01203
01204 BOOLEAN OSTmrDel (OS_TMR *ptmr,
01205 INT8U *perr);
01206
01207 #if OS_TMR_CFG_NAME_SIZE > 0
01208 INT8U OSTmrNameGet (OS_TMR *ptmr,
01209 INT8U *pdest,
01210 INT8U *perr);
01211 #endif
01212 INT32U OSTmrRemainGet (OS_TMR *ptmr,
01213 INT8U *perr);
01214
01215 INT8U OSTmrStateGet (OS_TMR *ptmr,
01216 INT8U *perr);
01217
01218 BOOLEAN OSTmrStart (OS_TMR *ptmr,
01219 INT8U *perr);
01220
01221 BOOLEAN OSTmrStop (OS_TMR *ptmr,
01222 INT8U opt,
01223 void *callback_arg,
01224 INT8U *perr);
01225
01226 INT8U OSTmrSignal (void);
01227 #endif
01228
01229
01230
01231
01232
01233
01234
01235 void OSInit (void);
01236
01237 void OSIntEnter (void);
01238 void OSIntExit (void);
01239
01240 #if OS_SCHED_LOCK_EN > 0
01241 void OSSchedLock (void);
01242 void OSSchedUnlock (void);
01243 #endif
01244
01245 void OSStart (void);
01246
01247 void OSStatInit (void);
01248
01249 INT16U OSVersion (void);
01250
01251
01252
01253
01254
01255
01256
01257
01258
01259 #if OS_TASK_DEL_EN > 0
01260 void OS_Dummy (void);
01261 #endif
01262
01263 #if (OS_EVENT_EN)
01264 INT8U OS_EventTaskRdy (OS_EVENT *pevent,
01265 void *pmsg,
01266 INT8U msk,
01267 INT8U pend_stat);
01268
01269 void OS_EventTaskWait (OS_EVENT *pevent);
01270
01271 void OS_EventTaskRemove (OS_TCB *ptcb,
01272 OS_EVENT *pevent);
01273
01274 #if (OS_EVENT_MULTI_EN > 0)
01275 void OS_EventTaskWaitMulti (OS_EVENT **pevents_wait);
01276
01277 void OS_EventTaskRemoveMulti (OS_TCB *ptcb,
01278 OS_EVENT **pevents_multi);
01279 #endif
01280
01281 void OS_EventWaitListInit (OS_EVENT *pevent);
01282 #endif
01283
01284 #if (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
01285 void OS_FlagInit (void);
01286 void OS_FlagUnlink (OS_FLAG_NODE *pnode);
01287 #endif
01288
01289 void OS_MemClr (INT8U *pdest,
01290 INT16U size);
01291
01292 void OS_MemCopy (INT8U *pdest,
01293 INT8U *psrc,
01294 INT16U size);
01295
01296 #if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
01297 void OS_MemInit (void);
01298 #endif
01299
01300 #if OS_Q_EN > 0
01301 void OS_QInit (void);
01302 #endif
01303
01304 void OS_Sched (void);
01305
01306 #if (OS_EVENT_NAME_SIZE > 1) || (OS_FLAG_NAME_SIZE > 1) || (OS_MEM_NAME_SIZE > 1) || (OS_TASK_NAME_SIZE > 1)
01307 INT8U OS_StrCopy (INT8U *pdest,
01308 INT8U *psrc);
01309
01310 INT8U OS_StrLen (INT8U *psrc);
01311 #endif
01312
01313 void OS_TaskIdle (void *p_arg);
01314
01315 #if OS_TASK_STAT_EN > 0
01316 void OS_TaskStat (void *p_arg);
01317 #endif
01318
01319 #if (OS_TASK_STAT_STK_CHK_EN > 0) && (OS_TASK_CREATE_EXT_EN > 0)
01320 void OS_TaskStkClr (OS_STK *pbos,
01321 INT32U size,
01322 INT16U opt);
01323 #endif
01324
01325 #if (OS_TASK_STAT_STK_CHK_EN > 0) && (OS_TASK_CREATE_EXT_EN > 0)
01326 void OS_TaskStatStkChk (void);
01327 #endif
01328
01329 INT8U OS_TCBInit (INT8U prio,
01330 OS_STK *ptos,
01331 OS_STK *pbos,
01332 INT16U id,
01333 INT32U stk_size,
01334 void *pext,
01335 INT16U opt);
01336
01337 #if OS_TMR_EN > 0
01338 void OSTmr_Init (void);
01339 #endif
01340
01341
01342
01343
01344
01345
01346
01347
01348
01349 #if OS_DEBUG_EN > 0
01350 void OSDebugInit (void);
01351 #endif
01352
01353 void OSInitHookBegin (void);
01354 void OSInitHookEnd (void);
01355
01356 void OSTaskCreateHook (OS_TCB *ptcb);
01357 void OSTaskDelHook (OS_TCB *ptcb);
01358
01359 void OSTaskIdleHook (void);
01360
01361 void OSTaskStatHook (void);
01362 OS_STK *OSTaskStkInit (void (*task)(void *p_arg),
01363 void *p_arg,
01364 OS_STK *ptos,
01365 INT16U opt);
01366
01367 #if OS_TASK_SW_HOOK_EN > 0
01368 void OSTaskSwHook (void);
01369 #endif
01370
01371 void OSTCBInitHook (OS_TCB *ptcb);
01372
01373 #if OS_TIME_TICK_HOOK_EN > 0
01374 void OSTimeTickHook (void);
01375 #endif
01376
01377
01378
01379
01380
01381
01382
01383
01384
01385 #if OS_APP_HOOKS_EN > 0
01386 void App_TaskCreateHook (OS_TCB *ptcb);
01387 void App_TaskDelHook (OS_TCB *ptcb);
01388 void App_TaskIdleHook (void);
01389
01390 void App_TaskStatHook (void);
01391
01392 #if OS_TASK_SW_HOOK_EN > 0
01393 void App_TaskSwHook (void);
01394 #endif
01395
01396 void App_TCBInitHook (OS_TCB *ptcb);
01397
01398 #if OS_TIME_TICK_HOOK_EN > 0
01399 void App_TimeTickHook (void);
01400 #endif
01401 #endif
01402
01403
01404
01405
01406
01407
01408
01409
01410
01411 #if 0
01412 void OSStartHighRdy (void);
01413 void OSIntCtxSw (void);
01414 void OSCtxSw (void);
01415 #endif
01416
01417
01418
01419
01420
01421
01422
01423
01424
01425
01426
01427
01428
01429
01430
01431
01432
01433
01434
01435
01436 #ifndef OS_FLAG_EN
01437 #error "OS_CFG.H, Missing OS_FLAG_EN: Enable (1) or Disable (0) code generation for Event Flags"
01438 #else
01439 #ifndef OS_MAX_FLAGS
01440 #error "OS_CFG.H, Missing OS_MAX_FLAGS: Max. number of Event Flag Groups in your application"
01441 #else
01442 #if OS_MAX_FLAGS > 65500u
01443 #error "OS_CFG.H, OS_MAX_FLAGS must be <= 65500"
01444 #endif
01445 #endif
01446
01447 #ifndef OS_FLAGS_NBITS
01448 #error "OS_CFG.H, Missing OS_FLAGS_NBITS: Determine #bits used for event flags, MUST be either 8, 16 or 32"
01449 #endif
01450
01451 #ifndef OS_FLAG_WAIT_CLR_EN
01452 #error "OS_CFG.H, Missing OS_FLAG_WAIT_CLR_EN: Include code for Wait on Clear EVENT FLAGS"
01453 #endif
01454
01455 #ifndef OS_FLAG_ACCEPT_EN
01456 #error "OS_CFG.H, Missing OS_FLAG_ACCEPT_EN: Include code for OSFlagAccept()"
01457 #endif
01458
01459 #ifndef OS_FLAG_DEL_EN
01460 #error "OS_CFG.H, Missing OS_FLAG_DEL_EN: Include code for OSFlagDel()"
01461 #endif
01462
01463 #ifndef OS_FLAG_NAME_SIZE
01464 #error "OS_CFG.H, Missing OS_FLAG_NAME_SIZE: Determines the size of flag group names"
01465 #endif
01466
01467 #ifndef OS_FLAG_QUERY_EN
01468 #error "OS_CFG.H, Missing OS_FLAG_QUERY_EN: Include code for OSFlagQuery()"
01469 #endif
01470 #endif
01471
01472
01473
01474
01475
01476
01477
01478 #ifndef OS_MBOX_EN
01479 #error "OS_CFG.H, Missing OS_MBOX_EN: Enable (1) or Disable (0) code generation for MAILBOXES"
01480 #else
01481 #ifndef OS_MBOX_ACCEPT_EN
01482 #error "OS_CFG.H, Missing OS_MBOX_ACCEPT_EN: Include code for OSMboxAccept()"
01483 #endif
01484
01485 #ifndef OS_MBOX_DEL_EN
01486 #error "OS_CFG.H, Missing OS_MBOX_DEL_EN: Include code for OSMboxDel()"
01487 #endif
01488
01489 #ifndef OS_MBOX_PEND_ABORT_EN
01490 #error "OS_CFG.H, Missing OS_MBOX_PEND_ABORT_EN: Include code for OSMboxPendAbort()"
01491 #endif
01492
01493 #ifndef OS_MBOX_POST_EN
01494 #error "OS_CFG.H, Missing OS_MBOX_POST_EN: Include code for OSMboxPost()"
01495 #endif
01496
01497 #ifndef OS_MBOX_POST_OPT_EN
01498 #error "OS_CFG.H, Missing OS_MBOX_POST_OPT_EN: Include code for OSMboxPostOpt()"
01499 #endif
01500
01501 #ifndef OS_MBOX_QUERY_EN
01502 #error "OS_CFG.H, Missing OS_MBOX_QUERY_EN: Include code for OSMboxQuery()"
01503 #endif
01504 #endif
01505
01506
01507
01508
01509
01510
01511
01512 #ifndef OS_MEM_EN
01513 #error "OS_CFG.H, Missing OS_MEM_EN: Enable (1) or Disable (0) code generation for MEMORY MANAGER"
01514 #else
01515 #ifndef OS_MAX_MEM_PART
01516 #error "OS_CFG.H, Missing OS_MAX_MEM_PART: Max. number of memory partitions"
01517 #else
01518 #if OS_MAX_MEM_PART > 65500u
01519 #error "OS_CFG.H, OS_MAX_MEM_PART must be <= 65500"
01520 #endif
01521 #endif
01522
01523 #ifndef OS_MEM_NAME_SIZE
01524 #error "OS_CFG.H, Missing OS_MEM_NAME_SIZE: Determines the size of memory partition names"
01525 #endif
01526
01527 #ifndef OS_MEM_QUERY_EN
01528 #error "OS_CFG.H, Missing OS_MEM_QUERY_EN: Include code for OSMemQuery()"
01529 #endif
01530 #endif
01531
01532
01533
01534
01535
01536
01537
01538 #ifndef OS_MUTEX_EN
01539 #error "OS_CFG.H, Missing OS_MUTEX_EN: Enable (1) or Disable (0) code generation for MUTEX"
01540 #else
01541 #ifndef OS_MUTEX_ACCEPT_EN
01542 #error "OS_CFG.H, Missing OS_MUTEX_ACCEPT_EN: Include code for OSMutexAccept()"
01543 #endif
01544
01545 #ifndef OS_MUTEX_DEL_EN
01546 #error "OS_CFG.H, Missing OS_MUTEX_DEL_EN: Include code for OSMutexDel()"
01547 #endif
01548
01549 #ifndef OS_MUTEX_QUERY_EN
01550 #error "OS_CFG.H, Missing OS_MUTEX_QUERY_EN: Include code for OSMutexQuery()"
01551 #endif
01552 #endif
01553
01554
01555
01556
01557
01558
01559
01560 #ifndef OS_Q_EN
01561 #error "OS_CFG.H, Missing OS_Q_EN: Enable (1) or Disable (0) code generation for QUEUES"
01562 #else
01563 #ifndef OS_MAX_QS
01564 #error "OS_CFG.H, Missing OS_MAX_QS: Max. number of queue control blocks"
01565 #else
01566 #if OS_MAX_QS > 65500u
01567 #error "OS_CFG.H, OS_MAX_QS must be <= 65500"
01568 #endif
01569 #endif
01570
01571 #ifndef OS_Q_ACCEPT_EN
01572 #error "OS_CFG.H, Missing OS_Q_ACCEPT_EN: Include code for OSQAccept()"
01573 #endif
01574
01575 #ifndef OS_Q_DEL_EN
01576 #error "OS_CFG.H, Missing OS_Q_DEL_EN: Include code for OSQDel()"
01577 #endif
01578
01579 #ifndef OS_Q_FLUSH_EN
01580 #error "OS_CFG.H, Missing OS_Q_FLUSH_EN: Include code for OSQFlush()"
01581 #endif
01582
01583 #ifndef OS_Q_PEND_ABORT_EN
01584 #error "OS_CFG.H, Missing OS_Q_PEND_ABORT_EN: Include code for OSQPendAbort()"
01585 #endif
01586
01587 #ifndef OS_Q_POST_EN
01588 #error "OS_CFG.H, Missing OS_Q_POST_EN: Include code for OSQPost()"
01589 #endif
01590
01591 #ifndef OS_Q_POST_FRONT_EN
01592 #error "OS_CFG.H, Missing OS_Q_POST_FRONT_EN: Include code for OSQPostFront()"
01593 #endif
01594
01595 #ifndef OS_Q_POST_OPT_EN
01596 #error "OS_CFG.H, Missing OS_Q_POST_OPT_EN: Include code for OSQPostOpt()"
01597 #endif
01598
01599 #ifndef OS_Q_QUERY_EN
01600 #error "OS_CFG.H, Missing OS_Q_QUERY_EN: Include code for OSQQuery()"
01601 #endif
01602 #endif
01603
01604
01605
01606
01607
01608
01609
01610 #ifndef OS_SEM_EN
01611 #error "OS_CFG.H, Missing OS_SEM_EN: Enable (1) or Disable (0) code generation for SEMAPHORES"
01612 #else
01613 #ifndef OS_SEM_ACCEPT_EN
01614 #error "OS_CFG.H, Missing OS_SEM_ACCEPT_EN: Include code for OSSemAccept()"
01615 #endif
01616
01617 #ifndef OS_SEM_DEL_EN
01618 #error "OS_CFG.H, Missing OS_SEM_DEL_EN: Include code for OSSemDel()"
01619 #endif
01620
01621 #ifndef OS_SEM_PEND_ABORT_EN
01622 #error "OS_CFG.H, Missing OS_SEM_PEND_ABORT_EN: Include code for OSSemPendAbort()"
01623 #endif
01624
01625 #ifndef OS_SEM_QUERY_EN
01626 #error "OS_CFG.H, Missing OS_SEM_QUERY_EN: Include code for OSSemQuery()"
01627 #endif
01628
01629 #ifndef OS_SEM_SET_EN
01630 #error "OS_CFG.H, Missing OS_SEM_SET_EN: Include code for OSSemSet()"
01631 #endif
01632 #endif
01633
01634
01635
01636
01637
01638
01639
01640 #ifndef OS_MAX_TASKS
01641 #error "OS_CFG.H, Missing OS_MAX_TASKS: Max. number of tasks in your application"
01642 #else
01643 #if OS_MAX_TASKS < 2
01644 #error "OS_CFG.H, OS_MAX_TASKS must be >= 2"
01645 #endif
01646
01647 #if OS_MAX_TASKS > ((OS_LOWEST_PRIO - OS_N_SYS_TASKS) + 1)
01648 #error "OS_CFG.H, OS_MAX_TASKS must be <= OS_LOWEST_PRIO - OS_N_SYS_TASKS + 1"
01649 #endif
01650
01651 #endif
01652
01653 #if OS_LOWEST_PRIO > 254
01654 #error "OS_CFG.H, OS_LOWEST_PRIO must be <= 254 in V2.8x and higher"
01655 #endif
01656
01657 #ifndef OS_TASK_IDLE_STK_SIZE
01658 #error "OS_CFG.H, Missing OS_TASK_IDLE_STK_SIZE: Idle task stack size"
01659 #endif
01660
01661 #ifndef OS_TASK_STAT_EN
01662 #error "OS_CFG.H, Missing OS_TASK_STAT_EN: Enable (1) or Disable(0) the statistics task"
01663 #endif
01664
01665 #ifndef OS_TASK_STAT_STK_SIZE
01666 #error "OS_CFG.H, Missing OS_TASK_STAT_STK_SIZE: Statistics task stack size"
01667 #endif
01668
01669 #ifndef OS_TASK_STAT_STK_CHK_EN
01670 #error "OS_CFG.H, Missing OS_TASK_STAT_STK_CHK_EN: Check task stacks from statistics task"
01671 #endif
01672
01673 #ifndef OS_TASK_CHANGE_PRIO_EN
01674 #error "OS_CFG.H, Missing OS_TASK_CHANGE_PRIO_EN: Include code for OSTaskChangePrio()"
01675 #endif
01676
01677 #ifndef OS_TASK_CREATE_EN
01678 #error "OS_CFG.H, Missing OS_TASK_CREATE_EN: Include code for OSTaskCreate()"
01679 #endif
01680
01681 #ifndef OS_TASK_CREATE_EXT_EN
01682 #error "OS_CFG.H, Missing OS_TASK_CREATE_EXT_EN: Include code for OSTaskCreateExt()"
01683 #endif
01684
01685 #ifndef OS_TASK_DEL_EN
01686 #error "OS_CFG.H, Missing OS_TASK_DEL_EN: Include code for OSTaskDel()"
01687 #endif
01688
01689 #ifndef OS_TASK_NAME_SIZE
01690 #error "OS_CFG.H, Missing OS_TASK_NAME_SIZE: Determine the size of task names"
01691 #endif
01692
01693 #ifndef OS_TASK_SUSPEND_EN
01694 #error "OS_CFG.H, Missing OS_TASK_SUSPEND_EN: Include code for OSTaskSuspend() and OSTaskResume()"
01695 #endif
01696
01697 #ifndef OS_TASK_QUERY_EN
01698 #error "OS_CFG.H, Missing OS_TASK_QUERY_EN: Include code for OSTaskQuery()"
01699 #endif
01700
01701
01702
01703
01704
01705
01706
01707 #ifndef OS_TICKS_PER_SEC
01708 #error "OS_CFG.H, Missing OS_TICKS_PER_SEC: Sets the number of ticks in one second"
01709 #endif
01710
01711 #ifndef OS_TIME_DLY_HMSM_EN
01712 #error "OS_CFG.H, Missing OS_TIME_DLY_HMSM_EN: Include code for OSTimeDlyHMSM()"
01713 #endif
01714
01715 #ifndef OS_TIME_DLY_RESUME_EN
01716 #error "OS_CFG.H, Missing OS_TIME_DLY_RESUME_EN: Include code for OSTimeDlyResume()"
01717 #endif
01718
01719 #ifndef OS_TIME_GET_SET_EN
01720 #error "OS_CFG.H, Missing OS_TIME_GET_SET_EN: Include code for OSTimeGet() and OSTimeSet()"
01721 #endif
01722
01723
01724
01725
01726
01727
01728
01729 #ifndef OS_TMR_EN
01730 #error "OS_CFG.H, Missing OS_TMR_EN: When (1) enables code generation for Timer Management"
01731 #elif OS_TMR_EN > 0
01732 #if OS_SEM_EN == 0
01733 #error "OS_CFG.H, Semaphore management is required (set OS_SEM_EN to 1) when enabling Timer Management."
01734 #error " Timer management require TWO semaphores."
01735 #endif
01736
01737 #ifndef OS_TMR_CFG_MAX
01738 #error "OS_CFG.H, Missing OS_TMR_CFG_MAX: Determines the total number of timers in an application (2 .. 65500)"
01739 #else
01740 #if OS_TMR_CFG_MAX < 2
01741 #error "OS_CFG.H, OS_TMR_CFG_MAX should be between 2 and 65500"
01742 #endif
01743
01744 #if OS_TMR_CFG_MAX > 65500
01745 #error "OS_CFG.H, OS_TMR_CFG_MAX should be between 2 and 65500"
01746 #endif
01747 #endif
01748
01749 #ifndef OS_TMR_CFG_WHEEL_SIZE
01750 #error "OS_CFG.H, Missing OS_TMR_CFG_WHEEL_SIZE: Sets the size of the timer wheel (1 .. 1023)"
01751 #else
01752 #if OS_TMR_CFG_WHEEL_SIZE < 2
01753 #error "OS_CFG.H, OS_TMR_CFG_WHEEL_SIZE should be between 2 and 1024"
01754 #endif
01755
01756 #if OS_TMR_CFG_WHEEL_SIZE > 1024
01757 #error "OS_CFG.H, OS_TMR_CFG_WHEEL_SIZE should be between 2 and 1024"
01758 #endif
01759 #endif
01760
01761 #ifndef OS_TMR_CFG_NAME_SIZE
01762 #error "OS_CFG.H, Missing OS_TMR_CFG_NAME_SIZE: Determines the number of characters used for Timer names"
01763 #endif
01764
01765 #ifndef OS_TMR_CFG_TICKS_PER_SEC
01766 #error "OS_CFG.H, Missing OS_TMR_CFG_TICKS_PER_SEC: Determines the rate at which tiem timer management task will run (Hz)"
01767 #endif
01768
01769 #ifndef OS_TASK_TMR_STK_SIZE
01770 #error "OS_CFG.H, Missing OS_TASK_TMR_STK_SIZE: Determines the size of the Timer Task's stack"
01771 #endif
01772 #endif
01773
01774
01775
01776
01777
01778
01779
01780
01781 #ifndef OS_ARG_CHK_EN
01782 #error "OS_CFG.H, Missing OS_ARG_CHK_EN: Enable (1) or Disable (0) argument checking"
01783 #endif
01784
01785
01786 #ifndef OS_CPU_HOOKS_EN
01787 #error "OS_CFG.H, Missing OS_CPU_HOOKS_EN: uC/OS-II hooks are found in the processor port files when 1"
01788 #endif
01789
01790
01791 #ifndef OS_APP_HOOKS_EN
01792 #error "OS_CFG.H, Missing OS_APP_HOOKS_EN: Application-defined hooks are called from the uC/OS-II hooks"
01793 #endif
01794
01795
01796 #ifndef OS_DEBUG_EN
01797 #error "OS_CFG.H, Missing OS_DEBUG_EN: Allows you to include variables for debugging or not"
01798 #endif
01799
01800
01801 #ifndef OS_LOWEST_PRIO
01802 #error "OS_CFG.H, Missing OS_LOWEST_PRIO: Defines the lowest priority that can be assigned"
01803 #endif
01804
01805
01806 #ifndef OS_MAX_EVENTS
01807 #error "OS_CFG.H, Missing OS_MAX_EVENTS: Max. number of event control blocks in your application"
01808 #else
01809 #if OS_MAX_EVENTS > 65500u
01810 #error "OS_CFG.H, OS_MAX_EVENTS must be <= 65500"
01811 #endif
01812 #endif
01813
01814
01815 #ifndef OS_SCHED_LOCK_EN
01816 #error "OS_CFG.H, Missing OS_SCHED_LOCK_EN: Include code for OSSchedLock() and OSSchedUnlock()"
01817 #endif
01818
01819
01820 #ifndef OS_EVENT_MULTI_EN
01821 #error "OS_CFG.H, Missing OS_EVENT_MULTI_EN: Include code for OSEventPendMulti()"
01822 #endif
01823
01824
01825 #ifndef OS_TASK_PROFILE_EN
01826 #error "OS_CFG.H, Missing OS_TASK_PROFILE_EN: Include data structure for run-time task profiling"
01827 #endif
01828
01829
01830 #ifndef OS_TASK_SW_HOOK_EN
01831 #error "OS_CFG.H, Missing OS_TASK_SW_HOOK_EN: Allows you to include the code for OSTaskSwHook() or not"
01832 #endif
01833
01834
01835 #ifndef OS_TICK_STEP_EN
01836 #error "OS_CFG.H, Missing OS_TICK_STEP_EN: Allows to 'step' one tick at a time with uC/OS-View"
01837 #endif
01838
01839
01840 #ifndef OS_TIME_TICK_HOOK_EN
01841 #error "OS_CFG.H, Missing OS_TIME_TICK_HOOK_EN: Allows you to include the code for OSTimeTickHook() or not"
01842 #endif
01843
01844
01845
01846
01847
01848
01849
01850 #ifdef SAFETY_CRITICAL_RELEASE
01851
01852 #if OS_ARG_CHK_EN < 1
01853 #error "OS_CFG.H, OS_ARG_CHK_EN must be enabled for safety-critical release code"
01854 #endif
01855
01856 #if OS_APP_HOOKS_EN > 0
01857 #error "OS_CFG.H, OS_APP_HOOKS_EN must be disabled for safety-critical release code"
01858 #endif
01859
01860 #if OS_DEBUG_EN > 0
01861 #error "OS_CFG.H, OS_DEBUG_EN must be disabled for safety-critical release code"
01862 #endif
01863
01864 #ifdef CANTATA
01865 #error "OS_CFG.H, CANTATA must be disabled for safety-critical release code"
01866 #endif
01867
01868 #ifdef OS_SCHED_LOCK_EN
01869 #error "OS_CFG.H, OS_SCHED_LOCK_EN must be disabled for safety-critical release code"
01870 #endif
01871
01872 #ifdef VSC_VALIDATION_MODE
01873 #error "OS_CFG.H, VSC_VALIDATION_MODE must be disabled for safety-critical release code"
01874 #endif
01875
01876 #if OS_TASK_STAT_EN > 0
01877 #error "OS_CFG.H, OS_TASK_STAT_EN must be disabled for safety-critical release code"
01878 #endif
01879
01880 #if OS_TICK_STEP_EN > 0
01881 #error "OS_CFG.H, OS_TICK_STEP_EN must be disabled for safety-critical release code"
01882 #endif
01883
01884 #if OS_FLAG_EN > 0
01885 #if OS_FLAG_DEL_EN > 0
01886 #error "OS_CFG.H, OS_FLAG_DEL_EN must be disabled for safety-critical release code"
01887 #endif
01888 #endif
01889
01890 #if OS_MBOX_EN > 0
01891 #if OS_MBOX_DEL_EN > 0
01892 #error "OS_CFG.H, OS_MBOX_DEL_EN must be disabled for safety-critical release code"
01893 #endif
01894 #endif
01895
01896 #if OS_MUTEX_EN > 0
01897 #if OS_MUTEX_DEL_EN > 0
01898 #error "OS_CFG.H, OS_MUTEX_DEL_EN must be disabled for safety-critical release code"
01899 #endif
01900 #endif
01901
01902 #if OS_Q_EN > 0
01903 #if OS_Q_DEL_EN > 0
01904 #error "OS_CFG.H, OS_Q_DEL_EN must be disabled for safety-critical release code"
01905 #endif
01906 #endif
01907
01908 #if OS_SEM_EN > 0
01909 #if OS_SEM_DEL_EN > 0
01910 #error "OS_CFG.H, OS_SEM_DEL_EN must be disabled for safety-critical release code"
01911 #endif
01912 #endif
01913
01914 #if OS_TASK_EN > 0
01915 #if OS_TASK_DEL_EN > 0
01916 #error "OS_CFG.H, OS_TASK_DEL_EN must be disabled for safety-critical release code"
01917 #endif
01918 #endif
01919
01920 #if OS_CRITICAL_METHOD != 3
01921 #error "OS_CPU.H, OS_CRITICAL_METHOD must be type 3 for safety-critical release code"
01922 #endif
01923
01924 #endif
01925
01926 #ifdef __cplusplus
01927 }
01928 #endif
01929
01930 #endif