Skip to content

Commit

Permalink
Release 1.6.7: Fix ESP32 clearTimer
Browse files Browse the repository at this point in the history
  • Loading branch information
Naguissa committed Sep 15, 2021
1 parent 7c79670 commit fec6898
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=uTimerLib
version=1.6.6
version=1.6.7
author=Naguissa <naguissa@foroelectro.net>
maintainer=Naguissa <naguissa@foroelectro.net>
sentence=Tiny and cross-device compatible timer library
Expand Down
2 changes: 1 addition & 1 deletion src/hardware/uTimerLib.ATTINY.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @see <a href="https://github.com/Naguissa/uTimerLib">https://github.com/Naguissa/uTimerLib</a>
* @see <a href="https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html">https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html</a>
* @see <a href="mailto:naguissa@foroelectro.net">naguissa@foroelectro.net</a>
* @version 1.6.6
* @version 1.6.7
*/

#if (defined(ARDUINO_ARCH_AVR) && (defined(ARDUINO_attiny) || defined(ARDUINO_AVR_ATTINYX4) || defined(ARDUINO_AVR_ATTINYX5) || defined(ARDUINO_AVR_ATTINYX7) || defined(ARDUINO_AVR_ATTINYX8) || defined(ARDUINO_AVR_ATTINYX61) || defined(ARDUINO_AVR_ATTINY43) || defined(ARDUINO_AVR_ATTINY828) || defined(ARDUINO_AVR_ATTINY1634) || defined(ARDUINO_AVR_ATTINYX313))) && defined(UTIMERLIB_HW_COMPILE)
Expand Down
2 changes: 1 addition & 1 deletion src/hardware/uTimerLib.AVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @see <a href="https://github.com/Naguissa/uTimerLib">https://github.com/Naguissa/uTimerLib</a>
* @see <a href="https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html">https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html</a>
* @see <a href="mailto:naguissa@foroelectro.net">naguissa@foroelectro.net</a>
* @version 1.6.6
* @version 1.6.7
*/

#if (defined(__AVR_ATmega32U4__) || defined(ARDUINO_ARCH_AVR)) && !defined(ARDUINO_attiny) && defined(UTIMERLIB_HW_COMPILE)
Expand Down
2 changes: 1 addition & 1 deletion src/hardware/uTimerLib.DIGISPARK_AVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @see <a href="https://github.com/Naguissa/uTimerLib">https://github.com/Naguissa/uTimerLib</a>
* @see <a href="https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html">https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html</a>
* @see <a href="mailto:naguissa@foroelectro.net">naguissa@foroelectro.net</a>
* @version 1.6.6
* @version 1.6.7
*/

