Firmware for xatLabs Caracal WiFi Module
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
708 B

Prepare the firmware image for publishing
- Read Firmware version from code
- Generate firmware.version file
- Rename Firmware image
import os
import re
import time
with open("Caracal_Firmware.ino", 'r') as f:
code =
match ="#define HW_GROUP (\d+)", code)
hw_version =
match ="FW_VERSION = (\d+);", code)
fw_version =
fname = "firmware{}.bin".format(hw_version)
if os.path.exists("Caracal_Firmware.ino.generic.bin"):
if os.path.exists(fname):
os.rename("Caracal_Firmware.ino.generic.bin", fname)
with open("firmware{}.version".format(hw_version), 'w') as f: