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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user