#if defined(ARDUINO_ARCH_AVR) && defined(ARDUINO_AVR_DIGISPARK) && defined(UTIMERLIB_HW_COMPILE)
Expand Down
15 changes: 9 additions & 6 deletions src/hardware/uTimerLib.ESP32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @see <a href="https://github.com/Naguissa/uTimerLib">https://github.com/Naguissa/uTimerLib</a>
* @see <a href="https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html">https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html</a>
* @see <a href="mailto:naguissa@foroelectro.net">naguissa@foroelectro.net</a>
* @version 1.6.6
* @version 1.6.7
*/
#if (defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)) && defined(UTIMERLIB_HW_COMPILE)
#if !defined(_uTimerLib_IMP_) && defined(_uTimerLib_cpp_)
Expand All @@ -45,6 +45,7 @@
if (us == 0) { // Not valid
return;
}
clearTimer();
__overflows = _overflows = __remaining = _remaining = 0;
const esp_timer_create_args_t timer_args = {
.callback = (esp_timer_cb_t) &uTimerLib::interrupt
Expand All @@ -65,7 +66,7 @@
if (s == 0) { // Not valid
return;
}

clearTimer();
__overflows = _overflows = __remaining = _remaining = 0;
const esp_timer_create_args_t timer_args = {
.callback = (esp_timer_cb_t) &uTimerLib::interrupt
Expand All @@ -89,11 +90,13 @@
* Note: This is device-dependant
*/
void uTimerLib::clearTimer() {
esp_timer_stop(_timer);
esp_timer_delete(_timer);
_type == UTIMERLIB_TYPE_OFF;
if (_timer) {
esp_timer_stop(_timer);
esp_timer_delete(_timer);
_type == UTIMERLIB_TYPE_OFF;
_timer = NULL;
}
}

/**
* \brief Internal intermediate function to control timer interrupts
*
Expand Down
2 changes: 1 addition & 1 deletion src/hardware/uTimerLib.ESP8266.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @see <a href="https://github.com/Naguissa/uTimerLib">https://github.com/Naguissa/uTimerLib</a>
* @see <a href="https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html">https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html</a>
* @see <a href="mailto:naguissa@foroelectro.net">naguissa@foroelectro.net</a>
* @version 1.6.6
* @version 1.6.7
*/
#if (defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)) && defined(UTIMERLIB_HW_COMPILE)
#if !defined(_uTimerLib_IMP_) && defined(_uTimerLib_cpp_)
Expand Down
2 changes: 1 addition & 1 deletion src/hardware/uTimerLib.SAM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @see <a href="https://github.com/Naguissa/uTimerLib">https://github.com/Naguissa/uTimerLib</a>
* @see <a href="https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html">https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html</a>
* @see <a href="mailto:naguissa@foroelectro.net">naguissa@foroelectro.net</a>
* @version 1.6.6
* @version 1.6.7
*/
#if defined(ARDUINO_ARCH_SAM) && defined(UTIMERLIB_HW_COMPILE)
#if !defined(_uTimerLib_IMP_) && defined(_uTimerLib_cpp_)
Expand Down
2 changes: 1 addition & 1 deletion src/hardware/uTimerLib.SAMD21.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @see <a href="https://github.com/Naguissa/uTimerLib">https://github.com/Naguissa/uTimerLib</a>
* @see <a href="https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html">https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html</a>
* @see <a href="mailto:naguissa@foroelectro.net">naguissa@foroelectro.net</a>
* @version 1.6.6
* @version 1.6.7
*/
#if defined(_SAMD21_) && defined(UTIMERLIB_HW_COMPILE)
#ifndef _uTimerLib_IMP_
Expand Down
2 changes: 1 addition & 1 deletion src/hardware/uTimerLib.SAMD51.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @see <a href="https://github.com/Naguissa/uTimerLib">https://github.com/Naguissa/uTimerLib</a>
* @see <a href="https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html">https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html</a>
* @see <a href="mailto:naguissa@foroelectro.net">naguissa@foroelectro.net</a>
* @version 1.6.6
* @version 1.6.7
*/
#if defined(__SAMD51__) && defined(UTIMERLIB_HW_COMPILE)
#if !defined(_uTimerLib_IMP_) && defined(_uTimerLib_cpp_)
Expand Down
2 changes: 1 addition & 1 deletion src/hardware/uTimerLib.STM32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @see <a href="https://github.com/Naguissa/uTimerLib">https://github.com/Naguissa/uTimerLib</a>
* @see <a href="https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html">https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html</a>
* @see <a href="mailto:naguissa@foroelectro.net">naguissa@foroelectro.net</a>
* @version 1.6.6
* @version 1.6.7
*/
#if (defined(_VARIANT_ARDUINO_STM32_) || defined(ARDUINO_ARCH_STM32)) && defined(UTIMERLIB_HW_COMPILE)
#ifndef _uTimerLib_IMP_
Expand Down
2 changes: 1 addition & 1 deletion src/hardware/uTimerLib.UNSUPPORTED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @see <a href="https://github.com/Naguissa/uTimerLib">https://github.com/Naguissa/uTimerLib</a>
* @see <a href="https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html">https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html</a>
* @see <a href="mailto:naguissa@foroelectro.net">naguissa@foroelectro.net</a>
* @version 1.6.6
* @version 1.6.7
*/
#if (!defined(__AVR_ATmega32U4__) && !defined(ARDUINO_ARCH_AVR) && !defined(_VARIANT_ARDUINO_STM32_) && !defined(ARDUINO_ARCH_STM32) && !defined(ARDUINO_ARCH_ESP8266) && !defined(ARDUINO_ARCH_ESP32) && !defined(ARDUINO_ARCH_SAM) && !defined(_SAMD21_) && !defined(__SAMD51__) && !defined(ARDUINO_attiny) && !defined(ARDUINO_AVR_ATTINYX5) && defined(UTIMERLIB_HW_COMPILE))
#ifndef _uTimerLib_IMP_
Expand Down
2 changes: 1 addition & 1 deletion src/uTimerLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @see <a href="https://github.com/Naguissa/uTimerLib">https://github.com/Naguissa/uTimerLib</a>
* @see <a href="https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html">https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html</a>
* @see <a href="mailto:naguissa@foroelectro.net">naguissa@foroelectro.net</a>
* @version 1.6.5
* @version 1.6.7
*/

// # if !defined(_uTimerLib_cpp_) && defined(_uTimerLib_IMP_)
Expand Down
2 changes: 1 addition & 1 deletion src/uTimerLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @see <a href="https://github.com/Naguissa/uTimerLib">https://github.com/Naguissa/uTimerLib</a>
* @see <a href="https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html">https://www.foroelectro.net/librerias-arduino-ide-f29/utimerlib-libreria-arduino-para-eventos-temporizad-t191.html</a>
* @see <a href="mailto:naguissa@foroelectro.net">naguissa@foroelectro.net</a>
* @version 1.6.5
* @version 1.6.7
*/
/** \file uTimerLib.h
* \brief uTimerLib header file
Expand Down

0 comments on commit fec6898

Please sign in to comment.