zoto 发表于 2005-3-9 16:32:57

ucos,如何处理中断?

把网站的例子修来修去,跑起来没有问题了。



可怎么处理中断啊?比如从串口接收一个字节?





谁能提供个例子!!!



处理 堆栈 老是有问题!~
-----此内容被zoto于2005-03-09,16:35:07编辑过

zoto 发表于 2005-3-9 16:42:06

搞定~~

Eagle 发表于 2005-7-22 16:03:56

请问楼上的怎么处理中断的? 我现在被困在这了.我的邮箱是JXLWG_007@163.COM.收到请回复我. 先谢了.

tarzar 发表于 2007-4-10 08:58:15

楼主,能否说明你是如何解决问题的啊,我现在遇到同样的问题



如果没有加入向串口发送数据任务时(用中断方式),其它的两个任务运行正常起来一切正常.

我发现如果任务中如果有用到中断,系统运行一会儿,就不能调度了( OSTickISR()不运行了,原因是 SREG的位I被清零)



谢谢!



验证系统是否有在进行任务调度方法:

在函数OSTickISR()中放一个IO取反,所以只要该IO有输出周期性的方波就说明系统时间有运行,即有进行任务调度

wswh2o 发表于 2007-4-30 15:21:47

SAdcISR_1:

                CALL    _adc_isr                                  ; Handle the tick ISR

                CALL    _OSIntExit                  ; Notify uC/OS-II about end of ISR



                POP_SP                              ; Restore the hardware stack pointer from task's stack

                POP_SREG                            ; Restore the SREG register

                POP_ALL                           ; Restore all registers



                RET                                 ; Note: RET instead of RETI

                               

;

;

;

;

;

;

_OSUart1ISR::

                                   PUSH_ALL                            ; Save all registers and status register

                IN      R16,SREG                  ; Save the SREG but with interrupts enabled

                SBR   R16,BIT07                  

                ST      -Y,R16

                PUSH_SP

                               

                                CALL    _OSIntEnter

                                ;LDS   R16,_OSIntNesting         ; Notify uC/OS-II of ISR

                ;INC   R16                         ;

                ;STS   _OSIntNesting,R16         ;

                               

                                CPI   R16,1                     ; if (OSIntNesting == 1) {

                BRNE    OSUart1ISR_1



                LDS   R30,_OSTCBCur               ;   OSTCBCur->OSTCBStkPtr = Y

                LDS   R31,_OSTCBCur+1

                ST      Z+,R28

                ST      Z+,R29                      ; }



OSUart1ISR_1:

                CALL    _uart1_rx_isr                      ; Handle the tick ISR



                CALL    _OSIntExit                  ; Notify uC/OS-II about end of ISR



                POP_SP                              ; Restore the hardware stack pointer from task's stack

                POP_SREG                            ; Restore the SREG register

                POP_ALL                           ; Restore all registers



                RET                                                             ; Note: RET instead of RETI

wswh2o 发表于 2007-4-30 15:22:56

我参考移植的时钟中断写的adc中断,可以用的,就是不太稳定

ddgg 发表于 2007-5-1 20:30:24

同在网上找的,还没有用过!!!不知行不行.







可以这样子用,呵呵

UCOSISR(SIG_UART0_RECV)



文件呢?

点击此处下载armok01152617.rar


-----此内容被ddgg于2007-05-01,20:31:32编辑过

ralfak 发表于 2007-6-20 15:41:36

直接用C写中断,如果不需要中断嵌套的话,不用SEI(),加上osintenter,osintnesting++,osintexit就ok,我用的ICCAVR
-----此内容被ralfak于2007-06-20,15:55:03编辑过

0620223 发表于 2009-12-13 21:22:52

7 楼:有arm7的中断例子吗?
页: [1]
查看完整版本: ucos,如何处理中断?