Skip to content

Commit 65b3f4d

Browse files
author
jantje
committed
#585 this works for some stuff
1 parent efd444e commit 65b3f4d

File tree

5 files changed

+10
-35
lines changed

5 files changed

+10
-35
lines changed

io.sloeber.core/src/io/sloeber/core/api/BoardDescription.java

+3-26
Original file line numberDiff line numberDiff line change
@@ -655,38 +655,14 @@ public IPath getReferencingLibraryPath() {
655655

656656
public String getUploadPatternKey() {
657657
updateWhenDirty();
658-
String upLoadTool = getActualUploadTool();
659-
String action = UPLOAD;
660-
if (usesProgrammer()) {
661-
action = PROGRAM;
662-
}
658+
String upLoadTool = getuploadTool();
663659
String networkPrefix = EMPTY;
664660
if (isNetworkUpload()) {
665661
networkPrefix = NETWORK_PREFIX;
666662
}
667-
return TOOLS + DOT + upLoadTool + DOT + action + DOT + networkPrefix + PATTERN;
668-
663+
return TOOLS + DOT + upLoadTool + DOT + UPLOAD + DOT + networkPrefix + PATTERN;
669664
}
670665

671-
public String getActualUploadTool() {
672-
updateWhenDirty();
673-
// if (confdesc == null) {
674-
// Common.log(new Status(IStatus.ERROR, .CORE_PLUGIN_ID, "Confdesc null is
675-
// not alowed here")); //$NON-NLS-1$
676-
// return this.myUploadTool;
677-
// }
678-
// if (usesProgrammer()) {
679-
// return Common.getBuildEnvironmentVariable(confdesc, PROGRAM_TOOL,
680-
// "Program tool not properly configured"); //$NON-NLS-1$
681-
// }
682-
//
683-
// if (this.myUploadTool == null) {
684-
// return Common.getBuildEnvironmentVariable(confdesc, UPLOAD_TOOL,
685-
// "upload tool not properly configured"); //$NON-NLS-1$
686-
// }
687-
return myUploadTool;
688-
689-
}
690666

691667
public boolean usesProgrammer() {
692668
updateWhenDirty();
@@ -897,6 +873,7 @@ public Map<String, String> getEnvVars() {
897873
Programmers localProgrammers[] = Programmers.fromBoards(this);
898874
String programmer = getProgrammer();
899875
for (Programmers curProgrammer : localProgrammers) {
876+
// allVars.putAll(curProgrammer.getAllEnvironVars());
900877
String programmerID = curProgrammer.getIDFromNiceName(programmer);
901878
if (programmerID != null) {
902879
allVars.putAll(curProgrammer.getAllEnvironVars(programmerID));

io.sloeber.core/src/io/sloeber/core/common/Const.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class Const {
5050
public static final String COM_PORT = "com_port";
5151
public static final String ARDUINO = "arduino";
5252
public static final String PATH = "path";
53-
public static final String PROTOCOL = "protocol";
53+
public static final String PROTOCOL = "protocol";
5454

5555
// arduino txt pre and suffix
5656
public static final String NETWORK_PREFIX = "network_";

io.sloeber.core/src/io/sloeber/core/toolchain/ArduinoGnuMakefileGenerator.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1190,11 +1190,11 @@ private StringBuffer addTargets(List<String> outputVarsAdditionsList, boolean re
11901190
+ "\t${tools.${upload.tool}.upload.pattern}\n" + "\n" + "uploadWithHoutBuild: \n"
11911191
+ "\t@echo trying to upload without build with upload tool ${upload.tool}\n"
11921192
+ "\t${tools.${upload.tool}.upload.pattern}\n" + " \n" + "uploadWithProgrammerWithBuild: all\n"
1193-
+ "\t@echo trying to build and upload with programmer ${programID}\n"
1194-
+ "\t${tools.${${programID}.program.tool}.program.pattern}\n" + "\n"
1193+
+ "\t@echo trying to build and upload with programmer ${program.tool}\n"
1194+
+ "\t${tools.${program.tool}.program.pattern}\n" + "\n"
11951195
+ "uploadWithProgrammerWithHoutBuild: \n"
1196-
+ "\t@echo trying to upload with programmer ${programID} without build\n"
1197-
+ "\t${tools.${${programID}.program.tool}.program.pattern}\n\n");
1196+
+ "\t@echo trying to upload with programmer ${program.tool} without build\n"
1197+
+ "\t${tools.${program.tool}.program.pattern}\n\n");
11981198
String defaultTarget = "all:";
11991199
if (prebuildStep.length() > 0) {
12001200
// Add the comment for the "All" target

io.sloeber.core/src/io/sloeber/core/tools/uploaders/UploadSketchWrapper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private Job internalUpload(IProject project,
5959
SloeberProject sProject = SloeberProject.getSloeberProject(project, false);
6060
BoardDescription boardDescriptor = sProject.getBoardDescription(confDesc.getName(), false);
6161

62-
String UpLoadTool = boardDescriptor.getActualUploadTool();
62+
String UpLoadTool = boardDescriptor.getuploadTool();
6363
// String uploadClass = Common.getBuildEnvironmentVariable(confDesc,
6464
// Common.get_ENV_KEY_TOOL(Const.UPLOAD_CLASS),
6565
// new String());/** @jniclass flags=no_gen */

io.sloeber.core/src/io/sloeber/core/tools/uploaders/arduinoUploader.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ public boolean uploadUsingPreferences(IFile hexFile, BoardDescription boardDescr
4343
IEnvironmentVariableManager envManager = CCorePlugin.getDefault().getBuildEnvironmentManager();
4444
IContributedEnvironment contribEnv = envManager.getContributedEnvironment();
4545

46-
if (boardDescr.usesProgrammer()) {
47-
highStream.println(Messages.uploader_no_reset_using_programmer);
48-
} else if (boardDescr.isNetworkUpload()) {
46+
if (boardDescr.isNetworkUpload()) {
4947
setEnvironmentvarsForAutorizedUpload(contribEnv, mycConf);
5048
highStream.println(Messages.uploader_no_reset_using_network);
5149
} else {

0 commit comments

Comments
 (0)