Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
SRGDamia1 committed May 21, 2018
2 parents 45ce06e + f247715 commit c7c919e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 19 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Arduino-SDI-12",
"version": "1.3.2",
"version": "1.3.3",
"keywords": "SDI-12, sdi12, communication, bus, sensor, Decagon",
"description": "Arduino library for SDI-12 communications to 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=Arduino-SDI-12
version=1.3.2
version=1.3.3
author=Kevin M. Smith <[email protected]>, Shannon Hicks <[email protected]>
maintainer=Sara Damiano <[email protected]>
sentence=Arduino library for SDI-12 communications to a wide variety of environmental sensors.
Expand Down
9 changes: 8 additions & 1 deletion src/SDI12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,13 @@ SDI12::SDI12(uint8_t dataPin){
}

// 3.2 Destructor
SDI12::~SDI12(){ setState(DISABLED); }
SDI12::~SDI12(){
setState(DISABLED);
_activeObject = NULL;
// Set the timer prescalers back to original values
// NOTE: This does NOT reset SAMD board pre-scalers!
resetSDI12TimerPrescale();
}

// 3.3 Begin
void SDI12::begin(){
Expand Down Expand Up @@ -441,6 +447,7 @@ void SDI12::begin(uint8_t dataPin){
void SDI12::end()
{
setState(DISABLED);
_activeObject = NULL;
// Set the timer prescalers back to original values
// NOTE: This does NOT reset SAMD board pre-scalers!
resetSDI12TimerPrescale();
Expand Down
32 changes: 16 additions & 16 deletions src/SDI12_boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
// 1/(13.0208 ticks/bit) * 2^10 = 78.6432
#define RX_WINDOW_FUDGE 2

uint8_t preSDI12_TCCR2A;
uint8_t preSDI12_TCCR2B;
static uint8_t preSDI12_TCCR2A;
static uint8_t preSDI12_TCCR2B;
void configSDI12TimerPrescale(void)
{
preSDI12_TCCR2A = TCCR2A;
Expand All @@ -44,8 +44,8 @@
// 1/(26.04166667 ticks/bit) * 2^10 = 39.3216
#define RX_WINDOW_FUDGE 10

uint8_t preSDI12_TCCR2A;
uint8_t preSDI12_TCCR2B;
static uint8_t preSDI12_TCCR2A;
static uint8_t preSDI12_TCCR2B;
void configSDI12TimerPrescale(void)
{
preSDI12_TCCR2A = TCCR2A;
Expand Down Expand Up @@ -100,7 +100,7 @@
// 1/(13.0208 ticks/bit) * 2^10 = 78.6432
#define RX_WINDOW_FUDGE 2

uint8_t preSDI12_TCCR1A;
static uint8_t preSDI12_TCCR1A;
void configSDI12TimerPrescale(void)
{
preSDI12_TCCR1A = TCCR1A
Expand All @@ -121,7 +121,7 @@
// 1/(13.0208 ticks/bit) * 2^10 = 78.6432
#define RX_WINDOW_FUDGE 5

uint8_t preSDI12_TCCR1A;
static uint8_t preSDI12_TCCR1A;
void configSDI12TimerPrescale(void)
{
preSDI12_TCCR1A = TCCR1A
Expand Down Expand Up @@ -150,11 +150,11 @@
// 1/(13.0208 ticks/bit) * 2^10 = 78.6432
#define RX_WINDOW_FUDGE 2

uint8_t preSDI12_TCCR4A;
uint8_t preSDI12_TCCR4B;
uint8_t preSDI12_TCCR4C;
uint8_t preSDI12_TCCR4D;
uint8_t preSDI12_TCCR4E;
static uint8_t preSDI12_TCCR4A;
static uint8_t preSDI12_TCCR4B;
static uint8_t preSDI12_TCCR4C;
static uint8_t preSDI12_TCCR4D;
static uint8_t preSDI12_TCCR4E;
void configSDI12TimerPrescale(void)
{
preSDI12_TCCR4A = TCCR4A;
Expand Down Expand Up @@ -187,11 +187,11 @@
// 1/(13.0208 ticks/bit) * 2^10 = 78.6432
#define RX_WINDOW_FUDGE 5

uint8_t preSDI12_TCCR4A;
uint8_t preSDI12_TCCR4B;
uint8_t preSDI12_TCCR4C;
uint8_t preSDI12_TCCR4D;
uint8_t preSDI12_TCCR4E;
static uint8_t preSDI12_TCCR4A;
static uint8_t preSDI12_TCCR4B;
static uint8_t preSDI12_TCCR4C;
static uint8_t preSDI12_TCCR4D;
static uint8_t preSDI12_TCCR4E;
void configSDI12TimerPrescale(void)
{
preSDI12_TCCR4A = TCCR4A;
Expand Down

0 comments on commit c7c919e

Please sign in to comment.