Fix s2 enterprise wpa (#3406)

* Don't use `strcasecmp` from ROM

* fmt

* CHANGELOG
This commit is contained in:
Björn Quentin 2025-04-24 10:37:04 +02:00 committed by GitHub
parent ab73f43d7d
commit 934bf818fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 28 additions and 0 deletions

View File

@ -25,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Allow `Configuration::None`, set country early, changed default power-save-mode to None (#3364)
- Enterprise WPA fixed for ESP32-S2 (#3406)
### Removed
## [0.13.0] - 2025-02-24

View File

@ -83,6 +83,32 @@ unsafe extern "C" fn atoi(str: *const i8) -> i32 {
res * sign
}
// We cannot just use the ROM function since it calls `__getreent`
//
// From docs: The __getreent() function returns a per-task pointer to struct
// _reent in newlib libc. This structure is allocated on the TCB of each task.
// i.e. it assumes a FreeRTOS task calling it.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn strcasecmp(
s1: *const core::ffi::c_char,
s2: *const core::ffi::c_char,
) -> i32 {
let mut i = 0;
loop {
unsafe {
let s1_i = s1.add(i);
let s2_i = s2.add(i);
let val = (*s1_i).to_ascii_lowercase() as i32 - (*s2_i).to_ascii_lowercase() as i32;
if val != 0 || *s1_i == 0 {
return val;
}
}
i += 1;
}
}
#[derive(Debug, Copy, Clone)]
#[repr(C)]
struct Tm {