summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2012-08-10 17:19:03 +0200
committerPali Rohár <pali.rohar@gmail.com>2012-08-10 17:19:03 +0200
commit19a8d76e0ce350be25ecd0322bab98d805fe0d05 (patch)
tree9029db83f1f9cef4e1a98c977c1cb40a218298ed
parentaa89ef8dad06f3beac87b0e7da54fd2ed01c0b23 (diff)
download0xFFFF-19a8d76e0ce350be25ecd0322bab98d805fe0d05.tar.bz2
main: Do not enter to usb mode if not needed
-rw-r--r--src/main2.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/src/main2.c b/src/main2.c
index 5008430..903b596 100644
--- a/src/main2.c
+++ b/src/main2.c
@@ -712,41 +712,45 @@ int main(int argc, char **argv) {
}
}
- while ( image_first ) {
+ if ( dev_boot || dev_reboot || dev_load || dev_flash || dev_cold_flash || dev_ident || set_root || set_usb || set_rd || set_rd_flags || set_hw || set_kernel || set_nolo || set_sw || set_emmc ) {
- usb_dev = usb_open_and_wait_for_device();
+ while ( image_first ) {
- /* cold flash */
- if ( dev_cold_flash ) {
+ usb_dev = usb_open_and_wait_for_device();
- ret = cold_flash(usb_dev, image_2nd, image_secondary);
- usb_close_device(usb_dev);
- usb_dev = NULL;
+ /* cold flash */
+ if ( dev_cold_flash ) {
- if ( ret != 0 )
- continue;
+ ret = cold_flash(usb_dev, image_2nd, image_secondary);
+ usb_close_device(usb_dev);
+ usb_dev = NULL;
- if ( dev_flash ) {
- dev_cold_flash = 0;
- continue;
- }
+ if ( ret != 0 )
+ continue;
- break;
+ if ( dev_flash ) {
+ dev_cold_flash = 0;
+ continue;
+ }
- }
+ break;
- /* device identify */
-// while(get_status());
+ }
+
+ /* device identify */
+// while(get_status());
- /* flash */
+ /* flash */
- /* configuration */
+ /* configuration */
- /* load */
+ /* load */
- /* boot */
+ /* boot */
- /* reboot */
+ /* reboot */
+
+ }
}