@@ -72,7 +72,7 @@ public String toString() {
72
72
* This is the basic info contained in the descriptor
73
73
*/
74
74
private String myUploadPort ;
75
- private String myUploadProtocol ;
75
+ private String myProgrammer ;
76
76
private String myBoardID ;
77
77
private Map <String , String > myOptions ;
78
78
@@ -144,7 +144,7 @@ public boolean equals(BoardDescriptor obj) {
144
144
if (!this .getUploadPort ().equals (obj .getUploadPort ())) {
145
145
return false ;
146
146
}
147
- if (!this .getUploadProtocol ().equals (obj .getUploadProtocol ())) {
147
+ if (!this .getProgrammer ().equals (obj .getProgrammer ())) {
148
148
return false ;
149
149
}
150
150
if (!this .getBoardID ().equals (obj .getBoardID ())) {
@@ -291,13 +291,12 @@ protected BoardDescriptor(ICConfigurationDescription confdesc) {
291
291
this .myTxtFile = new TxtFile (this .myreferencingBoardsFile );
292
292
this .myBoardID = myStorageNode .get (KEY_LAST_USED_BOARD , "" );
293
293
this .myUploadPort = myStorageNode .get (KEY_LAST_USED_UPLOAD_PORT , "" );
294
- this .myUploadProtocol = myStorageNode .get (KEY_LAST_USED_UPLOAD_PROTOCOL ,
295
- Defaults .getDefaultUploadProtocol ());
294
+ this .myProgrammer = myStorageNode .get (KEY_LAST_USED_UPLOAD_PROTOCOL , Defaults .getDefaultUploadProtocol ());
296
295
this .myOptions = KeyValue .makeMap (myStorageNode .get (KEY_LAST_USED_BOARD_MENU_OPTIONS , new String ()));
297
296
298
297
} else {
299
298
this .myUploadPort = Common .getBuildEnvironmentVariable (confdesc , ENV_KEY_JANTJE_UPLOAD_PORT , "" );
300
- this .myUploadProtocol = Common .getBuildEnvironmentVariable (confdesc , JANTJE_ACTION_UPLOAD , "" );
299
+ this .myProgrammer = Common .getBuildEnvironmentVariable (confdesc , JANTJE_ACTION_UPLOAD , "" );
301
300
this .myreferencingBoardsFile = new File (
302
301
Common .getBuildEnvironmentVariable (confdesc , ENV_KEY_JANTJE_BOARDS_FILE , "" ));
303
302
this .myBoardID = Common .getBuildEnvironmentVariable (confdesc , ENV_KEY_JANTJE_BOARD_ID , "" );
@@ -357,7 +356,7 @@ public static List<BoardDescriptor> makeBoardDescriptors(File boardFile) {
357
356
*/
358
357
protected BoardDescriptor (File boardsFile , String boardID , Map <String , String > options ) {
359
358
this .myUploadPort = new String ();
360
- this .myUploadProtocol = Defaults .getDefaultUploadProtocol ();
359
+ this .myProgrammer = Defaults .getDefaultUploadProtocol ();
361
360
this .myBoardID = boardID ;
362
361
this .myOptions = new TreeMap <>(String .CASE_INSENSITIVE_ORDER );
363
362
this .myreferencingBoardsFile = boardsFile ;
@@ -373,7 +372,7 @@ protected BoardDescriptor(File boardsFile, String boardID, Map<String, String> o
373
372
374
373
protected BoardDescriptor (TxtFile txtFile , String boardID ) {
375
374
this .myUploadPort = new String ();
376
- this .myUploadProtocol = Defaults .getDefaultUploadProtocol ();
375
+ this .myProgrammer = Defaults .getDefaultUploadProtocol ();
377
376
this .myBoardID = boardID ;
378
377
this .myOptions = new TreeMap <>(String .CASE_INSENSITIVE_ORDER );
379
378
this .myreferencingBoardsFile = txtFile .getTxtFile ();
@@ -545,7 +544,7 @@ public void saveConfiguration(ICConfigurationDescription confDesc, IContributedE
545
544
this .myWorkSpaceLocation );
546
545
Common .setBuildEnvironmentVariable (contribEnv , confDesc , ENV_KEY_JANTJE_ECLIPSE_LOCATION ,
547
546
this .myWorkEclipseLocation );
548
- Common .setBuildEnvironmentVariable (confDesc , JANTJE_ACTION_UPLOAD , this .myUploadProtocol );
547
+ Common .setBuildEnvironmentVariable (confDesc , JANTJE_ACTION_UPLOAD , this .myProgrammer );
549
548
if (this .myOptions != null ) {
550
549
for (Map .Entry <String , String > curoption : this .myOptions .entrySet ()) {
551
550
Common .setBuildEnvironmentVariable (contribEnv , confDesc , MENUSELECTION + curoption .getKey (),
@@ -558,7 +557,7 @@ public void saveConfiguration(ICConfigurationDescription confDesc, IContributedE
558
557
myStorageNode .put (KEY_LAST_USED_BOARDS_FILE , getReferencingBoardsFile ().toString ());
559
558
myStorageNode .put (KEY_LAST_USED_BOARD , this .myBoardID );
560
559
myStorageNode .put (KEY_LAST_USED_UPLOAD_PORT , this .myUploadPort );
561
- myStorageNode .put (KEY_LAST_USED_UPLOAD_PROTOCOL , this .myUploadProtocol );
560
+ myStorageNode .put (KEY_LAST_USED_UPLOAD_PROTOCOL , this .myProgrammer );
562
561
myStorageNode .put (KEY_LAST_USED_BOARD_MENU_OPTIONS , KeyValue .makeString (this .myOptions ));
563
562
}
564
563
@@ -582,16 +581,16 @@ public String getUploadPort() {
582
581
return this .myUploadPort ;
583
582
}
584
583
585
- public String getUploadProtocol () {
586
- return this .myUploadProtocol ;
584
+ public String getProgrammer () {
585
+ return this .myProgrammer ;
587
586
}
588
587
589
588
public void setUploadPort (String newUploadPort ) {
590
589
this .myUploadPort = newUploadPort ;
591
590
}
592
591
593
592
public void setUploadProtocol (String newUploadProtocol ) {
594
- this .myUploadProtocol = newUploadProtocol ;
593
+ this .myProgrammer = newUploadProtocol ;
595
594
596
595
}
597
596
@@ -825,17 +824,29 @@ public IPath getReferencingLibraryPath() {
825
824
}
826
825
827
826
public String getUploadCommand (ICConfigurationDescription confdesc ) {
828
- String upLoadProtocol = getActualUploadProtocol ( );
827
+ String upLoadProtocol = getActualUploadTool ( confdesc );
829
828
return Common .getBuildEnvironmentVariable (confdesc , "A.TOOLS." + upLoadProtocol + ".UPLOAD.PATTERN" ,
830
829
upLoadProtocol );
831
830
}
832
831
833
- public String getActualUploadProtocol () {
832
+ public String getActualUploadTool (ICConfigurationDescription confdesc ) {
833
+ if (this .myUploadTool == null && confdesc != null ) {
834
+ return Common .getBuildEnvironmentVariable (confdesc , "A.UPLOAD.TOOL" , this .myUploadTool );
835
+ }
834
836
return this .myUploadTool ;
835
837
}
836
838
839
+ public String getActualUploadTool () {
840
+ return getActualUploadTool (null );
841
+ }
842
+
837
843
public boolean usesProgrammer () {
838
- return !this .myUploadProtocol .equals (Defaults .getDefaultUploadProtocol ());
844
+ return !this .myProgrammer .equals (Defaults .getDefaultUploadProtocol ());
839
845
}
840
846
847
+ // public String getActualUploadProtocol() {
848
+ // // TODO Auto-generated method stub
849
+ // return null;
850
+ // }
851
+
841
852
}
0 commit comments