主题 : mini2440 UCOS里加入中断,出现崩溃,请一定帮忙看下 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 14969
精华: 0
发帖: 5
金钱: 25 两
威望: 5 点
贡献值: 0 点
综合积分: 10 分
注册时间: 2010-02-26
最后登录: 2011-10-12
楼主  发表于: 2011-04-15 15:36

 mini2440 UCOS里加入中断,出现崩溃,请一定帮忙看下



#define REQCNT 30
#define ADCPRS 9 //YH 0627
#define LOOP 1

void Task0 (void *pdata)//Init lwip and create task2

          Uart_Printf("%x\n",rINTMSK);
          Uart_Printf("%x\n",rINTSUBMSK);
         Test_Touchpanel();
          while(1)
         {
                     Uart_Printf("%x\n",rINTMSK);
                     Uart_Printf("%x\n",rINTSUBMSK);
                     //rINTMSK = 0xfffffbff;
                     //rINTSUBMSK =0x7fff;
                     if(button(15,60,105,140))
                     {
                                   Uart_Printf("Press first picture.\n");
                     }
                      OSTimeDly(OS_TICKS_PER_SEC);
           }
}

void __irq AdcTsAuto(void)
{
            #if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
            OS_CPU_SR  cpu_sr;
            #endif
            OS_ENTER_CRITICAL();
            // OSIntEnter();
            // OS_EXIT_CRITICAL();


            if(rADCDAT0&0x8000)
            {
                          Uart_Printf("Up state\n");
                          //Uart_Printf("count=%03d  XP=%04d, YP=%04d\n\n", count++, xdata, ydata);    //X-position Conversion data            

                         rSUBSRCPND|=BIT_SUB_TC;
                         ClearPending(BIT_ADC);  
                         rADCTSC =0xd3;
                         Touchupflag = 1;
                          // rSRCPND = 0xFFFFFFFF;
                         // rSUBSRCPND = 0xFFFF; 
             }else{
                          Uart_Printf("Down state\n");
                           rADCTSC=(1<<3)|(1<<2);         //Pull-up disable, Seq. X,Y postion measure.
                           rADCDLY=40000;                 //Normal conversion mode delay about (1/50M)*40000=0.8ms

                           // rADCCON|=0x1;                   //start ADC

                           // while(rADCCON & 0x1); /eck if Enable_start is low
                           // while(!(rADCCON & 0x8000));        /eck if EC(End of Conversion) flag is high, This line is necessary~!!

                           //            while(!(rSRCPND & (BIT_ADC)));  /eck if ADC is finished with interrupt bit

                          xdata=(rADCDAT0&0x3ff);
                          ydata=(rADCDAT1&0x3ff);
                          rADCTSC =0xd3;    //Waiting for interrupt
                          rADCTSC=rADCTSC|(1<<8); // Detect stylus up interrupt signal.
                          rSUBSRCPND|=BIT_SUB_TC;
                          ClearPending(BIT_ADC);
                          Uart_Printf("%x\n",rINTMSK);
                          Uart_Printf("%x\n",rINTSUBMSK);
                          // rSRCPND = 0xFFFFFFFF;
                          // rSUBSRCPND = 0xFFFF;
                          // Uart_Printf("%x\n",rSRCPND);
                         // Uart_Printf("%x\n",rSUBSRCPND);
            }
            //    OSIntExit();
           OS_EXIT_CRITICAL();
}
有谁能帮我看看,mini2440的开发板用UCOS,进了触摸中断后,怎么出不来呢?
级别: 新手上路
UID: 45583
精华: 0
发帖: 5
金钱: 25 两
威望: 5 点
贡献值: 0 点
综合积分: 10 分
注册时间: 2011-05-06
最后登录: 2011-10-07
1楼  发表于: 2011-06-01 20:05
去掉__irq就可以,搞了我好久啊!!终于在此被我找到了,多谢各位兄台!!
其实,每个人都只是一个演员!