#define COUNTER_STOP(counter) \
do{ \
s_flash_stats.counter.count++; \
- s_flash_stats.counter.time += (xthal_get_ccount() - ts_begin) / (XT_CLOCK_FREQ / 1000000); \\
+ s_flash_stats.counter.time += (xthal_get_ccount() - ts_begin) / (XT_CLOCK_FREQ / 1000000); \
} while(0)
#define COUNTER_ADD_BYTES(counter, size) \
esp_err_t IRAM_ATTR spi_flash_write(size_t dest_addr, const void *src, size_t size)
{
- // TODO: replace this check with code which deals with unaligned sources
- if (((ptrdiff_t) src) % 4 != 0) {
- return ESP_ERR_INVALID_ARG;
- }
// Destination alignment is also checked in ROM code, but we can give
// better error code here
// TODO: add handling of unaligned destinations
/**
* @brief Write data to Flash.
*
- * @note Both des_addr and src_addr have to be 4-byte aligned.
+ * @note Address in flash, dest, has to be 4-byte aligned.
* This is a temporary limitation which will be removed.
*
* @param dest destination address in Flash
/**
* @brief Read data from Flash.
*
- * @note Both des_addr and src_addr have to be 4-byte aligned.
+ * @note Both src and dest have to be 4-byte aligned.
* This is a temporary limitation which will be removed.
*
* @param src source address of the data in Flash.