Skip to content

SoftwareSerial breaks abs macro #7872

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

Closed
florian-schweiger opened this issue Aug 9, 2018 · 1 comment
Closed

SoftwareSerial breaks abs macro #7872

florian-schweiger opened this issue Aug 9, 2018 · 1 comment
Labels
Architecture: AVR Applies only to the AVR microcontrollers (Uno, etc.) Library: SoftwareSerial The SoftwareSerial Arduino library

Comments

@florian-schweiger
Copy link

When I include SoftwareSerial.h, other libraries break because the abs(x) macro stops working. One particular library that stops functioning properly is uStepper.

The reason for it seems to be a section at the bottom of SoftwareSerial.h that undefines several macros:

// Arduino 0012 workaround
#undef int
#undef char
#undef long
#undef byte
#undef float
#undef abs
#undef round

I've commented this out in my project, and things are back to normal.

So I'm wondering, is this workaround still needed in the post-Arduino-0012 era?

@per1234 per1234 added Library: SoftwareSerial The SoftwareSerial Arduino library Architecture: AVR Applies only to the AVR microcontrollers (Uno, etc.) labels Aug 9, 2018
@florian-schweiger
Copy link
Author

florian-schweiger commented Aug 10, 2018

I just realised that I've opened the issue in the wrong repository. I'm closing it here and will reopen it in ArduinoCore-avr: arduino/ArduinoCore-avr#30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture: AVR Applies only to the AVR microcontrollers (Uno, etc.) Library: SoftwareSerial The SoftwareSerial Arduino library
Projects
None yet
Development

No branches or pull requests

2 participants