由于函数比较多,所以采取了跳转表的方式!但是发现个奇怪的问题就是在跳转的过程中参数传递漏传了!
下面是代码中的跳转指令与目标函数。
(void)(*PGNFuncList[ paramGroupNumAddr ])( j1939PGN, dataLen, data
); //跳转
const UINT16 (*PGNFuncList[])( const UINT32 currentPGN, const UINT8
dataLen, const UINT8 *const data ) //这个是跳转表
{
PGN65159Func
}
UINT16 PGN65159Func( const UINT32 currentPGN, const UINT8 dataLen,
const UINT8 *const data ) //目标函数
在跳转到目标函数时dataLen的参数传递出了问题,本来应该是8,但变成0了!其余两个参数正常!