daily pastebin goal
71%
SHARE
TWEET

UNITCFZ

a guest Oct 28th, 2017 58 in 35 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int temp_ports, i, temp_datareg, reg, result;
  2. load_library("unit_cfz.dll");
  3. reenumerate_all_port_types();
  4. temp_ports = get_enumerated_number_of_ports(PortType_USBMultilink);
  5. for (i = 0;i<temp_ports;i++)
  6.     LogStr(get_port_descriptor(PortType_USBMultilink, i+1));
  7.  
  8. if (open_port(PortType_USBMultilink,1) == 1)
  9. {
  10.     LogStr("Connected OK!");
  11.     btnReboot->Enabled = true;
  12.     btnResume->Enabled = true;
  13.     btnStop->Enabled = true;
  14.     StatusTimer->Enabled = true;
  15.     btnSS->Enabled = true;
  16. }
  17. else
  18. {
  19.     LogStr("Connected Failed!");
  20.     return;
  21. }
  22. reset_hardware_interface();
  23. set_bdm_shift_speed(24);
  24.  
  25. force_background_mode();
  26.  
  27. result = check_critical_error();        //Return 0
  28.  
  29. int addr = 0x464;
  30.  
  31. char b[2] = {0};
  32. char HALT[2] = {0x4A, 0xC8};
  33. char b_err[2] = {0};
  34. WORD OrBytes = read_data_word(addr);
  35. BP.AddBP(addr, OrBytes);
  36. write_data_word(addr, 0x4AC8);          //<--Don't write
  37. put_data_block(addr, 2, 2, HALT);       //<--Don't write
  38. result = buss_error_value();            //Return 0
  39. get_data_block(addr, 2, 1, b, b_err);
  40. result = buss_error_value();            //Return 0
  41. OrBytes = read_data_word(addr);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top