diff --git a/esp-storage/src/esp32.rs b/esp-storage/src/esp32.rs index de84839b72a..85956aca3ef 100644 --- a/esp-storage/src/esp32.rs +++ b/esp-storage/src/esp32.rs @@ -26,16 +26,16 @@ const FLASH_CHIP_ADDR: u32 = 0x3ffae270; const FLASH_DUMMY_LEN_PLUS_ADDR: u32 = 0x3ffae290; crate::rom_fn! { - fn esp_rom_cache_flush(cpu_num: u32) = 0x40009a14, - fn esp_rom_cache_read_enable(cpu_num: u32) = 0x40009a84, - fn esp_rom_spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 = 0x40062ed8, - fn esp_rom_spiflash_erase_sector(sector_number: u32) -> i32 = 0x40062ccc, + fn esp_rom_cache_flush(cpu_num: u32) = 0x40009a14; + fn esp_rom_cache_read_enable(cpu_num: u32) = 0x40009a84; + fn esp_rom_spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 = 0x40062ed8; + fn esp_rom_spiflash_erase_sector(sector_number: u32) -> i32 = 0x40062ccc; fn esp_rom_spi_read_status_high( flash_chip: *const EspRomSpiflashChipT, status: *mut u32 - ) -> i32 = 0x40062448, - fn esp_rom_spi_read_status(flash_chip: *const EspRomSpiflashChipT, status: *mut u32) -> i32 = 0x4006226c, - fn esp_rom_spi_write_status(flash_chip: *const EspRomSpiflashChipT, status_value: u32) -> i32 = 0x400622f0, + ) -> i32 = 0x40062448; + fn esp_rom_spi_read_status(flash_chip: *const EspRomSpiflashChipT, status: *mut u32) -> i32 = 0x4006226c; + fn esp_rom_spi_write_status(flash_chip: *const EspRomSpiflashChipT, status_value: u32) -> i32 = 0x400622f0; } #[inline(always)] diff --git a/esp-storage/src/esp32c2.rs b/esp-storage/src/esp32c2.rs index 54408ac729d..bb620259106 100644 --- a/esp-storage/src/esp32c2.rs +++ b/esp-storage/src/esp32c2.rs @@ -1,10 +1,10 @@ use crate::maybe_with_critical_section; crate::rom_fn! { - fn esp_rom_spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 = 0x4000013c, - fn esp_rom_spiflash_unlock() -> i32 = 0x40000140, - fn esp_rom_spiflash_erase_sector(sector_number: u32) -> i32 = 0x40000130, - fn esp_rom_spiflash_write(dest_addr: u32, data: *const u32, len: u32) -> i32 = 0x40000138, + fn esp_rom_spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 = 0x4000013c; + fn esp_rom_spiflash_unlock() -> i32 = 0x40000140; + fn esp_rom_spiflash_erase_sector(sector_number: u32) -> i32 = 0x40000130; + fn esp_rom_spiflash_write(dest_addr: u32, data: *const u32, len: u32) -> i32 = 0x40000138; } pub(crate) fn spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 { diff --git a/esp-storage/src/esp32c3.rs b/esp-storage/src/esp32c3.rs index 89f28f4dbe3..7dd40900b66 100644 --- a/esp-storage/src/esp32c3.rs +++ b/esp-storage/src/esp32c3.rs @@ -1,10 +1,10 @@ use crate::maybe_with_critical_section; crate::rom_fn! { - fn esp_rom_spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 = 0x40000130, - fn esp_rom_spiflash_unlock() -> i32 = 0x40000140, - fn esp_rom_spiflash_erase_sector(sector_number: u32) -> i32 = 0x40000128, - fn esp_rom_spiflash_write(dest_addr: u32, data: *const u32, len: u32) -> i32 = 0x4000012c, + fn esp_rom_spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 = 0x40000130; + fn esp_rom_spiflash_unlock() -> i32 = 0x40000140; + fn esp_rom_spiflash_erase_sector(sector_number: u32) -> i32 = 0x40000128; + fn esp_rom_spiflash_write(dest_addr: u32, data: *const u32, len: u32) -> i32 = 0x4000012c; } pub(crate) fn spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 { diff --git a/esp-storage/src/esp32c6.rs b/esp-storage/src/esp32c6.rs index ed533e8e200..6b85309eeab 100644 --- a/esp-storage/src/esp32c6.rs +++ b/esp-storage/src/esp32c6.rs @@ -1,10 +1,10 @@ use crate::maybe_with_critical_section; crate::rom_fn! { - fn esp_rom_spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 = 0x40000150, - fn esp_rom_spiflash_unlock() -> i32 = 0x40000154, - fn esp_rom_spiflash_erase_sector(sector_number: u32) -> i32 = 0x40000144, - fn esp_rom_spiflash_write(dest_addr: u32, data: *const u32, len: u32) -> i32 = 0x4000014c, + fn esp_rom_spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 = 0x40000150; + fn esp_rom_spiflash_unlock() -> i32 = 0x40000154; + fn esp_rom_spiflash_erase_sector(sector_number: u32) -> i32 = 0x40000144; + fn esp_rom_spiflash_write(dest_addr: u32, data: *const u32, len: u32) -> i32 = 0x4000014c; } pub(crate) fn spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 { diff --git a/esp-storage/src/esp32h2.rs b/esp-storage/src/esp32h2.rs index 3043efd9793..88da9458e42 100644 --- a/esp-storage/src/esp32h2.rs +++ b/esp-storage/src/esp32h2.rs @@ -1,10 +1,10 @@ use crate::maybe_with_critical_section; crate::rom_fn! { - fn esp_rom_spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 = 0x4000012c, - fn esp_rom_spiflash_unlock() -> i32 = 0x40000130, - fn esp_rom_spiflash_erase_sector(sector_number: u32) -> i32 = 0x40000120, - fn esp_rom_spiflash_write(dest_addr: u32, data: *const u32, len: u32) -> i32 = 0x40000128, + fn esp_rom_spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 = 0x4000012c; + fn esp_rom_spiflash_unlock() -> i32 = 0x40000130; + fn esp_rom_spiflash_erase_sector(sector_number: u32) -> i32 = 0x40000120; + fn esp_rom_spiflash_write(dest_addr: u32, data: *const u32, len: u32) -> i32 = 0x40000128; } pub(crate) fn spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 { diff --git a/esp-storage/src/esp32s2.rs b/esp-storage/src/esp32s2.rs index 1204a00fc34..19ff74549e4 100644 --- a/esp-storage/src/esp32s2.rs +++ b/esp-storage/src/esp32s2.rs @@ -1,10 +1,10 @@ use crate::maybe_with_critical_section; crate::rom_fn! { - fn esp_rom_spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 = 0x4001728c, - fn esp_rom_spiflash_unlock() -> i32 = 0x40016e88, - fn esp_rom_spiflash_erase_sector(sector_number: u32) -> i32 = 0x4001716c, - fn esp_rom_spiflash_write(dest_addr: u32, data: *const u32, len: u32) -> i32 = 0x400171cc, + fn esp_rom_spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 = 0x4001728c; + fn esp_rom_spiflash_unlock() -> i32 = 0x40016e88; + fn esp_rom_spiflash_erase_sector(sector_number: u32) -> i32 = 0x4001716c; + fn esp_rom_spiflash_write(dest_addr: u32, data: *const u32, len: u32) -> i32 = 0x400171cc; } pub(crate) fn spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 { diff --git a/esp-storage/src/esp32s3.rs b/esp-storage/src/esp32s3.rs index e683b801ef5..3dcb777c46e 100644 --- a/esp-storage/src/esp32s3.rs +++ b/esp-storage/src/esp32s3.rs @@ -1,10 +1,10 @@ use crate::maybe_with_critical_section; crate::rom_fn! { - fn esp_rom_spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 = 0x40000a20, - fn esp_rom_spiflash_unlock() -> i32 = 0x40000a2c, - fn esp_rom_spiflash_erase_sector(sector_number: u32) -> i32 = 0x400009fc, - fn esp_rom_spiflash_write(dest_addr: u32, data: *const u32, len: u32) -> i32 = 0x40000a14, + fn esp_rom_spiflash_read(src_addr: u32, data: *const u32, len: u32) -> i32 = 0x40000a20; + fn esp_rom_spiflash_unlock() -> i32 = 0x40000a2c; + fn esp_rom_spiflash_erase_sector(sector_number: u32) -> i32 = 0x400009fc; + fn esp_rom_spiflash_write(dest_addr: u32, data: *const u32, len: u32) -> i32 = 0x40000a14; } #[inline(always)] diff --git a/esp-storage/src/lib.rs b/esp-storage/src/lib.rs index a676c327c3c..feb13159715 100644 --- a/esp-storage/src/lib.rs +++ b/esp-storage/src/lib.rs @@ -76,7 +76,7 @@ macro_rules! rom_fn { } }; - ($($(#[$attrs:meta])* fn $name:ident($($arg:tt: $ty:ty),*) $(-> $retval:ty)? = $addr:expr),+ $(,)?) => { + ($($(#[$attrs:meta])* fn $name:ident($($arg:tt: $ty:ty),*) $(-> $retval:ty)? = $addr:expr)+;) => { $( $crate::rom_fn!(fn $name($($arg: $ty),*) $(-> $retval)? = $addr); )+