forked from espressif/esp-idf
		
	This fixes a bug introduced by !848, where APP CPU would not be reset during esp_restart, if esp_restart was called from a task running on APP CPU, and wouldn’t be reset by PRO CPU on startup. This change replaces stalling APP CPU with resetting it. Also adds a non-automated esp_restart tests.
		
			
				
	
	
		
			27 lines
		
	
	
		
			417 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			417 B
		
	
	
	
		
			C
		
	
	
	
	
	
#include "unity.h"
 | 
						|
#include "esp_system.h"
 | 
						|
#include "freertos/FreeRTOS.h"
 | 
						|
#include "freertos/task.h"
 | 
						|
 | 
						|
 | 
						|
TEST_CASE("restart from PRO CPU", "[restart][ignore]")
 | 
						|
{
 | 
						|
    esp_restart();
 | 
						|
}
 | 
						|
 | 
						|
static void restart_task(void* arg)
 | 
						|
{
 | 
						|
    esp_restart();
 | 
						|
}
 | 
						|
 | 
						|
TEST_CASE("restart from APP CPU", "[restart][ignore]")
 | 
						|
{
 | 
						|
    xTaskCreatePinnedToCore(&restart_task, "restart", 2048, NULL, 5, NULL, 1);
 | 
						|
 | 
						|
    while(true) {
 | 
						|
        ;
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
 |