200 """ |
200 """ |
201 from .EspFirmwareSelectionDialog import EspFirmwareSelectionDialog |
201 from .EspFirmwareSelectionDialog import EspFirmwareSelectionDialog |
202 dlg = EspFirmwareSelectionDialog() |
202 dlg = EspFirmwareSelectionDialog() |
203 if dlg.exec() == QDialog.DialogCode.Accepted: |
203 if dlg.exec() == QDialog.DialogCode.Accepted: |
204 chip, firmware, baudRate, flashMode, _ = dlg.getData() |
204 chip, firmware, baudRate, flashMode, _ = dlg.getData() |
|
205 if chip not in ("esp8266", "esp32"): |
|
206 raise ValueError(self.tr("Unsupported chip type '{0}'.") |
|
207 .format(chip)) |
|
208 |
205 if chip == "esp8266": |
209 if chip == "esp8266": |
206 flashAddress = "0x0000" |
210 flashAddress = "0x0000" |
207 elif chip == "esp32": |
211 elif chip == "esp32": |
208 flashAddress = "0x1000" |
212 flashAddress = "0x1000" |
209 else: |
213 |
210 raise ValueError(self.tr("Unsupported chip type '{0}'.") |
|
211 .format(chip)) |
|
212 flashArgs = [ |
214 flashArgs = [ |
213 "-u", |
215 "-u", |
214 "-m", "esptool", |
216 "-m", "esptool", |
215 "--chip", chip, |
217 "--chip", chip, |
216 "--port", self.microPython.getCurrentPort(), |
218 "--port", self.microPython.getCurrentPort(), |