ISP_CMD = ISP_CMD&0xf8; /* 1111,1000 */
ISP_CMD = ISP_CMD|PROGRAM_AP_and_Data_Memory_Command; /* 0000,0010 */
ISP_DATA = original_data;
ISP_IAP_enable();
ISP_TRIG = 0x46;
ISP_TRIG = 0xb9;
_nop_();
ISP_DATA = 0x00;
ISP_CMD = ISP_CMD &0xf8; /* 1111,1000 */
ISP_CMD = ISP_CMD | READ_AP_and_Data_Memory_Command; /* 0000,0001 */
ISP_TRIG = 0x46; /* 触发ISP_IAP命令 */
ISP_TRIG = 0xb9; /* 触发ISP_IAP命令 */
_nop_();
ISP_IAP_disable();
if(ISP_DATA == original_data)
return OK;
else
return ERROR;
}