我正在看这个开源启动加载器,我看到了这行代码.最后一行发生了什么?是某种指向函数的指针,是否转换为地址?
uint8_t ret = init_api(); uint16_t ptr; ptr = PGM_READ_WORD(JUMP_TABLE_INDEX(6)); ret = ( (uint8_t(*)(uint32_t, uint8_t *, uint8_t)) ptr )(addr, data, erase);
AlexD.. 14
ptr
被转换为指向函数的指针
uint8_t f(uint32_t, uint8_t *, uint8_t)
和函数被调用的参数addr
,data
,erase
.
ptr
被转换为指向函数的指针
uint8_t f(uint32_t, uint8_t *, uint8_t)
和函数被调用的参数addr
,data
,erase
.