feat(ble): expose isInitialized and reclaim memory before radios start

The controller and the WiFi driver each need a large aggregate allocation,
which a live app sitting on garbage can deny - that is why a failed connect
often succeeded on retry. Both bindings now collect before initializing, and
the tree reserves its node and spec capacity so a build does not reallocate
into a tight heap.
This commit is contained in:
2026-08-04 13:10:18 -04:00
parent 3416f54c83
commit bf286eefa6
7 changed files with 37 additions and 3 deletions
+4 -1
View File
@@ -96,7 +96,10 @@ int main() {
"assert(wifi.connect())");
assert(bench.wifi.savedReconnect);
run(state, "assert(ble.scan()[1].address == 'aa:bb')\n"
run(state, "assert(not ble.isInitialized())\n"
"assert(ble.init())\n"
"assert(ble.isInitialized())\n"
"assert(ble.scan()[1].address == 'aa:bb')\n"
"assert(#ble.read('svc', 'chr') == 3)\n"
"assert(ble.write('svc', 'chr', 'x\\0y'))");
assert(bench.ble.duration == 3000);