esp-hal/esp-radio/MIGRATING-0.15.0.md
Jesse Braham a7673b35f7
Remove scan_*_max and scan_n* functions from esp-radio (#3963)
* Remove `scan_*_max` and `scan_n*` functions

* Derive `BuilderLite` for `ScanConfig`

* Update migration guide for `esp-radio`

* Update changelogs
2025-08-20 13:22:26 +00:00

1.9 KiB

Migration Guide from 0.15.0 to {{currentVersion}}

Initialization

The builtin-scheduler feature has been removed. The functionality has been moved to esp_preempt_baremetal. esp_preempt_baremetal needs to be initialized before calling esp_radio::init. Failure to do so will result in an error.

Depending on your chosen OS, you may need to use other esp_preempt implementations.

Furthermore, esp_wifi::init no longer requires RNG or a timer.

-let esp_wifi_ctrl = esp_wifi::init(timg0.timer0, Rng::new()).unwrap();
+esp_preempt::init(timg0.timer0);
+let esp_wifi_ctrl = esp_radio::init().unwrap();

Importing

esp_wifi crate has been renamed to esp_radio

- esp-wifi = "0.15.0"
+ esp-radio = "{{currentVersion}}"

EspWifi prefix has been removed

- use esp_wifi::EspWifiController;
+ use esp_radio::Controller;

Memory allocation functions

The way to provide your own implementation of heap memory allocations (if not using esp-alloc) has changed.

Provide these symbols:

- pub extern "C" fn esp_wifi_free_internal_heap() ...
- pub extern "C" fn esp_wifi_allocate_from_internal_ram(size: usize) ...
- pub extern "C" fn esp_wifi_deallocate_internal_ram(ptr: *mut u8) ...
+ pub extern "C" fn malloc(size: usize) -> *mut u8 ...
+ pub extern "C" fn malloc_internal(size: usize) -> *mut u8 ...
+ pub extern "C" fn free(ptr: *mut u8) ...
+ pub extern "C" fn calloc(number: u32, size: usize) -> *mut u8 ...
+ pub extern "C" fn calloc_internal(number: u32, size: usize) -> *mut u8 ...
+ pub extern "C" fn realloc(ptr: *mut u8, new_size: usize) -> *mut u8 ...
+ pub extern "C" fn get_free_internal_heap_size() -> usize; ...

Scanning Functions

The scan_with_config_sync_max, scan_with_config_sync_max, scan_n, and scan_n_async functions have been removed. You can instead use the scan_with_config_async or scan_with_config_sync funtions while specifying a max value in ScanConfig.