SofaPirate / Plaquette

Object-oriented Arduino library for creative physical computing
https://sofapirate.github.io/Plaquette/
GNU General Public License v3.0
15 stars 4 forks source link

Replace min(), max(), constrain(), round(), etc. macros by functions #73

Open sofian opened 1 year ago

sofian commented 1 year ago

min, max, abs, constrain, round and sq are all defined as macros in Arduino which is shitty for a number of reasons. Consider undefining them (#undef) and redefining them as functions.

This is a bit tricky because it might not always be backwards-compatible with Arduino code so we must be very careful in how to implement it.