|
|||||||||||
| 技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng) 驅(qū)動編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機 | DSP技術(shù) | MCU技術(shù) | IC 設計 | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe |
ucos下中斷是不是一定要有OSIntEnter和OSIntExit?? |
| 作者:毛克 欄目:嵌入式系統(tǒng) |
ucos+lwip下的8019驅(qū)動就是c啊 ucos+lwip下的8019驅(qū)動就是c啊,但是是不是一定要有OSIntEnter和OSIntExit??原來skyeye的代碼沒有啊 調(diào)試lwip時,在中斷服務里面調(diào)用的程序發(fā)送了個消息給tcpip_thread認務,卻沒有發(fā)生認務切換,是不是這個原因。坎贿^加上這兩個好像也不行。 OSTCBCur->OSTCBStkPtr=pc;如何實現(xiàn)? void __irq ne2k_isr(void) { u8_t isr,curr,bnry; struct netif *netif; /////////maokor 7.1 for debug OSIntEnter(); if (OSIntNesting==1){ // OSTCBCur->OSTCBStkPtr=pc; } ////////// rI_ISPC =BIT_EINT1; //CLOSE nic //******************** add by maokor for debug ,2005.6.17******* outb(CMD_PAGE2 | CMD_NODMA | CMD_STOP,NE_CR); isr = inb(NE_IMR); //*****************************************************888888 //in PAGE0 outb(CMD_PAGE0 | CMD_NODMA | CMD_STOP,NE_CR); isr = inb(NE_ISR); // ram overflow interrupt if (isr & ISR_OVW) { outb(ISR_OVW,NE_ISR); // clear interrupt // ne2k_overflowProcess(); //yangye :no overflow now } // error transfer interrupt ,NIC abort tx due to excessive collisions if (isr & ISR_TXE) { outb(ISR_TXE,NE_ISR); // clear interrupt //temporarily do nothing } // Rx error , reset BNRY pointer to CURR (use SEND PACKET mode) if (isr & ISR_RXE) { outb(ISR_RXE,NE_ISR); // clear interrupt outb(CMD_PAGE1 | CMD_NODMA | CMD_STOP,NE_CR); curr = inb(NE_CURR); outb(CMD_PAGE0 | CMD_NODMA | CMD_STOP,NE_CR); outb(curr, NE_BNRY); } //got packet with no errors if (isr & ISR_PRX) { outb(ISR_PRX, NE_ISR); // clear interrupt outb(CMD_PAGE1 | CMD_NODMA | CMD_STOP, NE_CR); curr = inb(NE_CURR); outb(CMD_PAGE0 | CMD_NODMA | CMD_STOP, NE_CR); bnry = inb(NE_BNRY); //yangye 2003-1-21 //get more than one packet until receive buffer is empty while(curr != bnry){ ne2k_recv_packet(rtl8019if_netif); outb(CMD_PAGE1 | CMD_NODMA | CMD_STOP, NE_CR); curr = inb(NE_CURR); outb(CMD_PAGE0 | CMD_NODMA | CMD_STOP, NE_CR); bnry = inb(NE_BNRY); } } //Transfer complelte, do nothing here if( isr & ISR_PTX){ PRINT("ne2k_isr: is ISR_PTX\n"); outb(ISR_PTX, NE_ISR); // clear interrupt } outb(CMD_PAGE0 | CMD_NODMA | CMD_STOP, NE_CR); outb(0xff, NE_ISR); // clear ISR //open nic for next packet outb(CMD_PAGE0 | CMD_NODMA | CMD_RUN, NE_CR); ////////////7.1 maokor for debug OSIntExit(); ////////////// } |
| 2樓: | >>參與討論 |
| 作者: hh_wsl 于 2005/7/14 16:33:00 發(fā)布:
根據(jù)需要確定 OSIntEnter和OSIntExit,主要是中斷潛逃管理如果你不是用這個功能自然也可以。但是不能在中斷處理工程中開中斷。 一家之言,多多交流! |
|
|
|
| 免費注冊為維庫電子開發(fā)網(wǎng)會員,參與電子工程師社區(qū)討論,點此進入 |
Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號 |