How do I stop a timer?
Posted: Tue Nov 02, 2021 11:54 pm
I'm trying this example project
and there is no information on how to stop a timer.
I have found in the online documentation:
So I tried:
or
but none stoped the timer.
How do I do it?
Are the above commands pausing or stopping a timer?
I mean, if I resart the timer later will it restart from zero, or from the value where I paused it?
Thanks
Code: Select all
/* Timer group-hardware timer example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
I have found in the online documentation:
Code: Select all
esp_err_t timer_pause(timer_group_t group_num, timer_idx_t timer_num)
Pause the counter of hardware timer.
Code: Select all
esp_err_t timer_pause(TIMER_GROUP_0, TIMER_1);
Code: Select all
esp_err_t timer_pause(timer_group_t TIMER_GROUP_0, timer_idx_t TIMER_1) ;
How do I do it?
Are the above commands pausing or stopping a timer?
I mean, if I resart the timer later will it restart from zero, or from the value where I paused it?
Thanks