|
OS: uCOS-II V2.61
PORT: TI-MSP430-FOR-uCOS-II-V252.ZIP
задача - по прерыванию освободить семафор, освобождения которого ждет
задача с 0 приоритетом.
Цель пошустрее обработать событие прерывания в subj задаче...
Обработчик прерывания(прерывание по P1.2 on risedown):
#include PUSHALL MACRO POPALL MACRO ;******************************************************************************************************** EXTERN Alarm0Sem PUBLIC PORT1_ISR ;******************************************************************************************************** RSEG CODE ; Program code PORT1_ISR inc.b &OSIntNesting ; increase OSIntNesting ; my ISR handler... MOV.B &P1IFG,R10 ; call #OSIntExit POPALL ORG PORT1_VECTOR END /* /* ---------------------- MISCELLANEOUS ----------------------- */ #define OS_DEBUG_EN 0 /* Enable(1) debug variables NEW!*/ #define OS_EVENT_NAME_SIZE 0 /* Determine the size of the name of a Sem, Mutex, Mbox or Q NEW!*/ #define OS_LOWEST_PRIO 10 /* Defines the lowest priority that can be assigned ... */ #define OS_SCHED_LOCK_EN 1 /* Include code for OSSchedLock() and OSSchedUnlock() */ #define OS_TASK_IDLE_STK_SIZE 64 /* Idle task stack size (# of OS_STK wide entries) */ #define OS_TASK_STAT_EN 0 /* Enable (1) or Disable(0) the statistics task */ #define OS_TICK_STEP_EN 1 /* Enable tick stepping feature for uC/OS-View NEW!*/ /* -------------------- MESSAGE MAILBOXES --------------------- */ /* ---------------- MUTUAL EXCLUSION SEMAPHORES --------------- */ /* ---------------------- MESSAGE QUEUES ---------------------- */ /* ------------------------ SEMAPHORES ------------------------ */ /* --------------------- TASK MANAGEMENT ---------------------- */ /* --------------------- TIME MANAGEMENT ---------------------- */ typedef INT16U OS_FLAGS; /* Date type for event flag bits (8, 16 or 32 bits) */
E-mail:
info@telesys.ru
push r4
push r5
push r6
push r7
push r8
push r9
push r10
push r11
push r12
push r13
push r14
push r15
ENDM
pop r15
pop r14
pop r13
pop r12
pop r11
pop r10
pop r9
pop r8
pop r7
pop r6
pop r5
pop r4
ENDM
; PUBLIC AND EXTERNAL DECLARATIONS
;********************************************************************************************************
; EXTERN OSIntEnter
EXTERN OSIntNesting
EXTERN OSIntExit
EXTERN OSSemPost
PUSHALL
AND.B #0xF3,&P1IE
MOV.B #0,&P1IFG
BIT.B #4,R10
JEQ P1_ISR_NOTA0
MOV &Alarm0Sem,R12
CALL #OSSemPost
DINT
P1_ISR_NOTA0
dec.b &OSIntNesting ; increase OSIntNesting
reti
;********************************************************************************************************
; P1 INTERRUPT VECTOR ENTRY
;
; MSP430x11x1/MSP430F14x Interrupt vectors
;********************************************************************************************************
COMMON INTVEC
P1_VEC DW PORT1_ISR ; interrupt vector. PORT1
файл конфигурации uCOS2:
*********************************************************************************************************
* uC/OS-II CONFIGURATION
*********************************************************************************************************
*/
#define OS_ARG_CHK_EN 0 /* Enable (1) or Disable (0) argument checking */
#define OS_CPU_HOOKS_EN 1 /* uC/OS-II hooks are found in the processor port files */
/* ... MUST NEVER be higher than 63! */
#define OS_MAX_EVENTS 3 /* Max. number of event control blocks in your application ... */
/* ... MUST be > 0 */
#define OS_MAX_FLAGS 2 /* Max. number of Event Flag Groups in your application ... */
/* ... MUST be > 0 */
#define OS_MAX_MEM_PART 2 /* Max. number of memory partitions ... */
/* ... MUST be > 0 */
#define OS_MAX_QS 2 /* Max. number of queue control blocks in your application ... */
/* ... MUST be > 0 */
#define OS_MAX_TASKS 6 /* Max. number of tasks in your application ... */
/* ... MUST be >= 2 */
#define OS_TASK_STAT_STK_SIZE 64 /* Statistics task stack size (# of OS_STK wide entries) */
#define OS_TASK_STAT_STK_CHK_EN 0 /* Check task stacks from statistic task NEW!*/
#define OS_TICKS_PER_SEC 113 /* Set the number of ticks in one second */
/* ----------------------- 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_NAME_SIZE 0 /* Determine the size of the name of an event flag group NEW!*/
#define OS_FLAG_QUERY_EN 0 /* Include code for OSFlagQuery() */
#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 0 /* 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() */
#define OS_MEM_NAME_SIZE 0 /* Determine the size of a memory partition name NEW!*/
#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() */
#define OS_Q_EN 0 /* Enable (1) or Disable (0) code generation for QUEUES */
#define OS_Q_ACCEPT_EN 0 /* 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 0 /* 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() */
#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 1 /* Include code for OSSemDel() */
#define OS_SEM_QUERY_EN 1 /* Include code for OSSemQuery() */
#define OS_TASK_CHANGE_PRIO_EN 1 /* Include code for OSTaskChangePrio() */
#define OS_TASK_CREATE_EN 1 /* Include code for OSTaskCreate() */
#define OS_TASK_CREATE_EXT_EN 1 /* Include code for OSTaskCreateExt() */
#define OS_TASK_DEL_EN 1 /* Include code for OSTaskDel() */
#define OS_TASK_NAME_SIZE 0 /* Determine the size of a task name NEW!*/
#define OS_TASK_PROFILE_EN 1 /* Include variables in OS_TCB for profiling NEW!*/
#define OS_TASK_QUERY_EN 1 /* Include code for OSTaskQuery() */
#define OS_TASK_SUSPEND_EN 1 /* Include code for OSTaskSuspend() and OSTaskResume() */
#define OS_TASK_SW_HOOK_EN 1 /* Include code for OSTaskSwHook() NEW!*/
#define OS_TIME_DLY_HMSM_EN 1 /* Include code for OSTimeDlyHMSM() */
#define OS_TIME_DLY_RESUME_EN 1 /* Include code for OSTimeDlyResume() */
#define OS_TIME_GET_SET_EN 1 /* Include code for OSTimeGet() and OSTimeSet() */
#define OS_TIME_TICK_HOOK_EN 1 /* Include code for OSTimeTickHook() NEW!*/
Ответы