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

Conflict between Pcimanager & SoftwareSerial #3

Open
timwilson235 opened this issue Nov 12, 2015 · 5 comments
Open

Conflict between Pcimanager & SoftwareSerial #3

timwilson235 opened this issue Nov 12, 2015 · 5 comments

Comments

@timwilson235
Copy link

I want to use SoftTimer and SoftwareSerial together. To use SoftTimer, I have to also include PciManager.h. But if I include both PciManager.h and SoftwareSerial.h, I get a stream of ld errors (sample below). I am using latest releases of SoftTimer & PciManager (3.1.0 and 2.1.0 respectively), and the SoftwareSerial that's built-in to Arduino IDE 1.6.5.

Compile output follows:

Arduino: 1.6.5 (Mac OS X), Board: "Arduino/Genuino Uno"

PciManager/PciManager.cpp.o: In function __vector_3': /Users/twilson/Documents/Arduino/libraries/PciManager/src/PciManager.cpp:144: multiple definition of__vector_3'
SoftwareSerial/SoftwareSerial.cpp.o:/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:227: first defined here
PciManager/PciManager.cpp.o: In function PciManagerClass::remove(PciListener*)': /Users/twilson/Documents/Arduino/libraries/PciManager/src/PciManager.cpp:63: multiple definition of__vector_4'
SoftwareSerial/SoftwareSerial.cpp.o:/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:392: first defined here
PciManager/PciManager.cpp.o: In function PciManagerClass::remove(PciListener*)': /Users/twilson/Documents/Arduino/libraries/PciManager/src/PciManager.cpp:63: multiple definition of__vector_5'
SoftwareSerial/SoftwareSerial.cpp.o:/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:392: first defined here
collect2: error: ld returned 1 exit status
Error compiling.

@prampec
Copy link
Owner

prampec commented Nov 13, 2015

I confirm the problem.
The SoftwareSerial occupies PinChangeInterrupt PCI vectors, so does the PciManager. This causes the conflict.
As matter stand PciManager cannot be used in combination with SoftwareSerial. I need to consult with the authors of SoftwareSerial whether we can find a solution for that.

(It seems that I finally need to make it possible to use SoftTimer without PciManager, but thats an issue for the SoftTimer project.)

@acacha
Copy link

acacha commented Dec 31, 2015

Same problem here!

@prampec
Copy link
Owner

prampec commented Dec 31, 2015

Unfortunately I couldn't found a way to consult with the authors of SoftwareSerial. If one can help me in that I might do any further steps.

If you are about to use SoftTimer with SoftwareSerial, you can remove Debouncer and Rotary source files that needs PciManager, to remove dependency.
If I find an origin of SoftwareSerial (which I could not), I might want to provide a patch, so that SoftwareSerial use PciManager instead direct PCI access.

Another solution is for you to use an older version of SoftwareSerial.

@dedayoa
Copy link

dedayoa commented Jan 31, 2018

I just ran into this same issue. Is there a fix (in the wild) yet...or has anyone come up with a work around - besides removing debouncer and rotary.

@prampec
Copy link
Owner

prampec commented Jan 31, 2018

I have forked (and keep managed) a version of the SoftTimer, that contains only the core functionality and no classes requires PCI.
https://github.com/prampec/arduino-softtimer-nopci

(It still can be possible to migrate the SoftwareSerial source code to use PciManager so that other event handlers could also benefit from the PCI interrupts.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants