Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for 32u4 #18

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d8f77b7
Merge pull request #1 from SlashDevin/master
SRGDamia1 Sep 8, 2017
d3f6b2d
Added Travis support
SRGDamia1 Sep 12, 2017
804e871
Added support for 32u4
SRGDamia1 Sep 12, 2017
b46608d
Added another test for myself
SRGDamia1 Sep 12, 2017
398c8da
Removed limits on baud rates for 8MHz boards
SRGDamia1 Sep 12, 2017
bd32958
Better testing script
SRGDamia1 Sep 13, 2017
78bfd3e
Merge pull request #2 from SlashDevin/master
SRGDamia1 May 18, 2018
4d45b56
Merge remote-tracking branch 'origin/master'
SRGDamia1 May 18, 2018
19a4266
Added peak and unsetting prescalers at ignore
SRGDamia1 May 18, 2018
cb04f1e
Merge branch 'devin'
SRGDamia1 May 18, 2018
cc1f99e
Interrupts off by default
SRGDamia1 May 18, 2018
8738faf
Oops, uncommented the wrong line!
SRGDamia1 May 18, 2018
283da33
Fixed some comments
SRGDamia1 May 21, 2018
63f17a1
Added missed setting of TCCR's
SRGDamia1 May 21, 2018
66f4508
Default take ISR
SRGDamia1 Jan 8, 2019
2251940
Travis on more boards
SRGDamia1 Jan 9, 2019
3cdc90d
Move tests
SRGDamia1 Jan 9, 2019
eaaea5f
Example to compile against
SRGDamia1 Jan 9, 2019
a2dbb78
Fix timer pre-setting assignment
SRGDamia1 Jan 9, 2019
075f1e0
Oops, wrong speeds
SRGDamia1 Jan 9, 2019
7046a6c
Missed ignore
SRGDamia1 Jan 9, 2019
a51d575
Skipping test on ATTINY
SRGDamia1 Jan 9, 2019
67f1a7f
Removed unwanted comment
SRGDamia1 Jan 9, 2019
dcbdc48
Get tests really working
SRGDamia1 Jan 11, 2019
02fe96e
Printing speed in test
SRGDamia1 Jan 15, 2019
545404e
Limit speeds for processors at less than 12mhz
SRGDamia1 Jan 15, 2019
f003e0a
Removed extra comment
SRGDamia1 Jan 15, 2019
a51c235
Small fix to print dropped chars in test
SRGDamia1 Jan 16, 2019
27229c4
Added notes on processors and pin numbers
SRGDamia1 Jan 16, 2019
96cfd10
Corrected 2560RFR2 tp 256RFR2, also added notes on compatibility at 8MHz
SRGDamia1 Jan 16, 2019
bf6653d
Added sign to pin vars, fixed elif
SRGDamia1 Aug 29, 2019
fff812b
version bump
SRGDamia1 Aug 29, 2019
e0a9c6e
Extra braces
SRGDamia1 Aug 29, 2019
79d693b
Make fallthrough explicity
SRGDamia1 May 24, 2021
5a0daf7
Make interrupts external by default
SRGDamia1 Jul 12, 2022
9626916
add support for RS232-type logic levels
tpwrules Jan 10, 2023
df6af12
NeoSWSerial: avoid undefined behavior when TX disable is requested
tpwrules Feb 13, 2023
304c2ae
Merge pull request #3 from tpwrules/fixes
SRGDamia1 Oct 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,14 @@ $RECYCLE.BIN/
Network Trash Folder
Temporary Items
.apdisk

# Atom / PlatformIO
.pio
.pioenvs
.piolibdeps
.clang_complete
.gcc-flags.json
lib/readme.txt
platformio.ini
.history
.vscode
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: python
python:
- "2.7"

sudo: false
cache:
pip: true
directories:
- "~/.platformio"

env:
- PLATFORMIO_CI_SRC=examples/passThrough

install:
- pip install -U platformio

script:
- platformio ci --lib="." --board=uno --board=feather328p --board=megaatmega2560 --board=sparkfun_megapro8MHz --board=leonardo --board=feather32u4 --board=mightycore1284 --board=mayfly
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The class methods are nearly identical to the built-in `SoftwareSerial`, except

There are five, nay, **six** advantages over `SoftwareSerial`:

**1)** It uses *much* less CPU time.
**1)** It uses *much* less CPU time.

**2)** Simultaneous transmit and receive is fully supported.

Expand All @@ -28,15 +28,15 @@ There are five, nay, **six** advantages over `SoftwareSerial`:
```
#include <NeoSWSerial.h>
NeoSWSerial ss( 4, 3 );

volatile uint32_t newlines = 0UL;

static void handleRxChar( uint8_t c )
{
if (c == '\n')
newlines++;
}

void setup()
{
ss.attachInterrupt( handleRxChar );
Expand Down Expand Up @@ -68,4 +68,6 @@ void setup()
}
```

This class supports the following MCUs: ATtinyx61, ATtinyx4, ATtinyx5, ATmega328P (Pro, UNO, Nano), ATmega32U4 (Micro, Leonardo), ATmega2560 (Mega), ATmega2560RFR2, ATmega1284P and ATmega1286
This class supports the following MCUs at 16MHz: ATmega328P (Pro, UNO, Nano), ATmega2560 (Mega), ATmega256RFR2 (Xplained Pro, Altair, Pinoccio), ATmega1284P (MightyCore), ATmega32U4 (Micro, Leonardo), ATtinyx61, ATtinyx4, ATtinyx5 (Trinket), and AT90USB1286 (Teensy++)

These MCUs are also supported at 8MHz: ATmega328P (Pro, Fio, Feather 328), ATmega2560 (Mega), ATmega256RFR2, ATmega1284P (Mayfly, Mbili), ATmega32U4 (Feather 32U4, Flora), and ATtinyx5 (Trinket, Gemma). To run on 8MHz boards, NeoSWSerial must set another timer prescaler - timer4 on the 32U4, timer1 on the AtTiny, and timer2 on the others. For the vast majority of cases, this will not be a problem. But, if not used carefully, this will cause the tone() function (and possibly others) to behave strangely. It could also cause the [EnviroDIY SDI-12](https://github.com/EnviroDIY/Arduino-SDI-12) library (which was partly modeled on NeoSWSerial) to malfunction. To avoid these problems make sure that you ignore() or end() all instances of NeoSWSerial before using the other functions/libraries. You must then begin() or listen() again to restart NeoSWSerial.
30 changes: 30 additions & 0 deletions examples/passThrough/passThrough.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <Arduino.h>
#include <NeoSWSerial.h>

uint16_t baudrate = 9600;

NeoSWSerial nss( 10, 11 );

void setup(){
Serial.begin(115200);
delay(50);

while (!Serial){};

Serial.print( F("NeoSWSerial pass through @ ") );
Serial.println( baudrate );
Serial.flush();

nss.begin(baudrate);
delay(50);

}

void loop() {
while (nss.available()) {
Serial.write(nss.read());
}
while (Serial.available()) {
nss.write(Serial.read());
}
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=NeoSWSerial
version=3.0.5
version=3.0.6
author=SlashDevin
maintainer=SlashDevin
sentence=An efficient replacement for SoftwareSerial at baud rates 9600, 19200 and 38400.
Expand Down
Loading