INNER CODE UNIT · Python
get_boards
xoseperez/espurna · code/ota.py:150
def get_boards():
"""
Grabs board types from hardware.h file
"""
boards = []
for line in open("espurna/config/hardware.h"):
match = re.search(r"^#elif defined\((\w*)\)", line)
if match:
boards.append(match.group(1))
return sorted(boards)
def get_device_size(device):
if device.get("mem_size", 0) == device.get("sdk_size", 0):
return int(device.get("mem_size", 0)) // 1024
return 0