mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-27 04:10:28 +00:00
Replace unsafe with new std API (#4178)
* Replace unsafe with new std API * bump * Fix link in readme --------- Co-authored-by: Dániel Buga <bugadani@gmail.com>
This commit is contained in:
parent
c233ca70fe
commit
a47f0b8a4b
@ -2,7 +2,7 @@
|
|||||||
name = "esp-bootloader-esp-idf"
|
name = "esp-bootloader-esp-idf"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
rust-version = "1.86.0"
|
rust-version = "1.88.0"
|
||||||
description = "Functionality related to the esp-idf bootloader"
|
description = "Functionality related to the esp-idf bootloader"
|
||||||
documentation = "https://docs.espressif.com/projects/rust/esp-bootloader-esp-idf/latest/"
|
documentation = "https://docs.espressif.com/projects/rust/esp-bootloader-esp-idf/latest/"
|
||||||
keywords = ["esp32", "espressif", "no-std"]
|
keywords = ["esp32", "espressif", "no-std"]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
[](https://crates.io/crates/esp-bootloader-esp-idf)
|
[](https://crates.io/crates/esp-bootloader-esp-idf)
|
||||||
[](https://docs.espressif.com/projects/rust/esp-bootloader-esp-idf/latest/)
|
[](https://docs.espressif.com/projects/rust/esp-bootloader-esp-idf/latest/)
|
||||||

|

|
||||||

|

|
||||||
[](https://matrix.to/#/#esp-rs:matrix.org)
|
[](https://matrix.to/#/#esp-rs:matrix.org)
|
||||||
|
|
||||||
|
@ -199,7 +199,8 @@ impl<'a> PartitionTable<'a> {
|
|||||||
return Err(Error::Invalid);
|
return Err(Error::Invalid);
|
||||||
}
|
}
|
||||||
|
|
||||||
if binary.len() % RAW_ENTRY_LEN != 0 {
|
let (binary, rem) = binary.as_chunks::<RAW_ENTRY_LEN>();
|
||||||
|
if !rem.is_empty() {
|
||||||
return Err(Error::Invalid);
|
return Err(Error::Invalid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,14 +211,6 @@ impl<'a> PartitionTable<'a> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// we checked binary before
|
|
||||||
let binary = unsafe {
|
|
||||||
core::slice::from_raw_parts(
|
|
||||||
binary.as_ptr() as *const [u8; RAW_ENTRY_LEN],
|
|
||||||
binary.len() / RAW_ENTRY_LEN,
|
|
||||||
)
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut raw_table = Self {
|
let mut raw_table = Self {
|
||||||
binary,
|
binary,
|
||||||
entries: binary.len(),
|
entries: binary.len(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user