From ab5915ff8b8cd9765b7814fe8f3acbe5912e03e5 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Thu, 22 Dec 2016 12:28:08 +1100 Subject: [PATCH] spi_flash: Standardise argument types & names used for flash offsets Closes github #88: https://github.com/espressif/esp-idf/issues/88 --- components/spi_flash/flash_mmap.c | 2 +- components/spi_flash/include/esp_spi_flash.h | 26 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/components/spi_flash/flash_mmap.c b/components/spi_flash/flash_mmap.c index 2165a784d..15f75f363 100644 --- a/components/spi_flash/flash_mmap.c +++ b/components/spi_flash/flash_mmap.c @@ -77,7 +77,7 @@ static void IRAM_ATTR spi_flash_mmap_init() } } -esp_err_t IRAM_ATTR spi_flash_mmap(uint32_t src_addr, size_t size, spi_flash_mmap_memory_t memory, +esp_err_t IRAM_ATTR spi_flash_mmap(size_t src_addr, size_t size, spi_flash_mmap_memory_t memory, const void** out_ptr, spi_flash_mmap_handle_t* out_handle) { esp_err_t ret; diff --git a/components/spi_flash/include/esp_spi_flash.h b/components/spi_flash/include/esp_spi_flash.h index 91675088a..bb3ec39b4 100644 --- a/components/spi_flash/include/esp_spi_flash.h +++ b/components/spi_flash/include/esp_spi_flash.h @@ -78,13 +78,13 @@ esp_err_t spi_flash_erase_range(size_t start_address, size_t size); * @note If source address is in DROM, this function will return * ESP_ERR_INVALID_ARG. * - * @param dest destination address in Flash. Must be a multiple of 4 bytes. - * @param src pointer to the source buffer. - * @param size length of data, in bytes. Must be a multiple of 4 bytes. + * @param dest_addr destination address in Flash. Must be a multiple of 4 bytes. + * @param src pointer to the source buffer. + * @param size length of data, in bytes. Must be a multiple of 4 bytes. * * @return esp_err_t */ -esp_err_t spi_flash_write(size_t dest, const void *src, size_t size); +esp_err_t spi_flash_write(size_t dest_addr, const void *src, size_t size); /** @@ -97,24 +97,24 @@ esp_err_t spi_flash_write(size_t dest, const void *src, size_t size); * @note If source address is in DROM, this function will return * ESP_ERR_INVALID_ARG. * - * @param dest destination address in Flash. Must be a multiple of 32 bytes. - * @param src pointer to the source buffer. - * @param size length of data, in bytes. Must be a multiple of 32 bytes. + * @param dest_addr destination address in Flash. Must be a multiple of 32 bytes. + * @param src pointer to the source buffer. + * @param size length of data, in bytes. Must be a multiple of 32 bytes. * * @return esp_err_t */ -esp_err_t spi_flash_write_encrypted(size_t dest, const void *src, size_t size); +esp_err_t spi_flash_write_encrypted(size_t dest_addr, const void *src, size_t size); /** * @brief Read data from Flash. * - * @param src source address of the data in Flash. - * @param dest pointer to the destination buffer - * @param size length of data + * @param src_addr source address of the data in Flash. + * @param dest pointer to the destination buffer + * @param size length of data * * @return esp_err_t */ -esp_err_t spi_flash_read(size_t src, void *dest, size_t size); +esp_err_t spi_flash_read(size_t src_addr, void *dest, size_t size); /** * @brief Enumeration which specifies memory space requested in an mmap call @@ -149,7 +149,7 @@ typedef uint32_t spi_flash_mmap_handle_t; * * @return ESP_OK on success, ESP_ERR_NO_MEM if pages can not be allocated */ -esp_err_t spi_flash_mmap(uint32_t src_addr, size_t size, spi_flash_mmap_memory_t memory, +esp_err_t spi_flash_mmap(size_t src_addr, size_t size, spi_flash_mmap_memory_t memory, const void** out_ptr, spi_flash_mmap_handle_t* out_handle); /**