Advertisement
Guest User

Untitled

a guest
Jun 18th, 2015
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. void copy_ram_to_flash (uint32_t dest_flash_addr, uint32_t source_ram_addr, uint16_t num_bytes)
  2. {
  3.  
  4. if (num_bytes > 1024)
  5. num_bytes = 4096;
  6. else if (num_bytes > 512)
  7. num_bytes = 1024;
  8. else if (num_bytes > 256)
  9. num_bytes = 512;
  10. else
  11. num_bytes = 256;
  12.  
  13. command[0] = COPY_RAM_TO_FLASH;
  14. command[1] = dest_flash_addr;
  15. command[2] = source_ram_addr;
  16. command[3] = num_bytes;
  17. command[4] = __CORE_CLK / 1000;
  18.  
  19. iap_entry (command, result);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement