Skip to content

Conversation

@aethaniel
Copy link
Contributor

This patch fix potential issue coming with newlib integrated at least since ARM GCC 4.9 2015q2:

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=32c96ddd14acadc82e7fccf110367ec3c8320c85

Some tests have been done without breaking anything at the moment.
Only WString.cpp is using this API.

Signed-off-by: Thibaut VIARD [email protected]

@sandeepmistry
Copy link
Contributor

@aethaniel thanks for submitting!

Could you please expand on the potential issue?

I think we have bigger problems, as Arduino.h includes both <stdlib.h> and "itoa.h" so there will still be a conflict.

Would a better solution be to wrap some of the contents of itoa.h and itoa.c around macros based on the newlib version? So, the new built-in itoa and utoa functions can be used?

@sandeepmistry
Copy link
Contributor

I'm going to close this for now, we can revisit when the GCC version for the SAMD core is updated.

boseji pushed a commit to go-ut/combined-ArduinoCore-samd that referenced this pull request May 30, 2020
* Fix pulseIn() on SAMD51 by writing it in plain C, so that
the CM0+-specific pulse_asm won't need to be linked.
The SAMD51 is fast enough that we can time pulses with micros()
Tested with a bunch of pulse lengths from <1us to >1s

* Implement a new delayMicroseconds() function for SAMD51
This version enables the "Debug Watchpoint and Trace" module (DWT)
in startup.c and then uses the 32bit cycle counter that is part
of DWT to count cycles indepenent of instruction timing.
Tested for good accuracy with various values between 1 and 2000us.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants