mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-10-02 14:44:42 +00:00
Fix s2 enterprise wpa (#3406)
* Don't use `strcasecmp` from ROM * fmt * CHANGELOG
This commit is contained in:
parent
ab73f43d7d
commit
934bf818fc
@ -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
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user