(*((void (*)(void))(*(unsigned long *)0x2c)))(); 是什么意思?

(((void ()(void))((unsigned long )0x2c)))(); 是什么意思?
在8962的boot_demo1中 (
((void (
)(void))(*(unsigned long *)0x2c)))(); 是什么意思?是把程序引导到地址为0X2C的位置?

这个语句会执行位于bootloader的SVC(软中断)异常服务例程,还是分解一下吧:

(*(unsigned long *)0x2c):将0x2C强制转化为unsigned long类型指针,并指向该地址所在的数据;

void (*)(void) :函数指针,指针名为空,该函数参数为空,返回值为空

(void ()(void))((unsigned long *)0x2c):将Flash地址0x2C中的内容强制转化为函数指针,该函数参数为空,返回值为空

(((void ()(void))(*(unsigned long *)0x2c)))();:调用函数,即开始从启动代码中的UpdateHandler标号处开始执行

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章