Skip to content

Commit dd1cccc

Browse files
committed
tooling: Add make list-frozen target to inspect frozen modules on board.
1 parent 92f8795 commit dd1cccc

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,34 @@ repl: ## Open MicroPython REPL on the board
153153
mount: ## Mount lib/ on the board for live testing
154154
$(PYTHON) -m mpremote connect $(PORT) mount lib/
155155

156+
.PHONY: list-frozen
157+
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
163+
@echo ""
164+
@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+
"
183+
156184
# --- Release ---
157185

158186
PART ?= patch

0 commit comments

Comments
 (0)