Andes Workshop http://forum.andestech.com/ |
|
not_nested與ready_nested http://forum.andestech.com/viewtopic.php?f=25&t=696 |
Page 1 of 1 |
Author: | cindy [ Tue Apr 30, 2013 5:40 pm ] |
Post subject: | not_nested與ready_nested |
not_nested的ISR,如果裡面打開GIE, 是不是會和ready_nested一樣變成巢狀中斷? not_nested原本的設計是用來執行無巢狀的中斷, 所以沒有把interrupt降階,所以如果把GIE打開,interrupt又會往上跳一層, 會造成錯誤。除非user自己要降階。 所以,巢狀中斷還是要使用ready_nested。 (下面是not_nested的example code,與本文的主題無關) Code: void NDS32ATTR_ISR("not_nested;id=0") HW0_ISR(void)
{ puts("* Enter HW0 ISR with GPIO *\n"); outw(GPIO_BASE + GPIO_IC_OFFSET, 0xFFFFFFFF); /* This service will take 6 secs */ unsigned int period; period = (6 * (MB_PCLK / TICK_HZ)) >> SIMU_FACTOR; outw(TM2_LOAD, period); outw(TM2_CNTR, 0); outw(TM_CR, (inw(TM_CR) | TM_CR_TM2ENA | TM_CR_TM2UP)); while (1) { unsigned int tm2_cntr = inw(TM2_CNTR); if (tm2_cntr > period) break; } puts("* End of HW0 ISR it takes 6 secs *\n"); } |
Page 1 of 1 | All times are UTC + 8 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |