|
求教密码保护模块中的程序理解
在TI例程中CSM模块有这么一段程序,如下: Uint16 CsmUnlock() { volatile Uint16 temp; EALLOW; CsmRegs.KEY0 = 0xFFFF; CsmRegs.KEY1 = 0xFFFF; CsmRegs.KEY2 = 0xFFFF; CsmRegs.KEY3 = 0xFFFF; CsmRegs.KEY4 = 0xFFFF; CsmRegs.KEY5 = 0xFFFF; CsmRegs.KEY6 = 0xFFFF; CsmRegs.KEY7 = 0xFFFF; EDIS;
temp = CsmPwl.PSWD0; temp = CsmPwl.PSWD1; temp = CsmPwl.PSWD2; temp = CsmPwl.PSWD3; temp = CsmPwl.PSWD4; temp = CsmPwl.PSWD5; temp = CsmPwl.PSWD6; temp = CsmPwl.PSWD7;
// If the CSM unlocked, return succes, otherwise return // failure. if (CsmRegs.CSMSCR.bit.SECURE == 0) return STATUS_SUCCESS; else return |
|
|