feat(patterns): merge pattern styles and add mode support
Consolidate legacy pattern ids into meteor, particles, sparkle, chase, and colour_cycle with n6/mode style selection; add pattern_modes helper, self-contained tests/all.py, and preset mode alias on wire. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
794f1a2841
commit
55a97ac51c
44 files changed
+998
-1539
No files matched your search
@@ -0,0 +1,34 @@
|
||||
"""GC / heap snapshot helpers for debug logging."""
|
||||
|
||||
import gc
|
||||
|
||||
|
||||
def snapshot():
|
||||
"""Return a dict of memory stats after ``gc.collect()``."""
|
||||
gc.collect()
|
||||
out = {
|
||||
"free": gc.mem_free(),
|
||||
"alloc": gc.mem_alloc(),
|
||||
}
|
||||
try:
|
||||
import esp32
|
||||
|
||||
blocks = esp32.idf_heap_info(esp32.HEAP_DATA)
|
||||
if blocks:
|
||||
block = blocks[0]
|
||||
if isinstance(block, dict):
|
||||
if "total_free_bytes" in block:
|
||||
out["idf_free"] = block["total_free_bytes"]
|
||||
largest = block.get("largest_free_block")
|
||||
if largest is None:
|
||||
largest = block.get("largest_free_block_in_bytes")
|
||||
if largest is not None:
|
||||
out["idf_largest"] = largest
|
||||
except Exception:
|
||||
pass
|
||||
return out
|
||||
|
||||
|
||||
def print_mem(label):
|
||||
"""Print one timestamped memory line (via ``print_timestamp`` when installed)."""
|
||||
print("mem %s:" % label, snapshot())
|
||||
Reference in new issue
Block a user