mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-27 12:20:56 +00:00

* Fix esp-bootloader-esp-idf * Use OTA enabled partition table for examples * Add simple OTA example * CHANGELOG.md * Create a dummy `ota_image` in CI * mkdir * Remove unnecessary details from CHANGELOG * Make non-Window's users life easier * Test ROM function in esp-bootloader-esp-idf * Fix
16 lines
331 B
Rust
16 lines
331 B
Rust
pub struct Crc32 {}
|
|
|
|
impl Crc32 {
|
|
pub fn new() -> Self {
|
|
Self {}
|
|
}
|
|
|
|
pub fn crc(&self, data: &[u8]) -> u32 {
|
|
unsafe extern "C" {
|
|
fn esp_rom_crc32_le(crc: u32, buf: *const u8, len: u32) -> u32;
|
|
}
|
|
|
|
unsafe { esp_rom_crc32_le(u32::MAX, data.as_ptr(), data.len() as u32) }
|
|
}
|
|
}
|