Skip to content

Commit

Permalink
Merge branch 'master' into ExtInts
Browse files Browse the repository at this point in the history
Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
  • Loading branch information
SRGDamia1 committed Jan 27, 2025
2 parents 7bd8700 + 58ec236 commit fe3bf6d
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 25 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/prepare_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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') }}
15 changes: 14 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.0
2.2.1
2 changes: 1 addition & 1 deletion docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SDI-12_ExtInts
version=2.2.0
version=2.2.1
author=Kevin M. Smith <Kevin@elite-education.org>, Shannon Hicks <shicks@stroudcenter.org>
maintainer=Sara Damiano <sdamiano@stroudcenter.org>
sentence=An Arduino library for SDI-12 communication with a wide variety of environmental sensors.
Expand Down
3 changes: 2 additions & 1 deletion src/SDI12_ExtInts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
38 changes: 21 additions & 17 deletions src/SDI12_boards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/SDI12_boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

1 comment on commit fe3bf6d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint_errors

Please sign in to comment.