isr.c
上传用户:dongxin
上传日期:2022-06-22
资源大小:370k
文件大小:1k
- #include "includes.h"
- //#include <stdio.h>
- #include <string.h>
- #define OS_CPU_GLOBALS
- extern OS_EVENT *delSEM;
- extern OS_EVENT *sw1SEM;
- extern OS_EVENT *sw2SEM;
- extern char reStr[8];
- extern INT8U delPrio;
- //按键2中断服务函数
- void OS_IRQ1_ISR_Handler(void)
- {
- MCF_EPORT0_EPFR |= 0x00000002; //清除中断标志位
- OSSemPost(sw2SEM);
- }
- //按键1中断服务函数
- void OS_IRQ7_ISR_Handler(void)
- {
- MCF_EPORT0_EPFR |= 0x00000080; //清除中断标志
- OSSemPost(sw1SEM);
- }
- //定时中断服务函数
- void OS_PIT0_ISR_Handler(void)
- {
- MCF_PIT0_PCSR |= MCF_PIT_PCSR_PIF; //清除中断标志
- OSTimeTick();
- }
- //串口中断服务函数
- void OS_UART0_ISR_Handler(void)
- {
- char str[3];
-
- if(UartReN(0,6,reStr) == 0)
- {
- delPrio = (reStr[4] - '0') * 10 + (reStr[5] - '0');
-
- strncpy(str,reStr,3);
-
- if(strcmp(str,"del") == 0)
- OSSemPost(delSEM);
- }
- }