Add to 11U68 11E68
Dependencies: DirectoryList MODSERIAL mbed
Fork of ika_shouyu_poppoyaki by
Diff: main.cpp
- Revision:
- 48:99cfe3a929ea
- Parent:
- 47:e7d395119a63
--- a/main.cpp Tue Jan 06 11:05:29 2015 +0000 +++ b/main.cpp Thu Jan 29 10:48:57 2015 +0000 @@ -2,7 +2,7 @@ * Sample of ISP operation for NXP MCUs * * @author Tedd OKANO - * @version 1.1.1 + * @version 1.1.2 * @date Jan-2015 * * This program programs MCU flash memory through UART. It uses @@ -24,6 +24,7 @@ #include "isp.h" #include "serial_utilities.h" #include "_user_settings.h" +#include "dir_handling.h" LocalFileSystem local( "local" ); @@ -36,9 +37,16 @@ { int err; - printf( "\r\n\r\n\r\nmbed ISP program : programming LPC device from mbed (v1.1.1)\r\n" ); + printf( "\r\n\r\n\r\nmbed ISP program : programming LPC device from mbed (v1.1.2)\r\n" ); +#ifndef ENABLE_FILE_SELECTOR err = isp_flash_write( SOURCE_FILE ); +#else + std::string str( SOURCE_FILE ); + if ( "" == get_file_name( str, SUFFIX_FILTER_STR ) ) + goto skip_ISP; + err = isp_flash_write( str.c_str() ); +#endif printf( "\r\n %d: %s\r\n\r\n",err, err ? @@ -49,6 +57,8 @@ if ( err ) error( " ** ISP failed\r\n" ); +skip_ISP: + #ifdef AUTO_PROGRAM_START start_target_in_normal_mode( TARGET_OPERATION_BAUD_RATE ); @@ -63,4 +73,3 @@ usb_serial_bridge_operation(); // doesn't return. infinite loop in this function } -