@@ -628,10 +628,12 @@ void esp_test_for_suspend(void)
628
628
printf ("aaaaa bbbbb zzzzz fffff qqqqq ccccc\n" );
629
629
}
630
630
631
+ static volatile bool task_erase_end , task_suspend_end = false;
631
632
void task_erase_large_region (void * arg )
632
633
{
633
634
esp_partition_t * part = (esp_partition_t * )arg ;
634
635
test_erase_large_region (part );
636
+ task_erase_end = true;
635
637
vTaskDelete (NULL );
636
638
}
637
639
@@ -640,20 +642,17 @@ void task_request_suspend(void *arg)
640
642
vTaskDelay (2 );
641
643
ESP_LOGI (TAG , "flash go into suspend" );
642
644
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;
649
646
vTaskDelete (NULL );
650
647
}
651
648
652
649
static void test_flash_suspend_resume (const esp_partition_t * part )
653
650
{
654
651
xTaskCreatePinnedToCore (task_request_suspend , "suspend" , 2048 , (void * )"test_for_suspend" , UNITY_FREERTOS_PRIORITY + 3 , NULL , 0 );
655
652
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 );
657
656
}
658
657
659
658
FLASH_TEST_CASE ("SPI flash suspend and resume test" , test_flash_suspend_resume );
0 commit comments