Andes Workshop
http://forum.andestech.com/

關於demo-int-c-ext的nmi_handler及warm_handler
http://forum.andestech.com/viewtopic.php?f=23&t=197
Page 1 of 1

Author:  cindy [ Fri Nov 11, 2011 6:54 pm ]
Post subject:  關於demo-int-c-ext的nmi_handler及warm_handler

demo-int-c-ext中的下面這個function,nmi_handler及warm_handler的流程會不會執行reset_handler的內容?

void __attribute__ ((reset("vectors=7;nmi_func=nmi_handler;warm_func=nmi_handler"))) reset_handler(void)
{
__cpu_init();
__c_init();
__soc_init();
main();
}

在Programming guide的Page 56介紹了int nmi_func(int *reg_ptr)的函式定義,
它寫
Return Value:
0 means OK to resume the work before NMI happens.
-1 means fail and the prologue of reset handler will reset the system.
It is also OK to hold the control and never return to the reset handler.

也就是user能自訂是否它要執行reset_handler是否要執行reset_handler的內容。
回0則不需要。回-1則會執行reset_handler。

Page 1 of 1 All times are UTC + 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/