esp32: move sleep test to esp_system

This commit is contained in:
Renz Bagaporo
2020-05-05 13:21:29 +08:00
parent fe65bf00b1
commit 0db3edd490
18 changed files with 34 additions and 18 deletions

View File

@@ -0,0 +1,3 @@
idf_component_register(SRC_DIRS .
PRIV_INCLUDE_DIRS .
PRIV_REQUIRES unity test_utils)

View File

@@ -0,0 +1,5 @@
#
#Component Makefile
#
COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive

View File

@@ -2,7 +2,6 @@
#include <sys/time.h>
#include <sys/param.h>
#include "esp_sleep.h"
#include "esp32/clk.h"
#include "driver/rtc_io.h"
#include "esp_rom_uart.h"
#include "freertos/FreeRTOS.h"
@@ -14,13 +13,22 @@
#include "soc/rtc.h" // for wakeup trigger defines
#include "soc/rtc_periph.h" // for read rtc registers directly (cause)
#include "soc/soc.h" // for direct register read macros
#include "esp32/rom/rtc.h"
#include "hal/rtc_cntl_ll.h"
#include "esp_newlib.h"
#include "test_utils.h"
#include "sdkconfig.h"
#include "esp_rom_sys.h"
#if CONFIG_IDF_TARGET_ESP32
#include "esp32/clk.h"
#include "esp32/rom/rtc.h"
#elif CONFIG_IDF_TARGET_ESP32S2
#include "esp32s2/clk.h"
#include "esp32s2/rom/rtc.h"
#endif
#define ESP_EXT0_WAKEUP_LEVEL_LOW 0
#define ESP_EXT0_WAKEUP_LEVEL_HIGH 1
@@ -127,7 +135,7 @@ TEST_CASE("light sleep stress test with periodic esp_timer", "[deepsleep]")
}
#ifdef CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS
#if defined(CONFIG_ESP_SYSTEM_RTC_EXT_XTAL)
#define MAX_SLEEP_TIME_ERROR_US 200
#else
#define MAX_SLEEP_TIME_ERROR_US 100