| 
									
										
										
										
											2017-06-14 18:07:15 +08:00
										 |  |  | #include "unity.h"
 | 
					
						
							|  |  |  | #include "esp_system.h"
 | 
					
						
							|  |  |  | #include "freertos/FreeRTOS.h"
 | 
					
						
							|  |  |  | #include "freertos/task.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-20 17:17:51 +08:00
										 |  |  | TEST_CASE("restart from PRO CPU", "[restart][reset=SW_CPU_RESET]") | 
					
						
							| 
									
										
										
										
											2017-06-14 18:07:15 +08:00
										 |  |  | { | 
					
						
							|  |  |  |     esp_restart(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-20 17:17:51 +08:00
										 |  |  | static void restart_task(void *arg) | 
					
						
							| 
									
										
										
										
											2017-06-14 18:07:15 +08:00
										 |  |  | { | 
					
						
							|  |  |  |     esp_restart(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-10 17:53:59 +08:00
										 |  |  | #ifndef CONFIG_FREERTOS_UNICORE
 | 
					
						
							| 
									
										
										
										
											2017-09-20 17:17:51 +08:00
										 |  |  | TEST_CASE("restart from APP CPU", "[restart][reset=SW_CPU_RESET]") | 
					
						
							| 
									
										
										
										
											2017-06-14 18:07:15 +08:00
										 |  |  | { | 
					
						
							|  |  |  |     xTaskCreatePinnedToCore(&restart_task, "restart", 2048, NULL, 5, NULL, 1); | 
					
						
							| 
									
										
										
										
											2017-09-20 17:17:51 +08:00
										 |  |  |     while (true) { | 
					
						
							| 
									
										
										
										
											2017-06-14 18:07:15 +08:00
										 |  |  |         ; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2017-11-10 17:53:59 +08:00
										 |  |  | #endif
 |