From 64a50f0423ff7f382e0977959bcaad5ed51362a9 Mon Sep 17 00:00:00 2001 From: Felipe Neves Date: Thu, 24 Oct 2019 17:31:19 -0300 Subject: [PATCH] components/freertos: fixed isr test failling when run multiple times --- components/freertos/test/test_isr_latency.c | 6 +++--- components/freertos/xtensa_context.S | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/freertos/test/test_isr_latency.c b/components/freertos/test/test_isr_latency.c index 3c8d78685e..5999b72f3f 100644 --- a/components/freertos/test/test_isr_latency.c +++ b/components/freertos/test/test_isr_latency.c @@ -19,9 +19,8 @@ static SemaphoreHandle_t sync; static SemaphoreHandle_t end_sema; uint32_t cycle_before_trigger; uint32_t cycle_before_exit; -uint32_t delta_enter_cycles; -uint32_t delta_enter_cycles; -uint32_t delta_exit_cycles; +uint32_t delta_enter_cycles = 0; +uint32_t delta_exit_cycles = 0; static void software_isr(void *arg) { (void)arg; @@ -56,6 +55,7 @@ static void test_task(void *arg) { delta_enter_cycles /= 10000; delta_exit_cycles /= 10000; + esp_intr_free(handle); xSemaphoreGive(end_sema); vTaskDelete(NULL); } diff --git a/components/freertos/xtensa_context.S b/components/freertos/xtensa_context.S index 3d1d979d6c..4db99114be 100644 --- a/components/freertos/xtensa_context.S +++ b/components/freertos/xtensa_context.S @@ -96,6 +96,7 @@ Exit conditions: .align 4 .literal_position .align 4 + _xt_context_save: s32i a2, sp, XT_STK_A2 s32i a3, sp, XT_STK_A3 @@ -195,6 +196,7 @@ _not_l1: #endif ret + /******************************************************************************* _xt_context_restore