@@ -49,9 +49,10 @@ public boolean uploadUsingPreferences(String buildPath, String className, boolea
49
49
TargetPlatform targetPlatform = Base .getTarget ();
50
50
51
51
if (programmer .contains (":" )) {
52
- String [] split = programmer .split (":" );
53
- targetPlatform = Base .getTargetPlatform (split [0 ], split [1 ]);
54
- programmer = split [2 ];
52
+ String [] split = programmer .split (":" , 2 );
53
+ targetPlatform = Base .getTargetPlatform (split [0 ], Preferences
54
+ .get ("target_platform" ));
55
+ programmer = split [1 ];
55
56
}
56
57
57
58
Collection <String > params = getProgrammerCommands (targetPlatform , programmer );
@@ -91,9 +92,10 @@ public boolean burnBootloader() throws RunnerException {
91
92
String programmer = Preferences .get ("programmer" );
92
93
TargetPlatform targetPlatform = Base .getTarget ();
93
94
if (programmer .contains (":" )) {
94
- String [] split = programmer .split (":" );
95
- targetPlatform = Base .getTargetPlatform (split [0 ], split [1 ]);
96
- programmer = split [2 ];
95
+ String [] split = programmer .split (":" , 2 );
96
+ targetPlatform = Base .getTargetPlatform (split [0 ], Preferences
97
+ .get ("target_platform" ));
98
+ programmer = split [1 ];
97
99
}
98
100
return burnBootloader (getProgrammerCommands (targetPlatform , programmer ));
99
101
}
@@ -146,24 +148,25 @@ protected boolean burnBootloader(Collection<String> params)
146
148
List <String > bootloader = new ArrayList <String >();
147
149
String bootloaderPath = boardPreferences .get ("bootloader.path" );
148
150
149
- if (bootloaderPath != null ) {
150
- TargetPlatform targetPlatform ;
151
- if (bootloaderPath .contains (":" )) {
152
- // the current target (associated with the board)
153
- targetPlatform = Base .getTarget ();
154
- } else {
155
- String [] split = bootloaderPath .split (":" , 3 );
156
- targetPlatform = Base .getTargetPlatform (split [0 ], split [1 ]);
157
- bootloaderPath = split [2 ];
158
- }
159
-
160
- File bootloadersFile = new File (targetPlatform .getFolder (), "bootloaders" );
161
- File bootloaderFile = new File (bootloadersFile , bootloaderPath );
162
- bootloaderPath = bootloaderFile .getAbsolutePath ();
163
-
164
- bootloader .add ("-Uflash:w:" + bootloaderPath + File .separator
165
- + boardPreferences .get ("bootloader.file" ) + ":i" );
166
- }
151
+ if (bootloaderPath != null ) {
152
+ TargetPlatform targetPlatform ;
153
+ if (bootloaderPath .contains (":" )) {
154
+ // the current target (associated with the board)
155
+ targetPlatform = Base .getTarget ();
156
+ } else {
157
+ String [] split = bootloaderPath .split (":" , 2 );
158
+ targetPlatform = Base .getTargetPlatform (split [0 ], Preferences
159
+ .get ("target_platform" ));
160
+ bootloaderPath = split [1 ];
161
+ }
162
+
163
+ File bootloadersFile = new File (targetPlatform .getFolder (), "bootloaders" );
164
+ File bootloaderFile = new File (bootloadersFile , bootloaderPath );
165
+ bootloaderPath = bootloaderFile .getAbsolutePath ();
166
+
167
+ bootloader .add ("-Uflash:w:" + bootloaderPath + File .separator +
168
+ boardPreferences .get ("bootloader.file" ) + ":i" );
169
+ }
167
170
if (boardPreferences .get ("bootloader.lock_bits" ) != null )
168
171
bootloader .add ("-Ulock:w:" + boardPreferences .get ("bootloader.lock_bits" ) + ":m" );
169
172
0 commit comments