📄 os_cfg.h
字号:
/*
*********************************************************************************************************
* uC/OS-II
* The Real-Time Kernel
*
* (c) Copyright 1992-2001, Jean J. Labrosse, Weston, FL
* All Rights Reserved
*
* uC/OS-II Configuration File for V2.51
*
* File : OS_CFG.H
* By : Jean J. Labrosse
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* uC/OS-II CONFIGURATION
*********************************************************************************************************
*/
#define OS_MAX_EVENTS 10 /* Max. number of event control blocks in your application ... */
/* ... MUST be > 0 */
#define OS_MAX_FLAGS 1 /* Max. number of Event Flag Groups in your application ... */
/* ... MUST be > 0 */
#define OS_MAX_MEM_PART 1 /* Max. number of memory partitions ... */
/* ... MUST be > 0 */
#define OS_MAX_QS 1 /* Max. number of queue control blocks in your application ... */
/* ... MUST be > 0 */
#define OS_MAX_TASKS 10 /* Max. number of tasks in your application ... */
/* ... MUST be >= 2 */
#define OS_LOWEST_PRIO 12 /* Defines the lowest priority that can be assigned ... */
/* ... MUST NEVER be higher than 63! */
#define OS_TASK_IDLE_STK_SIZE 128 /* Idle task stack size (# of 16-bit wide entries) */
#define OS_TASK_STAT_EN 0 /* Enable (1) or Disable(0) the statistics task */
#define OS_TASK_STAT_STK_SIZE 128 /* Statistics task stack size (# of 16-bit wide entries) */
#define OS_ARG_CHK_EN 1 /* Enable (1) or Disable (0) argument checking */
#define OS_CPU_HOOKS_EN 1 /* uC/OS-II hooks are found in the processor port files */
/* ----------------------- EVENT FLAGS ------------------------ */
#define OS_FLAG_EN 0 /* Enable (1) or Disable (0) code generation for EVENT FLAGS */
#define OS_FLAG_WAIT_CLR_EN 0 /* Include code for Wait on Clear EVENT FLAGS */
#define OS_FLAG_ACCEPT_EN 0 /* Include code for OSFlagAccept() */
#define OS_FLAG_DEL_EN 0 /* Include code for OSFlagDel() */
#define OS_FLAG_QUERY_EN 0 /* Include code for OSFlagQuery() */
/* -------------------- MESSAGE MAILBOXES --------------------- */
#define OS_MBOX_EN 0 /* Enable (1) or Disable (0) code generation for MAILBOXES */
#define OS_MBOX_ACCEPT_EN 0 /* Include code for OSMboxAccept() */
#define OS_MBOX_DEL_EN 0 /* Include code for OSMboxDel() */
#define OS_MBOX_POST_EN 1 /* Include code for OSMboxPost() */
#define OS_MBOX_POST_OPT_EN 0 /* Include code for OSMboxPostOpt() */
#define OS_MBOX_QUERY_EN 0 /* Include code for OSMboxQuery() */
/* --------------------- MEMORY MANAGEMENT -------------------- */
#define OS_MEM_EN 0 /* Enable (1) or Disable (0) code generation for MEMORY MANAGER */
#define OS_MEM_QUERY_EN 0 /* Include code for OSMemQuery() */
/* ---------------- MUTUAL EXCLUSION SEMAPHORES --------------- */
#define OS_MUTEX_EN 0 /* Enable (1) or Disable (0) code generation for MUTEX */
#define OS_MUTEX_ACCEPT_EN 0 /* Include code for OSMutexAccept() */
#define OS_MUTEX_DEL_EN 0 /* Include code for OSMutexDel() */
#define OS_MUTEX_QUERY_EN 0 /* Include code for OSMutexQuery() */
/* ---------------------- MESSAGE QUEUES ---------------------- */
#define OS_Q_EN 0 /* Enable (1) or Disable (0) code generation for QUEUES */
#define OS_Q_ACCEPT_EN 1 /* Include code for OSQAccept() */
#define OS_Q_DEL_EN 0 /* Include code for OSQDel() */
#define OS_Q_FLUSH_EN 0 /* Include code for OSQFlush() */
#define OS_Q_POST_EN 1 /* Include code for OSQPost() */
#define OS_Q_POST_FRONT_EN 0 /* Include code for OSQPostFront() */
#define OS_Q_POST_OPT_EN 0 /* Include code for OSQPostOpt() */
#define OS_Q_QUERY_EN 0 /* Include code for OSQQuery() */
/* ------------------------ SEMAPHORES ------------------------ */
#define OS_SEM_EN 1 /* Enable (1) or Disable (0) code generation for SEMAPHORES */
#define OS_SEM_ACCEPT_EN 1 /* Include code for OSSemAccept() */
#define OS_SEM_DEL_EN 0 /* Include code for OSSemDel() */
#define OS_SEM_QUERY_EN 0 /* Include code for OSSemQuery() */
/* --------------------- TASK MANAGEMENT ---------------------- */
#define OS_TASK_CHANGE_PRIO_EN 0 /* Include code for OSTaskChangePrio() */
#define OS_TASK_CREATE_EN 1 /* Include code for OSTaskCreate() */
#define OS_TASK_CREATE_EXT_EN 0 /* Include code for OSTaskCreateExt() */
#define OS_TASK_DEL_EN 0 /* Include code for OSTaskDel() */
#define OS_TASK_SUSPEND_EN 1 /* Include code for OSTaskSuspend() and OSTaskResume() */
#define OS_TASK_QUERY_EN 0 /* Include code for OSTaskQuery() */
/* --------------------- TIME MANAGEMENT ---------------------- */
#define OS_TIME_DLY_HMSM_EN 0 /* Include code for OSTimeDlyHMSM() */
#define OS_TIME_DLY_RESUME_EN 0 /* Include code for OSTimeDlyResume() */
#define OS_TIME_GET_SET_EN 1 /* Include code for OSTimeGet() and OSTimeSet() */
/* ---------------------- MISCELLANEOUS ----------------------- */
#define OS_SCHED_LOCK_EN 0 /* Include code for OSSchedLock() and OSSchedUnlock() */
#if __FASM__ != 1
typedef INT16U OS_FLAGS; /* Date type for event flag bits (8, 16 or 32 bits) */
#endif
/*
*********************************************************************************************************
* F2MC-16LX specific uC/OS-II CONFIGURATION
*
* FFMC-16 Family Softune C Compiler V30L03.
*
* added by : Andrey Mozzhevilov
*
* Port Version : 1.00
* Date : 07-December-2001
*
*********************************************************************************************************
*/
/* OS Time setup */
#define OS_TICKS_PER_SEC 30 /* Set the number of ticks in one second */
/* You can redefine this macro and set other timer for generating system ticks */
#define SETUP_SYSTEM_TICK()\
{\
TBTC = 0x93; /* Set the timer for system ticks .*/\
ICR02 = 2; /*6 IRQ15 IRQ16 - interrupt priority of timer */\
}\
/* Reset interrupt request flag of system timer */
/* This macro should be called from OSTimeTickHook */
#define CLEAR_TICK_ISR_REQUEST() TBTC_TBOF = 0;
/* The banks of registers from FIRST_TASK_BANK before LAST_TASK_BANK are used for contexts of tasks. */
/* The Banks of registers from 0 before FIRST_TASK_BANK-1 can be used in interrupts. */
/* The bank of registers #1 is used in interrupts OSTickISR and Delayed Interrupt. */
/* Use this bank in your interrupts only if priority of interrupt of system timer and priority of your */
/* interrupt coincide. */
/* The Bank of registers 0 is used for contexts of tasks, which came short separate bank. */
/* Registers of bank 0 are saved in stack of task when switching the context if interrupted task */
/* use this bank of registers. */
/* If OS_SCAN_FREE_BANK != 0, than OS will try to find the free bank for task from range */
/* FIRST_TASK_BANK..LAST_TASK_BANK */
/* If OS_SCAN_FREE_BANK == 0, for all tasks will be used bank of registers #0 */
#define OS_SCAN_FREE_BANK 1
/* Do not forget to reserve used banks of registers at link stage of project. */
/* You must use -rg linker option for this. */
#define FIRST_TASK_BANK 2
#define LAST_TASK_BANK 10
#if OS_SCAN_FREE_BANK != 0
/* Checking For border conditions FIRST_TASK_BANK */
#if (FIRST_TASK_BANK > 31) || (FIRST_TASK_BANK < 2)
#error FIRST_TASK_BANK not valid
#endif
/* Checking For maximum value LAST_TASK_BANK */
#if LAST_TASK_BANK > 31
#error LAST_TASK_BANK not valid
#endif
/* LAST_TASK_BANK must not be less, than FIRST_TASK_BANK */
#if LAST_TASK_BANK < FIRST_TASK_BANK
#error FIRST_TASK_BANK or LAST_TASK_BANK not valid
#endif
/* Check to need of use the bank of registers #0 as bank of registers for tasks, which came short */
/* separate bank */
#if (LAST_TASK_BANK - FIRST_TASK_BANK + 1) < OS_MAX_TASKS
#define TASKS_CAN_USE_BANK0 1
#else
#define TASKS_CAN_USE_BANK0 0
#endif
#else /* OS_SCAN_FREE_BANK != 0 */
#define TASKS_CAN_USE_BANK0 1
#endif /* OS_SCAN_FREE_BANK != 0 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -