Skip to content

Commit daaedf8

Browse files
peterdragunradimkarnis
authored andcommitted
fix(espefuse): Fix output messages for set_flash_voltage
1 parent 905249c commit daaedf8

File tree

3 files changed

+56
-41
lines changed

3 files changed

+56
-41
lines changed

espefuse/efuse/esp32/operations.py

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -157,22 +157,27 @@ def set_flash_voltage(esp, efuses, args):
157157
)
158158

159159
if args.voltage == "OFF":
160-
msg = "Disable internal flash voltage regulator (VDD_SDIO). "
161-
"SPI flash will need to be powered from an external source.\n"
162-
"The following efuse is burned: XPD_SDIO_FORCE.\n"
163-
"It is possible to later re-enable the internal regulator (%s) " % (
164-
"to 3.3V" if sdio_tieh.get() != 0 else "to 1.8V or 3.3V"
160+
print(
161+
"Disable internal flash voltage regulator (VDD_SDIO). "
162+
"SPI flash will need to be powered from an external source.\n"
163+
"The following eFuse is burned: XPD_SDIO_FORCE.\n"
164+
"It is possible to later re-enable the internal regulator"
165+
f"{'to 3.3V' if sdio_tieh.get() != 0 else 'to 1.8V or 3.3V'}"
166+
"by burning an additional eFuse"
165167
)
166-
"by burning an additional efuse"
167168
elif args.voltage == "1.8V":
168-
msg = "Set internal flash voltage regulator (VDD_SDIO) to 1.8V.\n"
169-
"The following efuses are burned: XPD_SDIO_FORCE, XPD_SDIO_REG.\n"
170-
"It is possible to later increase the voltage to 3.3V (permanently) "
171-
"by burning additional efuse XPD_SDIO_TIEH"
169+
print(
170+
"Set internal flash voltage regulator (VDD_SDIO) to 1.8V.\n"
171+
"The following eFuses are burned: XPD_SDIO_FORCE, XPD_SDIO_REG.\n"
172+
"It is possible to later increase the voltage to 3.3V (permanently) "
173+
"by burning additional eFuse XPD_SDIO_TIEH"
174+
)
172175
elif args.voltage == "3.3V":
173-
msg = "Enable internal flash voltage regulator (VDD_SDIO) to 3.3V.\n"
174-
"The following efuses are burned: XPD_SDIO_FORCE, XPD_SDIO_REG, XPD_SDIO_TIEH."
175-
print(msg)
176+
print(
177+
"Enable internal flash voltage regulator (VDD_SDIO) to 3.3V.\n"
178+
"The following eFuses are burned: XPD_SDIO_FORCE, XPD_SDIO_REG, XPD_SDIO_TIEH."
179+
)
180+
176181
sdio_force.save(1) # Disable GPIO12
177182
if args.voltage != "OFF":
178183
sdio_reg.save(1) # Enable internal regulator
@@ -272,8 +277,10 @@ def burn_key(esp, efuses, args):
272277
"The key block will left readable and writeable (due to --no-protect-key)"
273278
)
274279
else:
275-
msg += "The key block will be read and write protected "
276-
"(no further changes or readback)"
280+
msg += (
281+
"The key block will be read and write protected "
282+
"(no further changes or readback)"
283+
)
277284
print(msg, "\n")
278285
if not efuses.burn_all(check_batch_mode=True):
279286
return

espefuse/efuse/esp32s2/operations.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -205,22 +205,26 @@ def set_flash_voltage(esp, efuses, args):
205205
)
206206

