Skip to content

Commit

Permalink
Merge pull request #96 from serg3295/feat-newer-esp32-firmware
Browse files Browse the repository at this point in the history
Added support for latest nodemcu esp32 firmware
  • Loading branch information
4refr0nt authored Jun 30, 2024
2 parents 324b8c1 + f11b2c1 commit fcba1b2
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/main/java/ESPlorer/ESPlorer.java
Original file line number Diff line number Diff line change
Expand Up @@ -6045,7 +6045,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
RightBigPaneLayout.setVerticalGroup(
RightBigPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(RightBigPaneLayout.createSequentialGroup()
.addComponent(RightFilesSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)
.addComponent(RightFilesSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 813, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(RightSnippetsPane, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE))
);
Expand Down Expand Up @@ -7705,8 +7705,9 @@ public void serialEvent(SerialPortEvent event) {
log("FileManager: File list found! Do parsing...");
try {
// parsing answer
rx_data = rx_data.replaceAll("\r?\n", "\n");
int start = rx_data.indexOf("~~~File list START~~~");
rx_data = rx_data.substring(start + 23, rx_data.indexOf("~~~File list END~~~"));
rx_data = rx_data.substring(start + 22, rx_data.indexOf("~~~File list END~~~"));
//log(rx_data.replaceAll("\r?\n", "<CR+LF>\r\n"));
s = rx_data.split("\r?\n");
Arrays.sort(s);
Expand Down Expand Up @@ -12695,13 +12696,20 @@ private void UploadFilesStart() {
log("Uploader: loaded fail!");
return;
}
if (mFile.get(mFileIndex).length() == 0) {
TerminalAdd("\r\nUploader: ERROR! " + UploadFileName + " has zero size.\r\n");
return;
}
int lastPacketSize = SplitDataToPackets();
if (lastPacketSize < 0) {
log("Uploader: SplitDataToPackets fail!");
return;
}
log("sendPackets=" + Integer.toString(sendPackets.size()));
String cmd = "_up=function(n,l,ll)\n"
+ " if node.chipmodel then\n"
+ " uart.start(0)\n"
+ " end\n"
+ " local cs = 0\n"
+ " local i = 0\n"
+ " local open = file.open or io.open\n"
Expand All @@ -12724,6 +12732,9 @@ private void UploadFilesStart() {
+ " end\n"
+ " end,0)\n"
+ "end\n"
+ "if node.chipmodel then\n"
+ " uart.stop(0)\n"
+ "end\n"
+ "file.remove(\"" + UploadFileName + "\")\n";
sendBuf = cmdPrep(cmd);
int startPackets;
Expand Down

0 comments on commit fcba1b2

Please sign in to comment.