os_timer_t timer;
void setup() {
....
os_timer_disarm(&timer);
os_timer_setfn(&timer, (os_timer_func_t *)periodic_timer, NULL);
os_timer_arm(&timer, TIMER_PERIOD*1000, 1);
...
}
void loop() {
....
//here I need instruction that disables the timer interrupt or stops the time counter
some_function();
//here I need intruction that enables the timer interrupt or start the time counter
...
}
void periodic_timer()
{
...
}
I need instrction that disables timer interrupts. I know os_timer_arm or os_timer_disarm but these functions resets the timer counter and its start from the beginning. I need function that only stops counter or disables the interrupt. Thank You!
woodwax:
...
I need instrction that disables timer interrupts. I know os_timer_arm or os_timer_disarm but these functions resets the timer counter and its start from the beginning. I need function that only stops counter or disables the interrupt. Thank You!
Before disarm, read the timer and use that value as an offset added to the next arm.