Skip to content

Commit cd73454

Browse files
authored
fix: Add daplink_bridge and bme280 to firmware and fix list-frozen. (#359)
1 parent 50761b9 commit cd73454

3 files changed

Lines changed: 36 additions & 23 deletions

File tree

Makefile

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -155,31 +155,10 @@ mount: ## Mount lib/ on the board for live testing
155155

156156
.PHONY: list-frozen
157157
list-frozen: ## List frozen modules on the connected board
158-
@$(PYTHON) -m mpremote connect $(PORT) exec "\
159-
import sys;\
160-
frozen = [];\
161-
mods = help('modules');\
162-
" 2>/dev/null
158+
@$(PYTHON) -m mpremote connect $(PORT) exec "help('modules')"
163159
@echo ""
164160
@echo "--- Frozen driver modules ---"
165-
@$(PYTHON) -m mpremote connect $(PORT) exec "\
166-
import sys;\
167-
drivers = ['apds9960','bme280','bq27441','daplink_bridge','daplink_flash',\
168-
'gc9a01','hts221','im34dt05','ism330dl','lis2mdl','mcp23009e',\
169-
'ssd1327','steami_config','vl53l1x','wsen_hids','wsen_pads'];\
170-
for d in drivers:\
171-
try:\
172-
mod = __import__(d);\
173-
f = getattr(mod, '__file__', None);\
174-
if f and '.frozen' in f:\
175-
print(' ' + d + ' -> frozen');\
176-
elif f:\
177-
print(' ' + d + ' -> filesystem: ' + f);\
178-
else:\
179-
print(' ' + d + ' -> built-in');\
180-
except ImportError:\
181-
print(' ' + d + ' -> NOT AVAILABLE');\
182-
"
161+
@$(PYTHON) -m mpremote connect $(PORT) run scripts/list_frozen_drivers.py
183162

184163
# --- Release ---
185164

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ max-statements = 65
116116
"lib/mcp23009e/examples/i2c_scan.py" = ["PERF203"]
117117
"tests/**/*.py" = ["T20", "PLR0911", "PLR0912", "PLR0915"]
118118
"lib/lis2mdl/**/*.py" = ["RUF001", "RUF002", "RUF003"] # µ (microtesla) is intentional
119+
"scripts/**/*.py" = ["T20", "PERF203"]
119120

120121
[tool.ruff.format]
121122
quote-style = "double"

scripts/list_frozen_drivers.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""List STeaMi driver modules and their source (frozen, filesystem, or missing)."""
2+
3+
drivers = [
4+
"apds9960",
5+
"bme280",
6+
"bq27441",
7+
"daplink_bridge",
8+
"daplink_flash",
9+
"gc9a01",
10+
"hts221",
11+
"im34dt05",
12+
"ism330dl",
13+
"lis2mdl",
14+
"mcp23009e",
15+
"ssd1327",
16+
"steami_config",
17+
"vl53l1x",
18+
"wsen_hids",
19+
"wsen_pads",
20+
]
21+
22+
for d in drivers:
23+
try:
24+
mod = __import__(d)
25+
f = getattr(mod, "__file__", None)
26+
if f is None:
27+
print(" " + d + " -> built-in")
28+
elif f.startswith("/"):
29+
print(" " + d + " -> filesystem: " + f)
30+
else:
31+
print(" " + d + " -> frozen")
32+
except ImportError:
33+
print(" " + d + " -> NOT AVAILABLE")

0 commit comments

Comments
 (0)