Andes Workshop

It is currently Thu Mar 28, 2024 8:39 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: not_nested與ready_nested
PostPosted: Tue Apr 30, 2013 5:40 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
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");
}


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group