📄 ucosii_v2_1_0.tcl
字号:
puts $config_file "* *"
puts $config_file "**********************************************************************************************************"
puts $config_file "*/\n\n"
puts $config_file "#ifndef OS_CFG_H"
puts $config_file "#define OS_CFG_H\n"
puts $config_file " /* ---------------------- MISCELLANEOUS ----------------------- */"
set arg_chk_en [xget_value $ucos_handle "PARAMETER" "OS_ARG_CHK_EN"]
puts $config_file [format "#define OS_ARG_CHK_EN %s /* Enable (1) or Disable (0) argument checking */" $arg_chk_en]
set cpu_hooks_en [xget_value $ucos_handle "PARAMETER" "OS_CPU_HOOKS_EN"]
puts $config_file [format "#define OS_CPU_HOOKS_EN %s /* uC/OS-II hooks are found in the processor port files */\n" $cpu_hooks_en]
set debug_en [xget_value $ucos_handle "PARAMETER" "OS_DEBUG_EN"]
puts $config_file [format "#define OS_DEBUG_EN %s /* Enable(1) debug variables */\n" $debug_en]
set event_name_size [xget_value $ucos_handle "PARAMETER" "OS_EVENT_NAME_SIZE"]
puts $config_file [format "#define OS_EVENT_NAME_SIZE %s /* Determine the size of the name of a Sem, Mutex, Mbox or Q */\n" $event_name_size]
set lowest_prio [xget_value $ucos_handle "PARAMETER" "OS_LOWEST_PRIO"]
puts $config_file [format "#define OS_LOWEST_PRIO %s /* Defines the lowest priority that can be assigned ... */" $lowest_prio]
puts $config_file " /* ... MUST NEVER be higher than 63 */\n"
set max_events [xget_value $ucos_handle "PARAMETER" "OS_MAX_EVENTS"]
puts $config_file [format "#define OS_MAX_EVENTS %s /* Max. number of event control blocks in your application */" $max_events]
set max_flags [xget_value $ucos_handle "PARAMETER" "OS_MAX_FLAGS"]
puts $config_file [format "#define OS_MAX_FLAGS %s /* Max. number of Event Flag Groups in your application */" $max_flags]
set max_mem_part [xget_value $ucos_handle "PARAMETER" "OS_MAX_MEM_PART"]
puts $config_file [format "#define OS_MAX_MEM_PART %s /* Max. number of memory partitions */" $max_mem_part]
set max_qs [xget_value $ucos_handle "PARAMETER" "OS_MAX_QS"]
puts $config_file [format "#define OS_MAX_QS %s /* Max. number of queue control blocks in your application */" $max_qs]
set max_tasks [xget_value $ucos_handle "PARAMETER" "OS_MAX_TASKS"]
puts $config_file [format "#define OS_MAX_TASKS %s /* Max. number of tasks in your application, MUST be >= 2 */\n" $max_tasks]
set sched_lock_en [xget_value $ucos_handle "PARAMETER" "OS_SCHED_LOCK_EN"]
puts $config_file [format "#define OS_SCHED_LOCK_EN %s /* Include code for OSSchedLock() and OSSchedUnlock() when 1 */\n" $sched_lock_en]
set task_idle_stk_size [xget_value $ucos_handle "PARAMETER" "OS_TASK_IDLE_STK_SIZE"]
puts $config_file [format "#define OS_TASK_IDLE_STK_SIZE %s /* Idle task stack size (# of OS_STK wide entries) */\n" $task_idle_stk_size]
set task_stat_en [xget_value $ucos_handle "PARAMETER" "OS_TASK_STAT_EN"]
puts $config_file [format "#define OS_TASK_STAT_EN %s /* Enable (1) or Disable(0) the statistics task */" $task_stat_en]
set task_stat_stk_size [xget_value $ucos_handle "PARAMETER" "OS_TASK_STAT_STK_SIZE"]
puts $config_file [format "#define OS_TASK_STAT_STK_SIZE %s /* Statistics task stack size (# of OS_STK wide entries) */" $task_stat_stk_size]
set task_stat_stk_chk_en [xget_value $ucos_handle "PARAMETER" "OS_TASK_STAT_STK_CHK_EN"]
puts $config_file [format "#define OS_TASK_STAT_STK_CHK_EN %s /* Check task stacks from statistic task */\n" $task_stat_stk_chk_en]
set tick_step_en [xget_value $ucos_handle "PARAMETER" "OS_TICK_STEP_EN"]
puts $config_file [format "#define OS_TICK_STEP_EN %s /* Enable tick stepping feature for uC/OS-View */" $tick_step_en]
set ticks_per_sec [xget_value $ucos_handle "PARAMETER" "OS_TICKS_PER_SEC"]
puts $config_file [format "#define OS_TICKS_PER_SEC %s /* Set the number of ticks in one second */\n" $ticks_per_sec]
puts $config_file " /* ----------------------- EVENT FLAGS -------------------------*/"
set flag_en [xget_value $ucos_handle "PARAMETER" "OS_FLAG_EN"]
puts $config_file [format "#define OS_FLAG_EN %s /* Enable (1) or Disable (0) code generation for EVENT FLAGS */" $flag_en]
set flag_wait_clr_en [xget_value $ucos_handle "PARAMETER" "OS_FLAG_WAIT_CLR_EN"]
puts $config_file [format "#define OS_FLAG_WAIT_CLR_EN %s /* Include code for Wait on Clear EVENT FLAGS */" $flag_wait_clr_en]
set flag_accept_en [xget_value $ucos_handle "PARAMETER" "OS_FLAG_ACCEPT_EN"]
puts $config_file [format "#define OS_FLAG_ACCEPT_EN %s /* Include code for OSFlagAccept() */" $flag_accept_en]
set flag_del_en [xget_value $ucos_handle "PARAMETER" "OS_FLAG_DEL_EN"]
puts $config_file [format "#define OS_FLAG_DEL_EN %s /* Include code for OSFlagDel() */" $flag_del_en]
set flag_name_size [xget_value $ucos_handle "PARAMETER" "OS_FLAG_NAME_SIZE"]
puts $config_file [format "#define OS_FLAG_NAME_SIZE %s /* Determine the size of the name of an event flag group */" $flag_name_size]
set flag_query_en [xget_value $ucos_handle "PARAMETER" "OS_FLAG_QUERY_EN"]
puts $config_file [format "#define OS_FLAG_QUERY_EN %s /* Include code for OSFlagQuery() */\n" $flag_query_en]
puts $config_file " /* -------------------- MESSAGE MAILBOXES --------------------- */"
set mbox_en [xget_value $ucos_handle "PARAMETER" "OS_MBOX_EN"]
puts $config_file [format "#define OS_MBOX_EN %s /* Enable (1) or Disable (0) code generation for MAILBOXES */" $mbox_en]
set mbox_accept_en [xget_value $ucos_handle "PARAMETER" "OS_MBOX_ACCEPT_EN"]
puts $config_file [format "#define OS_MBOX_ACCEPT_EN %s /* Include code for OSMboxAccept() */" $mbox_accept_en]
set mbox_del_en [xget_value $ucos_handle "PARAMETER" "OS_MBOX_DEL_EN"]
puts $config_file [format "#define OS_MBOX_DEL_EN %s /* Include code for OSMboxDel() */" $mbox_del_en]
set mbox_post_en [xget_value $ucos_handle "PARAMETER" "OS_MBOX_POST_EN"]
puts $config_file [format "#define OS_MBOX_POST_EN %s /* Include code for OSMboxPost() */" $mbox_post_en]
set mbox_post_opt_en [xget_value $ucos_handle "PARAMETER" "OS_MBOX_POST_OPT_EN"]
puts $config_file [format "#define OS_MBOX_POST_OPT_EN %s /* Include code for OSMboxPostOpt() */" $mbox_post_opt_en]
set mbox_query_en [xget_value $ucos_handle "PARAMETER" "OS_MBOX_QUERY_EN"]
puts $config_file [format "#define OS_MBOX_QUERY_EN %s /* Include code for OSMboxQuery() */\n" $mbox_query_en]
puts $config_file " /* --------------------- MEMORY MANAGEMENT -------------------- */"
set mem_en [xget_value $ucos_handle "PARAMETER" "OS_MEM_EN"]
puts $config_file [format "#define OS_MEM_EN %s /* Enable (1) or Disable (0) code generation for MEMORY MANAGER */" $mem_en]
set mem_query_en [xget_value $ucos_handle "PARAMETER" "OS_MEM_QUERY_EN"]
puts $config_file [format "#define OS_MEM_QUERY_EN %s /* Include code for OSMemQuery() */" $mem_query_en]
set mem_name_size [xget_value $ucos_handle "PARAMETER" "OS_MEM_NAME_SIZE"]
puts $config_file [format "#define OS_MEM_NAME_SIZE %s /* Determine the size of a memory partition name */\n" $mem_name_size]
puts $config_file " /* ---------------- MUTUAL EXCLUSION SEMAPHORES --------------- */"
set mutex_en [xget_value $ucos_handle "PARAMETER" "OS_MUTEX_EN"]
puts $config_file [format "#define OS_MUTEX_EN %s /* Enable (1) or Disable (0) code generation for MUTEX */" $mutex_en]
set mutex_accept_en [xget_value $ucos_handle "PARAMETER" "OS_MUTEX_ACCEPT_EN"]
puts $config_file [format "#define OS_MUTEX_ACCEPT_EN %s /* Include code for OSMutexAccept() */" $mutex_accept_en]
set mutex_del_en [xget_value $ucos_handle "PARAMETER" "OS_MUTEX_DEL_EN"]
puts $config_file [format "#define OS_MUTEX_DEL_EN %s /* Include code for OSMutexDel() */" $mutex_del_en]
set mutex_query_en [xget_value $ucos_handle "PARAMETER" "OS_MUTEX_QUERY_EN"]
puts $config_file [format "#define OS_MUTEX_QUERY_EN %s /* Include code for OSMutexQuery() */\n" $mutex_query_en]
puts $config_file " /* ---------------------- MESSAGE QUEUES ---------------------- */"
set q_en [xget_value $ucos_handle "PARAMETER" "OS_Q_EN"]
puts $config_file [format "#define OS_Q_EN %s /* Enable (1) or Disable (0) code generation for QUEUES */" $q_en]
set q_accept_en [xget_value $ucos_handle "PARAMETER" "OS_Q_ACCEPT_EN"]
puts $config_file [format "#define OS_Q_ACCEPT_EN %s /* Include code for OSQAccept() */" $q_accept_en]
set q_del_en [xget_value $ucos_handle "PARAMETER" "OS_Q_DEL_EN"]
puts $config_file [format "#define OS_Q_DEL_EN %s /* Include code for OSQDel() */" $q_del_en]
set q_flush_en [xget_value $ucos_handle "PARAMETER" "OS_Q_FLUSH_EN"]
puts $config_file [format "#define OS_Q_FLUSH_EN %s /* Include code for OSQFlush() */" $q_flush_en]
set q_post_en [xget_value $ucos_handle "PARAMETER" "OS_Q_POST_EN"]
puts $config_file [format "#define OS_Q_POST_EN %s /* Include code for OSQPost() */" $q_post_en]
set q_post_front_en [xget_value $ucos_handle "PARAMETER" "OS_Q_POST_FRONT_EN"]
puts $config_file [format "#define OS_Q_POST_FRONT_EN %s /* Include code for OSQPostFront() */" $q_post_front_en]
set q_post_opt_en [xget_value $ucos_handle "PARAMETER" "OS_Q_POST_OPT_EN"]
puts $config_file [format "#define OS_Q_POST_OPT_EN %s /* Include code for OSQPostOpt() */" $q_post_opt_en]
set q_query_en [xget_value $ucos_handle "PARAMETER" "OS_Q_QUERY_EN"]
puts $config_file [format "#define OS_Q_QUERY_EN %s /* Include code for OSQQuery() */\n" $q_query_en]
puts $config_file " /* ------------------------ SEMAPHORES ------------------------ */"
set sem_en [xget_value $ucos_handle "PARAMETER" "OS_SEM_EN"]
puts $config_file [format "#define OS_SEM_EN %s /* Enable (1) or Disable (0) code generation for SEMAPHORES */" $sem_en]
set sem_accept_en [xget_value $ucos_handle "PARAMETER" "OS_SEM_ACCEPT_EN"]
puts $config_file [format "#define OS_SEM_ACCEPT_EN %s /* Include code for OSSemAccept() */" $sem_accept_en]
set sem_del_en [xget_value $ucos_handle "PARAMETER" "OS_SEM_DEL_EN"]
puts $config_file [format "#define OS_SEM_DEL_EN %s /* Include code for OSSemDel() */" $sem_del_en]
set sem_query_en [xget_value $ucos_handle "PARAMETER" "OS_SEM_QUERY_EN"]
puts $config_file [format "#define OS_SEM_QUERY_EN %s /* Include code for OSSemQuery() */" $sem_query_en]
set sem_set_en [xget_value $ucos_handle "PARAMETER" "OS_SEM_SET_EN"]
puts $config_file [format "#define OS_SEM_SET_EN %s /* Include code for OSSemSet() RRW - New in V2.76 */\n" $sem_set_en]
puts $config_file " /* --------------------- TASK MANAGEMENT ---------------------- */"
set task_change_prio_en [xget_value $ucos_handle "PARAMETER" "OS_TASK_CHANGE_PRIO_EN"]
puts $config_file [format "#define OS_TASK_CHANGE_PRIO_EN %s /* Include code for OSTaskChangePrio() */" $task_change_prio_en]
set task_create_en [xget_value $ucos_handle "PARAMETER" "OS_TASK_CREATE_EN"]
puts $config_file [format "#define OS_TASK_CREATE_EN %s /* Include code for OSTaskCreate() */" $task_create_en]
set task_create_ext_en [xget_value $ucos_handle "PARAMETER" "OS_TASK_CREATE_EXT_EN"]
puts $config_file [format "#define OS_TASK_CREATE_EXT_EN %s /* Include code for OSTaskCreateExt() */" $task_create_ext_en]
set task_del_en [xget_value $ucos_handle "PARAMETER" "OS_TASK_DEL_EN"]
puts $config_file [format "#define OS_TASK_DEL_EN %s /* Include code for OSTaskDel() */" $task_del_en]
set task_name_size [xget_value $ucos_handle "PARAMETER" "OS_TASK_NAME_SIZE"]
puts $config_file [format "#define OS_TASK_NAME_SIZE %s /* Determine the size of a task name */" $task_name_size]
set task_profile_en [xget_value $ucos_handle "PARAMETER" "OS_TASK_PROFILE_EN"]
puts $config_file [format "#define OS_TASK_PROFILE_EN %s /* Include variables in OS_TCB for profiling */" $task_profile_en]
set task_query_en [xget_value $ucos_handle "PARAMETER" "OS_TASK_QUERY_EN"]
puts $config_file [format "#define OS_TASK_QUERY_EN %s /* Include code for OSTaskQuery() */" $task_query_en]
set task_suspend_en [xget_value $ucos_handle "PARAMETER" "OS_TASK_SUSPEND_EN"]
puts $config_file [format "#define OS_TASK_SUSPEND_EN %s /* Include code for OSTaskSuspend() and OSTaskResume() */" $task_suspend_en]
set task_sw_hook_en [xget_value $ucos_handle "PARAMETER" "OS_TASK_SW_HOOK_EN"]
puts $config_file [format "#define OS_TASK_SW_HOOK_EN %s /* Include code for OSTaskSwHook() */\n" $task_sw_hook_en]
puts $config_file " /* --------------------- TIME MANAGEMENT ---------------------- */"
set time_dly_hmsm_en [xget_value $ucos_handle "PARAMETER" "OS_TIME_DLY_HMSM_EN"]
puts $config_file [format "#define OS_TIME_DLY_HMSM_EN %s /* Include code for OSTimeDlyHMSM() */" $time_dly_hmsm_en]
set time_dly_resume_en [xget_value $ucos_handle "PARAMETER" "OS_TIME_DLY_RESUME_EN"]
puts $config_file [format "#define OS_TIME_DLY_RESUME_EN %s /* Include code for OSTimeDlyResume() */" $time_dly_resume_en]
set time_get_set_en [xget_value $ucos_handle "PARAMETER" "OS_TIME_GET_SET_EN"]
puts $config_file [format "#define OS_TIME_GET_SET_EN %s /* Include code for OSTimeGet() and OSTimeSet() */" $time_get_set_en]
set time_tick_hook_en [xget_value $ucos_handle "PARAMETER" "OS_TIME_TICK_HOOK_EN"]
puts $config_file [format "#define OS_TIME_TICK_HOOK_EN %s /* Include code for OSTimeTickHook() */\n" $time_tick_hook_en]
set view_en [xget_value $ucos_handle "PARAMETER" "OS_VIEW_EN"]
puts $config_file [format "#define OS_VIEW_EN %s /* Include calls to OSView hook functions */\n" $view_en]
set flags_type [xget_value $ucos_handle "PARAMETER" "OS_FLAGS"]
puts $config_file [format "typedef %s OS_FLAGS; /* Data type for event flag bits (8, 16 or 32 bits) */\n" $flags_type]
puts $config_file "#endif\n"
close $config_file}
# --------------------------------------# Tcl procedure post_generate## This proc removes _interrupt_handler.o# from libxil.a# --------------------------------------proc post_generate {os_handle} { set prochandle [xget_processor] set procname [xget_value $prochandle "NAME"] set proctype [xget_value $prochandle "OPTION" "IPNAME"] if {[string compare -nocase $proctype "microblaze"] == 0} { set procdrv [xget_swhandle $procname] # Remove _interrupt_handler.o from libxil.a for mb-gcc set archiver [xget_value $procdrv "PARAMETER" "archiver"] exec bash -c "$archiver -d ../../lib/libxil.a _interrupt_handler.o" } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -