Code to load a LPC1114 over tx/rx. I have only tested with a 1114 chip but it should work with other LPC uControllers
Dependencies: DirectoryList MODSERIAL mbed
Fork of ika_shouyu_poppoyaki by
Diff: isp.cpp
- Revision:
- 47:e7d395119a63
- Parent:
- 45:0520330a7528
- Child:
- 48:99cfe3a929ea
diff -r fe8ca451abcb -r e7d395119a63 isp.cpp --- a/isp.cpp Wed Dec 10 09:42:12 2014 +0000 +++ b/isp.cpp Tue Jan 06 11:05:29 2015 +0000 @@ -79,7 +79,7 @@ printf( "\r\n ==== flash writing ====\r\n" ); - if ( err = write_flash( fp, tpp, &transferred_size ) ) + if ( err = write_flash( fp, tpp, &transferred_size, data_size ) ) return ( err ); printf( " -- %d bytes data are written\r\n", transferred_size ); @@ -102,7 +102,7 @@ } else { printf( "\r\n ==== flash reading and verifying ====\r\n" ); - if ( err = verify_flash( fp, tpp, &transferred_size ) ) + if ( err = verify_flash( fp, tpp, &transferred_size, data_size ) ) return ( err ); printf( " -- %d bytes data are read and verified\r\n", transferred_size ); @@ -204,3 +204,9 @@ { leds = 0x0; } + +void show_progress( int total_size, int file_size ) +{ + printf( " -- %5.1f%%\r", ((float)total_size/(float)file_size) * 100.0 ); + fflush( stdout ); +}