mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 12:35:28 +00:00
spi_flash: support working on differnt buses and frequency
This commit is contained in:

committed by
bot

parent
ce4de867d6
commit
1036a091fe
@@ -79,7 +79,7 @@ static void IRAM_ATTR test_read(int src_off, int dst_off, int len)
|
||||
spi_flash_disable_interrupts_caches_and_other_cpu();
|
||||
esp_rom_spiflash_result_t rc = esp_rom_spiflash_write(start, src_buf, sizeof(src_buf));
|
||||
spi_flash_enable_interrupts_caches_and_other_cpu();
|
||||
TEST_ASSERT_EQUAL_INT(rc, ESP_ROM_SPIFLASH_RESULT_OK);
|
||||
TEST_ASSERT_EQUAL_HEX(rc, ESP_ROM_SPIFLASH_RESULT_OK);
|
||||
memset(dst_buf, 0x55, sizeof(dst_buf));
|
||||
memset(dst_gold, 0x55, sizeof(dst_gold));
|
||||
fill(dst_gold + dst_off, src_off, len);
|
||||
@@ -87,7 +87,7 @@ static void IRAM_ATTR test_read(int src_off, int dst_off, int len)
|
||||
TEST_ASSERT_EQUAL_INT(cmp_or_dump(dst_buf, dst_gold, sizeof(dst_buf)), 0);
|
||||
}
|
||||
|
||||
TEST_CASE("Test spi_flash_read", "[spi_flash]")
|
||||
TEST_CASE("Test spi_flash_read", "[spi_flash][esp_flash]")
|
||||
{
|
||||
setup_tests();
|
||||
#if CONFIG_SPI_FLASH_MINIMAL_TEST
|
||||
@@ -158,14 +158,16 @@ static void IRAM_ATTR test_write(int dst_off, int src_off, int len)
|
||||
fill(dst_gold + dst_off, src_off, len);
|
||||
}
|
||||
ESP_ERROR_CHECK(spi_flash_write(start + dst_off, src_buf + src_off, len));
|
||||
|
||||
spi_flash_disable_interrupts_caches_and_other_cpu();
|
||||
esp_rom_spiflash_result_t rc = esp_rom_spiflash_read(start, dst_buf, sizeof(dst_buf));
|
||||
spi_flash_enable_interrupts_caches_and_other_cpu();
|
||||
TEST_ASSERT_EQUAL_INT(rc, ESP_ROM_SPIFLASH_RESULT_OK);
|
||||
TEST_ASSERT_EQUAL_HEX(rc, ESP_ROM_SPIFLASH_RESULT_OK);
|
||||
|
||||
TEST_ASSERT_EQUAL_INT(cmp_or_dump(dst_buf, dst_gold, sizeof(dst_buf)), 0);
|
||||
}
|
||||
|
||||
TEST_CASE("Test spi_flash_write", "[spi_flash]")
|
||||
TEST_CASE("Test spi_flash_write", "[spi_flash][esp_flash]")
|
||||
{
|
||||
setup_tests();
|
||||
#if CONFIG_SPI_FLASH_MINIMAL_TEST
|
||||
|
Reference in New Issue
Block a user