Skip to content

Commit acb1996

Browse files
committed
Enable erase
1 parent 8056d98 commit acb1996

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/modulino/firmware_flasher.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def flash_firmware(firmware_path, verbose=False):
132132

133133
print("🗑️ Erasing memory...")
134134
erase_params = bytearray([0xFF, 0xFF, 0x0]) # Mass erase flash
135-
#execute_command(CMD_ERASE, erase_params, 0, verbose)
135+
execute_command(CMD_ERASE, erase_params, 0, verbose)
136136

137137
with open(firmware_path, 'rb') as file:
138138
firmware_data = file.read()
@@ -248,9 +248,9 @@ def select_i2c_device():
248248
choice = int(input("Select the I2C device to flash (number): "))
249249
return devices[choice - 1]
250250

251-
def setup():
251+
def run():
252252
"""
253-
Setup function to initialize the flashing process.
253+
Initialize the flashing process.
254254
Finds .bin files, scans for I2C devices, and flashes the selected firmware.
255255
"""
256256

@@ -275,5 +275,5 @@ def setup():
275275
else:
276276
print("❌ Failed to flash firmware")
277277

278-
# Start the setup
279-
setup()
278+
if __name__ == "__main__":
279+
run()

0 commit comments

Comments
 (0)