Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

unattach ? #24

Closed
wuzi42 opened this issue Apr 17, 2022 · 2 comments
Closed

unattach ? #24

wuzi42 opened this issue Apr 17, 2022 · 2 comments
Labels
Support Library support

Comments

@wuzi42
Copy link

wuzi42 commented Apr 17, 2022

Hi Khoih,
thank you very much for the esp8266interrupt library!
Could you please tell me howto stop calling the interrupt handler routine correctly?
thank you again
Wulf

@khoih-prog
Copy link
Owner

Hi @wuzi42

Thanks for using the lbrary.

You can either

  1. detach the Timer1 Interrupt Calback function completely.
timer1_detachInterrupt();

then to reuse with the same Calback function

reattachInterrupt();

or new Calback function

attachInterrupt(frequency, newCallback);
  1. temporarily disable Timer1 Interrupt
detachInterrupt();
// or
//disableTimer();
// or
//stopTimer();

and easily reuse later, with the same Calback function, by

enableTimer();
// or
//restartTimer();

@khoih-prog khoih-prog added the Support Library support label Apr 25, 2022
@wuzi42
Copy link
Author

wuzi42 commented Apr 27, 2022 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Support Library support
Projects
None yet
Development

No branches or pull requests

2 participants