Skip to content

Commit

Permalink
1.1.0 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
ArminJo committed Jan 3, 2020
1 parent 1116cdb commit 50e7db2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Frequency Detector Library for Arduino and ATtinys

### Version 1.1.0
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Build Status](https://travis-ci.org/ArminJo/Arduino-FrequencyDetector.svg?branch=master)](https://travis-ci.org/ArminJo/Arduino-FrequencyDetector)
[![Hit Counter](https://hitcounter.pythonanywhere.com/count/tag.svg?url=https%3A%2F%2Fgit.luolix.top%2FArminJo%2FArduino-FrequencyDetector)](https://github.com/brentvollebregt/hit-counter)
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=FrequencyDetector
version=1.0.0
version=1.1.0
author=Armin Joachimsmeyer
maintainer=Armin Joachimsmeyer <armin.joachimsmeyer@gmail.com>
sentence=Measure frequency of analog captured signal connected to an Arduino and check for noise and mute.<br/>
Expand Down
7 changes: 5 additions & 2 deletions src/ATtinySerialOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,13 @@ inline void writeValue(uint8_t aValue) {
}

// The same class as for plain arduino
#if defined(ARDUINO_AVR_DIGISPARK)
// The digispark library defines (2/2019) F but not __FlashStringHelper
#if not defined(F) || defined(ARDUINO_AVR_DIGISPARK)
//# define F(string_literal) ((fstr_t*)PSTR(string_literal))
#define __FlashStringHelper fstr_t
#endif
#if not defined(F)
class __FlashStringHelper;
#undef F
#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))
#endif

Expand Down
13 changes: 7 additions & 6 deletions src/FrequencyDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@

#include <Arduino.h>

#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)
#include "ATtinySerialOut.h"
#endif

//#define INFO
//#define DEBUG
//#define TRACE

#if (defined(INFO) || defined(DEBUG) || defined(TRACE)) && (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__))
#include "ATtinySerialOut.h"
#endif

#include "FrequencyDetector.h"

#define maximumAllowableCountOf(aPeriodCountTotal) (aPeriodCountTotal / 8)
Expand Down Expand Up @@ -146,7 +146,8 @@ bool setFrequencyDetectorDropoutTimes(uint16_t aMinMatchNODropoutMillis, uint16_
/ FrequencyDetectorControl.PeriodOfOneReadingMillis;
FrequencyDetectorControl.MaxMatchDropoutCount = aMaxMatchDropoutMillis / FrequencyDetectorControl.PeriodOfOneReadingMillis;
// set initial to maximum dropouts
FrequencyDetectorControl.MatchDropoutCount = FrequencyDetectorControl.MinMatchNODropoutCount + FrequencyDetectorControl.MaxMatchDropoutCount;
FrequencyDetectorControl.MatchDropoutCount = FrequencyDetectorControl.MinMatchNODropoutCount
+ FrequencyDetectorControl.MaxMatchDropoutCount;

tRetval = true;
} else {
Expand Down Expand Up @@ -203,7 +204,7 @@ uint16_t readSignal() {
*/
#if defined(ARDUINO_AVR_DIGISPARK)
// Digispark uses timer1 for millis()
cbi(TIMSK, TOIE1);
cbi(TIMSK, TOIE1);
#else
# if defined(TIMSK) && defined(TOIE0)
cbi(TIMSK, TOIE0);
Expand Down

0 comments on commit 50e7db2

Please sign in to comment.