mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(esp_timer): place esp_timer_get_time test to IRAM
This commit is contained in:
parent
29b028076a
commit
1370511dff
@ -389,7 +389,7 @@ TEST_CASE("esp_timer for very short intervals", "[esp_timer]")
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if !CONFIG_IDF_TARGET_ESP32C61 // TODO: IDF-10955, test fail
|
#if !CONFIG_IDF_TARGET_ESP32C61 // TODO: IDF-10955, test fail
|
||||||
TEST_CASE("esp_timer_get_time call takes less than 1us", "[esp_timer]")
|
static void IRAM_ATTR test_esp_timer_get_time_performance(void)
|
||||||
{
|
{
|
||||||
int64_t begin = esp_timer_get_time();
|
int64_t begin = esp_timer_get_time();
|
||||||
volatile int64_t end;
|
volatile int64_t end;
|
||||||
@ -400,6 +400,11 @@ TEST_CASE("esp_timer_get_time call takes less than 1us", "[esp_timer]")
|
|||||||
int ns_per_call = (int)((end - begin) * 1000 / iter_count);
|
int ns_per_call = (int)((end - begin) * 1000 / iter_count);
|
||||||
TEST_PERFORMANCE_LESS_THAN(ESP_TIMER_GET_TIME_PER_CALL, "%dns", ns_per_call);
|
TEST_PERFORMANCE_LESS_THAN(ESP_TIMER_GET_TIME_PER_CALL, "%dns", ns_per_call);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("esp_timer_get_time call takes less than 1us", "[esp_timer]")
|
||||||
|
{
|
||||||
|
test_esp_timer_get_time_performance();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int64_t IRAM_ATTR __attribute__((noinline)) get_clock_diff(void)
|
static int64_t IRAM_ATTR __attribute__((noinline)) get_clock_diff(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user