I have coded a fix for a major problem with the Arduino map function (in Arduino.h & arduino/avr/cores/arduino/WMath.cpp).

I submitted it as a comment to map function causes huge errors when mapping to small intervals due to integer truncation #10382 but heard nothing so far.

I thought it might be handled quicker if I can submit it as a Pull Request with Unit Tests to A) expose how and why map is faulty and B) show how my solution fixes the problem.

  • 1
    You should be submitting requests about the API to the API repository, not the core repository: github.com/arduino/ArduinoCore-API – Majenko Aug 28 '20 at 10:28
  • 1
    I am not aware of any unit tests within the Arduino core. I suggest you commit the code change with no tests, add a small test sketch (mostly Serial.println()) within the “cover letter” of the pull request, and state the results you get with and without the patch applied. – Edgar Bonet Aug 28 '20 at 16:58
  • @Majenko note that the API is fine. It's the code in the core that does not implement the API properly (assuming that arduino/avr/cores/arduino/WMath.cpp is in the core) – brewmanz Aug 29 '20 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.