207207
if args.voltage == "OFF":
208-
msg = "Disable internal flash voltage regulator (VDD_SPI). SPI flash will "
209-
"need to be powered from an external source.\n"
210-
"The following efuse is burned: VDD_SPI_FORCE.\n"
211-
"It is possible to later re-enable the internal regulator (%s) " % (
212-
"to 3.3V" if sdio_tieh.get() != 0 else "to 1.8V or 3.3V"
208+
print(
209+
"Disable internal flash voltage regulator (VDD_SPI). "
210+
"SPI flash will need to be powered from an external source.\n"
211+
"The following eFuse is burned: VDD_SPI_FORCE.\n"
212+
"It is possible to later re-enable the internal regulator"
213+
f"{'to 3.3V' if sdio_tieh.get() != 0 else 'to 1.8V or 3.3V'}"
214+
"by burning an additional eFuse"
213215
)
214-
"by burning an additional efuse"
215216
elif args.voltage == "1.8V":
216-
msg = "Set internal flash voltage regulator (VDD_SPI) to 1.8V.\n"
217-
"The following efuses are burned: VDD_SPI_FORCE, VDD_SPI_XPD.\n"
218-
"It is possible to later increase the voltage to 3.3V (permanently) "
219-
"by burning additional efuse VDD_SPI_TIEH"
217+
print(
218+
"Set internal flash voltage regulator (VDD_SPI) to 1.8V.\n"
219+
"The following eFuses are burned: VDD_SPI_FORCE, VDD_SPI_XPD.\n"
220+
"It is possible to later increase the voltage to 3.3V (permanently) "
221+
"by burning additional eFuse VDD_SPI_TIEH"
222+
)
220223
elif args.voltage == "3.3V":
221-
msg = "Enable internal flash voltage regulator (VDD_SPI) to 3.3V.\n"
222-
"The following efuses are burned: VDD_SPI_FORCE, VDD_SPI_XPD, VDD_SPI_TIEH."
223-
print(msg)
224+
print(
225+
"Enable internal flash voltage regulator (VDD_SPI) to 3.3V.\n"
226+
"The following eFuses are burned: VDD_SPI_FORCE, VDD_SPI_XPD, VDD_SPI_TIEH."
227+
)
224228

225229
sdio_force.save(1) # Disable GPIO45
226230
if args.voltage != "OFF":

espefuse/efuse/esp32s3/operations.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -205,22 +205,26 @@ def set_flash_voltage(esp, efuses, args):
205205
)
206206

207207
if args.voltage == "OFF":
208-
msg = "Disable internal flash voltage regulator (VDD_SPI). "
209-
"SPI flash will need to be powered from an external source.\n"
210-
"The following efuse is burned: VDD_SPI_FORCE.\n"
211-
"It is possible to later re-enable the internal regulator (%s) " % (
212-
"to 3.3V" if sdio_tieh.get() != 0 else "to 1.8V or 3.3V"
208+
print(
209+
"Disable internal flash voltage regulator (VDD_SPI). "
210+
"SPI flash will need to be powered from an external source.\n"
211+
"The following eFuse is burned: VDD_SPI_FORCE.\n"
212+
"It is possible to later re-enable the internal regulator"
213+
f"{'to 3.3V' if sdio_tieh.get() != 0 else 'to 1.8V or 3.3V'}"
214+
"by burning an additional eFuse"
213215
)
214-
"by burning an additional efuse"
215216
elif args.voltage == "1.8V":
216-
msg = "Set internal flash voltage regulator (VDD_SPI) to 1.8V.\n"
217-
"The following efuses are burned: VDD_SPI_FORCE, VDD_SPI_XPD.\n"
218-
"It is possible to later increase the voltage to 3.3V (permanently) "
219-
"by burning additional efuse VDD_SPI_TIEH"
217+
print(
218+
"Set internal flash voltage regulator (VDD_SPI) to 1.8V.\n"
219+
"The following eFuses are burned: VDD_SPI_FORCE, VDD_SPI_XPD.\n"
220+
"It is possible to later increase the voltage to 3.3V (permanently) "
221+
"by burning additional eFuse VDD_SPI_TIEH"
222+
)
220223
elif args.voltage == "3.3V":
221-
msg = "Enable internal flash voltage regulator (VDD_SPI) to 3.3V.\n"
222-
"The following efuses are burned: VDD_SPI_FORCE, VDD_SPI_XPD, VDD_SPI_TIEH."
223-
print(msg)
224+
print(
225+
"Enable internal flash voltage regulator (VDD_SPI) to 3.3V.\n"
226+
"The following eFuses are burned: VDD_SPI_FORCE, VDD_SPI_XPD, VDD_SPI_TIEH."
227+
)
224228

225229
sdio_force.save(1) # Disable GPIO45
226230
if args.voltage != "OFF":

0 commit comments

Comments
 (0)