From: Darian Leung Date: Mon, 30 Oct 2017 11:42:16 +0000 (+0800) Subject: unit_tests/Update unit test timer divider X-Git-Tag: v3.1-dev~124^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b908b3cd58b3f4ec206984e59c8b05f431cabce5;p=esp-idf unit_tests/Update unit test timer divider This commit updates various test cases throughout esp-idf such that the values used for timer divider pass the assertions in the timer component. Timer divider values must be between 2 to 65536 --- diff --git a/components/app_trace/test/test_trace.c b/components/app_trace/test/test_trace.c index 6846ea50a2..6d95a87c55 100644 --- a/components/app_trace/test/test_trace.c +++ b/components/app_trace/test/test_trace.c @@ -67,7 +67,7 @@ static void esp_apptrace_test_timer_init(int timer_group, int timer_idx, uint32_ config.alarm_en = 1; config.auto_reload = 1; config.counter_dir = TIMER_COUNT_UP; - config.divider = 1; + config.divider = 2; //Range is 2 to 65536 config.intr_type = TIMER_INTR_LEVEL; config.counter_en = TIMER_PAUSE; /*Configure timer*/ @@ -403,7 +403,7 @@ static void esp_apptrace_test_ts_init(int timer_group, int timer_idx) config.alarm_en = 0; config.auto_reload = 0; config.counter_dir = TIMER_COUNT_UP; - config.divider = 1; + config.divider = 2; //Range is 2 to 65536 config.counter_en = 0; /*Configure timer*/ timer_init(timer_group, timer_idx, &config); @@ -420,7 +420,7 @@ static void esp_apptrace_test_ts_cleanup() config.alarm_en = 0; config.auto_reload = 0; config.counter_dir = TIMER_COUNT_UP; - config.divider = 1; + config.divider = 2; //Range is 2 to 65536 config.counter_en = 0; /*Configure timer*/ timer_init(s_ts_timer_group, s_ts_timer_idx, &config); diff --git a/components/freertos/test/test_suspend_scheduler.c b/components/freertos/test/test_suspend_scheduler.c index c613dc6474..3d8932d86a 100644 --- a/components/freertos/test/test_suspend_scheduler.c +++ b/components/freertos/test/test_suspend_scheduler.c @@ -69,7 +69,7 @@ TEST_CASE("Scheduler disabled can handle a pending context switch on resume", "[ .alarm_en = 1, .auto_reload = 1, .counter_dir = TIMER_COUNT_UP, - .divider = 1, + .divider = 2, //Range is 2 to 65536 .intr_type = TIMER_INTR_LEVEL, .counter_en = TIMER_PAUSE, }; diff --git a/components/freertos/test/test_task_suspend_resume.c b/components/freertos/test/test_task_suspend_resume.c index 5908d2135f..d66e4af528 100644 --- a/components/freertos/test/test_task_suspend_resume.c +++ b/components/freertos/test/test_task_suspend_resume.c @@ -140,7 +140,7 @@ static void test_resume_task_from_isr(int target_core) .alarm_en = 1, .auto_reload = 0, .counter_dir = TIMER_COUNT_UP, - .divider = 1, + .divider = 2, //Range is 2 to 65536 .intr_type = TIMER_INTR_LEVEL, .counter_en = TIMER_PAUSE, };