diff --git a/.github/workflows/prepare_release.yaml b/.github/workflows/prepare_release.yaml index 62f618b..6bcf69a 100644 --- a/.github/workflows/prepare_release.yaml +++ b/.github/workflows/prepare_release.yaml @@ -6,6 +6,12 @@ on: paths: - 'VERSION' # Push events when the VERSION file changes workflow_dispatch: + inputs: + include_dependencies: + description: 'True to include a zip file with dependencies in the release' + required: false + type: boolean + default: true name: Create a New Release @@ -45,5 +51,4 @@ jobs: uses: EnviroDIY/workflows/.github/workflows/prepare_release.yaml@main secrets: inherit with: - library-manager: 'update' - library-compliance: 'strict' + include_dependencies: ${{ ( true ) || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true') }} diff --git a/ChangeLog.md b/ChangeLog.md index f60fa7a..9b3b93f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -20,6 +20,18 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm *** +## [2.2.1] - 2024-12-09 + +### Added + +- Added support for Arduino ESP32 Core versions >3.x.x, based on IDF >5.1.x + +### Fixed + +- Reordered steps to unset the prescaler on SAM/D boards. The incorrect order was causing a hang when waiting for sync. + +*** + ## [2.2.0] - 2024-08-14 _CRC and SAMD51 Support_ @@ -178,7 +190,8 @@ The first "official" release of this interrupt-based SDI-12 library for AVR and *** -[Unreleased]: https://github.com/EnviroDIY/Arduino-SDI-12/compare/v2.2.0...HEAD +[Unreleased]: https://github.com/EnviroDIY/Arduino-SDI-12/compare/v2.2.1...HEAD +[2.2.1]: https://github.com/EnviroDIY/Arduino-SDI-12/releases/tag/v2.2.1 [2.2.0]: https://github.com/EnviroDIY/Arduino-SDI-12/releases/tag/v2.2.0 [2.1.4]: https://github.com/EnviroDIY/Arduino-SDI-12/releases/tag/v2.1.4 [2.1.3]: https://github.com/EnviroDIY/Arduino-SDI-12/releases/tag/v2.1.3 diff --git a/VERSION b/VERSION index ccbccc3..c043eea 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.0 +2.2.1 diff --git a/docs/Doxyfile b/docs/Doxyfile index c96899f..e1c088e 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -48,7 +48,7 @@ PROJECT_NAME = "SDI-12 for Arduino" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 2.2.0 +PROJECT_NUMBER = 2.2.1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/library.json b/library.json index e8d25f8..bf8df41 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "SDI-12_ExtInts", - "version": "2.2.0", + "version": "2.2.1", "keywords": "SDI-12, sdi12, communication, bus, sensor, Decagon", "description": "An Arduino library for SDI-12 communication with a wide variety of environmental sensors.", "repository": { diff --git a/library.properties b/library.properties index 731e3db..a518d25 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SDI-12_ExtInts -version=2.2.0 +version=2.2.1 author=Kevin M. Smith , Shannon Hicks maintainer=Sara Damiano sentence=An Arduino library for SDI-12 communication with a wide variety of environmental sensors. diff --git a/src/SDI12_ExtInts.cpp b/src/SDI12_ExtInts.cpp index 6e3bdc3..af3a7d4 100644 --- a/src/SDI12_ExtInts.cpp +++ b/src/SDI12_ExtInts.cpp @@ -99,7 +99,8 @@ int SDI12::peek() { // a public function that clears the buffer contents and resets the status of the buffer // overflow. void SDI12::clearBuffer() { - _rxBufferHead = _rxBufferTail = 0; + _rxBufferHead = 0; + _rxBufferTail = 0; _bufferOverflow = false; } diff --git a/src/SDI12_boards.cpp b/src/SDI12_boards.cpp index 13cd648..12cb3d7 100644 --- a/src/SDI12_boards.cpp +++ b/src/SDI12_boards.cpp @@ -271,24 +271,23 @@ void SDI12Timer::configSDI12TimerPrescale(void) { } void SDI12Timer::resetSDI12TimerPrescale(void) { + // fully software reset the control register for Timer Controller 3 and then disable + // it + resetTC(SDI12_TC); + // reset the generic clock generator divisor register REG_GCLK_GENDIV = preSDI12_REG_GCLK_GENDIV; while (GCLK->STATUS.bit.SYNCBUSY) ; // Wait for synchronization - // reset the generic clock generator control register - REG_GCLK_GENCTRL = preSDI12_REG_GCLK_GENCTRL; - while (GCLK->STATUS.bit.SYNCBUSY) - ; // Wait for synchronization - // reset the generic clock control register REG_GCLK_CLKCTRL = preSDI12_REG_GCLK_CLKCTRL; while (GCLK->STATUS.bit.SYNCBUSY) ; // Wait for synchronization - // fully software reset the control register for Timer Controller 3 and then disable - // it - resetTC(SDI12_TC); + // reset the generic clock generator control register + REG_GCLK_GENCTRL = preSDI12_REG_GCLK_GENCTRL; + while (GCLK->STATUS.bit.SYNCBUSY); // Wait for synchronization } // SAMD51 and SAME51 boards @@ -490,19 +489,24 @@ void SDI12Timer::configSDI12TimerPrescale(void) { } void SDI12Timer::resetSDI12TimerPrescale(void) { - // Reset the generator control register for the clock generator - GCLK->GENCTRL[GENERIC_CLOCK_GENERATOR_SDI12].reg = preSDI12_REG_GCLK_GENCTRL; - while (GCLK->SYNCBUSY.reg & GCLK_SYNCBUSY_SDI12) - ; // Wait for the SDI-12 clock generator sync busy bit to clear + // fully software reset the control register for SDI-12 Timer Controller and then + // disable it + resetTC(SDI12_TC); // Reset the generic clock peripheral control channel register GCLK->PCHCTRL[SDI12_TC_GCLK_ID].reg = preSDI12_REG_GCLK_PCHCTRL; - while (!GCLK->PCHCTRL[SDI12_TC_GCLK_ID].bit.CHEN) - ; // wait to finish enabling ?? - // fully software reset the control register for SDI-12 Timer Controller and then - // disable it - resetTC(SDI12_TC); + // NOTE: This hangs. For some reason the enable bit is never clearing. + // if (!bitRead(preSDI12_REG_GCLK_PCHCTRL, GCLK_PCHCTRL_CHEN_Pos)) { + // while (!GCLK->PCHCTRL[SDI12_TC_GCLK_ID].bit.CHEN) + // ; // wait to finish enabling ?? + // } + + // Reset the generator control register for the clock generator + GCLK->GENCTRL[GENERIC_CLOCK_GENERATOR_SDI12].reg = preSDI12_REG_GCLK_GENCTRL; + while ( + GCLK->SYNCBUSY.reg & + GCLK_SYNCBUSY_SDI12); // Wait for the SDI-12 clock generator sync busy bit to clear } // Espressif ESP32/ESP8266 boards or other boards faster than 48MHz diff --git a/src/SDI12_boards.h b/src/SDI12_boards.h index ccc654b..12c3b4a 100644 --- a/src/SDI12_boards.h +++ b/src/SDI12_boards.h @@ -155,6 +155,8 @@ sensors. This library provides a general software solution, without requiring #define TIMER_INT_TYPE uint16_t #define TIMER_INT_SIZE 16 +/// The clock generator number to use +#define GENERIC_CLOCK_GENERATOR_SDI12 (4u) /// The timer controller to use #define SDI12_TC TC3