@@ -132,7 +132,8 @@ protected boolean burnBootloader(Collection params)
132
132
Map <String , String > boardPreferences = Base .getBoardPreferences ();
133
133
List fuses = new ArrayList ();
134
134
fuses .add ("-e" ); // erase the chip
135
- fuses .add ("-Ulock:w:" + boardPreferences .get ("bootloader.unlock_bits" ) + ":m" );
135
+ if (boardPreferences .get ("bootloader.unlock_bits" ) != null )
136
+ fuses .add ("-Ulock:w:" + boardPreferences .get ("bootloader.unlock_bits" ) + ":m" );
136
137
if (boardPreferences .get ("bootloader.extended_fuses" ) != null )
137
138
fuses .add ("-Uefuse:w:" + boardPreferences .get ("bootloader.extended_fuses" ) + ":m" );
138
139
fuses .add ("-Uhfuse:w:" + boardPreferences .get ("bootloader.high_fuses" ) + ":m" );
@@ -146,26 +147,32 @@ protected boolean burnBootloader(Collection params)
146
147
} catch (InterruptedException e ) {}
147
148
148
149
Target t ;
150
+ List bootloader = new ArrayList ();
149
151
String bootloaderPath = boardPreferences .get ("bootloader.path" );
150
152
151
- if (bootloaderPath .indexOf (':' ) == -1 ) {
152
- t = Base .getTarget (); // the current target (associated with the board)
153
- } else {
154
- String targetName = bootloaderPath .substring (0 , bootloaderPath .indexOf (':' ));
155
- t = Base .targetsTable .get (targetName );
156
- bootloaderPath = bootloaderPath .substring (bootloaderPath .indexOf (':' ) + 1 );
153
+ if (bootloaderPath != null ) {
154
+ if (bootloaderPath .indexOf (':' ) == -1 ) {
155
+ t = Base .getTarget (); // the current target (associated with the board)
156
+ } else {
157
+ String targetName = bootloaderPath .substring (0 , bootloaderPath .indexOf (':' ));
158
+ t = Base .targetsTable .get (targetName );
159
+ bootloaderPath = bootloaderPath .substring (bootloaderPath .indexOf (':' ) + 1 );
160
+ }
161
+
162
+ File bootloadersFile = new File (t .getFolder (), "bootloaders" );
163
+ File bootloaderFile = new File (bootloadersFile , bootloaderPath );
164
+ bootloaderPath = bootloaderFile .getAbsolutePath ();
165
+
166
+ bootloader .add ("-Uflash:w:" + bootloaderPath + File .separator +
167
+ boardPreferences .get ("bootloader.file" ) + ":i" );
157
168
}
158
-
159
- File bootloadersFile = new File (t .getFolder (), "bootloaders" );
160
- File bootloaderFile = new File (bootloadersFile , bootloaderPath );
161
- bootloaderPath = bootloaderFile .getAbsolutePath ();
162
-
163
- List bootloader = new ArrayList ();
164
- bootloader .add ("-Uflash:w:" + bootloaderPath + File .separator +
165
- boardPreferences .get ("bootloader.file" ) + ":i" );
166
- bootloader .add ("-Ulock:w:" + boardPreferences .get ("bootloader.lock_bits" ) + ":m" );
169
+ if (boardPreferences .get ("bootloader.lock_bits" ) != null )
170
+ bootloader .add ("-Ulock:w:" + boardPreferences .get ("bootloader.lock_bits" ) + ":m" );
167
171
168
- return avrdude (params , bootloader );
172
+ if (bootloader .size () > 0 )
173
+ return avrdude (params , bootloader );
174
+
175
+ return true ;
169
176
}
170
177
171
178
public boolean avrdude (Collection p1 , Collection p2 ) throws RunnerException {
0 commit comments