]> granicus.if.org Git - esp-idf/commitdiff
spi_flash: use same argument types in .h and .c files
authorIvan Grokhotkov <ivan@espressif.com>
Wed, 19 Jun 2019 13:26:02 +0000 (21:26 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Tue, 2 Jul 2019 08:26:06 +0000 (10:26 +0200)
Fixes compilations on targets where size_t != uint32_t

components/spi_flash/flash_ops.c
components/spi_flash/include/esp_partition.h
components/spi_flash/partition.c

index dcfc6cc4cba7584a640b136941d239f57ab9cc47..1b06447b1cd6b5acbcb549163848a414c83736fb 100644 (file)
@@ -208,7 +208,7 @@ esp_err_t IRAM_ATTR spi_flash_erase_sector(size_t sec)
 
 #ifdef CONFIG_SPI_FLASH_USE_LEGACY_IMPL
 //deprecated, only used in compatible mode
-esp_err_t IRAM_ATTR spi_flash_erase_range(uint32_t start_addr, uint32_t size)
+esp_err_t IRAM_ATTR spi_flash_erase_range(size_t start_addr, size_t size)
 {
     CHECK_WRITE_ADDRESS(start_addr, size);
     if (start_addr % SPI_FLASH_SEC_SIZE != 0) {
index d9ec1e3a52da533335ecac900e2dc4d4f7b9deb0..ade2e9eab86f49091eec91def0bc0697040854a0 100644 (file)
@@ -260,7 +260,7 @@ esp_err_t esp_partition_write(const esp_partition_t* partition,
  *         or one of error codes from lower-level flash driver.
  */
 esp_err_t esp_partition_erase_range(const esp_partition_t* partition,
-                                    uint32_t start_addr, uint32_t size);
+                                    size_t start_addr, size_t size);
 
 /**
  * @brief Configure MMU to map partition into data memory
@@ -287,7 +287,7 @@ esp_err_t esp_partition_erase_range(const esp_partition_t* partition,
  *
  * @return ESP_OK, if successful
  */
-esp_err_t esp_partition_mmap(const esp_partition_t* partition, uint32_t offset, uint32_t size,
+esp_err_t esp_partition_mmap(const esp_partition_t* partition, size_t offset, size_t size,
                              spi_flash_mmap_memory_t memory,
                              const void** out_ptr, spi_flash_mmap_handle_t* out_handle);
 
index 6876ee71ad687962ce32dc41ffc83100680f5a61..b598fcd5f20729d485b97e0cad9c364f8d740af4 100644 (file)
@@ -418,7 +418,7 @@ esp_err_t esp_partition_erase_range(const esp_partition_t* partition,
  * we can add esp_partition_mmapv which will accept an array of offsets and sizes, and return array of
  * mmaped pointers, and a single handle for all these regions.
  */
-esp_err_t esp_partition_mmap(const esp_partition_t* partition, uint32_t offset, uint32_t size,
+esp_err_t esp_partition_mmap(const esp_partition_t* partition, size_t offset, size_t size,
                              spi_flash_mmap_memory_t memory,
                              const void** out_ptr, spi_flash_mmap_handle_t* out_handle)
 {