Skip to content

Commit b1d3d0a

Browse files
committed
suspend_test: delay more time for erase
1 parent a0573f5 commit b1d3d0a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

components/spi_flash/test/test_esp_flash.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -628,10 +628,12 @@ void esp_test_for_suspend(void)
628628
printf("aaaaa bbbbb zzzzz fffff qqqqq ccccc\n");
629629
}
630630

631+
static volatile bool task_erase_end, task_suspend_end = false;
631632
void task_erase_large_region(void *arg)
632633
{
633634
esp_partition_t *part = (esp_partition_t *)arg;
634635
test_erase_large_region(part);
636+
task_erase_end = true;
635637
vTaskDelete(NULL);
636638
}
637639

@@ -640,20 +642,17 @@ void task_request_suspend(void *arg)
640642
vTaskDelay(2);
641643
ESP_LOGI(TAG, "flash go into suspend");
642644
esp_test_for_suspend();
643-
vTaskDelete(NULL);
644-
}
645-
646-
void task_delay(void *arg)
647-
{
648-
esp_rom_delay_us(2000000);
645+
task_suspend_end = true;
649646
vTaskDelete(NULL);
650647
}
651648

652649
static void test_flash_suspend_resume(const esp_partition_t* part)
653650
{
654651
xTaskCreatePinnedToCore(task_request_suspend, "suspend", 2048, (void *)"test_for_suspend", UNITY_FREERTOS_PRIORITY + 3, NULL, 0);
655652
xTaskCreatePinnedToCore(task_erase_large_region, "test", 2048, (void *)part, UNITY_FREERTOS_PRIORITY + 2, NULL, 0);
656-
xTaskCreatePinnedToCore(task_delay, "task_delay", 1024, (void *)"task_delay", UNITY_FREERTOS_PRIORITY + 1, NULL, 0);
653+
while (!task_erase_end || !task_suspend_end) {
654+
}
655+
vTaskDelay(200);
657656
}
658657

659658
FLASH_TEST_CASE("SPI flash suspend and resume test", test_flash_suspend_resume);

0 commit comments

Comments
 (0)