cc_get_pc();
txdata(app,verb,2);
break;
+ case CC_LOCKCHIP:
+ cc_lockchip();
+ //no break, return status
case CC_READ_STATUS:
cc_read_status();
txdata(app,verb,1);
0xA5 // DB 0xA5;
};
+
+//! Locks the chip.
+void cc_lockchip(){
+ debugstr("Locking chip.");
+ cc_wr_config(1);//Select Info Flash
+ cc_debug(3, 0x75, 0xAF, 0x00);//MOV FWDATA, #00H
+ //cc_debug(2, 0xF5, 0xAF, 0); //MOV FWDATA, A
+
+}
+
//! Copies flash buffer to flash.
void cc_write_flash_page(u32 adr){
//Assumes that page has already been written to XDATA 0xF000
void cc_resume();
//! Step an instruction
void cc_step_instr();
+//! Locks the chip.
+void cc_lockchip();
#define CC_STATUS_ERASED 0x80
#define CC_STATUS_PCONIDLE 0x40
#define CC_MASS_ERASE_FLASH 0x97
#define CC_PROGRAM_FLASH 0x98
#define CC_WIPEFLASHBUFFER 0x99
-
+#define CC_LOCKCHIP 0x9A