Skip to content

Commit

Permalink
Fixed console DEBUG_BAUD setting
Browse files Browse the repository at this point in the history
  • Loading branch information
maccasoft committed Jun 14, 2024
1 parent e36a743 commit 3d33933
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/spin-tools/src/com/maccasoft/propeller/ConsoleView.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class ConsoleView {
StyledText console;

SerialPort serialPort;
int serialBaudRate;
PrintStream os;

Preferences preferences;
Expand Down Expand Up @@ -383,6 +384,13 @@ public void setSerialPort(SerialPort serialPort) {
if (this.serialPort != serialPort) {
serialPort.addEventListener(serialEventListener);
}
serialPort.setParams(
serialBaudRate,
SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE,
false,
false);
}

this.serialPort = serialPort;
Expand All @@ -391,6 +399,10 @@ public void setSerialPort(SerialPort serialPort) {
}
}

public void setSerialBaudRate(int serialBaudRate) {
this.serialBaudRate = serialBaudRate;
}

public void setLogFile(File location, String fileName) {
try {
if (os != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2968,6 +2968,7 @@ private void handleUpload(boolean writeToFlash, boolean openTerminal, boolean fo
consoleToolItem.setSelection(true);
centralSashForm.layout();
}
consoleView.setSerialBaudRate(((Spin2Object) obj).getDebugBaud());
}
consoleView.setEnabled(isDebug);

Expand Down

0 comments on commit 3d33933

Please sign in to comment.