esp-idf/components/esp32/test/test_restart.c
Ivan Grokhotkov 9353666cc1 esp32: reset APP CPU when doing esp_restart
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.
2017-06-15 18:15:35 +08:00

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) {
;
}
}