tools/picctldisplaytest/src/picctldisplaytest.cpp
changeset 32 00a9c2c2f33f
parent 31 4567e7bc404c
     1.1 --- a/tools/picctldisplaytest/src/picctldisplaytest.cpp	Thu Apr 23 20:22:04 2009 +0200
     1.2 +++ b/tools/picctldisplaytest/src/picctldisplaytest.cpp	Thu Apr 23 20:54:06 2009 +0200
     1.3 @@ -128,9 +128,17 @@
     1.4  				cout << "Sending Clear Display..." << endl;
     1.5  				send_data(CMD_DISP_CLEAR_SCREEN,(sizeof(CMD_DISP_CLEAR_SCREEN)/sizeof(char)));
     1.6  				break;
     1.7 +			case 'e':
     1.8 +				cout << "Reading EEProm..." << endl;
     1.9 +				myflags.parse_return_eeprom = 1;
    1.10 +				send_data(CMD_READ_EE,(sizeof(CMD_READ_EE)/sizeof(char)));
    1.11 +				myflags.parse_return_eeprom = 0;
    1.12 +				break;
    1.13  			case 'b':
    1.14  				cout << "Sending Bootload Start..." << endl;
    1.15  				send_data(CMD_BOOT,(sizeof(CMD_BOOT)/sizeof(char)));
    1.16 +				cout << "Exiting." << endl;
    1.17 +				return EXIT_SUCCESS;
    1.18  				break;
    1.19  			case 'h':
    1.20  				print_help();
    1.21 @@ -453,10 +461,11 @@
    1.22  	cout << endl;
    1.23  	cout << "b\tenter bootload mode" << endl;
    1.24  	cout << endl;
    1.25 +	cout << "e\tdump eeprom" << endl;
    1.26 +	cout << endl;
    1.27  	cout << "h\tprint this help" << endl;
    1.28  	cout << "j\tprint command line options" << endl;
    1.29  	cout << "q\tquit" << endl;
    1.30 -	cout << ">";
    1.31  }
    1.32  
    1.33  /*! \brief prints command line options
    1.34 @@ -568,6 +577,9 @@
    1.35  		cout << endl;
    1.36  	}
    1.37  	if (myconfig.debug || myconfig.verbosity > 0) cout <<  dec << (buf_pos - buf_cmd_start) << " bytes received.\n";
    1.38 +	if (myflags.parse_return_eeprom > 0) {
    1.39 +		cout << "(eeprom-data)" << "0x" << ((int) buf[4] < 10 ? "0" : "") << hex << (int) buf[4] << " " << endl;
    1.40 +	}
    1.41  }
    1.42  
    1.43  /*! \brief sends size bytes of buffer data to the display
    1.44 @@ -595,6 +607,10 @@
    1.45  	}
    1.46  	if (myconfig.debug || myconfig.verbosity > 0) cout <<   endl;
    1.47  
    1.48 +	if (buffer == CMD_BOOT) {
    1.49 +		cout << " Entering Bootloader-mode... not waiting for an ACK Packet" << endl;
    1.50 +	}
    1.51 +
    1.52  	ack_flag = false;
    1.53  
    1.54  	while (!ack_flag && tout < 1000) {